示例#1
0
 /**
  * Display the view
  */
 public function display($tpl = null)
 {
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $this->authors = $this->get('Authors');
     $model = JModelLegacy::getInstance('Categories', 'TZ_Portfolio_PlusModel');
     $model->setState('filter.group', $this->state->get('filter.group'));
     $this->assign('listGroup', $model->getGroups());
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     // Levels filter.
     $options = array();
     $options[] = JHtml::_('select.option', '1', JText::_('J1'));
     $options[] = JHtml::_('select.option', '2', JText::_('J2'));
     $options[] = JHtml::_('select.option', '3', JText::_('J3'));
     $options[] = JHtml::_('select.option', '4', JText::_('J4'));
     $options[] = JHtml::_('select.option', '5', JText::_('J5'));
     $options[] = JHtml::_('select.option', '6', JText::_('J6'));
     $options[] = JHtml::_('select.option', '7', JText::_('J7'));
     $options[] = JHtml::_('select.option', '8', JText::_('J8'));
     $options[] = JHtml::_('select.option', '9', JText::_('J9'));
     $options[] = JHtml::_('select.option', '10', JText::_('J10'));
     $this->assign('f_levels', $options);
     // We don't need toolbar in the modal window.
     if ($this->getLayout() !== 'modal') {
         $this->addToolbar();
     }
     TZ_Portfolio_PlusHelper::addSubmenu('featured');
     $this->sidebar = JHtmlSidebar::render();
     parent::display($tpl);
 }
示例#2
0
 public function display($tpl = null)
 {
     $this->form = $this->get('Form');
     TZ_Portfolio_PlusHelper::addSubmenu('templates');
     $this->sidebar = JHtmlSidebar::render();
     $this->addToolbar();
     parent::display($tpl);
 }
示例#3
0
 public function display($tpl = null)
 {
     $this->items = $this->get('Items');
     $this->state = $this->get('State');
     $this->pagination = $this->get('Pagination');
     TZ_Portfolio_PlusHelper::addSubmenu('fields');
     $this->addToolbar();
     $this->sidebar = JHtmlSidebar::render();
     parent::display($tpl);
 }
示例#4
0
 public function display($tpl = null)
 {
     $this->state = $this->get('State');
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     TZ_Portfolio_PlusHelper::addSubmenu('tags');
     // We don't need toolbar in the modal window.
     if ($this->getLayout() !== 'modal') {
         $this->addToolbar();
     }
     $this->sidebar = JHtmlSidebar::render();
     parent::display($tpl);
 }
示例#5
0
 public function display($tpl = null)
 {
     $this->items = $this->get('Items');
     $this->state = $this->get('State');
     $this->pagination = $this->get('pagination');
     JFactory::getLanguage()->load('com_templates');
     TZ_Portfolio_PlusHelper::addSubmenu('template_styles');
     // We don't need toolbar in the modal window.
     if ($this->getLayout() !== 'modal') {
         $this->addToolbar();
     }
     $this->sidebar = JHtmlSidebar::render();
     parent::display($tpl);
 }
示例#6
0
 public function display($tpl = null)
 {
     $this->state = $this->get('State');
     $this->item = $this->get('Item');
     $this->return_link = $this->get('ReturnLink');
     if ($this->getLayout() == 'manager') {
         $this->addonItem = $this->get('AddonItem');
     }
     $this->form = $this->get('form');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     if ($this->getLayout() == 'upload') {
         TZ_Portfolio_PlusHelper::addSubmenu('addons');
         $this->sidebar = JHtmlSidebar::render();
     }
     $this->addToolbar();
     parent::display($tpl);
     // TODO: Change the autogenerated stub
 }
示例#7
0
 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     // Initialise variables.
     TZ_Portfolio_PlusHelper::addSubmenu('categories');
     $categoryId = $this->state->get('filter.category_id');
     $component = $this->state->get('filter.component');
     $section = $this->state->get('filter.section');
     $canDo = null;
     $user = TZ_Portfolio_PlusUser::getUser();
     // Get the toolbar object instance
     $bar = JToolBar::getInstance('toolbar');
     //		// Avoid nonsense situation.
     //		if ($component == 'com_tz_portfolio_plus') {
     //			return;
     //		}
     // Need to load the menu language file as mod_menu hasn't been loaded yet.
     $lang = JFactory::getLanguage();
     // Load the category helper.
     require_once JPATH_COMPONENT . '/helpers/categories.php';
     // Get the results for each action.
     $canDo = TZ_Portfolio_PlusHelper::getActions($component, $categoryId);
     // If a component categories title string is present, let's use it.
     if ($lang->hasKey($component_section_key = strtoupper($component . ($section ? "_{$section}" : '')))) {
         $title = JText::sprintf('COM_TZ_PORTFOLIO_PLUS_CATEGORIES_TITLE', $this->escape(JText::_($component_section_key)));
     } else {
         $title = JText::_('COM_TZ_PORTFOLIO_PLUS_CATEGORIES_BASE_TITLE');
     }
     // Load specific css component
     JHtml::_('stylesheet', $component . '/administrator/categories.css', array(), true);
     // Prepare the toolbar.
     JToolBarHelper::title($title, 'folder categories ' . substr($component, 4) . ($section ? "-{$section}" : '') . '-categories');
     if ($canDo->get('core.create') || count($user->getAuthorisedCategories($component, 'core.create')) > 0) {
         JToolBarHelper::addNew('category.add');
     }
     if ($canDo->get('core.edit') || $canDo->get('core.edit.own')) {
         JToolBarHelper::editList('category.edit');
         JToolBarHelper::divider();
     }
     if ($canDo->get('core.edit.state')) {
         JToolBarHelper::publish('categories.publish', 'JTOOLBAR_PUBLISH', true);
         JToolBarHelper::unpublish('categories.unpublish', 'JTOOLBAR_UNPUBLISH', true);
         JToolBarHelper::divider();
         JToolBarHelper::archiveList('categories.archive');
     }
     if (JFactory::getUser()->authorise('core.admin')) {
         JToolBarHelper::checkin('categories.checkin');
     }
     if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete', $component)) {
         JToolBarHelper::deleteList('', 'categories.delete', 'JTOOLBAR_EMPTY_TRASH');
     } elseif ($canDo->get('core.edit.state')) {
         JToolBarHelper::trash('categories.trash');
         JToolBarHelper::divider();
     }
     // Add a batch button
     if ($canDo->get('core.edit')) {
         JHtml::_('bootstrap.modal', 'collapseModal');
         $title = JText::_('JTOOLBAR_BATCH');
         $batchIcon = '<i class="icon-checkbox-partial" title="' . $title . '"></i>';
         $batchClass = ' class="btn btn-small"';
         $dhtml = '<a' . $batchClass . ' href="#" data-toggle="modal" data-target="#collapseModal">';
         $dhtml .= $batchIcon . $title . '</a>';
         $bar->appendButton('Custom', $dhtml, 'batch');
     }
     if ($canDo->get('core.admin')) {
         JToolBarHelper::custom('categories.rebuild', 'refresh.png', 'refresh_f2.png', 'JTOOLBAR_REBUILD', false);
         JToolBarHelper::preferences('com_tz_portfolio_plus');
         JToolBarHelper::divider();
     }
     // Compute the ref_key if it does exist in the component
     if (!$lang->hasKey($ref_key = strtoupper($component . ($section ? "_{$section}" : '')) . '_CATEGORIES_HELP_KEY')) {
         $ref_key = 'JHELP_COMPONENTS_' . strtoupper(substr($component, 4) . ($section ? "_{$section}" : '')) . '_CATEGORIES';
     }
     // Get help for the categories view for the component by
     // -remotely searching in a language defined dedicated URL: *component*_HELP_URL
     // -locally  searching in a component help file if helpURL param exists in the component and is set to ''
     // -remotely searching in a component URL if helpURL param exists in the component and is NOT set to ''
     if ($lang->hasKey($lang_help_url = strtoupper($component) . '_HELP_URL')) {
         $debug = $lang->setDebug(false);
         $url = JText::_($lang_help_url);
         $lang->setDebug($debug);
     } else {
         $url = null;
     }
     $doc = JFactory::getDocument();
     // If the joomla is version 3.0
     if (COM_TZ_PORTFOLIO_PLUS_JVERSION_COMPARE) {
         $doc->addStyleSheet(JURI::base(true) . '/components/com_tz_portfolio_plus/fonts/font-awesome-4.5.0/css/font-awesome.min.css');
     }
     $doc->addStyleSheet(JURI::base(true) . '/components/com_tz_portfolio_plus/css/style.min.css');
     JToolBarHelper::help($ref_key, JComponentHelper::getParams($component)->exists('helpURL'), $url);
     JHtmlSidebar::setAction('index.php?option=com_tz_portfolio_plus&view=categories');
     // Special HTML workaround to get send popup working
     $docClass = ' class="btn btn-small"';
     $youtubeIcon = '<i class="tz-icon-youtube tz-icon-14"></i>&nbsp;';
     $wikiIcon = '<i class="tz-icon-wikipedia tz-icon-14"></i>&nbsp;';
     $youtubeTitle = JText::_('COM_TZ_PORTFOLIO_PLUS_VIDEO_TUTORIALS');
     $wikiTitle = JText::_('COM_TZ_PORTFOLIO_PLUS_WIKIPEDIA_TUTORIALS');
     $videoTutorial = '<a' . $docClass . ' onclick="Joomla.popupWindow(\'http://www.youtube.com/channel/UCykS6SX6L2GOI-n3IOPfTVQ/videos\', \'' . $youtubeTitle . '\', 800, 500, 1)"' . ' href="#">' . $youtubeIcon . $youtubeTitle . '</a>';
     $wikiTutorial = '<a' . $docClass . ' onclick="Joomla.popupWindow(\'http://wiki.templaza.com/Main_Page\', \'' . $wikiTitle . '\', 800, 500, 1)"' . ' href="#">' . $wikiIcon . $wikiTitle . '</a>';
     $bar->appendButton('Custom', $videoTutorial, 'youtube');
     $bar->appendButton('Custom', $wikiTutorial, 'wikipedia');
     JHtmlSidebar::addFilter(JText::_('COM_TZ_PORTFOLIO_PLUS_OPTION_SELECT_FIELDS_GROUP'), 'filter_group', JHtml::_('select.options', $this->listsGroup, 'value', 'text', $this->state->get('filter.group')));
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_MAX_LEVELS'), 'filter_level', JHtml::_('select.options', $this->f_levels, 'value', 'text', $this->state->get('filter.level')));
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true));
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_ACCESS'), 'filter_access', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')));
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_LANGUAGE'), 'filter_language', JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text', $this->state->get('filter.language')));
 }