本文整理汇总了PHP中JToolbarHelper类的典型用法代码示例。如果您正苦于以下问题:PHP JToolbarHelper类的具体用法?PHP JToolbarHelper怎么用?PHP JToolbarHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JToolbarHelper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addToolbar
/**
* Add the page title and toolbar.
*/
protected function addToolbar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
$isNew = $this->item->id == 0;
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
$canDo = SibdietHelper::getActions();
JToolBarHelper::title(JText::_('COM_SIBDIET_MANAGER_ERRAND'), 'database errands');
// If not checked out, can save the item.
if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) {
JToolBarHelper::apply('errand.apply');
JToolBarHelper::save('errand.save');
}
if (!$checkedOut && $canDo->get('core.create')) {
JToolbarHelper::save2new('errand.save2new');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
JToolbarHelper::save2copy('errand.save2copy');
}
if (empty($this->item->id)) {
JToolBarHelper::cancel('errand.cancel');
} else {
JToolBarHelper::cancel('errand.cancel', 'JTOOLBAR_CLOSE');
}
}
示例2: addToolbar
/**
* Method to configure the toolbar for this view.
*
* @return void
*
* @since 2.5
*/
protected function addToolbar()
{
$canDo = JHelperContent::getActions('com_finder');
JToolbarHelper::title(JText::_('COM_FINDER_MAPS_TOOLBAR_TITLE'), 'zoom-in finder');
$toolbar = JToolbar::getInstance('toolbar');
if ($canDo->get('core.edit.state')) {
JToolbarHelper::publishList('maps.publish');
JToolbarHelper::unpublishList('maps.unpublish');
JToolbarHelper::divider();
}
if ($canDo->get('core.admin') || $canDo->get('core.options')) {
JToolbarHelper::preferences('com_finder');
}
JToolbarHelper::divider();
$toolbar->appendButton('Popup', 'bars', 'COM_FINDER_STATISTICS', 'index.php?option=com_finder&view=statistics&tmpl=component', 550, 350);
JToolbarHelper::divider();
JToolbarHelper::help('JHELP_COMPONENTS_FINDER_MANAGE_CONTENT_MAPS');
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList('', 'maps.delete');
JToolbarHelper::divider();
}
JHtmlSidebar::setAction('index.php?option=com_finder&view=maps');
JHtmlSidebar::addFilter('', 'filter_branch', JHtml::_('select.options', JHtml::_('finder.mapslist'), 'value', 'text', $this->state->get('filter.branch')), true);
JHtmlSidebar::addFilter(JText::_('COM_FINDER_INDEX_FILTER_BY_STATE'), 'filter_state', JHtml::_('select.options', JHtml::_('finder.statelist'), 'value', 'text', $this->state->get('filter.state')));
}
示例3: display
/**
* Renders the view
*
* @param string $tpl Template name
*
* @return void
*/
public function display($tpl = null)
{
$password = JFactory::getApplication()->getUserState('com_joomlaupdate.password', null);
$filesize = JFactory::getApplication()->getUserState('com_joomlaupdate.filesize', null);
$ajaxUrl = JUri::base() . 'components/com_joomlaupdate/restore.php';
$returnUrl = 'index.php?option=com_joomlaupdate&task=update.finalise';
// Set the toolbar information
JToolbarHelper::title(JText::_('COM_JOOMLAUPDATE_OVERVIEW'), 'install');
JToolBarHelper::divider();
JToolBarHelper::help('JHELP_COMPONENTS_JOOMLA_UPDATE');
// Add toolbar buttons
if (JFactory::getUser()->authorise('core.admin', 'com_joomlaupdate')) {
JToolbarHelper::preferences('com_joomlaupdate');
}
// Load mooTools
JHtml::_('behavior.framework', true);
$updateScript = <<<ENDSCRIPT
var joomlaupdate_password = '{$password}';
var joomlaupdate_totalsize = '{$filesize}';
var joomlaupdate_ajax_url = '{$ajaxUrl}';
var joomlaupdate_return_url = '{$returnUrl}';
ENDSCRIPT;
// Load our Javascript
$document = JFactory::getDocument();
$document->addScript('../media/com_joomlaupdate/json2.js');
$document->addScript('../media/com_joomlaupdate/encryption.js');
$document->addScript('../media/com_joomlaupdate/update.js');
JHtml::_('script', 'system/progressbar.js', true, true);
JHtml::_('stylesheet', 'media/mediamanager.css', array(), true);
$document->addScriptDeclaration($updateScript);
// Render the view
parent::display($tpl);
}
示例4: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
$isNew = $this->item->id == 0;
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
// Built the actions for new and existing records.
$canDo = JHelperContent::getActions('com_testyourself');
JToolBarHelper::title(JText::_('COM_TESTYOURSELF_MANAGER_QUESTION'), 'question questions');
// If not checked out, can save the item.
if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) {
JToolBarHelper::apply('question.apply');
JToolBarHelper::save('question.save');
}
if (!$checkedOut && $canDo->get('core.create')) {
JToolbarHelper::save2new('question.save2new');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
JToolbarHelper::save2copy('question.save2copy');
}
if (empty($this->item->id)) {
JToolBarHelper::cancel('question.cancel');
} else {
JToolBarHelper::cancel('question.cancel', 'JTOOLBAR_CLOSE');
}
}
示例5: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
require_once JPATH_COMPONENT . '/helpers/languages.php';
JFactory::getApplication()->input->set('hidemainmenu', 1);
$isNew = empty($this->item->lang_id);
$canDo = $this->canDo;
JToolbarHelper::title(JText::_($isNew ? 'COM_LANGUAGES_VIEW_LANGUAGE_EDIT_NEW_TITLE' : 'COM_LANGUAGES_VIEW_LANGUAGE_EDIT_EDIT_TITLE'), 'comments-2 langmanager');
// If a new item, can save.
if ($isNew && $canDo->get('core.create')) {
JToolbarHelper::save('language.save');
}
//If an existing item, allow to Apply and Save.
if (!$isNew && $canDo->get('core.edit')) {
JToolbarHelper::apply('language.apply');
JToolbarHelper::save('language.save');
}
// If an existing item, can save to a copy only if we have create rights.
if ($canDo->get('core.create')) {
JToolbarHelper::save2new('language.save2new');
}
if ($isNew) {
JToolbarHelper::cancel('language.cancel');
} else {
JToolbarHelper::cancel('language.cancel', 'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help('JHELP_EXTENSIONS_LANGUAGE_MANAGER_EDIT');
$this->sidebar = JHtmlSidebar::render();
}
示例6: display
function display($tpl = null)
{
$entry = $this->get('Data');
$characters_length = $this->get('CharactersLength');
$robots_array = array('', 'index, follow', 'noindex, follow', 'index, nofollow', 'noindex, nofollow');
if (empty($entry->id)) {
JToolBarHelper::title(JText::_('COM_EASYFRONTENDSEO') . ' - ' . JText::_('COM_EASYFRONTENDSEO_NEWENTRY'), 'easyfrontendseo-add');
JToolBarHelper::save('save');
JToolBarHelper::cancel('cancel');
} else {
JToolBarHelper::title(JText::_('COM_EASYFRONTENDSEO') . ' - ' . JText::_('COM_EASYFRONTENDSEO_EDITENTRY'), 'easyfrontendseo-edit');
JToolbarHelper::apply('apply');
JToolBarHelper::save('save');
JToolBarHelper::cancel('cancel', 'Close');
}
JHTML::_('behavior.framework');
$document = JFactory::getDocument();
$document->addStyleSheet('components/com_easyfrontendseo/css/easyfrontendseo.css');
$document->addScript('components/com_easyfrontendseo/js/wordcount.js', 'text/javascript');
$output = "window.addEvent('domready', function(){";
$output .= "new WordCount('counter_title', {inputName:'title', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'}); new WordCount('counter_title', {inputName:'title', eventTrigger: 'click', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'});\n";
$output .= "new WordCount('counter_description', {inputName:'description', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'}); new WordCount('counter_description', {inputName:'description', eventTrigger: 'click', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'});\n";
$output .= "new WordCount('counter_keywords', {inputName:'keywords', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'}); new WordCount('counter_keywords', {inputName:'keywords', eventTrigger: 'click', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'});\n";
$output .= "new WordCount('counter_generator', {inputName:'generator', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'}); new WordCount('counter_generator', {inputName:'generator', eventTrigger: 'click', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'});\n";
$output .= " });";
$document->addScriptDeclaration($output, 'text/javascript');
$this->entry = $entry;
$this->characters_length = $characters_length;
$this->robots_array = $robots_array;
// Get donation code message
require_once JPATH_COMPONENT . '/helpers/easyfrontendseo.php';
$donation_code_message = EasyFrontendSeoHelper::getDonationCodeMessage();
$this->donation_code_message = $donation_code_message;
parent::display($tpl);
}
示例7: addToolbar
protected function addToolbar()
{
$state = $this->get('State');
JToolBarHelper::title(JText::_('COM_XMAP_SITEMAPS_TITLE'), 'list');
$canDo = JHelperContent::getActions('com_xmap', 'sitemap');
JToolBarHelper::addNew('sitemap.add');
JToolbarHelper::editList('sitemap.edit');
if ($canDo->get('core.edit.state')) {
JToolbarHelper::publish('sitemaps.publish', 'JTOOLBAR_PUBLISH', true);
JToolbarHelper::unpublish('sitemaps.unpublish', 'JTOOLBAR_UNPUBLISH', true);
}
if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) {
JToolbarHelper::deleteList('', 'sitemaps.delete', 'JTOOLBAR_EMPTY_TRASH');
} elseif ($canDo->get('core.edit.state')) {
JToolbarHelper::trash('sitemaps.trash');
}
if ($canDo->get('core.manage')) {
JToolbarHelper::custom('sitemaps.ping', 'heart', 'heart', JText::_('COM_XMAP_TOOLBAR_PING'));
}
if (JFactory::getUser()->authorise('core.admin')) {
JToolbarHelper::preferences('com_xmap');
}
if (JHelperContent::getActions('com_plugins')->get('core.edit.state')) {
JToolbarHelper::custom('sitemaps.plugins', 'power-cord', 'power-cord', JText::_('COM_XMAP_TOOLBAR_PLUGINS'), false);
}
JHtmlSidebar::setAction('index.php?option=com_xmap&view=sitemaps');
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', XmapHelper::getStateOptions(), 'value', 'text', $this->state->get('filter.state')));
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_ACCESS'), 'filter_access', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')));
$this->sidebar = JHtmlSidebar::render();
}
示例8: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$input = JFactory::getApplication()->input;
$input->set('hidemainmenu', true);
$isNew = $this->item->id == 0;
$canDo = MenusHelper::getActions($this->state->get('filter.parent_id'));
JToolbarHelper::title(JText::_($isNew ? 'COM_MENUS_VIEW_NEW_MENU_TITLE' : 'COM_MENUS_VIEW_EDIT_MENU_TITLE'), 'list menu');
// If a new item, can save the item. Allow users with edit permissions to apply changes to prevent returning to grid.
if ($isNew && $canDo->get('core.create')) {
if ($canDo->get('core.edit')) {
JToolbarHelper::apply('menu.apply');
}
JToolbarHelper::save('menu.save');
}
// If user can edit, can save the item.
if (!$isNew && $canDo->get('core.edit')) {
JToolbarHelper::apply('menu.apply');
JToolbarHelper::save('menu.save');
}
// If the user can create new items, allow them to see Save & New
if ($canDo->get('core.create')) {
JToolbarHelper::save2new('menu.save2new');
}
if ($isNew) {
JToolbarHelper::cancel('menu.cancel');
} else {
JToolbarHelper::cancel('menu.cancel', 'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help('JHELP_MENUS_MENU_MANAGER_EDIT');
}
示例9: addToolbar
/**
* Add the page title and toolbar.
*
* @param object $campaign Campaign object.
* @param array $statistics Array or statistics.
*
* @return void
*
* @since 1.0.0
*/
protected function addToolbar($campaign, $statistics)
{
JToolbarHelper::title(JText::_('COM_CMDONATION_MANAGER_STATISTICS'), 'statistics icon-bars');
if (!empty($campaign) && !empty($statistics['donations'])) {
JToolbarHelper::custom('statistics.export_donors', 'export out', 'export out', 'COM_CMDONATION_EXPORT_DONORS', false);
}
}
示例10: addToolbar
/**
* Add the page title and toolbar.
*
* @return void.
*
* @since 1.6
*/
protected function addToolbar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$isNew = $this->item->id == 0;
$canDo = JHelperContent::getActions('com_redirect');
JToolbarHelper::title($isNew ? JText::_('COM_REDIRECT_MANAGER_LINK_NEW') : JText::_('COM_REDIRECT_MANAGER_LINK_EDIT'), 'refresh redirect');
// If not checked out, can save the item.
if ($canDo->get('core.edit')) {
JToolbarHelper::apply('link.apply');
JToolbarHelper::save('link.save');
}
/**
* This component does not support Save as Copy due to uniqueness checks.
* While it can be done, it causes too much confusion if the user does
* not change the Old URL.
*/
if ($canDo->get('core.edit') && $canDo->get('core.create')) {
JToolbarHelper::save2new('link.save2new');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel('link.cancel');
} else {
JToolbarHelper::cancel('link.cancel', 'JTOOLBAR_CLOSE');
}
JToolbarHelper::help('JHELP_COMPONENTS_REDIRECT_MANAGER_EDIT');
}
示例11: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$isNew = $this->item->id == 0;
$canDo = JHelperContent::getActions('com_users');
JToolbarHelper::title(JText::_($isNew ? 'COM_USERS_VIEW_NEW_LEVEL_TITLE' : 'COM_USERS_VIEW_EDIT_LEVEL_TITLE'), 'users levels-add');
if ($canDo->get('core.edit') || $canDo->get('core.create')) {
JToolbarHelper::apply('level.apply');
JToolbarHelper::save('level.save');
}
if ($canDo->get('core.create')) {
JToolbarHelper::save2new('level.save2new');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
JToolbarHelper::save2copy('level.save2copy');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel('level.cancel');
} else {
JToolbarHelper::cancel('level.cancel', 'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help('JHELP_USERS_ACCESS_LEVELS_EDIT');
}
示例12: addToolbar
protected function addToolbar()
{
require_once JPATH_COMPONENT . '/helpers/jcomments.php';
JFactory::getApplication()->input->set('hidemainmenu', 1);
$userId = JFactory::getUser()->get('id');
$canDo = JCommentsHelper::getActions();
$isNew = $this->item->id == 0;
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId);
if (version_compare(JVERSION, '3.0', 'ge')) {
JToolbarHelper::title($isNew ? JText::_('A_SMILIES_SMILEY_NEW') : JText::_('A_SMILIES_SMILEY_EDIT'), 'smilies.png');
} else {
JToolbarHelper::title($isNew ? JText::_('A_SMILIES_SMILEY_NEW') : JText::_('A_SMILIES_SMILEY_EDIT'), 'jcomments-smilies');
}
if (!$checkedOut && $canDo->get('core.edit')) {
JToolBarHelper::apply('smiley.apply');
JToolBarHelper::save('smiley.save');
}
if (!$isNew && $canDo->get('core.create')) {
JToolbarHelper::save2new('smiley.save2new');
}
if ($isNew) {
JToolBarHelper::cancel('smiley.cancel');
} else {
JToolBarHelper::cancel('smiley.cancel', 'JTOOLBAR_CLOSE');
}
}
示例13: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
$userId = $user->get('id');
$isNew = $this->item->id == 0;
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId);
// Since we don't track these assets at the item level, use the category id.
$canDo = BannersHelper::getActions($this->item->catid, 0);
JToolbarHelper::title($isNew ? JText::_('COM_BANNERS_MANAGER_BANNER_NEW') : JText::_('COM_BANNERS_MANAGER_BANNER_EDIT'), 'banners.png');
// If not checked out, can save the item.
if (!$checkedOut && ($canDo->get('core.edit') || count($user->getAuthorisedCategories('com_banners', 'core.create')) > 0)) {
JToolbarHelper::apply('banner.apply');
JToolbarHelper::save('banner.save');
if ($canDo->get('core.create')) {
JToolbarHelper::save2new('banner.save2new');
}
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
JToolbarHelper::save2copy('banner.save2copy');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel('banner.cancel');
} else {
JToolbarHelper::cancel('banner.cancel', 'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help('JHELP_COMPONENTS_BANNERS_BANNERS_EDIT');
}
示例14: addToolbar
/**
* Add the page title and toolbar.
*
* @return void
*
* @since 1.6
*/
protected function addToolbar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
$isNew = $this->item->id == 0;
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
$canDo = $this->canDo;
JToolbarHelper::title($isNew ? JText::_('COM_BANNERS_MANAGER_CLIENT_NEW') : JText::_('COM_BANNERS_MANAGER_CLIENT_EDIT'), 'bookmark banners-clients');
// If not checked out, can save the item.
if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) {
JToolbarHelper::apply('client.apply');
JToolbarHelper::save('client.save');
}
if (!$checkedOut && $canDo->get('core.create')) {
JToolbarHelper::save2new('client.save2new');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
JToolbarHelper::save2copy('client.save2copy');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel('client.cancel');
} else {
if ($this->state->params->get('save_history', 0) && $user->authorise('core.edit')) {
JToolbarHelper::versions('com_banners.client', $this->item->id);
}
JToolbarHelper::cancel('client.cancel', 'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help('JHELP_COMPONENTS_BANNERS_CLIENTS_EDIT');
}
示例15: addToolbar
/**
* Add the page title and toolbar.
*
* @return void
*
* @throws Exception
*/
protected function addToolbar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
$isNew = $this->item->id == 0;
if (isset($this->item->checked_out)) {
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
} else {
$checkedOut = false;
}
$canDo = VocabHelper::getActions();
JToolBarHelper::title(JText::_('COM_VOCAB_TITLE_SUBJECT'), 'subject.png');
// If not checked out, can save the item.
if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) {
JToolBarHelper::apply('subject.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('subject.save', 'JTOOLBAR_SAVE');
}
if (!$checkedOut && $canDo->get('core.create')) {
JToolBarHelper::custom('subject.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
JToolBarHelper::custom('subject.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
// Button for version control
if ($this->state->params->get('save_history', 1) && $user->authorise('core.edit')) {
JToolbarHelper::versions('com_vocab.subject', $this->item->id);
}
if (empty($this->item->id)) {
JToolBarHelper::cancel('subject.cancel', 'JTOOLBAR_CANCEL');
} else {
JToolBarHelper::cancel('subject.cancel', 'JTOOLBAR_CLOSE');
}
}