本文整理汇总了PHP中Wikia::linkTag方法的典型用法代码示例。如果您正苦于以下问题:PHP Wikia::linkTag方法的具体用法?PHP Wikia::linkTag怎么用?PHP Wikia::linkTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Wikia
的用法示例。
在下文中一共展示了Wikia::linkTag方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
/**
* execute
*
* main entry point
* @author eloy@wikia.com
*
* @param string $subpage: subpage of Title
*
* @return nothing
*/
public function execute($subpage)
{
global $wgUser, $wgOut, $wgRequest, $wgWikiaBatchTasks;
if ($wgUser->isBlocked()) {
throw new UserBlockedError($this->getUser()->mBlock);
}
if (wfReadOnly()) {
$wgOut->readOnlyPage();
return;
}
if (!$wgUser->isAllowed('taskmanager')) {
$this->displayRestrictionError();
return;
}
$wgOut->setPageTitle(wfMsg('taskmanager_title'));
$wgOut->setRobotpolicy('noindex,nofollow');
$wgOut->setArticleRelated(false);
$this->mTitle = Title::makeTitle(NS_SPECIAL, "TaskManager");
$this->mAction = $wgRequest->getVal("action");
if ($this->mAction) {
switch ($this->mAction) {
case "task":
#--- get task type and class
$sClass = $wgRequest->getText("wpType", null);
if (is_subclass_of($sClass, "BatchTask")) {
$oObject = new $sClass();
#--- get form for this class
$wgOut->addHTML($oObject->getForm($this->mTitle));
}
$wgOut->addHTML(XML::element("a", array("href" => $this->mTitle->getLocalUrl(), wfMsg("taskmanager_tasklist"))));
break;
case "save":
#--- get task type and class
$sType = $wgRequest->getText("wpType", null);
$sClass = $wgWikiaBatchTasks[$sType];
if (is_subclass_of($sClass, "BatchTask")) {
$oObject = new $sClass();
$aFormData = $oObject->submitForm();
if ($aFormData === true) {
#--- all correct, show new task form
$this->loadTaskForm();
} else {
#--- errors, show again form for choosen task
$wgOut->addHTML($oObject->getForm($this->mTitle, $aFormData));
}
}
$wgOut->addHTML(Wikia::linkTag($this->mTitle->getLocalUrl(), wfMsg("taskmanager_tasklist")));
break;
/**
* get task form for given id, NOTE - it should check if
* task is editable or not
*/
/**
* get task form for given id, NOTE - it should check if
* task is editable or not
*/
case "edit":
$oTask = $this->loadTaskData($wgRequest->getVal("id"));
#--- nothing so far
break;
/**
* remove task from database, carefull - without confirmation
* so far
*/
/**
* remove task from database, carefull - without confirmation
* so far
*/
case "remove":
#--- check if task exists
$oTask = $this->loadTaskData($wgRequest->getVal("id"));
if (!empty($oTask->task_id)) {
$this->removeTask($oTask->task_id);
$wgOut->addHTML(Wikia::successbox("Task nr {$oTask->task_id} removed"));
} else {
$wgOut->addHTML(Wikia::errorbox("Task doesn't exists"));
}
$this->loadTaskForm();
$this->loadPager();
break;
/**
* start task, possible only when task in TASK_WAITING state
*/
/**
* start task, possible only when task in TASK_WAITING state
*/
case "start":
#--- check if task exists
$oTask = $this->loadTaskData($wgRequest->getVal("id"));
if (!empty($oTask->task_id) && $oTask->task_status == TASK_WAITING) {
//.........这里部分代码省略.........