Exemple #1
0
 /**
  * Add new fieldCspCsp for children table (@see class field)
  * @param string $name name of a field
  * @param string $html html type of field (text, textarea, etc. @see html class)
  * @param string $type database type (int, varcahr, etc.)
  * @param mixed $default default value for this field
  * @return object $this - pointer to current object
  */
 protected function _addField($name, $html = 'text', $type = 'other', $default = '', $label = '', $maxlen = 0, $dbAdapt = '', $htmlAdapt = '', $description = '')
 {
     $this->_fields[$name] = toeCreateObjCsp('fieldCsp', array($name, $html, $type, $default, $label, $maxlen, $dbAdapt, $htmlAdapt, $description));
     return $this;
 }
Exemple #2
0
 public function __construct()
 {
     $this->_res = toeCreateObjCsp('response', array());
 }
Exemple #3
0
 public function saveFavico($d = array())
 {
     if (!empty($d) && isset($d['favico']) && !empty($d['favico']['name'])) {
         $uploader = toeCreateObjCsp('fileuploader', array());
         $valid = $uploader->validate('favico', frameCsp::_()->getModule('options')->getFavicoDir(), 'favico.png');
         utilsCsp::deleteFile(frameCsp::_()->getModule('options')->getFavicoFullDir());
         $up = $uploader->upload();
         if ($valid && $up) {
             $fileInfo = $uploader->getFileInfo();
             $this->save(array('code' => 'favico', 'opt_values' => array('favico' => $fileInfo['path'])));
             return true;
         } else {
             $this->pushError($uploader->getError());
         }
     } else {
         $this->pushError(langCsp::_('Empty data to setup'));
     }
     return false;
 }