本文整理汇总了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()
{
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 = SomosmaestrosHelper::getActions();
JToolBarHelper::title(JText::_('COM_SOMOSMAESTROS_TITLE_FORMACION'), 'formacion.png');
// If not checked out, can save the item.
if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) {
JToolBarHelper::apply('formacion.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('formacion.save', 'JTOOLBAR_SAVE');
}
if (!$checkedOut && $canDo->get('core.create')) {
JToolBarHelper::custom('formacion.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('formacion.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
if (empty($this->item->id)) {
JToolBarHelper::cancel('formacion.cancel', 'JTOOLBAR_CANCEL');
} else {
JToolBarHelper::cancel('formacion.cancel', 'JTOOLBAR_CLOSE');
}
}
示例2: display
function display($tpl = null)
{
JToolBarHelper::title(JText::_('COM_REDSOCIALSTREAM_CONFIGURE'), 'configure.png');
JToolBarHelper::apply();
JToolBarHelper::cancel('cancel', 'COM_REDSOCIALSTREAM_CLOSE');
//DEVNOTE: set document title
$document = JFactory::getDocument();
$document->setTitle(JText::_('COM_REDSOCIALSTREAM_REDSOCIALSTREAMS'));
$mainframe = JFactory::getApplication();
$context = "config";
$model = $this->getModel('configure');
$db = JFactory::getDbo();
$q = "SELECT * FROM #__redsocialstream_settings";
$db->setQuery($q);
$this->settingsrows = $db->loadObjectList();
$typelist = $this->get('type_list_sorted');
$pagination = $this->get('Pagination');
//DEVNOTE:give me ordering from request
$filter_order = $mainframe->getUserStateFromRequest($context . 'filter_order', 'filter_order', 'ordering');
$filter_order_Dir = $mainframe->getUserStateFromRequest($context . 'filter_order_Dir', 'filter_order_Dir', '');
$this->assignRef('lists', $lists);
$this->assignRef("typelist", $typelist);
$this->assignRef('pagination', $pagination);
parent::display($tpl);
}
示例3: 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');
}
}
示例4: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
JRequest::setVar('hidemainmenu', true);
$user = JFactory::getUser();
$isNew = $this->item->id == 0;
$canDo = RedirectHelper::getActions();
JToolBarHelper::title(JText::_('COM_REDIRECT_MANAGER_LINK'), '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');
}
示例5: addToolbar
protected function addToolbar()
{
JToolBarHelper::title(JText::_('COM_JDEVELOPER_OVERRIDE'));
JToolBarHelper::apply('override.apply');
JToolBarHelper::save('override.save');
JToolBarHelper::cancel('override.cancel', 'JTOOLBAR_CANCEL');
}
示例6: addEditEntityToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addEditEntityToolbar()
{
$user = JFactory::getUser();
$userId = $user->get('id');
$isNew = $this->record->id == 0;
$checkedOut = !($this->record->checked_out == 0 || $this->record->checked_out == $userId);
$toolbarHelperTitle = $isNew ? 'COM_JMAP_DATASETS_NEW' : 'COM_JMAP_DATASETS_EDIT';
$doc = JFactory::getDocument();
$doc->addStyleDeclaration('.icon-48-jmap{background-image:url("components/com_jmap/images/icon-48-datasets.png")}');
JToolBarHelper::title(JText::_($toolbarHelperTitle), 'jmap');
if ($isNew) {
// For new records, check the create permission.
if ($isNew && $user->authorise('core.create', 'com_jmap')) {
JToolBarHelper::apply('datasets.applyEntity', 'JAPPLY');
JToolBarHelper::save('datasets.saveEntity', 'JSAVE');
JToolBarHelper::save2new('datasets.saveEntity2New');
}
} else {
// Can't save the record if it's checked out.
if (!$checkedOut) {
// Since it's an existing record, check the edit permission, or fall back to edit own if the owner.
if ($user->authorise('core.edit', 'com_jmap')) {
JToolBarHelper::apply('datasets.applyEntity', 'JAPPLY');
JToolBarHelper::save('datasets.saveEntity', 'JSAVE');
JToolBarHelper::save2new('datasets.saveEntity2New');
}
}
}
JToolBarHelper::custom('datasets.cancelEntity', 'cancel', 'cancel', 'JCANCEL', false);
}
示例7: 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');
}
}
示例8: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
JRequest::setVar('hidemainmenu', true);
$user = JFactory::getUser();
$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'), 'menu.png');
// 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: __construct
function __construct($default = array())
{
parent::__construct($default);
$task = JRequest::getWord('task', '');
switch ($task) {
case 'add':
case 'save':
case 'apply':
case 'edit':
JToolBarHelper::apply();
JToolBarHelper::save();
JToolBarHelper::cancel();
break;
default:
JToolBarHelper::addNew();
JToolBarHelper::deleteList();
JToolBarHelper::makeDefault('publish');
break;
}
// Register Extra tasks
JRequest::setVar('view', 'services');
$this->registerTask('add', 'edit');
$this->registerTask('apply', 'save');
$this->registerTask('publish', 'setDefault');
}
示例10: toolbar
function toolbar()
{
switch (JRequest::getCmd('task')) {
case 'edit':
case 'apply':
case 'add':
switch (JRequest::getCmd('task')) {
case 'add':
JToolBarHelper::title(JText::_('COM_REDFORM_Add_Value'), 'redform_plus');
break;
default:
JToolBarHelper::title(JText::_('COM_REDFORM_Edit_Value'), 'redform_plus');
break;
}
JToolBarHelper::save();
JToolBarHelper::apply();
JToolBarHelper::cancel();
break;
default:
JToolBarHelper::title(JText::_('COM_REDFORM_Values'), 'redform_values');
if ($this->get('Total', 'fields') > 0) {
JToolBarHelper::publishList();
JToolBarHelper::unpublishList();
JToolBarHelper::spacer();
JToolBarHelper::deleteList();
JToolBarHelper::editListX();
JToolBarHelper::addNew();
}
break;
}
}
示例11: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
JRequest::setVar('hidemainmenu', true);
$user = JFactory::getUser();
$isNew = $this->item->id == 0;
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
$canDo = BannersHelper::getActions();
JToolBarHelper::title($isNew ? JText::_('COM_BANNERS_MANAGER_CLIENT_NEW') : JText::_('COM_BANNERS_MANAGER_CLIENT_EDIT'), 'banners-clients.png');
// 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 {
JToolBarHelper::cancel('client.cancel', 'JTOOLBAR_CLOSE');
}
JToolBarHelper::divider();
JToolBarHelper::help('JHELP_COMPONENTS_BANNERS_CLIENTS_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: _setToolBar
function _setToolBar()
{
JToolBarHelper::title(JText::_('ROLES_MANAGER_TITLE'), 'roles');
JToolBarHelper::save('save_package');
JToolBarHelper::apply('apply_package');
JToolBarHelper::cancel('cancel_package');
}
示例14: addToolBar
protected function addToolBar()
{
//JRequest::setVar('hidemainmenu', true);
JToolBarHelper::title(JText::_('Settings'));
JToolBarHelper::apply('settings.apply');
JToolBarHelper::cancel('settings.cancel', 'JTOOLBAR_CLOSE');
}
示例15: addToolbar
/**
* Add the page title and toolbar.
*/
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 = JvpricetableHelper::getActions();
JToolBarHelper::title(JText::_('COM_JVPRICETABLE_TITLE_ITEM'), 'item.png');
// If not checked out, can save the item.
if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) {
JToolBarHelper::apply('item.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('item.save', 'JTOOLBAR_SAVE');
}
if (!$checkedOut && $canDo->get('core.create')) {
JToolBarHelper::custom('item.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('item.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
if (empty($this->item->id)) {
JToolBarHelper::cancel('item.cancel', 'JTOOLBAR_CANCEL');
} else {
JToolBarHelper::cancel('item.cancel', 'JTOOLBAR_CLOSE');
}
JToolBarHelper::custom('item.template', 'briefcase', 'briefcase', 'COM_JVPRICETABLE_TEMPLATE', false);
JToolBarHelper::custom('item.customcss', 'list', 'list', 'COM_JVPRICETABLE_CUSTOMCSS', false);
}