Esempio n. 1
0
 function configure($aOptions)
 {
     $res = parent::configure($aOptions);
     if (PEAR::isError($res)) {
         return $res;
     }
     // FIXME make required *either* per-action property
     // FIXME or a global pref.
     $global_required_default = true;
     $this->bRequired = KTUtil::arrayGet($aOptions, 'required', $global_required_default, false) == true;
     // Part of the space on the mce editor is taken up by the toolbars, so make the plain text field slightly smaller (if using the default size)
     $default_rows = 20;
     if (isset($this->aOptions['field'])) {
         $oField = $this->aOptions['field'];
         if (!$oField->getIsHTML()) {
             $default_rows = 15;
         }
     }
     $this->aOptions['cols'] = KTUtil::arrayGet($aOptions, 'cols', 80);
     $this->aOptions['rows'] = KTUtil::arrayGet($aOptions, 'rows', $default_rows);
     $this->aOptions['field'] = KTUtil::arrayGet($aOptions, 'field');
 }
Esempio n. 2
0
 function configure($aOptions)
 {
     $res = parent::configure($aOptions);
     if (PEAR::isError($res)) {
         return $res;
     }
     // FIXME make required *either* per-action property
     // FIXME or a global pref.
     $global_required_default = true;
     $this->bRequired = KTUtil::arrayGet($aOptions, 'required', $global_required_default, false);
     $this->aOptions['cols'] = KTUtil::arrayGet($aOptions, 'cols', 60);
     $this->aOptions['rows'] = KTUtil::arrayGet($aOptions, 'rows', 3);
     $this->aOptions['field'] = KTUtil::arrayGet($aOptions, 'field');
 }
Esempio n. 3
0
 function configure($aOptions)
 {
     $aOptions['broken_name'] = KTUtil::arrayGet($aOptions, 'broken_name', true, false);
     $res = parent::configure($aOptions);
     if (PEAR::isError($res)) {
         return $res;
     }
     $this->oCollection = KTUtil::arrayGet($aOptions, 'collection');
     if (empty($this->oCollection)) {
         return PEAR::raiseError(_kt('No collection specified.'));
     }
     $this->iFolderId = KTUtil::arrayGet($aOptions, 'folder_id');
     if (empty($this->iFolderId)) {
         return PEAR::raiseError(_kt('No initial folder specified specified.'));
     }
     $this->aBCUrlParams = KTUtil::arrayGet($aOptions, 'bcurl_params', array());
     $this->aCols = array();
     foreach ($this->oCollection->columns as $oCol) {
         $this->aCols[] = $oCol->namespace;
     }
     $this->sCode = KTUtil::randomString();
     $this->sCollection = serialize($this->oCollection);
     $_SESSION['collection_widgets'][$this->sCode] = serialize($this);
     $this->requireJSResource('resources/js/collectionframe.js');
 }