本文整理汇总了PHP中TemplatesHelper::getActions方法的典型用法代码示例。如果您正苦于以下问题:PHP TemplatesHelper::getActions方法的具体用法?PHP TemplatesHelper::getActions怎么用?PHP TemplatesHelper::getActions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TemplatesHelper
的用法示例。
在下文中一共展示了TemplatesHelper::getActions方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _setToolbar
/**
* Setup the Toolbar.
*/
protected function _setToolbar()
{
$state = $this->get('State');
$canDo = TemplatesHelper::getActions();
$isSite = $state->get('filter.client_id') == 0;
if ($canDo->get('core.edit')) {
JToolBarHelper::editList('style.edit');
}
if ($canDo->get('core.edit.state')) {
JToolBarHelper::custom('styles.sethome', 'default.png', 'default_f2.png', 'Templates_Toolbar_Set_Home', true);
}
JToolBarHelper::title(JText::_('Templates_Manager_Styles'), 'thememanager');
if ($canDo->get('core.create') && $isSite) {
JToolBarHelper::addNew('styles.duplicate', 'Templates_Toolbar_Save_Copy');
}
if ($canDo->get('core.delete') && $isSite) {
JToolBarHelper::deleteList('', 'styles.delete');
}
if ($canDo->get('core.admin')) {
JToolBarHelper::divider();
JToolBarHelper::preferences('com_templates');
}
JToolBarHelper::divider();
JToolBarHelper::help('screen.templates');
}
示例2: 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 = TemplatesHelper::getActions();
JToolBarHelper::title($isNew ? JText::_('COM_TEMPLATES_MANAGER_ADD_STYLE') : JText::_('COM_TEMPLATES_MANAGER_EDIT_STYLE'), 'thememanager');
// If not checked out, can save the item.
if ($canDo->get('core.edit')) {
JToolBarHelper::apply('style.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('style.save', 'JTOOLBAR_SAVE');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
JToolBarHelper::custom('style.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
if (empty($this->item->id)) {
JToolBarHelper::cancel('style.cancel', 'JTOOLBAR_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()
{
$canDo = TemplatesHelper::getActions();
JToolbarHelper::title(JText::_('COM_TEMPLATES_MANAGER_STYLES'), 'thememanager');
if ($canDo->get('core.edit.state')) {
JToolbarHelper::makeDefault('styles.setDefault', 'COM_TEMPLATES_TOOLBAR_SET_HOME');
JToolbarHelper::divider();
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList('style.edit');
}
if ($canDo->get('core.create')) {
JToolbarHelper::custom('styles.duplicate', 'copy.png', 'copy_f2.png', 'JTOOLBAR_DUPLICATE', true);
JToolbarHelper::divider();
}
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList('', 'styles.delete');
JToolbarHelper::divider();
}
if ($canDo->get('core.admin')) {
JToolbarHelper::preferences('com_templates');
JToolbarHelper::divider();
}
JToolbarHelper::help('JHELP_EXTENSIONS_TEMPLATE_MANAGER_STYLES');
JHtmlSidebar::setAction('index.php?option=com_templates&view=styles');
JHtmlSidebar::addFilter(JText::_('COM_TEMPLATES_FILTER_TEMPLATE'), 'filter_template', JHtml::_('select.options', TemplatesHelper::getTemplateOptions($this->state->get('filter.client_id')), 'value', 'text', $this->state->get('filter.template')));
JHtmlSidebar::addFilter(JText::_('JGLOBAL_FILTER_CLIENT'), 'filter_client_id', JHtml::_('select.options', TemplatesHelper::getClientOptions(), 'value', 'text', $this->state->get('filter.client_id')));
}
示例4: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$state = $this->get('State');
$canDo = TemplatesHelper::getActions();
$isSite = $state->get('filter.client_id') == 0;
JToolBarHelper::title(JText::_('COM_TEMPLATES_MANAGER_STYLES'), 'thememanager');
if ($canDo->get('core.edit.state')) {
JToolBarHelper::makeDefault('styles.setDefault', 'COM_TEMPLATES_TOOLBAR_SET_HOME');
JToolBarHelper::divider();
}
if ($canDo->get('core.edit')) {
JToolBarHelper::editList('style.edit');
}
if ($canDo->get('core.create')) {
JToolBarHelper::custom('styles.duplicate', 'copy.png', 'copy_f2.png', 'JTOOLBAR_DUPLICATE', true);
JToolBarHelper::divider();
}
if ($canDo->get('core.delete')) {
JToolBarHelper::deleteList('', 'styles.delete');
JToolBarHelper::divider();
}
if ($canDo->get('core.admin')) {
JToolBarHelper::preferences('com_templates');
JToolBarHelper::divider();
}
JToolBarHelper::help('JHELP_EXTENSIONS_TEMPLATE_MANAGER_STYLES');
}
示例5: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
Request::setVar('hidemainmenu', true);
$isNew = $this->item->id == 0;
$canDo = TemplatesHelper::getActions();
Toolbar::title($isNew ? Lang::txt('COM_TEMPLATES_MANAGER_ADD_STYLE') : Lang::txt('COM_TEMPLATES_MANAGER_EDIT_STYLE'), 'thememanager');
// If not checked out, can save the item.
if ($canDo->get('core.edit')) {
Toolbar::apply('style.apply');
Toolbar::save('style.save');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
Toolbar::save2copy('style.save2copy');
}
if (empty($this->item->id)) {
Toolbar::cancel('style.cancel');
} else {
Toolbar::cancel('style.cancel', 'JTOOLBAR_CLOSE');
}
Toolbar::divider();
// Get the help information for the template item.
$lang = Lang::getRoot();
$help = $this->get('Help');
if ($lang->hasKey($help->url)) {
$debug = $lang->setDebug(false);
$url = Lang::txt($help->url);
$lang->setDebug($debug);
} else {
$url = null;
}
Toolbar::help('style');
//$help->key, false, $url);
}
示例6: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
JRequest::setVar('hidemainmenu', true);
$user = JFactory::getUser();
$canDo = TemplatesHelper::getActions();
JToolBarHelper::title(JText::_('COM_TEMPLATES_MANAGER_VIEW_TEMPLATE'), 'thememanager');
JToolBarHelper::cancel('template.cancel', 'JTOOLBAR_CLOSE');
JToolBarHelper::divider();
JToolBarHelper::help('JHELP_EXTENSIONS_TEMPLATE_MANAGER_TEMPLATES_EDIT');
}
示例7: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$canDo = TemplatesHelper::getActions();
JToolbarHelper::title(JText::_('COM_TEMPLATES_MANAGER_EDIT_FILE'), 'thememanager');
// Can save the item.
if ($canDo->get('core.edit')) {
JToolbarHelper::apply('source.apply');
JToolbarHelper::save('source.save');
}
JToolbarHelper::cancel('source.cancel');
JToolbarHelper::divider();
JToolbarHelper::help('JHELP_EXTENSIONS_TEMPLATE_MANAGER_TEMPLATES_EDIT_SOURCE');
}
示例8: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
$user = JFactory::getUser();
$canDo = TemplatesHelper::getActions();
JToolbarHelper::title(JText::_('COM_TEMPLATES_MANAGER_VIEW_TEMPLATE'), 'thememanager');
JToolbarHelper::cancel('template.cancel', 'JTOOLBAR_CLOSE');
// Add a copy button
if ($user->authorise('core.create', 'com_templates')) {
$title = JText::_('JLIB_HTML_BATCH_COPY');
$dhtml = "<button data-toggle=\"modal\" data-target=\"#collapseModal\" class=\"btn btn-small\">\n\t\t\t\t\t\t<i class=\"icon-copy\" title=\"{$title}\"></i>\n\t\t\t\t\t\t{$title}</button>";
$bar->appendButton('Custom', $dhtml, 'upload');
}
JToolbarHelper::divider();
JToolbarHelper::help('JHELP_EXTENSIONS_TEMPLATE_MANAGER_TEMPLATES_EDIT');
}
示例9: display
public function display($tpl = null)
{
$JSNMedia = JSNFactory::getMedia();
$JSNMedia->addStyleSheet(JSN_POWERADMIN_STYLE_URI . 'styles.css');
JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . "jsn.mousecheck.js");
JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . "jsn.submenu.js");
JSNHtmlAsset::addScript(JSN_POWERADMIN_LIB_JSNJS_URI . "jsn.manage-styles.js");
$JSNMedia->addStyleDeclaration("\n\t\t.template-item {\n\t\t\tbackground: url(" . JSN_POWERADMIN_IMAGES_URI . "icons-24/icon-24-loading-circle.gif) no-repeat center center;\n\t\t}\n\t\t.loading {\n\t\t\tbackground: url(" . JSN_POWERADMIN_IMAGES_URI . "icons-16/icon-16-loading-circle.gif) no-repeat center right;\n\t\t}\n\t\t");
$JSNMedia->addScriptDeclaration("\n (function (\$){\n \$(document).ready(function (){\n \$('#client-switch').change(function (e) {\n var val =\$(this).attr('value');\n if(val == 0){\n \$('.template-list').hide();\n \$('#site').show();\n }else{\n \$('.template-list').hide();\n \$('#admin').show();\n }\n })\n\t });\n })(JoomlaShine.jQuery);\n ");
// Add javascript lang translation
$jsnLang = new JSNJavascriptLanguages();
$jsnLang->addLang('JSN_POWERADMIN_TM_MAKE_DEFAULT');
$jsnLang->addLang('JSN_POWERADMIN_TM_UNINSTALL_TEMPLATE');
$jsnLang->addLang('JSN_POWERADMIN_TM_MAKE_DEFAULT');
$jsnLang->addLang('JSN_POWERADMIN_TM_UNINSTALL_TEMPLATE');
$jsnLang->addLang('JSN_POWERADMIN_TM_CLOSE_BEFORE_DELETE');
$jsnLang->addLang('JSN_POWERADMIN_TM_CLOSE_BEFORE_UNINSTALL');
$jsnLang->addLang('JSN_POWERADMIN_TM_ALREADY_DEFAULT');
$jsnLang->addLang('JSN_POWERADMIN_TM_CANNOT_DELETE_DEFAULT');
$jsnLang->addLang('JSN_POWERADMIN_TM_CANNOT_UNINSTALL_DEFAULT');
$jsnLang->addLang('JSN_POWERADMIN_TM_DELETE_STYLE_CONFIRM');
$jsnLang->addLang('JSN_POWERADMIN_TM_UNINSTALL_TEMPLATE_CONFIRM');
$JSNMedia->addScriptDeclaration($jsnLang->loadLang());
$model = $this->getModel('templates');
$rows = $model->getTemplates();
$adminRows = $model->getTemplates(1);
// Check permission for removing styles.
JSNFactory::import('components.com_templates.helpers.templates');
$canDo = version_compare(JVERSION, '3.2.2', 'ge') ? JHelperContent::getActions('com_templates') : TemplatesHelper::getActions();
$canDelete = $canDo->get('core.delete');
$canDelete = '<input type="hidden" id="candelete" value="' . $canDelete . '"></input>';
echo $canDelete;
// Check permission for uninstalling template.
JSNFactory::import('components.com_installer.helpers.installer');
$canDo = version_compare(JVERSION, '3.2.2', 'ge') ? JHelperContent::getActions('com_installer') : TemplatesHelper::getActions();
$canUninstall = $canDo->get('core.delete');
$canUninstall = '<input type="hidden" id="canuninstall" value="' . $canUninstall . '"></input>';
echo $canUninstall;
//assign to view
$this->assign('templates', $rows);
$this->assign('adminTemplates', $adminRows);
$this->assign('canDelete', $canDelete);
return parent::display();
}
示例10: delete
function delete()
{
JSNFactory::import('components.com_templates.helpers.templates');
$canDo = TemplatesHelper::getActions();
if (!$canDo->get('core.delete')) {
$response = array('isDeleted' => false);
echo json_encode($response);
jexit();
}
$id = JRequest::getVar('id', array(), 'GET', 'array');
JSNFactory::import('components.com_templates.models.style');
JSNFactory::import('components.com_templates.tables.style');
JFactory::getLanguage()->load('com_templates');
$model = $this->getModel('Style', 'TemplatesModel', array('ignore_request' => true));
$model->delete($id);
$isDeleted = $this->isDeleted($id[0]);
$response = array('isDeleted' => $isDeleted, 'message' => $model->getError());
echo json_encode($response);
jexit();
}
示例11: defined
<?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('behavior.keepalive');
$user = JFactory::getUser();
$canDo = TemplatesHelper::getActions();
?>
<script type="text/javascript">
Joomla.submitbutton = function(task)
{
if (task == 'style.cancel' || document.formvalidator.isValid(document.id('style-form'))) {
Joomla.submitform(task, document.getElementById('style-form'));
}
}
</script>
<form action="<?php
echo JRoute::_('index.php?option=com_templates&layout=edit&id=' . (int) $this->item->id);
?>
" method="post" name="adminForm" id="style-form" class="form-validate">
<div class="width-60 fltlft">
示例12: defined
/*
* ------------------------------------------------------------------------
* Copyright (C) 2009 - 2013 The YouTech JSC. All Rights Reserved.
* @license - GNU/GPL, http://www.gnu.org/licenses/gpl.html
* Author: The YouTech JSC
* Websites: http://www.smartaddons.com - http://www.cmsportal.net
* ------------------------------------------------------------------------
*/
// no direct access
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('behavior.keepalive');
$user = JFactory::getUser();
$canDo = version_compare(JVERSION, '3.2.2', 'ge') ? JHelperContent::getActions('com_templates') : TemplatesHelper::getActions();
// Form template
$form = JForm::getInstance('com_templates.style', 'style', array('control' => 'jform', 'load_data' => true));
// Get cookie of backend tab param
$tabcookie = isset($_COOKIE[$this->nameOfSJTemplate() . '_backend_tab']) && $_COOKIE[$this->nameOfSJTemplate() . '_backend_tab'] != "" ? $_COOKIE[$this->nameOfSJTemplate() . '_backend_tab'] : 'overview';
?>
<div class="yt-templatebackend yt-jv<?php
echo J_VERSION;
?>
">
<form action="<?php
echo JRoute::_('index.php?option=com_templates&layout=edit&id=' . JRequest::getInt('id'));
?>
" method="post" name="adminForm" id="style-form" class="form-validate">
<div class="yt-nav-template clearfix">
示例13: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*
* @return void
*/
protected function addToolbar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$canDo = TemplatesHelper::getActions();
if ($canDo->get('core.edit') && $canDo->get('core.create') && $canDo->get('core.admin')) {
$showButton = true;
} else {
$showButton = false;
}
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
$explodeArray = explode('.', $this->fileName);
$ext = end($explodeArray);
JToolbarHelper::title(JText::_('COM_TEMPLATES_MANAGER_VIEW_TEMPLATE'), 'eye thememanager');
// Add a Apply and save button
if ($this->type == 'file') {
if ($showButton) {
JToolbarHelper::apply('template.apply');
JToolbarHelper::save('template.save');
}
} elseif ($this->type == 'image') {
if ($showButton) {
JToolbarHelper::custom('template.cropImage', 'move', 'move', 'COM_TEMPLATES_BUTTON_CROP', false, false);
JToolbarHelper::modal('resizeModal', 'icon-refresh', 'COM_TEMPLATES_BUTTON_RESIZE');
}
} elseif ($this->type == 'archive') {
if ($showButton) {
JToolbarHelper::custom('template.extractArchive', 'arrow-down', 'arrow-down', 'COM_TEMPLATES_BUTTON_EXTRACT_ARCHIVE', false, false);
}
}
// Add a copy template button
if ($this->hathor->home == 0) {
if ($showButton) {
JToolbarHelper::modal('collapseModal', 'icon-copy', 'COM_TEMPLATES_BUTTON_COPY_TEMPLATE');
}
}
// Add a Template preview button
if ($this->preview->client_id == 0) {
$bar->appendButton('Link', 'picture', 'COM_TEMPLATES_BUTTON_PREVIEW', JUri::root() . 'index.php?tp=1&templateStyle=' . $this->preview->id);
}
// Add Manage folders button
if ($showButton) {
JToolbarHelper::modal('folderModal', 'icon-folder icon white', 'COM_TEMPLATES_BUTTON_FOLDERS');
}
// Add a new file button
if ($showButton) {
JToolbarHelper::modal('fileModal', 'icon-file', 'COM_TEMPLATES_BUTTON_FILE');
}
// Add a Rename file Button
if ($this->hathor->home == 0) {
if ($showButton && $this->type != 'home') {
JToolbarHelper::modal('renameModal', 'icon-refresh', 'COM_TEMPLATES_BUTTON_RENAME_FILE');
}
}
// Add a Delete file Button
if ($showButton && $this->type != 'home') {
JToolbarHelper::modal('deleteModal', 'icon-remove', 'COM_TEMPLATES_BUTTON_DELETE_FILE');
}
// Add a Compile Button
if ($showButton) {
if ($ext == 'less') {
JToolbarHelper::custom('template.less', 'play', 'play', 'COM_TEMPLATES_BUTTON_LESS', false, false);
}
}
if ($this->type == 'home') {
JToolbarHelper::cancel('template.cancel', 'JTOOLBAR_CLOSE');
} else {
JToolbarHelper::cancel('template.close', 'COM_TEMPLATES_BUTTON_CLOSE_FILE');
}
JToolbarHelper::divider();
JToolbarHelper::help('JHELP_EXTENSIONS_TEMPLATE_MANAGER_TEMPLATES_EDIT');
}
示例14: defined
* @package CANVAS Framework for Joomla!
*------------------------------------------------------------------------------
* @copyright Copyright (C) 2004-2013 ThemezArt.com. All Rights Reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @authors ThemezArt
* & t3-framework.org as base version
* @Link: http://themezart.com/canvas-framework
*------------------------------------------------------------------------------
*/
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('behavior.keepalive');
$user = JFactory::getUser();
$canDo = method_exists('TemplatesHelper', 'getActions') ? TemplatesHelper::getActions() : JHelperContent::getActions('com_templates');
$iswritable = is_writable('canvastest.txt');
if ($iswritable) {
?>
<div id="canvas-admin-writable-message" class="alert warning">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong><?php
echo JText::_('CANVAS_MSG_WARNING');
?>
</strong> <?php
echo JText::_('CANVAS_MSG_FILE_NOT_WRITABLE');
?>
</div>
<?php
}
?>