function display($tpl = null) { $app = JFactory::getApplication('site'); $document =& JFactory::getDocument(); // Load the parameters. $params = $app->getParams(); $params->merge(JoaktreeHelper::getTheme(true, true)); // set up style sheets and javascript files JHTML::stylesheet(JoaktreeHelper::joaktreecss()); JHTML::stylesheet(JoaktreeHelper::joaktreecss($params->get('theme'))); // get user info $userId = $this->get('userId'); if (!$userId || $userId == 0) { $document->addScript(JoaktreeHelper::joaktreejs('jtform.js')); } // Logs $this->name = $this->get('personName'); $this->items = $this->get('items'); $this->pagination = $this->get('pagination'); // check display method $tmpl = $this->get('tmpl'); if ($tmpl) { //return $retObject = $this->get('returnObject'); if (!is_object($retObject)) { $retObject = new stdClass(); $retObject->object = 'prsn'; } $this->lists['link'] = 'index.php?option=com_joaktree' . '&view=changehistory' . '&tmpl=' . $tmpl . '&retId=' . base64_encode(json_encode($retObject)); } else { $this->lists['link'] = 'index.php?option=com_joaktree' . '&view=changehistory'; } $this->lists['CR'] = JoaktreeHelper::getJoaktreeCR(); if (count($this->items) > 0) { // set title, meta title $title = $this->name ? $this->name : JText::_('JT_CHANGEHISTORY'); $document->setTitle($title); $document->setMetadata('title', $title); // set additional meta tags if ($params->get('menu-meta_description')) { $document->setDescription($params->get('menu-meta_description')); } if ($params->get('menu-meta_keywords')) { $document->setMetadata('keywords', $params->get('menu-meta_keywords')); } if ($params->get('robots')) { $document->setMetadata('robots', $params->get('robots')); } } parent::display($tpl); }
/** * Display the view */ public function display($tpl = null) { // First load the treeId! $this->lists['treeId'] = $this->get('treeId'); // Load the parameters. $this->params = JoaktreeHelper::getJTParams(true); if ($this->params->get('siteedit', 1)) { $this->canDo = JoaktreeHelper::getActions(); } else { $this->canDo = null; } // set up style sheets and javascript files JHTML::stylesheet(JoaktreeHelper::joaktreecss()); JHTML::stylesheet(JoaktreeHelper::joaktreecss($this->params->get('theme'))); $document =& JFactory::getDocument(); $document->addScript(JoaktreeHelper::joaktreejs('toggle.js')); $this->lists['lineEnd'] = $document->_getLineEnd(); // Initialiase variables. $this->form = $this->get('Form'); $this->lists['appId'] = $this->get('applicationId'); $this->lists['appName'] = $this->get('applicationName'); $relationId = $this->get('relationId'); if (isset($relationId)) { $this->relation = $this->get('relation'); $this->lists['action'] = $this->get('action'); } $this->lists['action'] = isset($this->lists['action']) ? $this->lists['action'] : 'new'; $this->picture = $this->get('picture'); $personId = $this->get('personId'); if (isset($personId)) { $this->lists['userAccess'] = $this->get('access'); $this->item = $this->get('Item'); $this->lists['indLiving'] = $this->item->living; } else { $this->lists['userAccess'] = true; $this->lists['indLiving'] = false; } $patronym = $this->params->get('patronym', 0); $this->lists['indPatronym'] = $patronym == 0 ? false : true; $familyname = $this->params->get('familyname', 0); $this->lists['indNamePreposition'] = $familyname == 1 ? true : false; $this->lists['CR'] = JoaktreeHelper::getJoaktreeCR(); if ($this->lists['userAccess']) { // set title if (isset($personId)) { $title = $this->item->firstName . ' ' . $this->item->familyName; $document->setTitle($title); } } parent::display($tpl); }
public function getUIControl($mapHtmlId) { if (isset($this->params['ui_control']) && !empty($this->params['ui_control'])) { $script = array(); $html = array(); $document =& JFactory::getDocument(); $document->addScript(JoaktreeHelper::joaktreejs('jtmap.js')); // set up style sheets and javascript files JHTML::stylesheet('components/com_joaktree/assets/css/joaktree.map.css'); JHtml::_('behavior.formvalidation'); JHtml::_('behavior.modal', 'a.modal_person'); if ($this->params['service'] == 'interactivemap') { $basicUrl = 'index.php?option=com_joaktree&tmpl=component&format=raw&view=interactivemap&mapId=' . $this->mapId . '&options=' . JSession::getFormToken(); $mapfunction = 'jtRefreshDynMap(\'' . $basicUrl . '\', \'' . $mapHtmlId . '\');'; } else { $theme = $this->getTheme(); $basicUrl = 'index.php?option=com_joaktree&format=raw&tmpl=component&view=map&layout=staticraw&mapId=' . $this->mapId . '&options=' . JSession::getFormToken(); $loadingUrl = JURI::base() . 'components/com_joaktree/themes/' . $theme->get('theme') . '/images/ajax-loader.gif'; $mapfunction = 'jtRefreshStatMap(\'' . $basicUrl . '\', \'' . $loadingUrl . '\',\'' . $mapHtmlId . '\');'; } $html[] = '<div>'; $html[] = '<div id="jtmap-but-showui" style="display: block;">'; $html[] = ' <input type="submit" class="button" onclick="showui();" value="' . JText::_('JTMAP_UICONTROL') . '">'; $html[] = ' <input id="jtmap-id" name="map_id" type="hidden" value="' . $this->mapId . '" />'; $html[] = '</div>'; $html[] = '<div id="jtmap-uidisplay" style="display:none;">'; $html[] = '<fieldset class="jtmap-fieldset">'; $html[] = '<legend class="jtmap-legend">' . JText::_('JTMAP_SELECTIONS') . '</legend>'; $html[] = ' <div class="jtmap-div-button">'; $html[] = ' <input type="submit" class="button" onclick="' . $mapfunction . '" value="' . JText::_('JTMAP_UIEXECUTE') . '">'; $html[] = ' <input type="submit" class="button" onclick="hideui();" value="' . JText::_('JLIB_HTML_BEHAVIOR_CLOSE') . '">'; $html[] = ' </div>'; // select another person if ($this->params['selection'] == 'person') { $person = $this->getPerson(); $link = JRoute::_('index.php?option=com_joaktree&view=joaktreelist&tmpl=component&layout=select&treeId=' . $this->params['tree_id'] . '&action=select'); $html[] = '<p>'; $html[] = '<label for="person" title="' . JText::_('JTMAP_DESC_PERSON') . '">' . JText::_('JTMAP_PERSON') . '</label>'; $html[] = '<input id="jtmap-person" name="person" class="inputbox readonly" type="text" value="' . $person->name . '" disabled="disabled" />'; $html[] = '<input id="jtmap-person_id" name="person_id" type="hidden" value="' . $this->params['app_id'] . '!' . $this->params['person_id'] . '" />'; $html[] = '<a class="modal_person button" style="float: left; padding: 3px; margin-left: 4px;" ' . 'href="' . $link . '" ' . 'rel="{handler: \'iframe\', size: {x: 800, y: 500}}">' . JText::_('JTMAP_SELECTPERSON') . '</a>'; $html[] = '</p>'; } // include relations for person if ($this->params['selection'] == 'person') { $html[] = '<p>'; $html[] = '<label for="relations" title="' . JText::_('JTMAP_DESC_RELATIONS') . '">' . JText::_('JTMAP_RELATIONS') . '</label>'; $html[] = '<select id="jtmap-relations" name="relations" class="inputbox" size="1">'; $html[] = '<option ' . ($this->params['relations'] == 0 ? 'selected="selected" ' : '') . ' value="0">' . JText::_('JNO') . '</option>'; $html[] = '<option ' . ($this->params['relations'] == 1 ? 'selected="selected" ' : '') . ' value="1">' . JText::_('JTMAP_VALUE_FIRSTDEGREE') . '</option>'; $html[] = '<option ' . ($this->params['relations'] == 2 ? 'selected="selected" ' : '') . ' value="2">' . JText::_('JTMAP_VALUE_DESCENDANTS') . '</option>'; $html[] = '<option ' . ($this->params['relations'] == 3 ? 'selected="selected" ' : '') . ' value="3">' . JText::_('JTMAP_VALUE_ANCESTORS') . '</option>'; $html[] = '</select>'; $html[] = '</p>'; } // include relations for tree which holds descendants if ($this->params['selection'] == 'tree' || $this->params['selection'] == 'location') { $tree = $this->getTree(); if ($tree->holds == 'descendants') { $html[] = '<p>'; $html[] = '<label for="relations" title="' . Jtext::_('JTMAP_DESC_DESCENDANTS') . '">' . JText::_('JTMAP_RELATIONS') . '</label>'; $html[] = '<select id="jtmap-relations" name="relations" class="inputbox" size="1">'; $html[] = '<option ' . ($this->params['relations'] == 0 ? 'selected="selected" ' : '') . ' value="0">' . JText::_('JTMAP_VALUE_ALL') . '</option>'; $html[] = '<option ' . ($this->params['relations'] != 0 ? 'selected="selected" ' : '') . ' value="1">' . JText::sprintf('JTMAP_VALUE_DESCENDANTSOF', $tree->orig_ancestor) . '</option>'; $html[] = '</select>'; $html[] = '</p>'; } } // filter on a family name if ($this->params['selection'] == 'tree' || $this->params['selection'] == 'location') { $html[] = '<p>'; $html[] = '<label for="familyname" title="' . JText::_('JTMAP_DESC_FAMILYNAME') . '">' . JText::_('JT_LABEL_FAMILYNAME') . '</label>'; $html[] = '<input id="jtmap-familyname" name="familyname" class="inputbox" type="text" value="' . $this->params['subject'] . '" />'; $html[] = '</p>'; } // filter on distance if ($this->params['selection'] == 'location') { if (isset($this->params['center']) && !empty($this->params['center'])) { $center = JText::_('JTMAP_FROM') . ' ' . $this->params['center']; } else { if (isset($this->params['longitude']) && !empty($this->params['longitude']) && isset($this->params['latitude']) && !empty($this->params['latitude'])) { $center = JText::_('JTMAP_FROM') . ' ' . '( ' . $this->params['latitude'] . ', ' . $this->params['longitude'] . ' )'; } else { $center = JText::_('JTMAP_NOCENTER'); } } $html[] = '<p>'; $html[] = '<label for="distance" title="' . JText::_('JTMAP_DESC_DISTANCE') . '">' . JText::_('JTMAP_DISTANCE') . '</label>'; $html[] = '<input id="jtmap-distance" name="distance" class="inputbox validate-numeric" type="text" value="' . $this->params['distance'] . '" maxlength="4" size="4"/>'; $html[] = '<span> ' . $center . '</span>'; $html[] = '</p>'; } $html[] = '<p>'; $html[] = '<label for="perstart" title="' . JText::_('JTMAP_DESC_PERIODSTART') . '">' . JText::_('JTMAP_PERIODSTART') . '</label>'; $html[] = '<input id="jtmap-perstart" name="perstart" class="inputbox validate-numeric" type="text" value="' . $this->params['period_start'] . '" maxlength="4" size="4"/>'; $html[] = '</p>'; $html[] = '<p>'; $html[] = '<label for="perend" title="' . JText::_('JTMAP_DESC_PERIODEND') . '" >' . JText::_('JTMAP_PERIODEND') . '</label>'; $html[] = '<input id="jtmap-perend" name="perend" class="inputbox validate-numeric" type="text" value="' . $this->params['period_end'] . '" maxlength="4" size="4"/>'; $html[] = '</p>'; $options = $this->getHtmlEvents(); if (count($options)) { $html[] = '<div style="clear:both;"></div>'; $html[] = '<p>'; $html[] = '<label for="events" title="' . JText::_('JTMAP_DESC_INCLUDE_EVENTS') . '">' . JText::_('JTMAP_INCLUDE_EVENTS') . '</label>'; $html[] = '<select id="jtmap-events" name="events" class="inputbox" multiple="multiple" size="10">'; $html = array_merge($html, $options); $html[] = '</select>'; $html[] = '</p>'; } $html[] = '</fieldset>'; $html[] = '</div>'; $html[] = '<div style="clear:both;"></div>'; $html[] = '</div>'; return implode("\n", array_merge($script, $html)); } else { return false; } }
function display($tpl = null) { // Load the parameters. $app = JFactory::getApplication('site'); $params = JoaktreeHelper::getJTParams(); $document =& JFactory::getDocument(); // Find the value for tech $technology = $this->get('technology'); // set up style sheets and javascript files JHTML::stylesheet(JoaktreeHelper::joaktreecss()); JHTML::stylesheet(JoaktreeHelper::joaktreecss($params->get('theme'))); // get user info $userId = $this->get('userId'); if (!$userId || $userId == 0) { $document->addScript(JoaktreeHelper::joaktreejs('jtform.js')); } // Get data from the model $personlist = $this->get('personlist'); $pagination =& $this->get('Pagination'); $tree_id = $this->get('treeId'); $patronymSetting = $this->get('patronymSetting'); $userAccess = $this->get('access'); $menus1 =& $this->get('menusJoaktree'); $menus2 =& $this->get('menusJoaktreelist'); // Id's and settings $lists['tree_id'] = $tree_id; $lists['relationId'] = $this->get('relationId'); $lists['menuItemId'] = $menus1[$tree_id]; $lists['menuItemId2'] = $menus2[$tree_id]; $lists['patronym'] = $patronymSetting; $lists['userAccess'] = $userAccess; $lists['technology'] = $technology; $lists['action'] = JoaktreeHelper::getAction(); //Filter $context = 'com_joaktree.joaktreelist.list.'; $filter_order = $app->getUserStateFromRequest($context . 'filter_order', 'filter_order', 'jpn.familyName', 'cmd'); $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); $search4 = $app->getUserStateFromRequest($context . 'search4', 'search4', '', 'string'); $search4 = base64_decode($search4); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $lists['searchWidth'] = (int) $params->get('search_width', '120'); $lists['search1'] = $search1; $lists['search2'] = $search2; $lists['search3'] = $search3; $lists['search4'] = $search4; // last update $lists['lastUpdate'] = $this->get('lastUpdate'); // copyright $lists['CR'] = JoaktreeHelper::getJoaktreeCR(); $this->assignRef('pagination', $pagination); $this->assignRef('personlist', $personlist); $this->assignRef('lists', $lists); if (($lists['action'] == 'save' || $lists['action'] == 'saveparent1') && count($personlist) == 0) { JFactory::getDocument()->addScriptDeclaration('window.parent.jtSavePerson();'); } else { if ($lists['userAccess']) { // set title, meta title if ($params->get('treeName')) { $title = $params->get('treeName'); $document->setTitle($title); $document->setMetadata('title', $title); } // set additional meta tags if ($params->get('menu-meta_description')) { $document->setDescription($params->get('menu-meta_description')); } if ($params->get('menu-meta_keywords')) { $document->setMetadata('keywords', $params->get('menu-meta_keywords')); } // robots if ($params->get('treeRobots') > 0) { $document->setMetadata('robots', JoaktreeHelper::stringRobots($params->get('treeRobots'))); } else { if ($params->get('robots')) { $document->setMetadata('robots', $params->get('robots')); } } } parent::display($tpl); } }
function display($tpl = null) { // Load the parameters. $model = $this->getModel(); $this->params = JoaktreeHelper::getJTParams(); $document =& JFactory::getDocument(); if ($this->params->get('siteedit', 1)) { $canDo = JoaktreeHelper::getActions(); } else { $canDo = null; } // Find the value for tech $technology = $this->get('technology'); // set up style sheets and javascript files JHTML::stylesheet(JoaktreeHelper::joaktreecss()); JHTML::stylesheet(JoaktreeHelper::joaktreecss($this->params->get('theme'))); // Set up shadowbox JHTML::stylesheet(JoaktreeHelper::shadowboxcss()); $document->addScript(JoaktreeHelper::shadowboxjs()); // Set up modal behavior JHtml::_('behavior.modal', 'a.modal'); if ($technology != 'b') { // javascript template - no ajax // default template includes ajax JHTML::stylesheet(JoaktreeHelper::briaskcss()); $document->addScript(JoaktreeHelper::joaktreejs('mod_briaskISS.js')); $document->addScript(JoaktreeHelper::joaktreejs('toggle.js')); } if ($technology != 'b' and $technology != 'j') { // default template includes ajax $document->addScript(JoaktreeHelper::joaktreejs('jtajax.js')); } // Access $lists['userAccess'] = $this->get('access'); $lists['technology'] = $technology; $edit = $this->get('action'); $lists['edit'] = $edit == 'edit' ? true : false; // Person $this->person = $this->get('person'); $model->setCookie(); $Html['lineage'] = $this->showLineage(); $lists['showAncestors'] = (int) $this->params->get('ancestorchart', 0); $lists['showDescendants'] = (int) $this->params->get('descendantchart', 0); $lists['numberArticles'] = $this->person->getArticleCount(); // Pictures $Html['pictures'] = $this->showPictures(); $lists['nextDelay'] = round((int) $this->params->get('nextDelay', 0) / 1000, 3); $lists['transDelay'] = round((int) $this->params->get('transDelay', 0) / 1000, 3); // Static map if ($this->person->map == 1) { $Html['staticmap'] = $this->person->getStaticMap(); $lists['indStaticMap'] = $Html['staticmap'] ? true : false; } // Interactive map if ($this->person->map == 2) { $Html['interactivemap'] = $this->person->getInteractiveMap(); $lists['indInteractiveMap'] = $Html['interactivemap'] ? true : false; $lists['pxHeightMap'] = (int) $this->params->get('pxHeight', 0); } // last update $lists['showUpdate '] = $this->params->get('show_update'); if ($lists['showUpdate '] != 'N') { $lists['lastUpdate'] = JoaktreeHelper::lastUpdateDateTimePerson($this->person->lastUpdateDate); $lists['showchange'] = (int) $this->params->get('indLogging', 0); } // copyright $lists['CR'] = JoaktreeHelper::getJoaktreeCR(); //return $retObject = new stdClass(); $retObject->object = 'prsn'; $retObject->app_id = $this->person->app_id; $retObject->object_id = $this->person->id; $lists['retId'] = base64_encode(json_encode($retObject)); // tab behavior if ((int) $this->params->get('indTabBehavior') == 1) { $lists['action'] = 'onClick'; } else { $lists['action'] = 'onMouseOver'; } $this->assignRef('Html', $Html); $this->assignRef('canDo', $canDo); $this->assignRef('lists', $lists); if ($lists['userAccess']) { // set title, meta title $title = $this->person->firstName . ' ' . $this->person->familyName; $document->setTitle($title); $document->setMetadata('title', $title); // set additional meta tags if ($this->params->get('menu-meta_description')) { $document->setDescription($this->params->get('menu-meta_description')); } if ($this->params->get('menu-meta_keywords')) { $document->setMetadata('keywords', $this->params->get('menu-meta_keywords')); } // robots if ($this->person->robots > 0) { $document->setMetadata('robots', JoaktreeHelper::stringRobots($this->person->robots)); } else { if ($this->params->get('robots')) { $document->setMetadata('robots', $this->params->get('robots')); } } } parent::display($tpl); }
function display($tpl = null) { $this->lists = array(); $app = JFactory::getApplication('site'); $document =& JFactory::getDocument(); // Load the parameters. $params = $app->getParams(); $params->merge(JoaktreeHelper::getGedCom()); $params->merge(JoaktreeHelper::getTheme(true, true)); // set up style sheets and javascript files JHTML::stylesheet(JoaktreeHelper::joaktreecss()); JHTML::stylesheet(JoaktreeHelper::joaktreecss($params->get('theme'))); $document->addScript(JoaktreeHelper::joaktreejs('toggle.js')); // get user info $userId = $this->get('userId'); if (!$userId || $userId == 0) { $document->addScript(JoaktreeHelper::joaktreejs('jtform.js')); } // Get data from the model $this->items = $this->get('items'); $this->pagination = $this->get('pagination'); $this->lists['app_id'] = $this->get('applicationId'); $this->lists['userAccess'] = $this->get('access'); $statusObj = $this->get('returnObject'); $this->lists['source_id'] = is_object($statusObj) ? $statusObj->object_id : null; $this->lists['status'] = is_object($statusObj) ? $statusObj->status : null; if ($this->lists['status'] == 'new') { $this->newItem = $this->get('newlyAddedItem'); } $this->lists['action'] = $this->get('action'); if ($this->lists['action'] == 'select') { $this->lists['link'] = 'index.php?option=com_joaktree' . '&view=sources' . '&appId=' . $this->lists['app_id'] . '&tmpl=component' . '&action=' . $this->lists['action']; // in case of "select" - what are the details $this->lists['counter'] = $this->get('counter'); } else { $this->lists['link'] = 'index.php?option=com_joaktree' . '&view=sources' . '&appId=' . $this->lists['app_id']; } if ($params->get('siteedit', 1)) { $this->canDo = JoaktreeHelper::getActions(false); } else { $this->canDo = null; } //Filter $context = 'com_joaktree.source.list.'; $search1 = $app->getUserStateFromRequest($context . 'search1', 'search1', '', 'string'); $search1 = JString::strtolower($search1); // search filter $this->lists['search1'] = $search1; // Find the value for tech $this->lists['technology'] = $this->get('technology'); // copyright $this->lists['CR'] = JoaktreeHelper::getJoaktreeCR(); $this->lists['showchange'] = (int) $params->get('indLogging', 0); //return $retObject = new stdClass(); $retObject->object = 'sour'; $this->lists['retId'] = base64_encode(json_encode($retObject)); if ($this->lists['userAccess']) { // set title, meta title if ($params->get('gedcomName')) { $title = $params->get('gedcomName'); $document->setTitle($title); $document->setMetadata('title', $title); } // set additional meta tags if ($params->get('menu-meta_description')) { $document->setDescription($params->get('menu-meta_description')); } if ($params->get('menu-meta_keywords')) { $document->setMetadata('keywords', $params->get('menu-meta_keywords')); } if ($params->get('robots')) { $document->setMetadata('robots', $params->get('robots')); } } parent::display($tpl); }