コード例 #1
0
 /**
  * Add the page title and toolbar.
  *
  * @since   1.6
  */
 protected function addToolbar()
 {
     $state = $this->get('State');
     $canDo = RedirectHelper::getActions();
     JToolbarHelper::title(JText::_('COM_REDIRECT_MANAGER_LINKS'), 'redirect');
     if ($canDo->get('core.create')) {
         JToolbarHelper::addNew('link.add');
     }
     if ($canDo->get('core.edit')) {
         JToolbarHelper::editList('link.edit');
     }
     if ($canDo->get('core.edit.state')) {
         if ($state->get('filter.state') != 2) {
             JToolbarHelper::divider();
             JToolbarHelper::publish('links.publish', 'JTOOLBAR_ENABLE', true);
             JToolbarHelper::unpublish('links.unpublish', 'JTOOLBAR_DISABLE', true);
         }
         if ($state->get('filter.state') != -1) {
             JToolbarHelper::divider();
             if ($state->get('filter.state') != 2) {
                 JToolbarHelper::archiveList('links.archive');
             } elseif ($state->get('filter.state') == 2) {
                 JToolbarHelper::unarchiveList('links.publish', 'JTOOLBAR_UNARCHIVE');
             }
         }
     }
     if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) {
         JToolbarHelper::deleteList('', 'links.delete', 'JTOOLBAR_EMPTY_TRASH');
         JToolbarHelper::divider();
     } elseif ($canDo->get('core.edit.state')) {
         JToolbarHelper::trash('links.trash');
         JToolbarHelper::divider();
     }
     if ($canDo->get('core.admin')) {
         JToolbarHelper::preferences('com_redirect');
         JToolbarHelper::divider();
     }
     JToolbarHelper::help('JHELP_COMPONENTS_REDIRECT_MANAGER');
     JHtmlSidebar::setAction('index.php?option=com_redirect&view=links');
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', RedirectHelper::publishedOptions(), 'value', 'text', $this->state->get('filter.state'), true));
 }
コード例 #2
0
ファイル: default.php プロジェクト: vuchannguyen/hoctap
echo JText::_('JSEARCH_FILTER_SUBMIT');
?>
</button>
			<button type="button" onclick="document.id('filter_search').value='';this.form.submit();"><?php 
echo JText::_('JSEARCH_FILTER_CLEAR');
?>
</button>
		</div>
		<div class="filter-select fltrt">
			<select name="filter_state" class="inputbox" onchange="this.form.submit()">
				<option value=""><?php 
echo JText::_('JOPTION_SELECT_PUBLISHED');
?>
</option>
				<?php 
echo JHtml::_('select.options', RedirectHelper::publishedOptions(), 'value', 'text', $this->state->get('filter.state'), true);
?>
			</select>
		</div>
	</fieldset>
	<div class="clr"> </div>

	<table class="adminlist">
		<thead>
			<tr>
				<th width="20">
					<input type="checkbox" name="checkall-toggle" value="" title="<?php 
echo JText::_('JGLOBAL_CHECK_ALL');
?>
" onclick="Joomla.checkAll(this)" />
				</th>
コード例 #3
0
ファイル: view.html.php プロジェクト: naumangla/joomla-cms
 /**
  * Add the page title and toolbar.
  *
  * @return  void.
  *
  * @since   1.6
  */
 protected function addToolbar()
 {
     $state = $this->get('State');
     $canDo = JHelperContent::getActions('com_redirect');
     JToolbarHelper::title(JText::_('COM_REDIRECT_MANAGER_LINKS'), 'refresh redirect');
     if ($canDo->get('core.create')) {
         JToolbarHelper::addNew('link.add');
     }
     if ($canDo->get('core.edit')) {
         JToolbarHelper::editList('link.edit');
     }
     if ($canDo->get('core.edit.state')) {
         if ($state->get('filter.state') != 2) {
             JToolbarHelper::divider();
             JToolbarHelper::publish('links.publish', 'JTOOLBAR_ENABLE', true);
             JToolbarHelper::unpublish('links.unpublish', 'JTOOLBAR_DISABLE', true);
         }
         if ($state->get('filter.state') != -1) {
             JToolbarHelper::divider();
             if ($state->get('filter.state') != 2) {
                 JToolbarHelper::archiveList('links.archive');
             } elseif ($state->get('filter.state') == 2) {
                 JToolbarHelper::unarchiveList('links.publish', 'JTOOLBAR_UNARCHIVE');
             }
         }
     }
     if ($canDo->get('core.create')) {
         // Get the toolbar object instance
         $bar = JToolbar::getInstance('toolbar');
         $title = JText::_('JTOOLBAR_BATCH');
         // Instantiate a new JLayoutFile instance and render the batch button
         $layout = new JLayoutFile('joomla.toolbar.batch');
         $dhtml = $layout->render(array('title' => $title));
         $bar->appendButton('Custom', $dhtml, 'batch');
     }
     if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) {
         JToolbarHelper::deleteList('', 'links.delete', 'JTOOLBAR_EMPTY_TRASH');
         JToolbarHelper::divider();
     } elseif ($canDo->get('core.edit.state')) {
         JToolbarHelper::trash('links.trash');
         JToolbarHelper::divider();
     }
     if ($canDo->get('core.admin') || $canDo->get('core.options')) {
         JToolbarHelper::preferences('com_redirect');
         JToolbarHelper::divider();
     }
     JToolbarHelper::help('JHELP_COMPONENTS_REDIRECT_MANAGER');
     JHtmlSidebar::setAction('index.php?option=com_redirect&view=links');
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', RedirectHelper::publishedOptions(), 'value', 'text', $this->state->get('filter.state'), true));
 }