本文整理汇总了PHP中JControllerAdmin类的典型用法代码示例。如果您正苦于以下问题:PHP JControllerAdmin类的具体用法?PHP JControllerAdmin怎么用?PHP JControllerAdmin使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JControllerAdmin类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
/**
* Removes an item.
*
* Overrides JControllerAdmin::delete to check the core.admin permission.
*
* @return void
*
* @since 2.0
*/
public function delete()
{
if (!JFactory::getUser()->authorise('core.admin', $this->option)) {
JError::raiseError(500, JText::_('JERROR_ALERTNOAUTHOR'));
jexit();
}
return parent::delete();
}
示例2: publish
public function publish()
{
parent::publish();
$extra_id = JFactory::getApplication()->input->get('extra_id', 0, 'int');
$extra_id_url = !empty($extra_id) ? '&extra_id=' . $extra_id : '';
$this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list . $extra_id_url, false));
}
示例3: delete
public function delete()
{
// Get items to remove from the request and reverse the order to delete child albums first
$cid = JFactory::getApplication()->input->get('cid', array(), 'array');
JFactory::getApplication()->input->set('cid', array_reverse($cid));
parent::delete();
}
示例4: __construct
public function __construct($config = array())
{
parent::__construct($config);
global $ext_name, $ext_name_com;
$this->ext_name = $ext_name;
$this->ext_name_com = JFactory::getApplication()->input->get('extension', $ext_name_com, 'string');
}
示例5: createView
/**
* Overrides method to first lookup into potential extension for the view.
* @since 1.5
*/
protected function createView($name, $prefix = '', $type = '', $config = array())
{
$extensions = JoomleagueHelper::getExtensions(JRequest::getInt('p'));
foreach ($extensions as $e => $extension) {
$result = null;
// Clean the view name
$viewName = preg_replace('/[^A-Z0-9_]/i', '', $name);
$classPrefix = preg_replace('/[^A-Z0-9_]/i', '', $prefix);
$viewType = preg_replace('/[^A-Z0-9_]/i', '', $type);
// Build the view class name
$viewClassExtension = $classPrefix . $viewName . ucfirst($extension);
if (!class_exists($viewClassExtension)) {
jimport('joomla.filesystem.path');
$path = JPath::find($this->paths['view'], $this->createFileName('view', array('name' => $viewName, 'type' => $viewType)));
if ($path) {
require_once $path;
if (class_exists($viewClassExtension)) {
$result = new $viewClassExtension($config);
return $result;
}
}
} else {
$result = new $viewClassExtension($config);
return $result;
}
}
// Still here ? Then the extension doesn't override this, use regular view
return parent::createView($name, $prefix, $type, $config);
}
示例6: delete
public function delete()
{
parent::delete();
$this->input = $this->input->post->get('trieda_id', 0, 'int');
$this->setRedirect(JRoute::_('index.php?option=com_absolventi&view=ziacilist&trieda_id=' . $this->input, false));
$this->redirect;
}
示例7: publish
public function publish()
{
parent::publish();
if (!file_exists(JPATH_ADMINISTRATOR . '/components/com_jhackguard/data/.rules_need_update')) {
file_put_contents(JPATH_ADMINISTRATOR . '/components/com_jhackguard/data/.rules_need_update', "1");
}
}
示例8: __construct
public function __construct($config = array())
{
parent::__construct($config);
$this->registerTask('view_torrents', 'changeTypeYes');
$this->registerTask('no_view_torrents', 'changeTypeNo');
$this->registerTask('edit_torrents', 'changeTypeYes');
$this->registerTask('no_edit_torrents', 'changeTypeNo');
$this->registerTask('delete_torrents', 'changeTypeYes');
$this->registerTask('no_delete_torrents', 'changeTypeNo');
$this->registerTask('upload_torrents', 'changeTypeYes');
$this->registerTask('no_upload_torrents', 'changeTypeNo');
$this->registerTask('download_torrents', 'changeTypeYes');
$this->registerTask('no_download_torrents', 'changeTypeNo');
$this->registerTask('can_leech', 'changeTypeYes');
$this->registerTask('no_can_leech', 'changeTypeNo');
$this->registerTask('view_comments', 'changeTypeYes');
$this->registerTask('no_view_comments', 'changeTypeNo');
$this->registerTask('write_comments', 'changeTypeYes');
$this->registerTask('no_write_comments', 'changeTypeNo');
$this->registerTask('edit_comments', 'changeTypeYes');
$this->registerTask('no_edit_comments', 'changeTypeNo');
$this->registerTask('delete_comments', 'changeTypeYes');
$this->registerTask('no_delete_comments', 'changeTypeNo');
$this->registerTask('autopublish_comments', 'changeTypeYes');
$this->registerTask('no_autopublish_comments', 'changeTypeNo');
$this->registerTask('state', 'changeTypeYes');
$this->registerTask('no_state', 'changeTypeNo');
}
示例9: delete
public function delete()
{
/*
* получаем имя файла из записи по ID
* удаляем файл
* выполняем родительский метод
*/
$cid = JFactory::getApplication()->input->get('cid', array(), 'array');
if (is_array($cid) && count($cid) > 0) {
$arFilesToDelete = array();
foreach ($cid as $id) {
$db = JFactory::getDBO();
$q = "SELECT `id`, `filename` FROM #__downfiles WHERE id = {$id}";
$res = $db->setQuery($q);
$data_row = $res->loadAssoc();
$arFilesToDelete[] = $data_row["filename"];
}
jimport('joomla.filesystem.file');
foreach ($arFilesToDelete as $fname) {
JFile::delete(JPATH_ROOT . '/' . $fname);
}
} else {
JLog::add(JText::_($this->text_prefix . '_NO_ITEM_SELECTED'), JLog::WARNING, 'jerror');
}
parent::delete();
}
示例10:
function __construct()
{
parent::__construct();
$this->registerTask("edit", "editAuthor");
$this->registerTask("apply", "save");
$this->_model = $this->getModel('Customer');
}
示例11: getModel
/**
* Proxy for getModel.
*/
public function getModel($name = 'Cssmanager', $prefix = 'JEMModel', $config = array())
{
$model = parent::getModel($name, $prefix, array(
'ignore_request' => true
));
return $model;
}
示例12: getModel
/**
* Proxy for getModel.
* @since 2.5
*/
public function getModel($name = 'TSJs', $prefix = 'TSJModel', $config = array('ignore_request' => true))
{
//JFactory::getApplication()->enqueueMessage('Debug: TSJControllerTSJs::getModel');
$model = parent::getModel($name, $prefix, $config);
//JFactory::getApplication()->enqueueMessage('Debug: TSJControllerTSJs::getModel model='.$model);
return $model;
}
示例13:
function __construct()
{
parent::__construct();
$this->registerDefaultTask('get_survey_list');
$this->registerTask('surveys.publish', 'publish_list');
$this->registerTask('surveys.unpublish', 'unpublish_list');
$this->registerTask('publish_item', 'publish_item');
$this->registerTask('unpublish_item', 'unpublish_item');
$this->registerTask('surveys.delete', 'delete_surveys');
$this->registerTask('set_private', 'set_private_survey');
$this->registerTask('unset_private', 'unset_private_survey');
$this->registerTask('set_anonymous', 'set_anonymous_survey');
$this->registerTask('unset_anonymous', 'unset_anonymous_survey');
$this->registerTask('set_publicperms', 'set_public_permissions');
$this->registerTask('unset_publicperms', 'unset_public_permissions');
$this->registerTask('refresh', 'refresh_counters');
$this->registerTask('responses', 'get_responses');
$this->registerTask('responses.delete', 'delete_responses');
$this->registerTask('copy', 'copy_surveys');
$this->registerTask('add', 'add_survey');
$this->registerTask('edit', 'edit_survey');
$lang = JFactory::getLanguage();
$lang->load(S_APP_NAME, JPATH_ROOT);
JLoader::import('joomla.application.component.model');
JLoader::import('survey', JPATH_ROOT . DS . 'components' . DS . S_APP_NAME . DS . 'models');
}
示例14: getModel
public function getModel($name = 'Profiles', $prefix = 'GAnalyticsModel')
{
if (JRequest::getVar('task', '') == 'delete' || JRequest::getVar('task', '') == 'profiles.delete') {
$name = 'Profile';
}
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
return $model;
}
示例15: getModel
public function getModel($name = '', $prefix = '', $config = array('ignore_request' => true))
{
$option = JRequest::getVar('option');
$clearName = substr($option, 4);
$prefix = ucfirst($clearName) . 'Model';
$name = str_replace('s', '', str_replace(ucfirst($clearName) . 'Controller', '', get_class()));
return parent::getModel($name, $prefix, $config);
}