Exemplo n.º 1
0
 private function &_widgetTextArea(&$field, $args)
 {
     HTML_QuickForm::registerElementType('wikiarea', 'HTML/QuickForm/wikiarea.php', 'HTML_QuickForm_wikiarea');
     $id = $field['id'];
     $element =& $this->_addElement('wikiarea', $id, array('class' => 'expand'));
     if (!empty($args)) {
         $rules = explode(',', $args);
     } elseif (array_key_exists('wiki_rules', $field)) {
         // DEPRECATED use of "wiki_rules" option instead of "widget_args"
         $rules = explode(',', $field['wiki_rules']);
     } else {
         $rules = null;
     }
     $element->setWiki(TIP_Renderer::getWiki($rules));
     $element->setCols($this->text_cols);
     $element->setRows($this->text_rows);
     return $element;
 }
Exemplo n.º 2
0
 /**
  * Get the data rows and return a renderer ready to be used
  *
  * @param  string                     $action The action template string
  * @return HTML_Menu_TipRenderer|null         The renderer or
  *                                            null on errors
  * @internal
  */
 protected function &_getRenderer($action)
 {
     if (is_null($this->_model)) {
         $this->startDataView() && $this->endView();
     }
     if (is_null($this->_model)) {
         $fake_null = null;
         return $fake_null;
     }
     // Duplicate the model and update the URLs on the copy
     $model = $this->_model;
     $this->_updateModelUrl($model, $action);
     require_once 'HTML/Menu.php';
     $menu = new HTML_Menu($model);
     empty($action) || $menu->forceCurrentUrl(TIP::getRequestUri());
     $renderer =& TIP_Renderer::getMenu();
     $menu->render($renderer, 'sitemap');
     return $renderer;
 }
Exemplo n.º 3
0
 /**
  * Perform a browse action
  *
  * In $conditions, you must specify an associative array of
  * 'field_id' => 'value' to impose for this browse action. Only equal
  * conditions are allowed.
  *
  * @param  array &$conditions The browse conditions
  * @return bool               true on success or false on errors
  */
 protected function actionBrowse($id)
 {
     if (!TIP_AHAH) {
         // Browse actions implemented only as AHAH response
         return false;
     }
     sscanf($id, '%04s%02s', $year, $month);
     if (!$year || !$this->_render()) {
         return false;
     }
     if (array_key_exists($year, $this->_tree)) {
         $tree =& $this->_tree[$year]['sub'];
     } else {
         return true;
     }
     if (array_key_exists($id, $tree)) {
         $tree =& $tree[$id]['sub'];
     } elseif (isset($month)) {
         return true;
     }
     require_once 'HTML/Menu.php';
     $model =& new HTML_Menu($tree);
     $renderer =& TIP_Renderer::getMenu(0);
     $model->render($renderer, 'sitemap');
     $content =& TIP_Application::getGlobal('content');
     $content .= $renderer->toHtml();
     return true;
 }