/** * Render the list of associated items * * @param integer $catid Category identifier to search its associations * @param string $extension Category Extension * * @return string The language HTML */ public static function association($catid, $extension = 'com_content') { // Defaults $html = ''; // Get the associations if ($associations = CategoriesHelper::getAssociations($catid, $extension)) { JArrayHelper::toInteger($associations); // Get the associated categories $db = JFactory::getDbo(); $query = $db->getQuery(true)->select('c.id, c.title')->select('l.sef as lang_sef')->from('#__categories as c')->where('c.id IN (' . implode(',', array_values($associations)) . ')')->join('LEFT', '#__languages as l ON c.language=l.lang_code')->select('l.image')->select('l.title as language_title'); $db->setQuery($query); try { $items = $db->loadObjectList('id'); } catch (RuntimeException $e) { throw new Exception($e->getMessage(), 500); } if ($items) { foreach ($items as &$item) { $text = strtoupper($item->lang_sef); $url = JRoute::_('index.php?option=com_categories&task=category.edit&id=' . (int) $item->id . '&extension=' . $extension); $tooltipParts = array(JHtml::_('image', 'mod_languages/' . $item->image . '.gif', $item->language_title, array('title' => $item->language_title), true), $item->title); $item->link = JHtml::_('tooltip', implode(' ', $tooltipParts), null, null, $text, $url, null, ' label label-association label-' . $item->lang_sef); } } $html = JLayoutHelper::render('joomla.content.associations', $items); } return $html; }
/** * Render the button * * @param array &$definition Definition * * @return string */ public function render(&$definition) { $data = new stdClass(); $data->button = JText::sprintf('COM_NENO_TRANSLATION_CREDIT_TOOLBAR_FAKE_BUTTON', number_format($definition[1], 0, ',', '.')); $layout = JLayoutHelper::render('toolbartcbutton', $data, JPATH_NENO_LAYOUTS); return $layout; }
/** * Get the associated language flags * * @param int $newsfeedid The item id to search associations * * @return string The language HTML */ public static function association($newsfeedid) { // Defaults $html = ''; // Get the associations if ($associations = JLanguageAssociations::getAssociations('com_newsfeeds', '#__newsfeeds', 'com_newsfeeds.item', $newsfeedid)) { foreach ($associations as $tag => $associated) { $associations[$tag] = (int) $associated->id; } // Get the associated newsfeed items $db = JFactory::getDbo(); $query = $db->getQuery(true)->select('c.id, c.name as title')->select('l.sef as lang_sef')->from('#__newsfeeds as c')->select('cat.title as category_title')->join('LEFT', '#__categories as cat ON cat.id=c.catid')->where('c.id IN (' . implode(',', array_values($associations)) . ')')->join('LEFT', '#__languages as l ON c.language=l.lang_code')->select('l.image')->select('l.title as language_title'); $db->setQuery($query); try { $items = $db->loadObjectList('id'); } catch (RuntimeException $e) { throw new Exception($e->getMessage(), 500); } if ($items) { foreach ($items as &$item) { $text = strtoupper($item->lang_sef); $url = JRoute::_('index.php?option=com_newsfeeds&task=newsfeed.edit&id=' . (int) $item->id); $tooltipParts = array(JHtml::_('image', 'mod_languages/' . $item->image . '.gif', $item->language_title, array('title' => $item->language_title), true), $item->title, '(' . $item->category_title . ')'); $item->link = JHtml::_('tooltip', implode(' ', $tooltipParts), null, null, $text, $url, null, 'hasTooltip label label-association label-' . $item->lang_sef); } } $html = JLayoutHelper::render('joomla.content.associations', $items); } return $html; }
/** * Render the list of associated items * * @param integer $catid Category identifier to search its associations * @param string $extension Category Extension * * @return string The language HTML * * @since 3.2 * @throws Exception */ public static function association($catid, $extension = 'com_content') { // Defaults $html = ''; // Get the associations if ($associations = CategoriesHelper::getAssociations($catid, $extension)) { $associations = ArrayHelper::toInteger($associations); // Get the associated categories $db = JFactory::getDbo(); $query = $db->getQuery(true)->select('c.id, c.title')->select('l.sef as lang_sef')->select('l.lang_code')->from('#__categories as c')->where('c.id IN (' . implode(',', array_values($associations)) . ')')->join('LEFT', '#__languages as l ON c.language=l.lang_code')->select('l.image')->select('l.title as language_title'); $db->setQuery($query); try { $items = $db->loadObjectList('id'); } catch (RuntimeException $e) { throw new Exception($e->getMessage(), 500, $e); } if ($items) { foreach ($items as &$item) { $text = $item->lang_sef ? strtoupper($item->lang_sef) : 'XX'; $url = JRoute::_('index.php?option=com_categories&task=category.edit&id=' . (int) $item->id . '&extension=' . $extension); $classes = 'hasPopover label label-association label-' . $item->lang_sef; $item->link = '<a href="' . $url . '" title="' . $item->language_title . '" class="' . $classes . '" data-content="' . $item->title . '" data-placement="top">' . $text . '</a>'; } } JHtml::_('bootstrap.popover'); $html = JLayoutHelper::render('joomla.content.associations', $items); } return $html; }
/** * Displays the comments area * * @param string $context The context of the content being passed to the plugin * @param object &$row The article object * @param object &$params The article params * @param integer $page The 'page' number * * @return mixed html string containing code for the comment if in com_content.article else boolean false * */ public function onContentAfterDisplay($context, &$row, &$params, $page = 0) { $parts = explode(".", $context); $plgCatid = $this->params->def('catid'); // Check is run com_content if ($parts[0] != 'com_content') { return false; } // Check category of the plugin in the allowable category array of the plugin if ($plgCatid[0] != 'all' && !in_array($row->catid, $plgCatid)) { return false; } // Add media file JHtml::_('jquery.framework'); JHtml::script(JUri::base() . 'media/pkg_mjcommentsystem/plg_content_mjformcomment/js/plg_mjformcomment.js', false, true); JHtml::stylesheet(JUri::base() . 'media/pkg_mjcommentsystem/plg_content_mjformcomment/css/plg_mjformcomment.css', false, true, false); // Add the language file of the component $lang = JFactory::getLanguage(); $basePath = JPATH_SITE . '/components/com_mjcomments'; $lang->load('com_mjcomments', $basePath, null, true); // Assign value to the layout variables $content_id = $row->id; $formReturn = 'index.php?option=com_mjcomments&task=comment.send&format=json'; // Get the comment form $this->setCommentForm(); // Get the comment list $this->setCommentList($content_id); // Name of the variables that will be used in the layout $data = array('view' => $context, 'form' => $this->form, 'formReturn' => $formReturn, 'content_id' => $content_id, 'comments' => $this->comments); return JLayoutHelper::render('default', compact('data'), __DIR__ . '/layouts'); }
/** * Generate the markup to display the item associations * * @param int $itemid The menu item id * * @return string * * @since 3.0 * * @throws Exception If there is an error on the query */ public static function association($itemid) { // Defaults $html = ''; // Get the associations if ($associations = MenusHelper::getAssociations($itemid)) { // Get the associated menu items $db = JFactory::getDbo(); $query = $db->getQuery(true)->select('m.id, m.title')->select('l.sef as lang_sef, l.lang_code')->select('mt.title as menu_title')->from('#__menu as m')->join('LEFT', '#__menu_types as mt ON mt.menutype=m.menutype')->where('m.id IN (' . implode(',', array_values($associations)) . ')')->join('LEFT', '#__languages as l ON m.language=l.lang_code')->select('l.image')->select('l.title as language_title'); $db->setQuery($query); try { $items = $db->loadObjectList('id'); } catch (runtimeException $e) { throw new Exception($e->getMessage(), 500); } // Construct html if ($items) { foreach ($items as &$item) { $text = strtoupper($item->lang_sef); $url = JRoute::_('index.php?option=com_menus&task=item.edit&id=' . (int) $item->id); $tooltip = $item->title . '<br />' . JText::sprintf('COM_MENUS_MENU_SPRINTF', $item->menu_title); $classes = 'hasPopover label label-association label-' . $item->lang_sef; $item->link = '<a href="' . $url . '" title="' . $item->language_title . '" class="' . $classes . '" data-content="' . $tooltip . '" data-placement="top">' . $text . '</a>'; } } JHtml::_('bootstrap.popover'); $html = JLayoutHelper::render('joomla.content.associations', $items); } return $html; }
/** * Generate the markup to display the item associations * * @param int $itemid The menu item id * * @return string * * @since 3.0 * * @throws Exception If there is an error on the query */ public static function association($itemid) { // Defaults $html = ''; // Get the associations if ($associations = MenusHelper::getAssociations($itemid)) { // Get the associated menu items $db = JFactory::getDbo(); $query = $db->getQuery(true)->select('m.id, m.title')->select('l.sef as lang_sef')->select('mt.title as menu_title')->from('#__menu as m')->join('LEFT', '#__menu_types as mt ON mt.menutype=m.menutype')->where('m.id IN (' . implode(',', array_values($associations)) . ')')->join('LEFT', '#__languages as l ON m.language=l.lang_code')->select('l.image')->select('l.title as language_title'); $db->setQuery($query); try { $items = $db->loadObjectList('id'); } catch (runtimeException $e) { throw new Exception($e->getMessage(), 500); } // Construct html if ($items) { foreach ($items as &$item) { $text = strtoupper($item->lang_sef); $url = JRoute::_('index.php?option=com_menus&task=item.edit&id=' . (int) $item->id); $tooltipParts = array(JHtml::_('image', 'mod_languages/' . $item->image . '.gif', $item->language_title, array('title' => $item->language_title), true), $item->title, '(' . $item->menu_title . ')'); $class = 'hasTooltip label label-association label-' . $item->lang_sef; $item->link = JHtml::_('tooltip', implode(' ', $tooltipParts), null, null, $text, $url, null, $class); } } $html = JLayoutHelper::render('joomla.content.associations', $items); } return $html; }
/** * Get the associated language flags * * @param integer $contactid The item id to search associations * * @return string The language HTML * * @throws Exception */ public static function association($contactid) { // Defaults $html = ''; // Get the associations if ($associations = JLanguageAssociations::getAssociations('com_contact', '#__contact_details', 'com_contact.item', $contactid)) { foreach ($associations as $tag => $associated) { $associations[$tag] = (int) $associated->id; } // Get the associated contact items $db = JFactory::getDbo(); $query = $db->getQuery(true)->select('c.id, c.name as title')->select('l.sef as lang_sef, lang_code')->from('#__contact_details as c')->select('cat.title as category_title')->join('LEFT', '#__categories as cat ON cat.id=c.catid')->where('c.id IN (' . implode(',', array_values($associations)) . ')')->join('LEFT', '#__languages as l ON c.language=l.lang_code')->select('l.image')->select('l.title as language_title'); $db->setQuery($query); try { $items = $db->loadObjectList('id'); } catch (RuntimeException $e) { throw new Exception($e->getMessage(), 500, $e); } if ($items) { foreach ($items as &$item) { $text = strtoupper($item->lang_sef); $url = JRoute::_('index.php?option=com_contact&task=contact.edit&id=' . (int) $item->id); $tooltip = $item->title . '<br />' . JText::sprintf('JCATEGORY_SPRINTF', $item->category_title); $classes = 'hasPopover label label-association label-' . $item->lang_sef; $item->link = '<a href="' . $url . '" title="' . $item->language_title . '" class="' . $classes . '" data-content="' . $tooltip . '" data-placement="top">' . $text . '</a>'; } } JHtml::_('bootstrap.popover'); $html = JLayoutHelper::render('joomla.content.associations', $items); } return $html; }
public function payment() { // Set base path JLayoutHelper::$defaultBasePath = JPATH_PLUGINS . '/content/ic_paypal/layouts'; // Render mylayout.php $renderedLayout = JLayoutHelper::render('payment_test'); echo $renderedLayout; }
public function display($tpl = null) { $this->state = $this->get('State'); $this->form = $this->get('form'); JDeveloperHelper::addSubmenu('import'); $this->addToolbar(); $this->sidebar = JLayoutHelper::render("sidebar", array("active" => "import"), JDeveloperLAYOUTS); parent::display($tpl); }
/** * Get a translations * * @return void */ public function getTranslation() { $input = $this->input; $translationId = $input->getInt('id'); if (!empty($translationId)) { $translation = NenoContentElementTranslation::getTranslation($translationId); echo JLayoutHelper::render('editor', $translation->prepareDataForView(true), JPATH_NENO_LAYOUTS); } JFactory::getApplication()->close(); }
public function display($tpl = null) { $this->items = $this->get('Items'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } JDeveloperHelper::addSubmenu('packages'); $this->addToolbar(); $this->sidebar = JLayoutHelper::render("sidebar", array("active" => "packages"), JDeveloperLAYOUTS); parent::display($tpl); }
function DefaultPaginationForm($total, $limitstart, $limit, $keyword = "") { jimport('joomla.html.pagination'); $pageNav = new JPagination($total, $limitstart, $limit); if ($keyword != "" && method_exists($pageNav, "setAdditionalUrlParam")) { $pageNav->setAdditionalUrlParam("keyword", urlencode($keyword)); $pageNav->setAdditionalUrlParam("showpast", JRequest::getInt("showpast", 0)); } $Itemid = JRequest::getInt("Itemid"); $task = JRequest::getVar("jevtask"); // include catids to make sure not lost when category is pre-selected $catids = JRequest::getString("catids", JRequest::getString("category_fv", "")); if (JString::strlen($catids) > 0) { $catids = explode("|", $catids); JArrayHelper::toInteger($catids); $catids = "&catids=" . implode("|", $catids); } $year = ""; if (JRequest::getInt("year", 0) > 0) { $year = "&year=" . JRequest::getInt("year", 0); } $month = ""; if (JRequest::getInt("month", 0) > 0) { $month = "&month=" . JRequest::getInt("month", 0); } if ($keyword != "") { $keyword = "&keyword=" . urlencode($keyword) . "&showpast=" . JRequest::getInt("showpast", 0); } $link = JRoute::_("index.php?option=" . JEV_COM_COMPONENT . "&Itemid={$Itemid}&task={$task}{$catids}{$year}{$month}{$keyword}"); ?> <div class="jev_pagination"> <form action="<?php echo $link; ?> " method="post" name="adminForm" id="adminForm"> <?php if ($task != "crawler.listevents" || version_compare(JVERSION, "3.0.0", 'lt')) { echo $pageNav->getListFooter(); } else { // Allow to receive a null layout $layoutId = 'pagination.crawlerlinks'; $app = JFactory::getApplication(); $list = array('prefix' => $pageNav->prefix, 'limit' => $pageNav->limit, 'limitstart' => $pageNav->limitstart, 'total' => $pageNav->total, 'limitfield' => $pageNav->getLimitBox(), 'pagescounter' => $pageNav->getPagesCounter(), 'pages' => $pageNav->getPaginationPages()); $options = array(); echo JLayoutHelper::render($layoutId, array('list' => $list, 'options' => $options)); } ?> </form> </div> <?php }
/** * Method to render the layout. * * @param string $layout Name of the layout to render * @param array $displayData Object which properties are used inside the layout file to build displayed output * @param string $basePath Base path to use when loading layout files * * @return string */ public static function render($layout, $displayData, $basePath) { $result = ''; if (is_dir($basePath)) { if (version_compare(JVERSION, '3.0', 'ge')) { $result = JLayoutHelper::render($layout, $displayData, $basePath); } else { ob_start(); require $basePath . '/' . $layout . '.php'; $result = ob_get_contents(); ob_get_clean(); } } return $result; }
private function getTextAnswers() { $app = JFactory::getApplication(); $model = $this->getModel('survey'); $surveyId = $app->input->getInt('id'); $questionId = $app->input->getInt('qid'); if (!$model->authorize_survey($surveyId)) { throw new Exception(JText::_('JERROR_ALERTNOAUTHOR')); } $textAnswers = $model->getTextAnswers($surveyId, $questionId); $params = JComponentHelper::getParams('com_communitysurveys'); $layout = $params->get('layout', 'default'); $output = JLayoutHelper::render($layout . '.reports.text_answers_list', array('answers' => $textAnswers, 'params' => $params), JPATH_COMPONENT_SITE . '/layouts'); echo new JResponseJson($output); }
public function display($tpl = null) { $input = JFactory::getApplication()->input; $this->_layout == "edit" ? $input->set('hidemainmenu', true) : null; $this->form = $this->get('Form'); $this->item = $this->get('Item'); $this->state = $this->get('State'); if ($this->_layout == "default") { $model = JModelLegacy::getInstance("Libraries", "JDeveloperModel"); $this->items = $model->getItems(); } $this->sidebar = JLayoutHelper::render("sidebar", array("active" => "libraries"), JDeveloperLAYOUTS); $this->addToolbar(); parent::display($tpl); }
/** * Renders the error stack and returns the results as a string * * @param string $name Not used. * @param array $params Associative array of values * @param string $content Not used. * * @return string The output of the script * * @since 11.1 */ public function render($name, $params = array(), $content = null) { $msgList = $this->getData(); $displayData = array('msgList' => $msgList, 'name' => $name, 'params' => $params, 'content' => $content); $app = JFactory::getApplication(); $chromePath = JPATH_THEMES . '/' . $app->getTemplate() . '/html/message.php'; if (file_exists($chromePath)) { include_once $chromePath; } if (function_exists('renderMessage')) { JLog::add('renderMessage() is deprecated. Override system message rendering with layouts instead.', JLog::WARNING, 'deprecated'); return renderMessage($msgList); } return JLayoutHelper::render('joomla.system.message', $displayData); }
/** * Method to load the Sortable script and make table sortable * * @param string $tableId DOM id of the table * @param string $formId DOM id of the form * @param string $sortDir Sort direction * @param string $saveOrderingUrl Save ordering url, ajax-load after an item dropped * @param boolean $proceedSaveOrderButton Set whether a save order button is displayed * @param boolean $nestedList Set whether the list is a nested list * * @return void * * @since 3.0 * * @throws InvalidArgumentException */ public static function sortable($tableId, $formId, $sortDir = 'asc', $saveOrderingUrl = null, $proceedSaveOrderButton = true, $nestedList = false) { // Only load once if (isset(static::$loaded[__METHOD__])) { return; } // Note: $i is required but has to be an optional argument in the function call due to argument order if (null === $saveOrderingUrl) { throw new InvalidArgumentException('$saveOrderingUrl is a required argument in JHtmlSortablelist::sortable'); } $displayData = array('tableId' => $tableId, 'formId' => $formId, 'sortDir' => $sortDir, 'saveOrderingUrl' => $saveOrderingUrl, 'nestedList' => $nestedList, 'proceedSaveOrderButton' => $proceedSaveOrderButton); JLayoutHelper::render('joomla.html.sortablelist', $displayData); // Set static array static::$loaded[__METHOD__] = true; return; }
/** * Load installation step * * @return void */ public function loadInstallationStep() { $step = NenoSettings::get('installation_status', 0); if (empty($step)) { $layout = JLayoutHelper::render('installationgetstarted', null, JPATH_NENO_LAYOUTS); } else { $layout = JLayoutHelper::render('installationstep' . $step, $this->getDataForStep($step), JPATH_NENO_LAYOUTS); } $sidebar = ''; if ($step == 5) { NenoHelperBackend::addSubmenu(); $sidebar = JHtmlSidebar::render(); } echo json_encode(array('installation_step' => $layout, 'jsidebar' => $sidebar)); JFactory::getApplication()->close(); }
public function display($tpl = null) { $this->items = $this->get('Items'); $this->state = $this->get('State'); $this->pagination = $this->get('Pagination'); $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } $this->addToolbar(); $this->sidebar = JLayoutHelper::render("sidebar", array("active" => "overrides"), JDeveloperLAYOUTS); parent::display($tpl); }
public function display($tpl = null) { $this->items = $this->get('Items'); $this->state = $this->get('State'); $this->pagination = $this->get('Pagination'); $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); // Check for errors. if (count($errors = $this->get('Errors'))) { throw new Exception(implode("\n", $errors)); return false; } JDeveloperHelper::addSubmenu('extensions'); $this->addToolbar(); $this->sidebar = JLayoutHelper::render("sidebar", array("active" => "extensions"), JDeveloperLAYOUTS); parent::display($tpl); }
/** * Renders multiple modules script and returns the results as a string * * @param string $position The position of the modules to render * @param array $params Associative array of values * @param string $content Module content * * @return string The output of the script * * @since 3.6 */ public function render($position, $params = array(), $content = null) { $renderer = $this->_doc->loadRenderer('module'); $buffer = ''; $app = JFactory::getApplication(); $user = JFactory::getUser(); $frontediting = $app->isSite() && $app->get('frontediting', 1) && !$user->guest; $menusEditing = $app->get('frontediting', 1) == 2 && $user->authorise('core.edit', 'com_menus'); foreach (JModuleHelper::getModules($position) as $mod) { $moduleHtml = $renderer->render($mod, $params, $content); if ($frontediting && trim($moduleHtml) != '' && $user->authorise('module.edit.frontend', 'com_modules.module.' . $mod->id)) { $displayData = array('moduleHtml' => &$moduleHtml, 'module' => $mod, 'position' => $position, 'menusediting' => $menusEditing); JLayoutHelper::render('joomla.edit.frontediting_modules', $displayData); } $buffer .= $moduleHtml; } return $buffer; }
/** * Renders multiple modules script and returns the results as a string * * @param string $position The position of the modules to render * @param array $params Associative array of values * @param string $content Module content * * @return string The output of the script * * @since 11.1 */ public function render($position, $params = array(), $content = null) { $renderer = $this->_doc->loadRenderer('module'); $buffer = ''; $app = JFactory::getApplication(); $frontediting = $app->get('frontediting', 1); $user = JFactory::getUser(); $canEdit = $user->id && $frontediting && !($app->isAdmin() && $frontediting < 2) && $user->authorise('core.edit', 'com_modules'); $menusEditing = $frontediting == 2 && $user->authorise('core.edit', 'com_menus'); $modules = JModuleHelper::getModules($position); //add for plugin $count = count($modules); //add for plugin $counter = 0; //add for plugin $style = isset($params['style']) ? $params['style'] : NULL; //add for plugin $plugin = JPluginHelper::getPlugin('system', 'nnbootstrapparams'); //add for plugin $pluginparams = json_decode($plugin->params); //add for plugin $exludeposition = $pluginparams->exludeposition; //add for plugin if ($exludeposition != '') { $exludeposition = explode(',', $exludeposition); } //add for plugin foreach ($modules as $mod) { if (!in_array($position, $exludeposition)) { $mod = $this->changeparams($mod, $count, $counter, $style); //add for plugin } $moduleHtml = $renderer->render($mod, $params, $content); if ($app->isSite() && $canEdit && trim($moduleHtml) != '' && $user->authorise('core.edit', 'com_modules.module.' . $mod->id)) { $displayData = array('moduleHtml' => &$moduleHtml, 'module' => $mod, 'position' => $position, 'menusediting' => $menusEditing); JLayoutHelper::render('joomla.edit.frontediting_modules', $displayData); } $buffer .= $moduleHtml; $counter++; //add for plugin } return $buffer; }
/** * Generate content element file * * @return void */ public function downloadContentElementFile() { $input = JFactory::getApplication()->input; $tableId = $input->getInt('table_id'); /* @var $table NenoContentElementTable */ $table = NenoContentElementTable::load($tableId, false, true); /* @var $tableObject stdClass */ $tableObject = $table->prepareDataForView(); // Make file name $tableName = str_replace('#__', '', $tableObject->table_name); $fileName = $tableName . '_contentelements.xml'; $displayData = array(); $displayData['table_name'] = $tableName; $displayData['table'] = $tableObject; // Output XML header('Content-Type: application/xml; charset=utf-8'); header('Content-Disposition: attachment; filename="' . $fileName . '"'); echo JLayoutHelper::render('contentelementxml', $displayData, JPATH_NENO_LAYOUTS); JFactory::getApplication()->close(); }
public function display($tpl = null) { $this->items = $this->get('Items'); $this->state = $this->get('State'); $this->pagination = $this->get('Pagination'); $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } JDeveloperHelper::addSubmenu('templates'); $this->addToolbar(); $this->sidebar = JLayoutHelper::render("sidebar", array("active" => "templates"), JDeveloperLAYOUTS); parent::display($tpl); if (JFactory::getApplication()->input->get('ajax') == "1") { exit; } }
public function display($tpl = null) { //-- Hauptmenü sperren $input = JFactory::getApplication()->input; $this->_layout == "edit" ? $input->set('hidemainmenu', true) : null; $this->form = $this->get('Form'); $this->item = $this->get('Item'); $this->state = $this->get('State'); $this->tables = JModelLegacy::getInstance("Tables", "JDeveloperModel")->getComponentTables($this->item->id); $this->active = $this->getActiveTab(); if ($this->_layout == "default") { $model = JModelLegacy::getInstance("Overrides", "JDeveloperModel"); $this->overrides_admin = $model->getOverrides("component.admin", $this->item->id); if ($this->item->site) { $this->overrides_site = $model->getOverrides("component.site", $this->item->id); } } $this->sidebar = JLayoutHelper::render("sidebar", array("active" => "components"), JDeveloperLAYOUTS); $this->addToolbar(); parent::display($tpl); }
/** * Method to get the field input markup. * * @return string The field input markup. * * @since 3.1.2 (CMS) */ protected function getInput() { // Translate placeholder text $hint = $this->translateHint ? JText::_($this->hint) : $this->hint; // Initialize some field attributes. $size = !empty($this->size) ? ' size="' . $this->size . '"' : ''; $maxLength = !empty($this->maxLength) ? ' maxlength="' . $this->maxLength . '"' : ''; $class = !empty($this->class) ? ' class="' . $this->class . '"' : ''; $readonly = $this->readonly ? ' readonly' : ''; $disabled = $this->disabled ? ' disabled' : ''; $required = $this->required ? ' required aria-required="true"' : ''; $hint = $hint ? ' placeholder="' . $hint . '"' : ''; $autocomplete = !$this->autocomplete ? ' autocomplete="off"' : ' autocomplete="' . $this->autocomplete . '"'; $autocomplete = $autocomplete == ' autocomplete="on"' ? '' : $autocomplete; $autofocus = $this->autofocus ? ' autofocus' : ''; $spellcheck = $this->spellcheck ? '' : ' spellcheck="false"'; // Initialize JavaScript field attributes. $onchange = !empty($this->onchange) ? ' onchange="' . $this->onchange . '"' : ''; $displayData = array($this->name, $this->id, $this->value, $size, $maxlength, $class, $readonly, $disabled, $required, $hint, $autocomplete, $autofocus, $spellcheck, $onchange); return JLayoutHelper::render('libraries.joomla.form.fields.url', $displayData); }
/** * Render the list of associated items * * @param integer $competitie_id The competitie item id * * @return string The language HTML */ public static function association($competitie_id) { // Get the associations // Defaults $html = ''; // Get the associations if ($associations = JLanguageAssociations::getAssociations('com_knvbapi', '#__knvbapi_competities', 'com_knvbapi.competitie.item', $competitie_id, 'id', 'alias', 'catid')) { foreach ($associations as $tag => $associated) { $associations[$tag] = (int) $associated->id; } // Get the associated menu items $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('a.*'); $query->from($db->quoteName('#__knvbapi_competities') . ' as a'); $query->select($db->quoteName('c.title') . ' as category_title'); $query->join('LEFT', $db->quoteName('#__categories') . ' as c ON ' . $db->quoteName('c.id') . ' = ' . $db->quoteName('a.catid')); $query->where($db->quoteName('a.id') . ' IN (' . implode(',', array_values($associations)) . ')'); $query->join('LEFT', $db->quoteName('#__languages') . ' as l ON ' . $db->quoteName('a.language') . ' = ' . $db->quoteName('l.lang_code')); $query->select($db->quoteName('l.image')); $query->select($db->quoteName('l.title') . ' as language_title'); $query->select($db->quoteName('l.sef') . ' as lang_sef'); $db->setQuery($query); try { $items = $db->loadObjectList('id'); } catch (runtimeException $e) { throw new Exception($e->getMessage(), 500); } if ($items) { foreach ($items as &$item) { $text = strtoupper($item->lang_sef); $url = JRoute::_('index.php?option=com_knvbapi&task=competitie.edit&id=' . (int) $item->id); $tooltip_parts = array(JHtml::_('image', 'mod_languages/' . $item->image . '.gif', $item->language_title, array('title' => $item->language_title), true), $item->name, '(' . $item->category_title . ')'); $item->link = JHtml::_('tooltip', implode(' ', $tooltip_parts), null, null, $text, $url, null, 'hasTooltip label label-association label-' . $item->lang_sef); } } $html = JLayoutHelper::render('joomla.content.associations', $items); } return $html; }
public function ajax() { jimport('joomla.application.module.helper'); $model = $this->getModel(); $input = JFactory::getApplication()->input; $cookie = JFactory::getApplication()->input->cookie; $id = $input->post->get('id', NULL, 'INT'); $subtask = $input->post->get('subtask', NULL, 'STRING'); $vote = $input->post->get('vote', NULL, 'INT'); $modid = $input->post->get('modid', 0, 'INT'); $module = $model->getModule($modid); $params = new JRegistry(); $params->loadString($module->params); if ($subtask != 'result') { if ($cookie->get('sp_poll_voted_' . $modid, null)) { die('<p></p><p class="alert alert-danger">' . JText::_('COM_SPPOLLS_ALREADY_VOTED') . '</p>'); } $poll = $model->getPoll($id); $options = json_decode($poll->polls); $new_polls = array(); foreach ($options as $key => $value) { if ($key == $vote) { $new_polls[] = array('poll' => $value->poll, 'votes' => $value->votes + 1); } else { $new_polls[] = array('poll' => $value->poll, 'votes' => $value->votes); } } // Update $poll = $model->updatePoll($new_polls, $id); } $poll = $model->getPoll($id); $options = json_decode($poll->polls); $output = JLayoutHelper::render('results', array('options' => $options)); // Set Cookie if ($subtask != 'result') { $cookie->set('sp_poll_voted_' . $modid, 'yes', time() + $params->get('lag', 12) * 60 * 60); } die($output); }
/** * Filter before display: apply discount, coupon */ public function displaymap() { $user = JBFactory::getAccount(); if ($user->isAgent) { echo JLayoutHelper::render('agent_menu', ''); } $hotel_id = JRequest::getInt('hotel_id', null); $dest_id = JRequest::getInt('dest_id', null); $obj = new stdClass(); if ($hotel_id) { if (!class_exists('BookProModeHotel')) { AImporter::model('hotel'); } $hotelModel = new BookProModelHotel(); $hotelModel->setId($hotel_id); $hotel = $hotelModel->getObject(); $obj->longitude = $hotel->longitude; $obj->latitude = $hotel->latitude; $obj->address = $hotel->address; $obj->title = $hotel->title; $obj->desc = $hotel->desc; } if ($dest_id) { if (!class_exists('BookProModeAirport')) { AImporter::model('airport'); } $destModel = new BookProModelAirport(); $destModel->setId($dest_id); $dest = $destModel->getObject(); $obj->longitude = $dest->longitude; $obj->latitude = $dest->latitude; $obj->title = $dest->title; $obj->desc = $dest->desc; } $view =& $this->getView('googlemap', 'html', 'BookProView'); $view->assign('obj', $obj); $view->display(); }