Gino Gmaps  1.0.1
Modulo di gestione di mappe interattive per Gino CMS
 Tutto Strutture dati File Funzioni Variabili Gruppi Pagine
class.gmapsVideo.php
Vai alla documentazione di questo file.
1 <?php
32 class gmapsVideo extends propertyObject {
33 
34  private static $_tbl_video = 'gmaps_point_video';
35 
36  private $_controller;
37 
46  function __construct($id, $instance) {
47 
48  $this->_controller = $instance;
49  $this->_tbl_data = self::$_tbl_video;
50  parent::__construct($id);
51  }
52 
60  public function setPoint_id($value) {
61 
62  if($this->_p['point_id']!=$value && !in_array('point_id', $this->_chgP)) $this->_chgP[] = 'point_id';
63  $this->_p['point_id'] = $value;
64  return true;
65 
66  }
67 
75  public function form($redirect) {
76 
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();
81  if(!$req_error) {
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', '');
86 
87  $this->updateDbData();
88 
89  header("Location: ".$redirect);
90  exit();
91  }
92  else {
93  error::errorMessage(array('error'=>1), $_SERVER['QUERY_STRING']);
94  exit();
95  }
96  }
97 
98  if($this->id) {
99  $title = _("Modifica video");
100  $submit = _("modifica");
101  }
102  else {
103  $title = _("Nuovo video");
104  $submit= _("inserisci");
105  }
106  $htmlsection = new htmlSection(array('class'=>'admin', 'headerTag'=>'header', 'headerLabel'=>$title));
107 
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);
112 
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'));
117 
118  $buffer .= $gform->cinput('submit', 'submit', $submit, '', array('classField'=>'submit'));
119 
120  $buffer .= $gform->cform();
121 
122  $htmlsection->content = $buffer;
123 
124  return $htmlsection->render();
125  }
126 
134  public function delete() {
135 
136  return $this->deleteDbData();
137 
138  }
139 
140 
141 }
142 
143 ?>