本文整理汇总了PHP中ModulesHelper类的典型用法代码示例。如果您正苦于以下问题:PHP ModulesHelper类的具体用法?PHP ModulesHelper怎么用?PHP ModulesHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ModulesHelper类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: display
/**
* Method to display a view.
*
* @param boolean $cachable If true, the view output will be cached
* @param array|boolean $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}
*
* @return JController This object to support chaining.
*
* @since 1.5
*/
public function display($cachable = false, $urlparams = false)
{
$id = $this->input->getInt('id');
$document = JFactory::getDocument();
// For JSON requests
if ($document->getType() == 'json') {
$view = new ModulesViewModule();
// Get/Create the model
if ($model = new ModulesModelModule()) {
// Checkin table entry
if (!$model->checkout($id)) {
JFactory::getApplication()->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_CHECKIN_USER_MISMATCH'), 'error');
return false;
}
// Push the model into the view (as default)
$view->setModel($model, true);
}
$view->document = $document;
return $view->display();
}
JLoader::register('ModulesHelper', JPATH_ADMINISTRATOR . '/components/com_modules/helpers/modules.php');
$layout = $this->input->get('layout', 'edit');
$id = $this->input->getInt('id');
// Check for edit form.
if ($layout == 'edit' && !$this->checkEditId('com_modules.edit.module', $id)) {
// Somehow the person just went to the form - we don't allow that.
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
$this->setMessage($this->getError(), 'error');
$this->setRedirect(JRoute::_('index.php?option=com_modules&view=modules', false));
return false;
}
// Load the submenu.
ModulesHelper::addSubmenu($this->input->get('view', 'modules'));
return parent::display();
}
开发者ID:adjaika,项目名称:J3Base,代码行数:45,代码来源:controller.php
示例2: display
/**
* Method to display a view.
*
* @param boolean $cachable If true, the view output will be cached
* @param array|boolean $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}
*
* @return JController This object to support chaining.
*
* @since 1.5
*/
public function display($cachable = false, $urlparams = false)
{
$view = $this->input->get('view', 'modules');
$layout = $this->input->get('layout', 'default');
$id = $this->input->getInt('id');
$document = JFactory::getDocument();
// For JSON requests
if ($document->getType() == 'json') {
$view = new ModulesViewModule();
// Get/Create the model
if ($model = new ModulesModelModule()) {
// Checkin table entry
if (!$model->checkout($id)) {
JFactory::getApplication()->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_CHECKIN_USER_MISMATCH'), 'error');
return false;
}
// Push the model into the view (as default)
$view->setModel($model, true);
}
$view->document = $document;
return $view->display();
}
require_once JPATH_COMPONENT . '/helpers/modules.php';
// Load the submenu.
ModulesHelper::addSubmenu($this->input->get('view', 'modules'));
return parent::display();
}
开发者ID:knigherrant,项目名称:decopatio,代码行数:37,代码来源:controller.php
示例3: _setToolbar
/**
* Setup the Toolbar
*
* @since 1.6
*/
protected function _setToolbar()
{
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 = ModulesHelper::getActions($this->state->get('filter.category_id'), $this->item->id);
$client = $this->get('client');
JToolBarHelper::title(JText::_('Modules_Manager_Module'));
if ($this->item->module == 'mod_custom') {
JToolBarHelper::Preview('index.php?option=com_modules&tmpl=component&client=' . $client->id . '&pollid=' . $this->item->id);
}
// If not checked out, can save the item.
if (!$checkedOut && $canDo->get('core.edit')) {
JToolBarHelper::apply('module.apply', 'JToolbar_Apply');
JToolBarHelper::save('module.save', 'JToolbar_Save');
JToolBarHelper::addNew('module.save2new', 'JToolbar_Save_and_new');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
JToolBarHelper::custom('module.save2copy', 'copy.png', 'copy_f2.png', 'JToolbar_Save_as_Copy', false);
}
if (empty($this->item->id)) {
JToolBarHelper::cancel('module.cancel', 'JToolbar_Cancel');
} else {
JToolBarHelper::cancel('module.cancel', 'JToolbar_Close');
}
JToolBarHelper::help('screen.module.edit');
}
开发者ID:joebushi,项目名称:joomla,代码行数:34,代码来源:view.html.php
示例4: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$state = $this->get('State');
$canDo = ModulesHelper::getActions();
Toolbar::title(Lang::txt('COM_MODULES_MANAGER_MODULES'), 'module.png');
if ($canDo->get('core.create')) {
//Toolbar::addNew('module.add');
Toolbar::appendButton('Popup', 'new', 'JTOOLBAR_NEW', 'index.php?option=com_modules&view=select&tmpl=component', 850, 400);
}
if ($canDo->get('core.edit')) {
Toolbar::editList('module.edit');
}
if ($canDo->get('core.create')) {
Toolbar::custom('modules.duplicate', 'copy.png', 'copy_f2.png', 'JTOOLBAR_DUPLICATE', true);
}
if ($canDo->get('core.edit.state')) {
Toolbar::divider();
Toolbar::publish('modules.publish', 'JTOOLBAR_PUBLISH', true);
Toolbar::unpublish('modules.unpublish', 'JTOOLBAR_UNPUBLISH', true);
Toolbar::divider();
Toolbar::checkin('modules.checkin');
}
if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) {
Toolbar::deleteList('', 'modules.delete', 'JTOOLBAR_EMPTY_TRASH');
Toolbar::divider();
} elseif ($canDo->get('core.edit.state')) {
Toolbar::trash('modules.trash');
Toolbar::divider();
}
if ($canDo->get('core.admin')) {
Toolbar::preferences('com_modules');
Toolbar::divider();
}
Toolbar::help('modules');
}
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:40,代码来源:view.html.php
示例5: display
/**
* Method to display a view.
*
* @param boolean If true, the view output will be cached
* @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
*
* @return JController This object to support chaining.
* @since 1.5
*/
public function display($cachable = false, $urlparams = false)
{
require_once JPATH_COMPONENT . '/helpers/modules.php';
// Load the submenu.
ModulesHelper::addSubmenu($this->input->get('view', 'modules'));
$view = $this->input->get('view', 'modules');
$layout = $this->input->get('layout', 'default');
$id = $this->input->getInt('id');
// Check for edit form.
if ($view == 'module' && $layout == 'edit') {
if (!$this->checkEditId('com_advancedmodules.edit.module', $id)) {
// Somehow the person just went to the form - we don't allow that.
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
$this->setMessage($this->getError(), 'error');
$this->setRedirect(JRoute::_('index.php?option=com_advancedmodules&view=modules', false));
return false;
}
// Check general edit permission first.
if (!JFactory::getUser()->authorise('core.edit', 'com_advancedmodules.module.' . $id)) {
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
$this->setMessage($this->getError(), 'error');
$this->setRedirect(JRoute::_('index.php?option=com_advancedmodules&view=modules', false));
return false;
}
}
parent::display();
}
开发者ID:AxelFG,项目名称:ckbran-inf,代码行数:36,代码来源:controller.php
示例6: templates
/**
* @param int $clientId The client id
* @param string $state The state of the template
*/
public static function templates($clientId = 0, $state = '')
{
$templates = ModulesHelper::getTemplates($clientId, $state);
foreach ($templates as $template) {
$options[] = JHtml::_('select.option', $template->element, $template->name);
}
return $options;
}
开发者ID:interfaceslivres,项目名称:ccmd-ufpb,代码行数:12,代码来源:modules.php
示例7: display
/**
* Method to display a view.
*
* @param boolean $cachable If true, the view output will be cached
* @param array|boolean $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}
.
*
* @return JController This object to support chaining.
* @since 1.5
*/
public function display($cachable = false, $urlparams = false)
{
require_once JPATH_COMPONENT . '/helpers/modules.php';
// Load the submenu.
ModulesHelper::addSubmenu($this->input->get('view', 'modules'));
$view = $this->input->get('view', 'modules');
$layout = $this->input->get('layout', 'default');
$id = $this->input->getInt('id');
return parent::display();
}
开发者ID:WineWorld,项目名称:joomlatrialcmbg,代码行数:20,代码来源:controller.php
示例8: 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'));
$canDo = ModulesHelper::getActions($this->item->id);
JToolbarHelper::title(JText::sprintf('COM_MODULES_MANAGER_MODULE', JText::_($this->item->module)), 'cube module');
// For new records, check the create permission.
if ($isNew && $canDo->get('core.create')) {
JToolbarHelper::apply('module.apply');
JToolbarHelper::save('module.save');
JToolbarHelper::save2new('module.save2new');
JToolbarHelper::cancel('module.cancel');
} else {
// Can't save the record if it's checked out.
if (!$checkedOut) {
// Since it's an existing record, check the edit permission.
if ($canDo->get('core.edit')) {
JToolbarHelper::apply('module.apply');
JToolbarHelper::save('module.save');
// We can save this record, but check the create permission to see if we can return to make a new one.
if ($canDo->get('core.create')) {
JToolbarHelper::save2new('module.save2new');
}
}
}
// If checked out, we can still save
if ($canDo->get('core.create')) {
JToolbarHelper::save2copy('module.save2copy');
}
JToolbarHelper::cancel('module.cancel', 'JTOOLBAR_CLOSE');
}
// Get the help information for the menu 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);
}
开发者ID:shoffmann52,项目名称:install-from-web-server,代码行数:50,代码来源:view.html.php
示例9: display
/**
* Method to display a view.
*
* @param boolean If true, the view output will be cached
* @param array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
*
* @return JController This object to support chaining.
* @since 1.5
*/
public function display($cachable = false, $urlparams = false)
{
require_once JPATH_COMPONENT . '/helpers/modules.php';
// Load the submenu.
ModulesHelper::addSubmenu(JRequest::getCmd('view', 'modules'));
$view = JRequest::getCmd('view', 'modules');
$layout = JRequest::getCmd('layout', 'default');
$id = JRequest::getInt('id');
// Check for edit form.
if ($view == 'module' && $layout == 'edit' && !$this->checkEditId('com_modules.edit.module', $id)) {
// Somehow the person just went to the form - we don't allow that.
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
$this->setMessage($this->getError(), 'error');
$this->setRedirect(JRoute::_('index.php?option=com_modules&view=modules', false));
return false;
}
parent::display();
}
开发者ID:carmerin,项目名称:cesae-web,代码行数:27,代码来源:controller.php
示例10: getTemplateModuleStyles
/**
* Method to get the templates module styles.
*
* @return array The array of styles, grouped by templates.
*
* @since 3.0
*/
protected function getTemplateModuleStyles()
{
$moduleStyles = array();
$templates = array($this->getSystemTemplate());
$templates = array_merge($templates, ModulesHelper::getTemplates('site'));
foreach ($templates as $template) {
$modulesFilePath = JPATH_SITE . '/templates/' . $template->element . '/html/modules.php';
// Is there modules.php for that template?
if (file_exists($modulesFilePath)) {
$modulesFileData = file_get_contents($modulesFilePath);
preg_match_all('/function[\\s\\t]*modChrome\\_([a-z0-9\\-\\_]*)[\\s\\t]*\\(/i', $modulesFileData, $styles);
if (!array_key_exists($template->element, $moduleStyles)) {
$moduleStyles[$template->element] = array();
}
$moduleStyles[$template->element] = $styles[1];
}
}
return $moduleStyles;
}
开发者ID:shoffmann52,项目名称:install-from-web-server,代码行数:26,代码来源:chromestyle.php
示例11: display
/**
* Method to display a view.
*
* @param bool $cachable
* @param bool $urlparams
*
* @internal param \If $boolean true, the view output will be cached
* @internal param \An $array array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
*
* @return JController This object to support chaining.
* @since 1.5
*/
public function display($cachable = false, $urlparams = false)
{
require_once JPATH_ADMINISTRATOR . '/components/com_modules/helpers/modules.php';
// Load the submenu.
ModulesHelper::addSubmenu(JFactory::getApplication()->input->getCmd('view', 'modules'));
$view = JFactory::getApplication()->input->getCmd('view', 'modules');
$layout = JFactory::getApplication()->input->getCmd('layout', 'default');
$id = JFactory::getApplication()->input->getInt('id', null);
// Check for edit form.
if ($view == 'module' && $layout == 'edit' && !$this->checkEditId('com_roksprocket.edit.module', $id)) {
// Somehow the person just went to the form - we don't allow that.
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
$this->setMessage($this->getError(), 'error');
$this->setRedirect(JRoute::_(sprintf('index.php?option=%s&view=modules', RokSprocket_Helper::getRedirectionOption()), false));
return false;
}
if (RokCommon_Session::get('roksprocket.' . $id, false)) {
RokCommon_Session::clear('roksprocket.' . $id);
}
parent::display();
}
开发者ID:TeamCodeStudio,项目名称:fpmoz,代码行数:33,代码来源:controller.php
示例12: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$state = $this->get('State');
$canDo = ModulesHelper::getActions();
JToolBarHelper::title(JText::_('COM_MODULES_MANAGER_MODULES'), 'module.png');
if ($canDo->get('core.create')) {
//JToolBarHelper::addNew('module.add');
$bar = JToolBar::getInstance('toolbar');
$bar->appendButton('Popup', 'new', 'JTOOLBAR_NEW', 'index.php?option=com_modules&view=select&tmpl=component', 850, 400);
}
if ($canDo->get('core.edit')) {
JToolBarHelper::editList('module.edit', 'JTOOLBAR_EDIT');
}
if ($canDo->get('core.create')) {
JToolBarHelper::custom('modules.duplicate', 'copy.png', 'copy_f2.png', 'JTOOLBAR_DUPLICATE', true);
}
if ($canDo->get('core.edit.state')) {
JToolBarHelper::divider();
JToolBarHelper::custom('modules.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true);
JToolBarHelper::custom('modules.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true);
JToolBarHelper::divider();
JToolBarHelper::custom('modules.checkin', 'checkin.png', 'checkin_f2.png', 'JTOOLBAR_CHECKIN', true);
}
if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) {
JToolBarHelper::deleteList('', 'modules.delete', 'JTOOLBAR_EMPTY_TRASH');
JToolBarHelper::divider();
} else {
if ($canDo->get('core.edit.state')) {
JToolBarHelper::trash('modules.trash', 'JTOOLBAR_TRASH');
JToolBarHelper::divider();
}
}
if ($canDo->get('core.admin')) {
JToolBarHelper::preferences('com_modules');
JToolBarHelper::divider();
}
JToolBarHelper::help('JHELP_EXTENSIONS_MODULE_MANAGER');
}
开发者ID:akksi,项目名称:jcg,代码行数:43,代码来源:view.html.php
示例13: 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 = ModulesHelper::getActions($this->state->get('filter.category_id'), $this->item->id);
$item = $this->get('Item');
JToolBarHelper::title(JText::sprintf('COM_MODULES_MANAGER_MODULE', JText::_($this->item->module)), 'module.png');
// If not checked out, can save the item.
if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) {
JToolBarHelper::apply('module.apply');
JToolBarHelper::save('module.save');
}
if (!$checkedOut && $canDo->get('core.create')) {
JToolBarHelper::save2new('module.save2new');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
JToolBarHelper::save2copy('module.save2copy');
}
if (empty($this->item->id)) {
JToolBarHelper::cancel('module.cancel');
} else {
JToolBarHelper::cancel('module.cancel', 'JTOOLBAR_CLOSE');
}
// Get the help information for the menu 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);
}
开发者ID:Nechoj23,项目名称:SVI-Homepage,代码行数:43,代码来源:view.html.php
示例14: display
/**
* Method to display a view.
*/
public function display()
{
require_once JPATH_COMPONENT . '/helpers/modules.php';
// Get the document object.
$document = JFactory::getDocument();
// Set the default view name and format from the Request.
$vName = JRequest::getWord('view', 'modules');
$vFormat = $document->getType();
$lName = JRequest::getWord('layout', 'default');
// Get and render the view.
if ($view =& $this->getView($vName, $vFormat)) {
// Get the model for the view.
$model =& $this->getModel($vName);
// Push the model into the view (as default).
$view->setModel($model, true);
$view->setLayout($lName);
// Push document object into the view.
$view->assignRef('document', $document);
$view->display();
// Load the submenu.
ModulesHelper::addSubmenu($vName);
}
}
开发者ID:joebushi,项目名称:joomla,代码行数:26,代码来源:controller.php
示例15: positions
/**
* Display a batch widget for the module position selector.
*
* @param integer $clientId The client ID.
* @param integer $state The state of the module (enabled, unenabled, trashed).
* @param string $selectedPosition The currently selected position for the module.
*
* @return string The necessary positions for the widget.
*
* @since 2.5
*/
public static function positions($clientId, $state = 1, $selectedPosition = '')
{
require_once JPATH_ADMINISTRATOR . '/components/com_templates/helpers/templates.php';
$templates = array_keys(ModulesHelper::getTemplates($clientId, $state));
$templateGroups = array();
// Add an empty value to be able to deselect a module position
$option = ModulesHelper::createOption();
$templateGroups[''] = ModulesHelper::createOptionGroup('', array($option));
// Add positions from templates
$isTemplatePosition = false;
foreach ($templates as $template) {
$options = array();
$positions = TemplatesHelper::getPositions($clientId, $template);
if (is_array($positions)) {
foreach ($positions as $position) {
$text = ModulesHelper::getTranslatedModulePosition($clientId, $template, $position) . ' [' . $position . ']';
$options[] = ModulesHelper::createOption($position, $text);
if (!$isTemplatePosition && $selectedPosition === $position) {
$isTemplatePosition = true;
}
}
}
$templateGroups[$template] = ModulesHelper::createOptionGroup(ucfirst($template), $options);
}
// Add custom position to options
$customGroupText = JText::_('COM_MODULES_CUSTOM_POSITION');
$editPositions = true;
$customPositions = ModulesHelper::getPositions($clientId, $editPositions);
$templateGroups[$customGroupText] = ModulesHelper::createOptionGroup($customGroupText, $customPositions);
return $templateGroups;
}
开发者ID:joomlatools,项目名称:joomla-platform,代码行数:42,代码来源:modules.php
示例16: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$state = $this->get('State');
$canDo = ModulesHelper::getActions();
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
JToolbarHelper::title(JText::_($this->config->list_title ? 'COM_MODULES_MANAGER_MODULES' : 'AMM_ADVANCED_MODULES_MANAGER'), 'module.png');
if ($canDo->get('core.create')) {
$title = JText::_('JTOOLBAR_NEW');
$dhtml = "<button onClick=\"location.href='index.php?option=com_advancedmodules&view=select'\" class=\"btn btn-small btn-success\">\n\t\t\t\t\t\t<i class=\"icon-plus icon-white\" title=\"{$title}\"></i>\n\t\t\t\t\t\t{$title}</button>";
$bar->appendButton('Custom', $dhtml, 'new');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList('module.edit');
}
if ($canDo->get('core.create')) {
JToolbarHelper::custom('modules.duplicate', 'copy.png', 'copy_f2.png', 'JTOOLBAR_DUPLICATE', true);
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::publish('modules.publish', 'JTOOLBAR_PUBLISH', true);
JToolbarHelper::unpublish('modules.unpublish', 'JTOOLBAR_UNPUBLISH', true);
JToolbarHelper::checkin('modules.checkin');
}
if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) {
JToolbarHelper::deleteList('', 'modules.delete', 'JTOOLBAR_EMPTY_TRASH');
} elseif ($canDo->get('core.edit.state')) {
JToolbarHelper::trash('modules.trash');
}
// Add a batch button
if ($canDo->get('core.edit')) {
JHtml::_('bootstrap.modal', 'collapseModal');
$title = JText::_('JTOOLBAR_BATCH');
$dhtml = "<button data-toggle=\"modal\" data-target=\"#collapseModal\" class=\"btn btn-small\">\n\t\t\t\t\t\t<i class=\"icon-checkbox-partial\" title=\"{$title}\"></i>\n\t\t\t\t\t\t{$title}</button>";
$bar->appendButton('Custom', $dhtml, 'batch');
}
if ($canDo->get('core.admin')) {
JToolbarHelper::preferences('com_advancedmodules', 600, 900);
}
JToolbarHelper::help('JHELP_EXTENSIONS_MODULE_MANAGER');
JHtmlSidebar::addEntry(JText::_('JSITE'), 'index.php?option=com_advancedmodules&filter_client_id=0', $this->state->get('filter.client_id') == 0);
JHtmlSidebar::addEntry(JText::_('JADMINISTRATOR'), 'index.php?option=com_advancedmodules&filter_client_id=1', $this->state->get('filter.client_id') == 1);
JHtmlSidebar::setAction('index.php?option=com_modules');
JHtmlSidebar::addFilter('', 'filter_client_id', JHtml::_('select.options', ModulesHelper::getClientOptions(), 'value', 'text', $this->state->get('filter.client_id')), false);
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', ModulesHelper::getStateOptions(), 'value', 'text', $this->state->get('filter.state')));
JHtmlSidebar::addFilter(JText::_('COM_MODULES_OPTION_SELECT_POSITION'), 'filter_position', JHtml::_('select.options', ModulesHelper::getPositions($this->state->get('filter.client_id')), 'value', 'text', $this->state->get('filter.position')));
JHtmlSidebar::addFilter(JText::_('COM_MODULES_OPTION_SELECT_MODULE'), 'filter_module', JHtml::_('select.options', ModulesHelper::getModules($this->state->get('filter.client_id')), 'value', 'text', $this->state->get('filter.module')));
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_ACCESS'), 'filter_access', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')));
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_LANGUAGE'), 'filter_language', JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text', $this->state->get('filter.language')));
$this->sidebar = JHtmlSidebar::render();
}
开发者ID:AxelFG,项目名称:ckbran-inf,代码行数:55,代码来源:view.html.php
示例17:
}
</script>
<fieldset class="adminform">
<legend><?php
echo JText::_('COM_MODULES_MENU_ASSIGNMENT');
?>
</legend>
<label id="jform_menus-lbl" for="jform_menus"><?php
echo JText::_('COM_MODULES_MODULE_ASSIGN');
?>
</label>
<fieldset id="jform_menus" class="radio">
<?php
$options = ModulesHelper::getAssignmentOptions($that->item->client_id);
$displayValue = $displayText = $list = "";
foreach ($options as $option) {
$text = JText::_($option->text);
if ((string) $that->item->assignment == (string) $option->value) {
$displayValue = $option->value;
$displayText = $text;
}
$list .= '<li data-value="' . $option->value . '" data-text="' . $text . '" data-icon="" data-dynamic="">' . "\n";
$list .= ' <a href="#"><span>' . $text . '</span></a>' . "\n";
$list .= '</li>' . "\n";
}
?>
<div class="sprocket-dropdown">
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
<span><?php
开发者ID:densem-2013,项目名称:exikom,代码行数:31,代码来源:edit_assignment_25.php
示例18: getPositions
/**
* Get list of module position.
*
* @param integer $clientId Client ID.
*
* @return array
*/
static function getPositions($clientId)
{
jimport('joomla.filesystem.folder');
try {
$app = JFactory::getApplication('administrator');
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('DISTINCT(position)');
$query->from('#__modules');
$query->where($db->quoteName('client_id') . ' = ' . (int) $clientId);
$template = $app->getUserState('com_modules.modules.filter.template', null);
if ($template) {
$listPosition = ModulesHelper::getPositionsByTemplate();
if (!empty($listPosition)) {
$query->where('position in (' . $listPosition . ')');
}
}
$query->order('position');
$db->setQuery($query);
$positions = $db->loadColumn();
$positions = is_array($positions) ? $positions : array();
} catch (Exception $e) {
throw $e;
}
// Build the list
$options = array();
foreach ($positions as $position) {
if (!$position) {
$options[] = JHtml::_('select.option', 'none', ':: ' . JText::_('JNONE') . ' ::');
} else {
$options[] = JHtml::_('select.option', $position, $position);
}
}
return $options;
}
开发者ID:jdrzaic,项目名称:joomla-dummy,代码行数:42,代码来源:modules.php
示例19: addToolbar
/**
* Add the page title and toolbar.
*
* @return void
*
* @since 1.6
*/
protected function addToolbar()
{
$state = $this->get('State');
$canDo = JHelperContent::getActions('com_modules');
$user = JFactory::getUser();
// Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar');
if ($this->config->list_title) {
JToolbarHelper::title(JText::_('COM_MODULES_MANAGER_MODULES'), 'cube module');
} else {
JToolbarHelper::title(JText::_('AMM_ADVANCED_MODULE_MANAGER'), 'advancedmodulemanager icon-nonumber');
}
if ($canDo->get('core.create')) {
// Instantiate a new JLayoutFile instance and render the layout
$layout = new JLayoutFile('toolbar.newmodule');
$bar->appendButton('Custom', $layout->render(array()), 'new');
}
if ($canDo->get('core.edit')) {
JToolbarHelper::editList('module.edit');
}
if ($canDo->get('core.create')) {
JToolbarHelper::custom('modules.duplicate', 'copy', 'copy_f2', 'JTOOLBAR_DUPLICATE', true);
}
if ($canDo->get('core.edit.state')) {
JToolbarHelper::publish('modules.publish', 'JTOOLBAR_PUBLISH', true);
JToolbarHelper::unpublish('modules.unpublish', 'JTOOLBAR_UNPUBLISH', true);
JToolbarHelper::checkin('modules.checkin');
}
if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) {
JToolbarHelper::deleteList('', 'modules.delete', 'JTOOLBAR_EMPTY_TRASH');
} elseif ($canDo->get('core.edit.state')) {
JToolbarHelper::trash('modules.trash');
}
// Add a batch button
if ($user->authorise('core.create', 'com_modules') && $user->authorise('core.edit', 'com_modules') && $user->authorise('core.edit.state', 'com_modules')) {
JHtml::_('bootstrap.modal', 'collapseModal');
$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 ($canDo->get('core.admin')) {
JToolbarHelper::preferences('com_advancedmodules', 600, 900);
}
JToolbarHelper::help('JHELP_EXTENSIONS_MODULE_MANAGER');
JHtmlSidebar::setAction('index.php?option=com_advancedmodules');
JHtmlSidebar::addFilter(JText::_('NN_OPTION_SELECT_CLIENT'), 'filter_client_id', JHtml::_('select.options', ModulesHelper::getClientOptions(), 'value', 'text', $this->state->get('filter.client_id')), false);
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', ModulesHelper::getStateOptions(), 'value', 'text', $this->state->get('filter.state')));
JHtmlSidebar::addFilter(JText::_('COM_MODULES_OPTION_SELECT_POSITION'), 'filter_position', JHtml::_('select.options', ModulesHelper::getPositions($this->state->get('filter.client_id')), 'value', 'text', $this->state->get('filter.position')));
JHtmlSidebar::addFilter(JText::_('COM_MODULES_OPTION_SELECT_MODULE'), 'filter_module', JHtml::_('select.options', ModulesHelper::getModules($this->state->get('filter.client_id')), 'value', 'text', $this->state->get('filter.module')));
JHtmlSidebar::addFilter(JText::_('AMM_OPTION_SELECT_MENU_ID'), 'filter_menuid', JHtml::_('select.options', ModulesHelper::getMenuItemAssignmentOptions($this->state->get('filter.client_id')), 'value', 'text', $this->state->get('filter.menuid')));
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_ACCESS'), 'filter_access', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')));
JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_LANGUAGE'), 'filter_language', JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text', $this->state->get('filter.language')));
$this->sidebar = JHtmlSidebar::render();
}
开发者ID:jputz12,项目名称:OneNow-Vshop,代码行数:63,代码来源:view.html.php
示例20: render
function render($type)
{
$sliders =& JPane::getInstance('sliders');
echo $sliders->startPane('params');
TranslateParams_xml::renderDoublecolumnParams($this->form, 'params', 'com_modules', $sliders);
echo $sliders->endPane();
// menu assignments
// Initiasile related data.
if (!class_exists('MenusHelper')) {
JLoader::register('MenusHelper', JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php', true);
}
if (!class_exists('ModulesHelper')) {
JLoader::register('ModulesHelper', JPATH_ADMINISTRATOR . '/components/com_modules/helpers/modules.php', true);
}
$menuTypes = MenusHelper::getMenuLinks();
?>
<script type="text/javascript">
window.addEvent('domready', function(){
validate();
document.getElements('select').addEvent('change', function(e){validate();});
});
function validate(){
var value = document.id('jform_assignment').value;
var list = document.id('menu-assignment');
if(value == '-' || value == '0'){
$$('.jform-assignments-button').each(function(el) {el.setProperty('disabled', true); });
list.getElements('input').each(function(el){
el.setProperty('disabled', true);
if (value == '-'){
el.setProperty('checked', false);
} else {
el.setProperty('checked', true);
}
});
} else {
$$('.jform-assignments-button').each(function(el) {el.setProperty('disabled', false); });
list.getElements('input').each(function(el){
el.setProperty('disabled', false);
});
}
}
</script>
<div class="width-100 fltlft">
<fieldset class="adminform">
<legend><?php
echo JText::_('COM_MODULES_MENU_ASSIGNMENT');
?>
</legend>
<label id="jform_menus-lbl" for="jform_menus"><?php
echo JText::_('COM_MODULES_MODULE_ASSIGN');
?>
</label>
<fieldset id="jform_menus" class="radio">
<select name="jform[assignment]" id="jform_assignment">
<?php
echo JHtml::_('select.options', ModulesHelper::getAssignmentOptions($this->item->client_id), 'value', 'text', $this->item->assignment, true);
?>
</select>
</fieldset>
<label id="jform_menuselect-lbl" for="jform_menuselect"><?php
echo JText::_('JGLOBAL_MENU_SELECTION');
?>
</label>
<button type="button" class="jform-assignments-button jform-rightbtn" onclick="$$('.chk-menulink').each(function(el) { el.checked = !el.checked; });">
<?php
echo JText::_('JGLOBAL_SELECTION_INVERT');
?>
</button>
<button type="button" class="jform-assignments-button jform-rightbtn" onclick="$$('.chk-menulink').each(function(el) { el.checked = false; });">
<?php
echo JText::_('JGLOBAL_SELECTION_NONE');
?>
</button>
<button type="button" class="jform-assignments-button jform-rightbtn" onclick="$$('.chk-menulink').each(function(el) { el.checked = true; });">
<?php
echo JText::_('JGLOBAL_SELECTION_ALL');
?>
</button>
<div class="clr"></div>
<div id="menu-assignment">
<?php
echo JHtml::_('tabs.start', 'module-menu-assignment-tabs', array('useCookie' => 1));
?>
<?php
foreach ($menuTypes as &$type) {
|
请发表评论