function display($tpl = null) { $app = JFactory::getApplication(); JHTML::stylesheet(JoaktreeHelper::joaktreecss()); JHTML::script(JoaktreeHelper::jsfile()); $this->canDo = JoaktreeHelper::getActions(); // Get data from the model $this->items =& $this->get('Data'); $this->pagination =& $this->get('Pagination'); //Filter $context = 'com_joaktree.jt_trees.list.'; $this->filter['state'] = $app->getUserStateFromRequest($context . 'filter_state', 'filter_state', '', 'cmd'); $this->filter['apptitle'] = $app->getUserStateFromRequest($context . 'filter_apptitle', 'filter_apptitle', '', 'int'); $this->filter['gendex'] = $app->getUserStateFromRequest($context . 'filter_gendex', 'filter_gendex', '', 'int'); $this->filter['order'] = $app->getUserStateFromRequest($context . 'filter_order', 'filter_order', 'jte.id', 'cmd'); $this->filter['order_Dir'] = $app->getUserStateFromRequest($context . 'filter_order_Dir', 'filter_order_Dir', '', 'word'); $search = $app->getUserStateFromRequest($context . 'search', 'search', '', 'string'); $search = JString::strtolower($search); // table ordering $this->lists['order_Dir'] = $this->filter['order_Dir']; $this->lists['order'] = $this->filter['order']; // search filter $this->lists['search'] = $search; // state filter $this->state = array('published' => 1, 'unpublished' => 1, 'archived' => 0, 'trash' => 0, 'all' => 0); // application filter $this->appTitle = JoaktreeHelper::getApplications(); // gendex filter $this->gendex = array(); $selectObj = new StdClass(); $selectObj->value = 1; $selectObj->text = JText::_('JNO'); $this->gendex[] = $selectObj; unset($selectObj); $selectObj = new StdClass(); $selectObj->value = 2; $selectObj->text = JText::_('JYES'); $this->gendex[] = $selectObj; unset($selectObj); $this->lists['jsscript'] = $this->getJTscript(); $this->lists['action'] = $this->get('action'); if ($this->lists['action'] == 'assign') { $this->lists['act_treeId'] = $this->get('treeId'); } JoaktreeHelper::addSubmenu('trees'); $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); parent::display($tpl); }
function getInput() { $person =& JTable::getInstance('joaktree_persons', 'Table'); if ($this->value) { $id = $this->checkValue($this->fieldname, $this->value); $person->set('app_id', $id[0]); $person->set('id', $id[1]); $person->load(); } else { $person->firstName = JText::_('JTFIELD_PERSON_SELECTPERSON'); } JHTML::script(JoaktreeHelper::jsfile()); $apps = JoaktreeHelper::getApplications(); $linkTree = 'index.php?option=com_joaktree&view=jt_trees&layout=element&task=element&tmpl=component&object=' . $this->fieldname; $linkPerson = 'index.php?option=com_joaktree&view=jt_persons&layout=element&task=element&tmpl=component&object=' . $this->fieldname; JHTML::_('behavior.modal', 'a.modal'); $html = "\n" . '<br /><br /><div style="clear: both;">'; $html .= '<input style="background: #ffffff;" type="text" size="50" id="jform_personName" value="' . htmlspecialchars($person->firstName . ' ' . $person->familyName, ENT_QUOTES, 'UTF-8') . '" disabled="disabled" title="' . JText::_('JTFIELD_PERSON_DESC_PERSON') . '" />'; $html .= '<select class="inputbox" id="jform_appTitle" name="apptitle" disabled="disabled">'; $html .= JHtml::_('select.options', $apps, 'value', 'text', $person->app_id); $html .= '</select>'; $html .= '</div>'; // buttons $html .= "\n" . '<div style="clear: both;">'; // button 1 $html .= '<div class="button2-left">'; $html .= '<div class="blank">'; $html .= '<a class="modal" title="' . JText::_('JTFIELD_PERSON_BUTTONDESC_TREE') . '" href="' . $linkTree . '" rel="{handler: \'iframe\', size: {x: 650, y: 375}}">' . JText::_('JTFIELD_PERSON_BUTTON_TREE'); $html .= '</a>'; $html .= '</div>'; $html .= '</div>' . "\n"; // button 2 $html .= '<div class="button2-left">'; $html .= '<div class="blank">'; $html .= '<a class="modal" title="' . JText::_('JTFIELD_PERSON_BUTTONDESC_PERSON') . '" href="' . $linkPerson . '" rel="{handler: \'iframe\', size: {x: 650, y: 375}}">' . JText::_('JTFIELD_PERSON_BUTTON_PERSON'); $html .= '</a>'; $html .= '</div>'; $html .= '</div>' . "\n"; $html .= '</div>'; $html .= "\n" . '<input type="hidden" id="jform_personId" name="' . $this->name . '" value="' . $this->value . '" />'; return $html; }
function display($tpl = null) { $app = JFactory::getApplication(); JHTML::stylesheet(JoaktreeHelper::joaktreecss()); JHTML::script(JoaktreeHelper::jsfile()); // add script $document =& JFactory::getDocument(); $document->addScriptDeclaration($this->addScript()); // Get data from the model $this->items = $this->get('Persons'); $trees = $this->get('Trees'); $this->pagination = $this->get('Pagination'); $this->lists['patronym'] = $this->get('patronymShowing'); $this->columns = $this->get('columnSettings'); //Filter $context = 'com_joaktree.jt_persons.list.'; $this->filter['state'] = $app->getUserStateFromRequest($context . 'filter_state', 'filter_state', '', 'cmd'); $this->filter['living'] = $app->getUserStateFromRequest($context . 'filter_living', 'filter_living', '', 'word'); $this->filter['page'] = $app->getUserStateFromRequest($context . 'filter_page', 'filter_page', '', 'word'); $this->filter['map'] = $app->getUserStateFromRequest($context . 'filter_map', 'filter_map', '', 'int'); $this->filter['tree'] = $app->getUserStateFromRequest($context . 'filter_tree', 'filter_tree', '', 'int'); $this->filter['apptitle'] = $app->getUserStateFromRequest($context . 'filter_apptitle', 'filter_apptitle', '', 'int'); $this->filter['robots'] = $app->getUserStateFromRequest($context . 'filter_robots', 'filter_robots', '', 'int'); $this->filter['order'] = $app->getUserStateFromRequest($context . 'filter_order', 'filter_order', 'jpn.id', 'cmd'); $this->filter['order_Dir'] = $app->getUserStateFromRequest($context . 'filter_order_Dir', 'filter_order_Dir', '', 'word'); $search1 = $app->getUserStateFromRequest($context . 'search1', 'search1', '', 'string'); $search1 = JString::strtolower($search1); $search2 = $app->getUserStateFromRequest($context . 'search2', 'search2', '', 'string'); $search2 = JString::strtolower($search2); $search3 = $app->getUserStateFromRequest($context . 'search3', 'search3', '', 'string'); $search3 = JString::strtolower($search3); // table ordering $this->lists['order_Dir'] = $this->filter['order_Dir']; $this->lists['order'] = $this->filter['order']; // search filter $this->lists['search1'] = $search1; $this->lists['search2'] = $search2; $this->lists['search3'] = $search3; // application filter $this->appTitle = JoaktreeHelper::getApplications(); // default family tree filter $this->tree = array(); for ($i = 1; $i <= count($trees); $i++) { $selectObj = new StdClass(); $selectObj->value = $trees[$i - 1]->id; $selectObj->text = $trees[$i - 1]->name; $this->tree[] = $selectObj; unset($selectObj); } // state filter $this->state = array('published' => 1, 'unpublished' => 1, 'archived' => 0, 'trash' => 0, 'all' => 0); // $select_attr = array(); // $select_attr['class'] = 'inputbox'; // $select_attr['size'] = '1'; // $select_attr['onchange'] = 'submitform( );'; // living filter $this->living = array(); $selectObj = new StdClass(); $selectObj->value = 'L'; $selectObj->text = JText::_('JT_FILTER_VAL_LIVING'); $this->living[] = $selectObj; unset($selectObj); $selectObj = new StdClass(); $selectObj->value = 'D'; $selectObj->text = JText::_('JT_FILTER_VAL_NOTLIVING'); $this->living[] = $selectObj; unset($selectObj); // page filter $this->page = array(); $selectObj = new StdClass(); $selectObj->value = 'Y'; $selectObj->text = JText::_('JT_FILTER_VAL_PAGE'); $this->page[] = $selectObj; unset($selectObj); $selectObj = new StdClass(); $selectObj->value = 'N'; $selectObj->text = JText::_('JT_FILTER_VAL_NOPAGE'); $this->page[] = $selectObj; unset($selectObj); // map filter $this->map = array(); $selectObj = new StdClass(); $selectObj->value = 2; $selectObj->text = JText::_('JT_FILTER_VAL_STATMAP'); $this->map[] = $selectObj; unset($selectObj); $selectObj = new StdClass(); $selectObj->value = 3; $selectObj->text = JText::_('JT_FILTER_VAL_DYNMAP'); $this->map[] = $selectObj; unset($selectObj); $selectObj = new StdClass(); $selectObj->value = 1; $selectObj->text = JText::_('JT_FILTER_VAL_NOMAP'); $this->map[] = $selectObj; unset($selectObj); // robots filter $this->robots = array(); $selectObj = new StdClass(); $selectObj->value = 1; $selectObj->text = JText::_('JT_ROBOT_USE_TREE'); $this->robots[] = $selectObj; unset($selectObj); $selectObj = new StdClass(); $selectObj->value = 2; $selectObj->text = JText::_('JGLOBAL_INDEX_FOLLOW'); $this->robots[] = $selectObj; unset($selectObj); $selectObj = new StdClass(); $selectObj->value = 3; $selectObj->text = JText::_('JGLOBAL_NOINDEX_FOLLOW'); $this->robots[] = $selectObj; unset($selectObj); $selectObj = new StdClass(); $selectObj->value = 4; $selectObj->text = JText::_('JGLOBAL_INDEX_NOFOLLOW'); $this->robots[] = $selectObj; unset($selectObj); $selectObj = new StdClass(); $selectObj->value = 5; $selectObj->text = JText::_('JGLOBAL_NOINDEX_NOFOLLOW'); $this->robots[] = $selectObj; unset($selectObj); // end of filters JoaktreeHelper::addSubmenu('persons'); $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); parent::display($tpl); }