本文整理匯總了PHP中InstallerHelper::getActions方法的典型用法代碼示例。如果您正苦於以下問題:PHP InstallerHelper::getActions方法的具體用法?PHP InstallerHelper::getActions怎麽用?PHP InstallerHelper::getActions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類InstallerHelper
的用法示例。
在下文中一共展示了InstallerHelper::getActions方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: uninstall
function uninstall()
{
JSNFactory::import('components.com_installer.helpers.installer');
$canDo = InstallerHelper::getActions();
if (!$canDo->get('core.delete')) {
$response = array('isUninstalled' => false);
echo json_encode($response);
jexit();
}
$id = JRequest::getVar('id', 0);
if (!is_numeric($id) || $id <= 0) {
return;
}
$dbo = JFactory::getDBO();
$dbo->setQuery("SELECT e.extension_id FROM #__extensions e INNER JOIN #__template_styles s ON e.element=s.template WHERE e.type='template' AND s.id={$id} LIMIT 1");
$extensionId = $dbo->loadResult();
if ($extensionId > 0) {
JFactory::getLanguage()->load('com_installer');
JSNFactory::import('components.com_installer.models.manage');
$model = $this->getModel('manage', 'InstallerModel', array('ignore_request' => true));
$result = $model->remove(array($extensionId));
$response = array('isUninstalled' => true);
echo json_encode($response);
}
jexit();
}
示例2: installPaExtension
public function installPaExtension()
{
$this->model = $this->getModel('installer');
JSNFactory::import('components.com_installer.helpers.installer');
$canDo = InstallerHelper::getActions();
if ($canDo->get('core.manage')) {
try {
$rs = $this->model->download();
$this->input->set('package', $rs);
// Set extension parameters
$_GET['package'] = $rs;
$_GET['type'] = 'plugin';
$_GET['folder'] = 'jsnpoweradmin';
$_GET['publish'] = 1;
$_GET['client'] = 'site';
$_GET['name'] = str_ireplace(JSN_POWERADMIN_EXT_IDENTIFIED_NAME_PREFIX, '', $_GET['identified_name']);
$this->model->install($rs);
if ($this->model->install($rs)) {
require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/extensions.php';
// Enable extension suport
$_GET['name'] = str_ireplace(JSN_POWERADMIN_EXT_IDENTIFIED_NAME_PREFIX, '', $_GET['identified_name']);
try {
JSNPaExtensionsHelper::enableExt($identifiedName);
} catch (Exception $ex) {
exit('notenabled');
}
}
} catch (Exception $ex) {
exit($ex->getMessage());
}
exit('success');
}
}
示例3: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$canDo = InstallerHelper::getActions();
JToolBarHelper::custom('update.update', 'upload', 'upload', 'COM_INSTALLER_TOOLBAR_UPDATE', true, false);
JToolBarHelper::custom('update.find', 'refresh', 'refresh', 'COM_INSTALLER_TOOLBAR_FIND_UPDATES', false, false);
JToolBarHelper::custom('update.purge', 'purge', 'purge', 'JTOOLBAR_PURGE_CACHE', false, false);
JToolBarHelper::divider();
parent::addToolbar();
JToolBarHelper::help('JHELP_EXTENSIONS_EXTENSION_MANAGER_UPDATE');
}
示例4: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$canDo = InstallerHelper::getActions();
/*
* Set toolbar items for the page
*/
JToolBarHelper::custom('database.fix', 'refresh', 'refresh', 'COM_INSTALLER_TOOLBAR_DATABASE_FIX', false, false);
JToolBarHelper::divider();
parent::addToolbar();
JToolBarHelper::help('JHELP_EXTENSIONS_EXTENSION_MANAGER_DATABASE');
}
示例5: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$canDo = InstallerHelper::getActions();
JToolBarHelper::title(JText::_('COM_INSTALLER_HEADER_' . $this->getName()), 'install.png');
if ($canDo->get('core.admin')) {
JToolBarHelper::preferences('com_installer');
JToolBarHelper::divider();
}
// Document
$document = JFactory::getDocument();
$document->setTitle(JText::_('COM_INSTALLER_TITLE_' . $this->getName()));
}
示例6: addToolbar
/**
* Add the page title and toolbar.
*
* @return void
*
* @since 1.6
*/
protected function addToolbar()
{
$canDo = InstallerHelper::getActions();
/*
* Set toolbar items for the page
*/
JToolbarHelper::custom('discover.install', 'upload', 'upload', 'JTOOLBAR_INSTALL', true, false);
JToolbarHelper::custom('discover.refresh', 'refresh', 'refresh', 'COM_INSTALLER_TOOLBAR_DISCOVER', false, false);
JToolbarHelper::divider();
parent::addToolbar();
JToolbarHelper::help('JHELP_EXTENSIONS_EXTENSION_MANAGER_DISCOVER');
}
示例7: addToolbar
/**
* Add the page title and toolbar.
*
* @since 2.5
*/
protected function addToolbar()
{
$canDo = InstallerHelper::getActions();
JToolBarHelper::custom('site.install', 'upload', 'upload', 'JTOOLBAR_INSTALL', true, false);
JToolBarHelper::custom('site.find', 'refresh', 'refresh', 'COM_INSTALLER_TOOLBAR_FIND_EXTENSIONS', false, false);
JToolBarHelper::custom('site.purge', 'purge', 'purge', 'JTOOLBAR_PURGE_CACHE', false, false);
JToolBarHelper::divider();
parent::addToolbar();
JToolBarHelper::help('JHELP_EXTENSIONS_EXTENSION_MANAGER_UPDATE');
JToolBarHelper::title(JText::sprintf('COM_INSTALLER_TITLE_SITE', $this->distro->name), 'install');
$document = JFactory::getDocument();
$document->setTitle(JText::sprintf('COM_INSTALLER_TITLE_' . $this->getName(), $this->distro->name));
}
示例8: addToolbar
/**
* Add the page title and toolbar.
*
* @return void
*/
protected function addToolbar()
{
$canDo = InstallerHelper::getActions();
JToolBarHelper::title(JText::_('COM_INSTALLER_HEADER_' . $this->getName()), 'install.png');
if ($canDo->get('core.admin')) {
JToolBarHelper::custom('languages.install', 'upload', 'upload', 'COM_INSTALLER_TOOLBAR_INSTALL', true, false);
JToolBarHelper::custom('languages.find', 'refresh', 'refresh', 'COM_INSTALLER_TOOLBAR_FIND_LANGUAGES', false, false);
JToolBarHelper::divider();
parent::addToolbar();
// TODO: this help screen will need to be created
JToolBarHelper::help('JHELP_EXTENSIONS_EXTENSION_MANAGER_LANGUAGES');
}
}
示例9: _addToolbar16
private function _addToolbar16()
{
$canDo = InstallerHelper::getActions();
JToolBarHelper::title(JText::_('COM_INSTALLER_HEADER_INSTALL'), 'install.png');
if ($canDo->get('core.admin')) {
JToolBarHelper::preferences('com_installer');
JToolBarHelper::divider();
}
// Document
$document = JFactory::getDocument();
$document->setTitle(JText::_('COM_INSTALLER_HEADER_INSTALL'));
JToolBarHelper::help('JHELP_EXTENSIONS_EXTENSION_MANAGER_INSTALL');
}
示例10: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$canDo = InstallerHelper::getActions();
if ($canDo->get('core.edit.state')) {
JToolBarHelper::publish('manage.publish', 'JTOOLBAR_ENABLE', true);
JToolBarHelper::unpublish('manage.unpublish', 'JTOOLBAR_DISABLE', true);
JToolBarHelper::divider();
}
JToolBarHelper::custom('manage.refresh', 'refresh', 'refresh', 'JTOOLBAR_REFRESH_CACHE', true);
JToolBarHelper::divider();
if ($canDo->get('core.delete')) {
JToolBarHelper::deleteList('', 'manage.remove', 'JTOOLBAR_UNINSTALL');
JToolBarHelper::divider();
}
parent::addToolbar();
JToolBarHelper::help('JHELP_EXTENSIONS_EXTENSION_MANAGER_MANAGE');
}
示例11: addToolbar
/**
* Add the page title and toolbar.
*
* @return void
*
* @since 1.6
*/
protected function addToolbar()
{
$canDo = InstallerHelper::getActions();
if ($canDo->get('core.edit.state')) {
JToolbarHelper::publish('manage.publish', 'JTOOLBAR_ENABLE', true);
JToolbarHelper::unpublish('manage.unpublish', 'JTOOLBAR_DISABLE', true);
JToolbarHelper::divider();
}
JToolbarHelper::custom('manage.refresh', 'refresh', 'refresh', 'JTOOLBAR_REFRESH_CACHE', true);
JToolbarHelper::divider();
if ($canDo->get('core.delete')) {
JToolbarHelper::deleteList('', 'manage.remove', 'JTOOLBAR_UNINSTALL');
JToolbarHelper::divider();
}
JToolbarHelper::help('JHELP_EXTENSIONS_EXTENSION_MANAGER_MANAGE');
JHtmlSidebar::setAction('index.php?option=com_installer&view=manage');
JHtmlSidebar::addFilter(JText::_('COM_INSTALLER_VALUE_CLIENT_SELECT'), 'filter_client_id', JHtml::_('select.options', array('0' => 'JSITE', '1' => 'JADMINISTRATOR'), 'value', 'text', $this->state->get('filter.client_id'), true));
JHtmlSidebar::addFilter(JText::_('COM_INSTALLER_VALUE_STATE_SELECT'), 'filter_status', JHtml::_('select.options', array('0' => 'JDISABLED', '1' => 'JENABLED', '2' => 'JPROTECTED'), 'value', 'text', $this->state->get('filter.status'), true));
JHtmlSidebar::addFilter(JText::_('COM_INSTALLER_VALUE_TYPE_SELECT'), 'filter_type', JHtml::_('select.options', InstallerHelper::getExtensionTypes(), 'value', 'text', $this->state->get('filter.type'), true));
JHtmlSidebar::addFilter(JText::_('COM_INSTALLER_VALUE_FOLDER_SELECT'), 'filter_group', JHtml::_('select.options', array_merge(InstallerHelper::getExtensionGroupes(), array('*' => JText::_('COM_INSTALLER_VALUE_FOLDER_NONAPPLICABLE'))), 'value', 'text', $this->state->get('filter.group'), true));
parent::addToolbar();
}