public function display($tpl = null) { // Set toolbar items for the page JToolBarHelper::publishList(); JToolBarHelper::unpublishList(); JToolBarHelper::deleteList(); JToolBarHelper::editListX(); JToolBarHelper::addNewX(); JToolBarHelper::preferences('com_simplelists', '480'); JHTML::_('behavior.tooltip'); // Automatically fetch items, total and pagination - and assign them to the template $this->fetchItems(); // Re-order the items by parent $listview = $this->getFilter('listview'); if ($listview == 'tree') { $tree = new SimplelistsCategoryTree(); $tree->setItems($this->items); $this->items = $tree->getList(); } else { $listview = 'flat'; } // Listview box $options[] = array('id' => 'tree', 'title' => 'Tree'); $options[] = array('id' => 'flat', 'title' => 'Flat list'); $extra = 'onchange="document.adminForm.submit();"'; $this->lists['listview'] = JHTML::_('select.genericlist', $options, 'filter_listview', $extra, 'id', 'title', $listview); parent::display($tpl); }
public function display($tpl = null) { // Automatically fetch the item and assign it to the layout $this->fetchItem(); // Common lists $parent_id_params = array('nullvalue' => 1, 'nulltitle' => JText::_('No parent'), 'current' => $this->item->parent_id, 'self' => $this->item->id); $this->lists['parent_id'] = SimplelistsHTML::selectCategories('parent_id', $parent_id_params); // Construct the modal boxes $modal = array(); //$modal['image'] = 'index.php?option=com_simplelists&view=files&tmpl=component&type=picture' ; //$modal['image'] .= ($this->item->image) ? '&folder=/'.dirname($this->item->image).'&current='.$this->item->image : '&current='; $this->assignRef('modal', $modal); // Construct the slider-panel jimport('joomla.html.pane'); $pane =& JPane::getInstance('sliders'); $this->assignRef('pane', $pane); // Add jQuery if (JFactory::getApplication()->get('jquery') == false) { $this->addJs('jquery.js'); JFactory::getApplication()->set('jquery', true); } // Add extra JavaScript JHTML::_('behavior.formvalidation'); $this->addJs('form-validation.js'); parent::display($tpl); }
public function display($tpl = null) { // Automatically fetch items, total and pagination - and assign them to the template $this->setAutoClean(false); $this->fetchItems(); $document =& JFactory::getDocument(); // Get some variables $layout = $this->params->get('layout', 'default'); $clayout = $this->params->get('clayout', 'default'); // Load the layout-specific stylesheet $this->addCss('view-categories-' . $clayout . '.css'); // Get the parent-category from our model $model =& $this->getModel(); $parent = $model->getParent(); // Set the page title $page_title = $this->params->get('page_title'); if ($this->params->get('show_page_title') == 1 && !empty($page_title)) { $document->setTitle($page_title); $parent->title = $page_title; } elseif (!empty($parent->title)) { $document->setTitle($parent->title); } // Loop through the list to set things right if (count($this->items) > 0) { foreach ($this->items as $id => $item) { if ($this->params->get('show_category_title') == 0) { $item->title = null; } if ($this->params->get('show_category_description') == 0) { $item->description = null; } $layout = $item->params->get('layout', $layout); $needles = array('category_id' => $item->id, 'category_alias' => $item->alias, 'layout' => $layout); $item->link = SimplelistsHelper::getUrl($needles); // Reinsert this item $this->items[$id] = $item; } } else { $this->assignRef('message', JText::_('No categories found')); } // prepare the image if ($this->params->get('show_category_image') && !empty($parent->image)) { $parent->image = JHTML::image($parent->image, $parent->title, 'title="' . $parent->title . '" class="simplelists" align="' . $parent->image_position . '"'); } else { $parent->image = null; } // prepare the title if ($this->params->get('show_category_title') == 0) { $parent->title = null; } // prepare the description if ($this->params->get('show_category_description') == 0) { $parent->description = null; } $this->assignRef('category', $parent); parent::display($tpl); }
public function display($tpl = null) { // Hide the menu JRequest::setVar('hidemainmenu', 1); // Initialize tooltips JHTML::_('behavior.tooltip'); // Automatically fetch the item and assign it to the layout $this->fetchItem(); parent::display($tpl); }
public function display($tpl = null) { // Set toolbar items for the page JToolBarHelper::publishList(); JToolBarHelper::unpublishList(); JToolBarHelper::editListX(); // Automatically fetch items, total and pagination - and assign them to the template $this->fetchItems(); parent::display($tpl); }
public function display($tpl = null) { switch ($this->jinput->get('layout')) { case 'feeds': $feeds = $this->fetchFeeds('http://www.yireo.com/blog?format=feed&type=rss', 3); $this->feeds = $feeds; break; case 'promotion': $html = YireoHelper::fetchRemote('http://www.yireo.com/advertizement.php', $this->_option); print $html; exit; } parent::display($tpl); }
public function display($tpl = null) { switch (JRequest::getVar('layout')) { case 'feeds': $feeds = $this->fetchFeeds('http://www.yireo.com/blog?format=feed&type=rss', 3); $this->assignRef('feeds', $feeds); break; case 'promotion': $html = YireoHelper::fetchRemote('http://www.yireo.com/advertizement.php', 'SimpleLists'); print $html; exit; } parent::display($tpl); }
public function display($tpl = null) { JResponse::allowCache(false); if (YireoHelper::isJoomla15()) { JHTML::_('stylesheet', 'popup-imagelist.css', 'administrator/components/com_media/assets/'); } else { JHTML::_('stylesheet', 'popup-imagelist.css', 'media/media/css/'); } JHTML::_('behavior.mootools'); JHTML::_('behavior.modal'); $this->assignRef('files', $this->get('files')); $this->assignRef('folders', $this->get('folders')); $this->assignRef('state', $this->get('state')); parent::display($tpl); }
public function display($tpl = null) { // Get system variables $application = JFactory::getApplication(); $document = JFactory::getDocument(); // Get the item from our model $this->fetchItem(); // Set the meta-data $document->setTitle($this->item->title); $document->setMetaData('title', $this->item->title); // Initialize the parameters if ($this->item->params) { $p = clone $this->params; $this->item->params = YireoHelper::toParameter($this->item->params); $p->merge($this->item->params); $this->item->params = $p; } else { $this->item->params = $this->params; } if ($this->item->params->get('meta_author') != '') { $document->setMetaData('author', $this->item->params->get('meta_author')); } if ($this->item->params->get('meta_description') != '') { $document->setDescription($this->item->params->get('meta_description')); } if ($this->item->params->get('meta_keywords') != '') { $document->setMetadata('keywords', $this->item->params->get('meta_keywords')); } // Parse important parameters $layout = null; $this->item = $this->_prepareItem($this->item, $layout); // Check whether the item is still here if (empty($this->item)) { JError::raiseError(404, JText::_('Resource Not Found')); } // when the link was "hidden", we call the link-plugin to decide what to do if (JRequest::getCmd('task') == 'hidden') { $this->item->params->set('show_link', 0); $this->item->extra = SimplelistsPluginHelper::getPluginLinkHidden($item); } else { $this->item->extra = null; } parent::display($tpl); }
public function display($tpl = null) { // Variables $document = JFactory::getDocument(); // Generate the backend feeds $backend_feed = $this->params->get('backend_feed', 1); $this->backend_feed = $backend_feed; if ($backend_feed == 1) { $this->ajax('index.php?option=' . $this->_option . '&view=home&format=ajax&layout=feeds', 'latest_news'); $this->ajax('index.php?option=' . $this->_option . '&view=home&format=ajax&layout=promotion', 'promotion'); } // Add additional CSS $document->addStylesheet('https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700'); $document->addStylesheet('https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css'); // Get the current version $current_version = YireoHelper::getCurrentVersion(); $this->current_version = $current_version; parent::display($tpl); }
/** * Display method * * @param string $tpl * @return null */ public function display($tpl = null) { // Add CSS-code $this->addCss('backend.css', 'media/com_magebridge/css/'); if (MageBridgeHelper::isJoomla25()) { $this->addCss('backend-j25.css', 'media/com_magebridge/css/'); } if (MageBridgeHelper::isJoomla35()) { $this->addCss('backend-j35.css', 'media/com_magebridge/css/'); } // If we detect the API is down, report it $bridge = MageBridgeModelBridge::getInstance(); if ($bridge->getApiState() != null) { $message = null; switch (strtoupper($bridge->getApiState())) { case 'EMPTY METADATA': $message = JText::_('COM_MAGEBRIDGE_VIEW_API_ERROR_EMPTY_METADATA'); break; case 'SUPPORTKEY FAILED': $message = JText::sprintf('COM_MAGEBRIDGE_VIEW_API_ERROR_KEY_FAILED', $bridge->getApiExtra()); break; case 'AUTHENTICATION FAILED': $message = JText::_('COM_MAGEBRIDGE_VIEW_API_ERROR_AUTHENTICATION_FAILED'); break; case 'INTERNAL ERROR': $message = JText::sprintf('COM_MAGEBRIDGE_VIEW_API_ERROR_INTERNAL_ERROR', MageBridgeHelper::getHelpLink('troubleshooting')); break; case 'FAILED LOAD': $message = JText::sprintf('COM_MAGEBRIDGE_VIEW_API_ERROR_FAILED_LOAD', MageBridgeHelper::getHelpLink('faq-troubleshooting:api-widgets')); break; default: $message = JText::sprintf('COM_MAGEBRIDGE_VIEW_API_ERROR_GENERIC', $bridge->getApiState()); break; } MageBridgeModelDebug::getInstance()->feedback($message); } // If debugging is enabled report it if (MagebridgeModelConfig::load('debug') == 1 && JFactory::getApplication()->input->getCmd('tmpl') != 'component' && in_array(JFactory::getApplication()->input->getCmd('view'), array('config', 'home'))) { MageBridgeModelDebug::getInstance()->feedback('COM_MAGEBRIDGE_VIEW_API_DEBUGGING_ENABLED'); } parent::display($tpl); }
public function display($tpl = null) { // Generate the backend feeds $backend_feed = $this->params->get('backend_feed', 1); $this->assignRef('backend_feed', $backend_feed); if ($backend_feed == 1) { $this->ajax('index.php?option=' . $this->_option . '&view=home&format=ajax&layout=feeds', 'latest_news'); $this->ajax('index.php?option=' . $this->_option . '&view=home&format=ajax&layout=promotion', 'promotion'); $document = JFactory::getDocument(); if (JURI::getInstance()->isSSL() == true) { $document->addStylesheet('https://fonts.googleapis.com/css?family=Just+Me+Again+Down+Here'); } else { $document->addStylesheet('http://fonts.googleapis.com/css?family=Just+Me+Again+Down+Here'); } } // Get the current version $current_version = YireoHelper::getCurrentVersion(); $this->assignRef('current_version', $current_version); parent::display($tpl); }
public function display($tpl = null) { // Hide the menu JRequest::setVar('hidemainmenu', 1); // Initialize tooltips JHTML::_('behavior.tooltip'); // Automatically fetch the item and assign it to the layout $this->fetchItem(); // Add extra hidden fields $hidden_fields = '<input type="hidden" name="option" value="' . $this->_option . '" />'; $hidden_fields .= '<input type="hidden" name="view" value="' . $this->_view . '" />'; $hidden_fields .= '<input type="hidden" name="task" value="" />'; $hidden_fields .= JHTML::_('form.token'); $model = $this->getModel(); if (!empty($model)) { $primary_key = $model->getPrimaryKey(); $hidden_fields .= '<input type="hidden" name="cid[]" value="' . $this->item->{$primary_key} . '" />'; } $this->assignRef('hidden_fields', $hidden_fields); parent::display($tpl); }
/** * Main display method * * @param string $tpl * @return null */ public function display($tpl = null) { // Extra behaviors JHTML::_('behavior.tooltip'); JHTML::_('behavior.modal'); // Automatically fetch items, total and pagination - and assign them to the template $this->fetchItems(); // Fetch the primary key $primaryKey = $this->_model->getPrimaryKey(); // Parse the items a bit more if (!empty($this->items)) { foreach ($this->items as $index => $item) { // Determine the primary key $item->id = isset($item->{$primaryKey}) ? $item->{$primaryKey} : null; // Set the various links if (empty($item->edit_link)) { $item->edit_link = JRoute::_('index.php?option=' . $this->_option . '&view=' . $this->_view . '&task=edit&cid[]=' . $item->id); } // Re-insert the item $this->items[$index] = $item; } } $this->loadToolbarList(); // Insert extra fields $fields = array(); $fields['primary_field'] = $primaryKey; $fields['ordering_field'] = $this->_model->getOrderByDefault(); $fields['state_field'] = $this->_table->getStateField(); $this->fields = $fields; // Add extra variables $this->option = $this->_option; $this->view = $this->_view; parent::display($tpl); }
public function prepareDisplay() { // Get important system variables $document =& JFactory::getDocument(); $uri =& JFactory::getURI(); // Determine the current layout if ($this->params->get('layout') != '') { $layout = $this->params->get('layout'); $this->setLayout($layout); } else { $layout = $this->getLayout(); } // Load the model $model =& $this->getModel(); // Get the category from our model and prepare it $category = $model->getCategory(); $this->prepareCategory($category, $layout); // Prepare the HTML-document $this->prepareDocument($category); // Automatically fetch items, total and pagination - and assign them to the template $this->setAutoClean(false); $this->fetchItems(); // Set the URL of this page $url = $uri->toString(); // Set the to-top image if ($this->params->get('show_totop') == 1) { if ($this->params->get('totop_text')) { $totop_text = $this->params->get('totop_text'); } else { $totop_text = JText::_('Top'); } $totop = null; if ($this->params->get('totop_image') && is_file(JPATH_SITE . DS . 'images' . DS . 'simplelists' . DS . $this->params->get('totop_image'))) { $totop_image = JHTML::image('images/simplelists/' . $this->params->get('totop_image'), $totop_text); $totop_image = JHTML::link($url . '#top', $totop_image, 'class="totop"'); $totop .= $totop_image; } if ($this->params->get('totop_text')) { $totop_text = '<span class="totop_text">' . $totop_text . '</span>'; $totop_text = JHTML::link($url . '#top', $totop_text, 'class="totop"'); $totop .= $totop_text; } } else { $totop = null; } // Determine whether to show the "No Items" message if ($this->params->get('show_empty_list')) { $empty_list = JText::_('No items found'); } else { $empty_list = null; } // Check if the list is empty if (is_array($this->items) && !empty($this->items)) { // Loop through the list to set things right $counter = 0; foreach ($this->items as $id => $item) { // Append category-data $item->category_id = $category->id; $item->category_alias = $category->alias; // Prepare each item $item = $this->prepareItem($item, $layout, $counter); // Remove items that are empty if ($item == false) { unset($this->items[$id]); break; } // Save the item in the array $this->items[$id] = $item; $counter++; } // Add feeds to the document if ($this->params->get('show_feed') == 1) { $link = '&format=feed&limitstart='; $document->addHeadLink(JRoute::_($link . '&type=rss'), 'alternate', 'rel', array('type' => 'application/rss+xml', 'title' => 'RSS 2.0')); $document->addHeadLink(JRoute::_($link . '&type=atom'), 'alternate', 'rel', array('type' => 'application/atom+xml', 'title' => 'Atom 1.0')); } } // Load the default CSS only, if set through the parameters if ($this->params->get('load_css', 1)) { $this->loadCSS($layout); } // Load the default JavaScript only, if set through the parameters if ($this->params->get('load_js', 1)) { $this->loadJS($layout); } // Load the lightbox only, if set through the parameters if ($this->params->get('load_lightbox')) { JHTML::_('behavior.modal', 'a.lightbox'); } // Construct the page class $page_class = 'simplelists simplelists-' . $layout; if ($this->params->get('pageclass_sfx')) { $page_class .= ' simplelists' . $this->params->get('pageclass_sfx'); } // Assign all variables to this layout $this->assignRef('category', $category); $this->assignRef('totop', $totop); $this->assignRef('empty_list', $empty_list); $this->assignRef('url', $url); $this->assignRef('page_class', $page_class); // Call the parent method parent::prepareDisplay(); }
/** * Display method * * @param string $tpl * @return null */ public function displayBrowser($tpl) { // Initalize common elements MageBridgeViewHelper::initialize('Internal Browse Test'); JToolBarHelper::custom('refresh', 'preview.png', 'preview_f2.png', 'Browse', false); $this->url = MagebridgeModelConfig::load('url') . 'magebridge.php'; $this->host = MagebridgeModelConfig::load('host'); parent::display('browser'); }
/** * Main display method * * @param string $tpl * @return null */ public function display($tpl = null) { // Automatically fetch item $this->fetchItem(); parent::display($tpl); }
/** * Display method * * @param string $tpl * @return null */ public function display($tpl = null) { // ??? MageBridgeViewHelper::initialize('UPDATE'); // Filters - type $options = array(array('value' => '', 'text' => JText::_('COM_MAGEBRIDGE_VIEW_UPDATE_FILTER_TYPE_NONE')), array('value' => 'module', 'text' => JText::_('COM_MAGEBRIDGE_VIEW_UPDATE_FILTER_TYPE_MODULE')), array('value' => 'module-site', 'text' => JText::_('COM_MAGEBRIDGE_VIEW_UPDATE_FILTER_TYPE_MODULE_SITE')), array('value' => 'module-admin', 'text' => JText::_('COM_MAGEBRIDGE_VIEW_UPDATE_FILTER_TYPE_MODULE_ADMIN')), array('value' => 'plugin', 'text' => JText::_('COM_MAGEBRIDGE_VIEW_UPDATE_FILTER_TYPE_PLUGIN')), array('value' => 'plugin-other', 'text' => JText::_('COM_MAGEBRIDGE_VIEW_UPDATE_FILTER_TYPE_PLUGIN_OTHER')), array('value' => 'plugin-magebridgeproduct', 'text' => JText::_('COM_MAGEBRIDGE_VIEW_UPDATE_FILTER_TYPE_PLUGIN_PRODUCT')), array('value' => 'plugin-magebridgestore', 'text' => JText::_('COM_MAGEBRIDGE_VIEW_UPDATE_FILTER_TYPE_PLUGIN_STORE')), array('value' => 'plugin-magebridgeprofile', 'text' => JText::_('COM_MAGEBRIDGE_VIEW_UPDATE_FILTER_TYPE_PLUGIN_PROFILE')), array('value' => 'plugin-magebridgenewsletter', 'text' => JText::_('COM_MAGEBRIDGE_VIEW_UPDATE_FILTER_TYPE_PLUGIN_NEWSLETTER'))); $filter_type = $this->getFilter('type'); $javascript = 'onchange="document.adminForm.submit();"'; $this->lists['type'] = JHTML::_('select.genericlist', $options, 'filter_type', $javascript, 'value', 'text', $filter_type); // Filters - search $filter_search = $this->getFilter('search'); // Toolbar options JToolBarHelper::custom('home', 'back', '', 'LIB_YIREO_VIEW_TOOLBAR_HOME', false); JToolBarHelper::custom('refresh', 'preview.png', 'preview_f2.png', 'LIB_YIREO_VIEW_TOOLBAR_REFRESH', false); JToolBarHelper::custom('updateQueries', 'archive', '', 'LIB_YIREO_VIEW_TOOLBAR_DBUPGRADE', false); // Add jQuery for selection effects MageBridgeTemplateHelper::load('jquery'); $this->addJs('backend-update.js'); // Load the packages $data = MageBridgeUpdateHelper::getData(); // Add filtering if (!empty($filter_type) || !empty($filter_search)) { if (!empty($filter_type)) { $filter_type = explode('-', $filter_type); } foreach ($data as $index => $extension) { if (!empty($filter_search)) { if (!stristr($extension['name'], $filter_search) && !stristr($extension['title'], $filter_search) && !stristr($extension['description'], $filter_search)) { unset($data[$index]); continue; } } if (!empty($filter_type)) { if (count($filter_type) == 1) { if ($extension['type'] != $filter_type[0]) { unset($data[$index]); continue; } } else { if ($filter_type[0] == 'module') { if ($extension['type'] != 'module') { unset($data[$index]); continue; } elseif ($extension['type'] != $filter_type[0] || $extension['app'] != $filter_type[1]) { unset($data[$index]); continue; } } elseif ($filter_type[0] == 'plugin') { if ($extension['type'] != 'plugin') { unset($data[$index]); continue; } elseif ($filter_type[1] == 'other' && in_array($extension['group'], array('magebridgeproduct', 'magebridgenewsletter', 'magebridgestore', 'magebridgeprofile'))) { unset($data[$index]); continue; } elseif ($filter_type[1] != 'other' && $extension['group'] != $filter_type[1]) { unset($data[$index]); continue; } } } } } } // Detect whether updates are available $update = MAGEBRIDGE_UPDATE_NOTAVAILABLE; if (!empty($data)) { $update = MAGEBRIDGE_UPDATE_NOTNEEDED; foreach ($data as $index => $extension) { // Skip this entry for version detection if (empty($extension['version']) || empty($extension['current_version'])) { continue; } if ($extension['current_version'] != $extension['version']) { $update = MAGEBRIDGE_UPDATE_AVAILABLE; break; } } } if ($update == MAGEBRIDGE_UPDATE_NOTAVAILABLE) { JError::raiseWarning('MB', JText::_('COM_MAGEBRIDGE_VIEW_UPDATE_EMPTY_VERSION')); } else { JToolBarHelper::custom('update', 'download.png', 'download_f2.png', 'Update', false); } if ($update == MAGEBRIDGE_UPDATE_AVAILABLE) { JError::raiseNotice('UPDATE', JText::_('COM_MAGEBRIDGE_VIEW_UPDATE_NEW_VERSIONS')); } $this->data = $data; $this->update = $update; $this->search = $filter_search; parent::display($tpl); }
public function display($tpl = null) { // Extra behaviors JHTML::_('behavior.tooltip'); JHTML::_('behavior.modal'); // Automatically fetch items, total and pagination - and assign them to the template $this->fetchItems(); // Fetch the primary key $primaryKey = $this->_model->getPrimaryKey(); // Parse the items a bit more if (!empty($this->items)) { foreach ($this->items as $index => $item) { // Determine the primary key $item->id = isset($item->{$primaryKey}) ? $item->{$primaryKey} : null; // Set the various links if (empty($item->edit_link)) { $item->edit_link = JRoute::_('index.php?option=' . $this->_option . '&view=' . $this->_view . '&task=edit&cid[]=' . $item->id); } // Re-insert the item $this->items[$index] = $item; } } // Initialize the toolbar if ($this->_table->getStateField() != '') { JToolBarHelper::publishList(); JToolBarHelper::unpublishList(); } // Add the delete-button if ($this->loadToolbarDelete == true) { JToolBarHelper::deleteList(); } // Load the toolbar edit-buttons if ($this->loadToolbarEdit == true) { JToolBarHelper::editList(); JToolBarHelper::custom('copy', 'copy.png', 'copy.png', 'LIB_YIREO_VIEW_TOOLBAR_COPY', true, true); JToolBarHelper::addNew(); } // Insert extra fields $fields = array(); $fields['primary_field'] = $primaryKey; $fields['ordering_field'] = $this->_model->getOrderByDefault(); $fields['state_field'] = $this->_table->getStateField(); $this->assignRef('fields', $fields); // Add extra variables $this->assignRef('option', $this->_option); $this->assignRef('view', $this->_view); parent::display($tpl); }
public function display($tpl = null) { // Hide the menu $this->jinput->set('hidemainmenu', 1); // Initialize tooltips JHTML::_('behavior.tooltip'); // Automatically fetch the item and assign it to the layout $this->fetchItem(); if ($this->prepare_display == true) { $this->prepareDisplay(); } parent::display($tpl); }