本文整理汇总了PHP中Hubzero\Component\SiteController::execute方法的典型用法代码示例。如果您正苦于以下问题:PHP SiteController::execute方法的具体用法?PHP SiteController::execute怎么用?PHP SiteController::execute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hubzero\Component\SiteController
的用法示例。
在下文中一共展示了SiteController::execute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
/**
* Override execute method to init developer model
*
* @return void
*/
public function execute()
{
// authorize application usage
$this->_authorize('application', Request::getInt('id', null));
// call parent execute
parent::execute();
}
示例2: execute
/**
* Execute a task
*
* @return void
*/
public function execute()
{
$this->gid = Request::getVar('gid', '');
if (!$this->gid) {
App::redirect('index.php?option=' . $this->_option);
return;
}
// Load the course page
$this->course = Models\Course::getInstance($this->gid);
// Ensure we found the course info
if (!$this->course->exists() || $this->course->isDeleted() || $this->course->isUnpublished()) {
return App::abort(404, Lang::txt('COM_COURSES_NO_COURSE_FOUND'));
}
// No offering provided
if (!($offering = Request::getVar('offering', ''))) {
App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=course&gid=' . $this->course->get('alias')));
return;
}
// Ensure we found the course info
if (!$this->course->offering($offering)->exists() || $this->course->offering($offering)->isDeleted() || !$this->course->offering($offering)->access('manage', 'section') && $this->course->offering($offering)->isUnpublished()) {
return App::abort(404, Lang::txt('COM_COURSES_NO_OFFERING_FOUND'));
}
// Ensure the course has been published or has been approved
if (!$this->course->offering()->access('manage', 'section') && !$this->course->isAvailable()) {
return App::abort(404, Lang::txt('COM_COURSES_NOT_PUBLISHED'));
}
parent::execute();
}
示例3: execute
/**
* Determines task being called and attempts to execute it
*
* @return void
*/
public function execute()
{
if (User::isGuest()) {
App::abort(403, Lang::txt('COM_RESOURCES_ALERTLOGIN_REQUIRED'));
}
parent::execute();
}
示例4: execute
/**
* Execute a task
*
* @return void
*/
public function execute()
{
// Get the component parameters
$aconfig = Component::params('com_answers');
$this->infolink = $aconfig->get('infolink', '/kb/points/');
parent::execute();
}
示例5: execute
/**
* Execute a task
*
* @return void
*/
public function execute()
{
$this->warehouse = new Warehouse();
$user = User::getRoot();
$this->warehouse->addAccessLevels($user->getAuthorisedViewLevels());
// Get the task
$this->_task = Request::getCmd('task', '');
if (empty($this->_task)) {
$this->_task = 'home';
$this->registerTask('__default', $this->_task);
}
$executed = false;
if (!method_exists($this, $this->_task . 'Task')) {
// Try to find a corresponding collection
$cId = $this->warehouse->collectionExists($this->_task);
if ($cId) {
// if match is found -- browse collection
$executed = true;
$this->browseCollection($cId);
} else {
App::abort(404, Lang::txt('Collection Not Found'));
}
}
if (!$executed) {
parent::execute();
}
}
示例6: execute
/**
* Execute function
*
* @return void
*/
public function execute()
{
// Is component on?
if (!$this->config->get('component_on', 0)) {
App::redirect('/');
return;
}
// Publishing enabled?
$this->_publishing = Plugin::isEnabled('projects', 'publications') ? 1 : 0;
// Setup complete?
$this->_setupComplete = $this->config->get('confirm_step', 0) ? 3 : 2;
// Include scripts
$this->_includeScripts();
// Incoming project identifier
$id = Request::getInt('id', 0);
$alias = Request::getVar('alias', '');
$this->_identifier = $id ? $id : $alias;
// Incoming
$this->_task = strtolower(Request::getWord('task', ''));
$this->_gid = Request::getVar('gid', 0);
// Model
$this->model = new Models\Project($this->_identifier);
// Execute the task
parent::execute();
}
示例7: execute
/**
* Execute a task
*
* @return void
*/
public function execute()
{
$this->warehouse = new Warehouse();
$user = User::getRoot();
$this->warehouse->addAccessLevels($user->getAuthorisedViewLevels());
parent::execute();
}
示例8: execute
/**
* Determines task being called and attempts to execute it
*
* @return void
*/
public function execute()
{
// Set configs
$this->_setConfigs();
// Incoming
$this->_incoming();
// Resource map
if (strrpos(strtolower($this->_alias), '.rdf') > 0) {
$this->_resourceMap();
return;
}
// Set the default task
$this->registerTask('__default', 'intro');
// Register tasks
$this->registerTask('view', 'page');
$this->registerTask('download', 'serve');
$this->registerTask('video', 'serve');
$this->registerTask('play', 'serve');
$this->registerTask('watch', 'serve');
$this->registerTask('wiki', 'wikipage');
$this->registerTask('submit', 'contribute');
$this->registerTask('edit', 'contribute');
$this->registerTask('start', 'contribute');
$this->registerTask('publication', 'contribute');
$this->_task = trim(Request::getVar('task', ''));
if (($this->_id || $this->_alias) && !$this->_task) {
$this->_task = 'page';
} elseif (!$this->_task) {
$this->_task = 'intro';
}
parent::execute();
}
示例9: execute
/**
* Execute a task
*
* @return void
*/
public function execute()
{
// Load the course page
$this->course = Models\Course::getInstance(Request::getVar('gid', ''));
$this->registerTask('edit', 'display');
parent::execute();
}
示例10: execute
/**
* Execute a task
*
* @return void
*/
public function execute()
{
$this->config->set('banking', \Component::params('com_members')->get('bankAccounts'));
$this->registerTask('__default', 'search');
$this->registerTask('display', 'search');
$this->registerTask('latest', 'latest.rss');
parent::execute();
}
示例11: execute
/**
* Determines task being called and attempts to execute it
*
* @return void
*/
public function execute()
{
$this->_authorize();
// Load the com_resources component config
$rconfig = Component::params('com_resources');
$this->rconfig = $rconfig;
parent::execute();
}
示例12: execute
/**
* Execute a task
*
* @return void
*/
public function execute()
{
$this->model = new Manager('site', 0);
$this->registerTask('latest', 'feed');
$this->registerTask('latest', 'feed.rss');
$this->registerTask('latest', 'latest.rss');
parent::execute();
}
示例13: execute
/**
* Determines task being called and attempts to execute it
*
* @return void
*/
public function execute()
{
$this->_authorize('collection');
$this->_authorize('item');
$this->registerTask('__default', 'posts');
$this->registerTask('all', 'collections');
parent::execute();
}
示例14: execute
/**
* Execute a task
*
* @return void
*/
public function execute()
{
$parts = explode('/', $_SERVER['REQUEST_URI']);
$file = array_pop($parts);
if (substr(strtolower($file), 0, 5) == 'image' || substr(strtolower($file), 0, 4) == 'file') {
Request::setVar('task', 'download');
}
parent::execute();
}
示例15: execute
/**
* Determines task being called and attempts to execute it
*
* @return void
*/
public function execute()
{
// Check if they are logged in
if (User::isGuest()) {
App::abort(403, Lang::txt('You must be logged in to access.'));
return;
}
parent::execute();
}