48 $this->_controller = $instance;
49 $this->_tbl_data = self::$_tbl_video;
50 parent::__construct($id);
62 if($this->_p[
'point_id']!=$value && !in_array(
'point_id', $this->_chgP)) $this->_chgP[] =
'point_id';
63 $this->_p[
'point_id'] = $value;
75 public function form($redirect) {
77 if(isset($_POST[
'submit'])) {
78 $gform =
new Form(
'form_video',
'post',
false, array(
'verifyToken'=>
true));
79 $gform->save(
'dataform');
80 $req_error = $gform->arequired();
82 $this->title = cleanVar($_POST,
'title',
'string',
'');
83 $this->description = cleanVar($_POST,
'description',
'string',
'');
84 $this->credits = cleanVar($_POST,
'credits',
'string',
'');
85 $this->code = cleanVar($_POST,
'code',
'string',
'');
87 $this->updateDbData();
89 header(
"Location: ".$redirect);
93 error::errorMessage(array(
'error'=>1), $_SERVER[
'QUERY_STRING']);
99 $title = _(
"Modifica video");
100 $submit = _(
"modifica");
103 $title = _(
"Nuovo video");
104 $submit= _(
"inserisci");
106 $htmlsection =
new htmlSection(array(
'class'=>
'admin',
'headerTag'=>
'header',
'headerLabel'=>$title));
108 $gform =
new Form(
'form_video',
'post',
true, array(
'trnsl_table'=>$this->_tbl_data,
'trnsl_id'=>$this->
id));
109 $gform->load(
'dataform');
110 $buffer = $gform->form(
'',
true,
'title', array(
'generateToken'=>
true));
111 $buffer .= $gform->hidden(
'id', $this->
id);
113 $buffer .= $gform->cinput(
'title',
'text', $gform->retvar(
'title', htmlInput($this->title)), _(
"Titolo"), array(
'required'=>
true,
'maxlength'=>200,
'size'=>40,
'trnsl'=>
true,
'field'=>
'title'));
114 $buffer .= $gform->ctextarea(
'description', $gform->retvar(
'description', htmlInput($this->description)), _(
"Descrizione"), array(
'cols'=>40,
'rows'=>4,
'trnsl'=>
true,
'field'=>
'description'));
115 $buffer .= $gform->ctextarea(
'credits', $gform->retvar(
'credits', htmlInput($this->credits)), _(
"Credits"), array(
'cols'=>40,
'rows'=>2,
'trnsl'=>
true,
'field'=>
'credits'));
116 $buffer .= $gform->ctextarea(
'code', $gform->retvar(
'code', htmlInput($this->code)), array(_(
"Codice embed"), _(
'Inserire interamente il codice embed fornito dalla piattaforma di streaming')), array(
'cols'=>40,
'rows'=>2,
'trnsl'=>
true,
'field'=>
'credits'));
118 $buffer .= $gform->cinput(
'submit',
'submit', $submit,
'', array(
'classField'=>
'submit'));
120 $buffer .= $gform->cform();
122 $htmlsection->content = $buffer;
124 return $htmlsection->render();
134 public function delete() {
136 return $this->deleteDbData();