本文整理汇总了PHP中JToolbarHelper::apply方法的典型用法代码示例。如果您正苦于以下问题:PHP JToolbarHelper::apply方法的具体用法?PHP JToolbarHelper::apply怎么用?PHP JToolbarHelper::apply使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JToolbarHelper
的用法示例。
在下文中一共展示了JToolbarHelper::apply方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addToolbar
/**
* Add the page title and toolbar.
*
*/
protected function addToolbar()
{
$isNew = $this->item->id == 0;
$canDo = SnippetsHelper::getActions();
JHtml::stylesheet('nnframework/style.min.css', false, true);
JHtml::stylesheet('snippets/style.min.css', false, true);
JFactory::getApplication()->input->set('hidemainmenu', true);
// Set document title
JFactory::getDocument()->setTitle(JText::_('SNIPPETS') . ': ' . JText::_('NN_ITEM'));
// Set ToolBar title
JToolbarHelper::title(JText::_('SNIPPETS') . ': ' . JText::_('NN_ITEM'), 'snippets icon-nonumber');
// If not checked out, can save the item.
if ($canDo->get('core.edit')) {
JToolbarHelper::apply('item.apply');
JToolbarHelper::save('item.save');
}
if ($canDo->get('core.edit') && $canDo->get('core.create')) {
JToolbarHelper::save2new('item.save2new');
}
if (!$isNew && $canDo->get('core.create')) {
JToolbarHelper::save2copy('item.save2copy');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel('item.cancel');
} else {
JToolbarHelper::cancel('item.cancel', 'JTOOLBAR_CLOSE');
}
}
示例2: 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 = $this->canDo;
JToolbarHelper::title($isNew ? JText::_('COM_TEMPLATES_MANAGER_ADD_STYLE') : JText::_('COM_TEMPLATES_MANAGER_EDIT_STYLE'), 'eye thememanager');
// If not checked out, can save the item.
if ($canDo->get('core.edit')) {
JToolbarHelper::apply('style.apply');
JToolbarHelper::save('style.save');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
JToolbarHelper::save2copy('style.save2copy');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel('style.cancel');
} else {
JToolbarHelper::cancel('style.cancel', 'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
// Get the help information for the template item.
$lang = JFactory::getLanguage();
$help = $this->get('Help');
if ($lang->hasKey($help->url)) {
$debug = $lang->setDebug(false);
$url = JText::_($help->url);
$lang->setDebug($debug);
} else {
$url = null;
}
JToolbarHelper::help($help->key, false, $url);
}
示例3: 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 = !true;
// Since we don't track these assets at the item level, use the category id.
JToolbarHelper::title(JText::_('COM_HTRAININGLOGS_MANAGER_H_TR_SESSION'), 'link h_tr_sessions');
// If not checked out, can save the item.
if (!$checkedOut || count($user->getAuthorisedCategories('com_htraininglogs', 'core.create'))) {
JToolbarHelper::apply('h_tr_session.apply');
JToolbarHelper::save('h_tr_session.save');
}
if (!$checkedOut && count($user->getAuthorisedCategories('com_htraininglogs', 'core.create'))) {
JToolbarHelper::save2new('h_tr_session.save2new');
}
// If an existing item, can save to a copy.
if (!$isNew && count($user->getAuthorisedCategories('com_htraininglogs', 'core.create')) > 0) {
JToolbarHelper::save2copy('h_tr_session.save2copy');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel('h_tr_session.cancel');
} else {
if ($this->state->params->get('save_history', 0) && $user->authorise('core.edit')) {
JToolbarHelper::versions('com_htraininglogs.h_tr_session', $this->item->id);
}
JToolbarHelper::cancel('h_tr_session.cancel', 'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help('JHELP_COMPONENTS_H_tr_sessionS_LINKS_EDIT');
}
示例4: 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 == $user->get('id'));
// Since we don't track these assets at the item level, use the category id.
//$canDo = WcatalogHelper::getActions($this->item->catid, 0);
JToolbarHelper::title(JText::_('COM_WCATALOG_MANAGER_CATEGORY'), 'categories.png');
// If not checked out, can save the item.
//if (!$checkedOut && ($canDo->get('core.edit') || count($user->getAuthorisedCategories('com_wcatalog', 'core.create')) > 0))
//{
JToolbarHelper::apply('category.apply');
JToolbarHelper::save('category.save');
//}
//if (!$checkedOut && count($user->getAuthorisedCategories('com_wcatalog', 'core.create')) > 0){
JToolbarHelper::save2new('category.save2new');
//}
// If an existing item, can save to a copy.
//if (!$isNew && $canDo->get('core.create'))
//{
JToolbarHelper::save2copy('category.save2copy');
//}
if (empty($this->item->id)) {
JToolbarHelper::cancel('category.cancel');
} else {
JToolbarHelper::cancel('category.cancel', 'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help('JHELP_COMPONENTS_WCATALOG_CATEGORIES_EDIT');
}
示例5: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
$canDo = PluginsHelper::getActions();
JToolbarHelper::title(JText::sprintf('COM_PLUGINS_MANAGER_PLUGIN', JText::_($this->item->name)), 'plugin');
// If not checked out, can save the item.
if ($canDo->get('core.edit')) {
JToolbarHelper::apply('plugin.apply');
JToolbarHelper::save('plugin.save');
}
JToolbarHelper::cancel('plugin.cancel', 'JTOOLBAR_CLOSE');
JToolbarHelper::divider();
// Get the help information for the plugin item.
$lang = JFactory::getLanguage();
$help = $this->get('Help');
if ($lang->hasKey($help->url)) {
$debug = $lang->setDebug(false);
$url = JText::_($help->url);
$lang->setDebug($debug);
} else {
$url = null;
}
JToolbarHelper::help($help->key, false, $url);
}
示例6: addToolbar
protected function addToolbar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
$userId = $user->get('id');
$isNew = $this->item->id == 0;
$canDo = ReservaHelper::getActions($this->item->catid, 0);
JToolbarHelper::title(JText::_('COM_RESEVA_MANAGER_EVENTO'), '');
if ($canDo->get('core.edit') || count($user->getAuthorisedCategories('com_reserva', 'core.create'))) {
JToolbarHelper::apply('evento.apply');
JToolbarHelper::save('evento.save');
}
if (count($user->getAuthorisedCategories('com_reserva', 'core.create'))) {
JToolbarHelper::save2new('evento.save2new');
}
// If an existing item, can save to a copy.
if (!$isNew && count($user->getAuthorisedCategories('com_reserva', 'core.create')) > 0) {
JToolbarHelper::save2copy('evento.save2copy');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel('evento.cancel');
} else {
JToolbarHelper::cancel('evento.cancel', 'JTOOLBAR_CLOSE');
}
}
示例7: addToolbar
/**
* Add the page title and toolbar.
*
* @return void
*
* @since 1.0.0
*/
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 = CMDonationHelper::getActions();
JToolbarHelper::title(JText::_('COM_CMDONATION_MANAGER_DONATIONS'), 'donation icon-heart-2');
// If not checked out, can save the item.
if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) {
JToolbarHelper::apply('donation.apply');
JToolbarHelper::save('donation.save');
}
if (!$checkedOut && $canDo->get('core.create')) {
JToolbarHelper::save2new('donation.save2new');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
JToolbarHelper::save2copy('donation.save2copy');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel('donation.cancel');
} else {
JToolbarHelper::cancel('donation.cancel', 'JTOOLBAR_CLOSE');
}
}
示例8: display
function display($tpl = null)
{
$entry = $this->get('Data');
// Get Categories for selection list
$categories = $this->get('Categories', 'categories');
if (empty($entry->id)) {
JToolBarHelper::title(JText::_('COM_JOOMLABACKLINKCHECKER') . ' - ' . JText::_('COM_JOOMLABACKLINKCHECKER_NEWENTRY'), 'joomlabacklinkchecker-add');
JToolBarHelper::save('save');
JToolBarHelper::cancel('cancel');
} else {
JToolBarHelper::title(JText::_('COM_JOOMLABACKLINKCHECKER') . ' - ' . JText::_('COM_JOOMLABACKLINKCHECKER_EDITENTRY'), 'joomlabacklinkchecker-edit');
JToolbarHelper::apply('apply');
JToolBarHelper::save('save');
JToolBarHelper::custom('checkselection', 'extension', 'extension', JText::_('COM_JOOMLABACKLINKCHECKER_SAVECHECK_BUTTON'), false);
JToolBarHelper::cancel('cancel', 'Close');
}
$document = JFactory::getDocument();
$document->addStyleSheet('components/com_joomlabacklinkchecker/css/joomlabacklinkchecker.css');
$this->assignRef('entry', $entry);
$this->assignRef('categories', $categories);
require_once JPATH_COMPONENT . '/helpers/joomlabacklinkchecker.php';
$donation_code_message = JoomlaBacklinkCheckerHelper::getDonationCodeMessage();
$this->assignRef('donation_code_message', $donation_code_message);
parent::display($tpl);
}
示例9: _edit_coupon
function _edit_coupon($tpl = null)
{
$document = JFactory::getDocument();
JFactory::getApplication()->input->set('hidemainmenu', 1);
$logo = '<img src="' . JURI::root() . 'administrator/components/com_alphauserpoints/assets/images/icon-48-alphauserpoints.png" /> ';
JToolBarHelper::title($logo . 'AlphaUserPoints :: ' . JText::_('AUP_COUPON_CODES'), 'thememanager');
getCpanelToolbar();
if ($this->row->printable) {
$bar = JToolBar::getInstance('toolbar');
$bar->appendButton('Popup', 'print', JText::_('AUP_PRINT'), 'index.php?option=com_alphauserpoints&task=printcoupon&id=' . $this->row->id . '&layout=modal&tmpl=component', 740, 480, 0, 0);
JToolBarHelper::divider();
}
if (JFactory::getUser()->authorise('core.edit.state', 'com_alphauserpoints')) {
JToolbarHelper::apply('applycoupon');
JToolBarHelper::save('savecoupon');
}
JToolBarHelper::cancel('cancelcoupon');
getPrefHelpToolbar();
//JHTML::_('behavior.mootools');
JHTML::_('behavior.calendar');
//$document->addScriptDeclaration("window.addEvent('domready', function(){ var JTooltips = new Tips($$('.hasTip'), { maxTitleChars: 50, fixed: false}); });");
$this->assignRef('row', $this->row);
$this->assignRef('lists', $this->lists);
parent::display("form");
}
示例10: _edit_user
function _edit_user($tpl = null)
{
$document = JFactory::getDocument();
JFactory::getApplication()->input->set('hidemainmenu', 1);
$logo = '<img src="' . JURI::root() . 'administrator/components/com_alphauserpoints/assets/images/icon-48-alphauserpoints.png" /> ';
JToolBarHelper::title($logo . 'AlphaUserPoints :: ' . JText::_('AUP_USERS_POINTS') . ': ' . $this->row->name, 'user');
getCpanelToolbar();
if (JFactory::getUser()->authorise('core.edit.state', 'com_alphauserpoints')) {
JToolbarHelper::apply('applyuser');
JToolBarHelper::save('saveuser');
}
JToolBarHelper::cancel('canceluser');
getPrefHelpToolbar();
JHTML::_('behavior.calendar');
//$document->addScriptDeclaration("window.addEvent('domready', function(){ var JTooltips = new Tips($$('.hasTip'), { maxTitleChars: 50, fixed: false}); });");
$this->assignRef('row', $this->row);
$this->assignRef('listrank', $this->listrank);
$this->assignRef('medalsexist', $this->medalsexist);
$pagination = new JPagination($this->total, $this->limitstart, $this->limit);
$this->assignRef('pagination', $pagination);
$this->assignRef('userDetails', $this->userDetails);
$this->assignRef('total', $this->total);
$this->assignRef('limit', $this->limit);
$this->assignRef('limitstart', $this->limitstart);
$this->assignRef('lists', $this->lists);
$this->assignRef('name', $this->name);
$this->assignRef('cid', $this->cid);
parent::display("form");
}
示例11: addToolBar
/**
* Add the page title and toolbar.
*
* @return void
*
* @since 1.6
*/
protected function addToolBar()
{
$input = JFactory::getApplication()->input;
// Hide Joomla Administrator Main menu
$input->set('hidemainmenu', true);
$isNew = $this->item->id == 0;
if ($isNew) {
$title = JText::_('COM_ISSNREGISTRY_PUBLISHER_NEW');
} else {
$title = JText::_('COM_ISSNREGISTRY_PUBLISHER_EDIT');
$title .= ' : ' . $this->item->official_name;
}
JToolBarHelper::title($title, 'publisher');
JToolbarHelper::apply('publisher.apply');
if (!$isNew) {
// Add custom button for sending a message
$toolbar = JToolBar::getInstance('toolbar');
$layout = new JLayoutFile('joomla.toolbar.popup');
// Render the popup button
$dhtml = $layout->render(array('name' => 'generate-message', 'doTask' => '', 'text' => JText::_('COM_ISSNREGISTRY_PUBLISHER_BUTTON_SEND_MESSAGE'), 'class' => 'icon-envelope'));
$toolbar->appendButton('Custom', $dhtml);
// Render the popup button
$dhtml = $layout->render(array('name' => 'print', 'doTask' => '', 'text' => JText::_('COM_ISSNREGISTRY_PUBLISHER_BUTTON_PRINT'), 'class' => 'icon-print'));
$toolbar->appendButton('Custom', $dhtml);
}
JToolBarHelper::cancel('publisher.cancel', $isNew ? 'JTOOLBAR_CANCEL' : 'JTOOLBAR_CLOSE');
}
示例12: 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'));
// Since we don't track these assets at the item level, use the category id.
$canDo = JHelperContent::getActions('com_newsfeeds', 'category', $this->item->catid);
JToolbarHelper::title(JText::_('COM_NEWSFEEDS_MANAGER_NEWSFEED'), 'feed newsfeeds');
// If not checked out, can save the item.
if (!$checkedOut && ($canDo->get('core.edit') || count($user->getAuthorisedCategories('com_newsfeeds', 'core.create')) > 0)) {
JToolbarHelper::apply('newsfeed.apply');
JToolbarHelper::save('newsfeed.save');
}
if (!$checkedOut && count($user->getAuthorisedCategories('com_newsfeeds', 'core.create')) > 0) {
JToolbarHelper::save2new('newsfeed.save2new');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
JToolbarHelper::save2copy('newsfeed.save2copy');
}
if (empty($this->item->id)) {
JToolbarHelper::cancel('newsfeed.cancel');
} else {
if ($this->state->params->get('save_history', 0) && $user->authorise('core.edit')) {
JToolbarHelper::versions('com_newsfeeds.newsfeed', $this->item->id);
}
JToolbarHelper::cancel('newsfeed.cancel', 'JTOOLBAR_CLOSE');
}
JToolbarHelper::divider();
JToolbarHelper::help('JHELP_COMPONENTS_NEWSFEEDS_FEEDS_EDIT');
}
示例13: form
/**
* Displays the settings form for the respective page.
*
* @since 1.0
* @access public
* @param null
* @return null
* @author Mark Lee <mark@stackideas.com>
*/
public function form()
{
// Get the current page.
$page = JRequest::getVar('page', '');
// Get info object.
$info = FD::info();
if (empty($page)) {
// @TODO: Log errors here.
$info->set(JText::_('No page provided'), SOCIAL_MSG_ERROR);
$this->redirect('index.php?option=com_easysocial');
}
// Add Joomla toolbar buttons
JToolbarHelper::apply();
JToolbarHelper::custom('export', 'export', '', JText::_('COM_EASYSOCIAL_SETTINGS_EXPORT_SETTINGS'), false);
JToolbarHelper::custom('import', 'import', '', JText::_('COM_EASYSOCIAL_SETTINGS_IMPORT_SETTINGS'), false);
JToolbarHelper::custom('reset', 'default', '', JText::_('COM_EASYSOCIAL_RESET_TO_FACTORY'), false);
// We need to include the theme file's header info.
$theme = FD::get('Themes');
$paths = $theme->getTemplate('admin/settings/headers/' . $page);
if (JFile::exists($paths->file)) {
include $paths->file;
}
// Ensure that page is in proper string format.
$page = strtolower($page);
// Set the page to the class for other method to access
$this->section = $page;
// Set the page variable.
$this->set('page', $page);
// Set settings view variable
$this->set('settings', $this);
echo parent::display('admin/settings/form.container');
}
示例14: 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);
}
示例15: 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');
}