php wcf-system-request-LinkHandler类(方法)实例源码

下面列出了php wcf-system-request-LinkHandler 类(方法)源码代码实例,从而了解它的用法。

作者:jacbo    项目:JCoin   
/**
  * @see \wcf\system\event\listener\IParameterizedEventListener::execute()
  */
 public function execute($eventObj, $className, $eventName, array &$parameters)
 {
     if (!MODULE_CONVERSATION || !MODULE_JCOINS || JCOINS_RECEIVECOINS_ADDCONVERSATIONREPLY == 0) {
         return;
     }
     if ($eventObj->getActionName() != 'create' && $eventObj->getActionName() != 'quickReply') {
         return;
     }
     // catch 3rdparty plugins, which creates Conversations without an logged in user
     if (WCF::getUser()->userID == 0) {
         return;
     }
     $parameters = $eventObj->getParameters();
     if (isset($parameters['isFirstPost'])) {
         return;
     }
     if ($eventObj->getActionName() == 'create') {
         $return = $eventObj->getReturnValues();
         $conversation = $return['returnValues']->getConversation();
         $this->statementAction = new UserJcoinsStatementAction(array(), 'create', array('data' => array('reason' => 'wcf.jcoins.statement.conversationreplyadd.recive', 'sum' => JCOINS_RECEIVECOINS_ADDCONVERSATIONREPLY, 'additionalData' => array('title' => $conversation->subject), 'link' => $return['returnValues']->getLink()), 'changeBalance' => 1));
         $this->statementAction->validateAction();
         $this->statementAction->executeAction();
     } else {
         $conversation = new \wcf\data\conversation\Conversation(isset($parameters['objectID']) ? intval($parameters['objectID']) : 0);
         $this->statementAction = new UserJcoinsStatementAction(array(), 'create', array('data' => array('reason' => 'wcf.jcoins.statement.conversationadd.recive', 'sum' => JCOINS_RECEIVECOINS_CREATECONVERSATION, 'additionalData' => array('title' => $conversation->subject), 'link' => \wcf\system\request\LinkHandler::getInstance()->getLink('Conversation', array('object' => $conversation))), 'changeBalance' => 1));
         $this->statementAction->validateAction();
         $this->statementAction->executeAction();
     }
 }

作者:Gribori    项目:de.incendium.cms.new   
/**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // add breadcrumbs
     WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('cms.header.menu.news'), LinkHandler::getInstance()->getLink('NewsOverview', array('application' => 'cms'))));
     WCF::getBreadcrumbs()->add($this->entry->getDecoratedObject()->getBreadcrumb());
 }

作者:nick-stroh    项目:WC   
/**
  * @see	\wcf\system\search\acp\IACPSearchResultProvider::search()
  */
 public function search($query)
 {
     if (!WCF::getSession()->getPermission('admin.system.package.canUpdatePackage') && !WCF::getSession()->getPermission('admin.system.package.canUninstallPackage')) {
         return array();
     }
     $results = array();
     // search by language item
     $conditions = new PreparedStatementConditionBuilder();
     $conditions->add("languageID = ?", array(WCF::getLanguage()->languageID));
     $conditions->add("languageItem LIKE ?", array('wcf.acp.package.packageName.package%'));
     $conditions->add("languageItemValue LIKE ?", array('%' . $query . '%'));
     $sql = "SELECT\t\tlanguageItem\n\t\t\tFROM\t\twcf" . WCF_N . "_language_item\n\t\t\t" . $conditions;
     $statement = WCF::getDB()->prepareStatement($sql);
     $statement->execute($conditions->getParameters());
     $packageIDs = array();
     while ($row = $statement->fetchArray()) {
         $packageIDs[] = str_replace('wcf.acp.package.packageName.package', '', $row['languageItem']);
     }
     $conditions = new PreparedStatementConditionBuilder(false);
     if (!empty($packageIDs)) {
         $conditions->add("packageID IN (?)", array($packageIDs));
     }
     $sql = "SELECT\t*\n\t\t\tFROM\twcf" . WCF_N . "_package\n\t\t\tWHERE\tpackageName LIKE ?\n\t\t\t\tOR package LIKE ?\n\t\t\t\t" . (count($conditions->getParameters()) ? "OR " . $conditions : "");
     $statement = WCF::getDB()->prepareStatement($sql);
     $statement->execute(array_merge(array($query . '%', $query . '%'), $conditions->getParameters()));
     while ($package = $statement->fetchObject('wcf\\data\\package\\Package')) {
         $results[] = new ACPSearchResult($package->getName(), LinkHandler::getInstance()->getLink('Package', array('id' => $package->packageID, 'title' => $package->getName())));
     }
     return $results;
 }

作者:0xLeo    项目:WC   
/**
	 * @see	wcf\system\clipboard\action\IClipboardAction::execute()
	 */
	public function execute(array $objects, $actionName) {
		$item = parent::execute($objects, $actionName);
		
		if ($item === null) {
			return null;
		}
		
		// handle actions
		switch ($actionName) {
			case 'assignToGroup':
				$item->setURL(LinkHandler::getInstance()->getLink('UserAssignToGroup'));
			break;
			
			case 'delete':
				$item->addInternalData('confirmMessage', WCF::getLanguage()->getDynamicVariable('wcf.clipboard.item.com.woltlab.wcf.user.delete.confirmMessage', array(
					'count' => $item->getCount()
				)));
			break;
			
			case 'exportMailAddress':
				$item->setURL(LinkHandler::getInstance()->getLink('UserEmailAddressExport'));
			break;
			
			case 'sendMail':
				$item->setURL(LinkHandler::getInstance()->getLink('UserMail'));
			break;
		}
		
		return $item;
	}

作者:knz    项目:Firebal   
public function getLink($query = '')
 {
     if ($query) {
         return LinkHandler::getInstance()->getLink('Page', array('alias' => $this->getDecoratedObject()->getAlias(), 'application' => 'cms', 'highlight' => urlencode($query)));
     }
     return $this->getDecoratedObject()->getLink();
 }

作者:wouk    项目:com.woltlab.wcf.conversatio   
/**
  * @see	\wcf\data\search\ISearchResultObject::getLink()
  */
 public function getLink($query = '')
 {
     if ($query) {
         return LinkHandler::getInstance()->getLink('Conversation', array('object' => $this->getConversation(), 'messageID' => $this->messageID, 'highlight' => urlencode($query)), '#message' . $this->messageID);
     }
     return $this->getDecoratedObject()->getLink();
 }

作者:ZerGabrie    项目:WC   
/**
  * @see	wcf\system\clipboard\action\IClipboardAction::execute()
  */
 public function execute(array $objects, $actionName, $typeData = array())
 {
     $item = new ClipboardEditorItem();
     // handle actions
     switch ($actionName) {
         case 'assignToGroup':
             $item->setName('user.assignToGroup');
             $item->setURL(LinkHandler::getInstance()->getLink('UserAssignToGroup'));
             break;
         case 'delete':
             $userIDs = $this->validateDelete($objects);
             if (!count($userIDs)) {
                 return null;
             }
             $item->addInternalData('confirmMessage', WCF::getLanguage()->getDynamicVariable('wcf.clipboard.item.user.delete.confirmMessage', array('count' => count($userIDs))));
             $item->addParameter('actionName', 'delete');
             $item->addParameter('className', 'wcf\\data\\user\\UserAction');
             $item->addParameter('objectIDs', $userIDs);
             $item->setName('user.delete');
             break;
         case 'exportMailAddress':
             $item->setName('user.exportMailAddress');
             $item->setURL(LinkHandler::getInstance()->getLink('UserEmailAddressExport'));
             break;
         case 'sendMail':
             $item->setName('user.sendMail');
             $item->setURL(LinkHandler::getInstance()->getLink('UserMail'));
             break;
         default:
             throw new SystemException("action '" . $actionName . "' is invalid");
             break;
     }
     return $item;
 }

作者:Gribori    项目:de.incendium.cms.linklis   
/**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // stats
     if (LINKLIST_ENABLE_STATISTICS) {
         $this->stats = array_merge(StatsCacheBuilder::getInstance()->getData(), UserStatsCacheBuilder::getInstance()->getData());
     }
     // get categories
     $categoryTree = new LinklistCategoryNodeTree('de.incendium.linklist.category');
     $this->categoryList = $categoryTree->getIterator();
     $this->categoryList->setMaxDepth(0);
     // get featured entries
     $this->featuredEntryList = new AccessibleEntryList();
     $this->featuredEntryList->getConditionBuilder()->add('entry.isFeatured = ?', array(1));
     $this->featuredEntryList->sqlLimit = 10;
     $this->featuredEntryList->sqlOrderBy = 'RAND()';
     $this->featuredEntryList->readObjects();
     // remove default breadcrumb entry and set current page as 'website'
     if (WCF::isLandingPage()) {
         MetaTagHandler::getInstance()->addTag('og:url', 'og:url', LinkHandler::getInstance()->getLink('Linklist', array('application' => 'linklist')), true);
         MetaTagHandler::getInstance()->addTag('og:type', 'og:type', 'website', true);
         MetaTagHandler::getInstance()->addTag('og:title', 'og:title', WCF::getLanguage()->get(PAGE_TITLE), true);
         MetaTagHandler::getInstance()->addTag('og:description', 'og:description', WCF::getLanguage()->get(PAGE_DESCRIPTION), true);
     }
 }

作者:nick-stroh    项目:WC   
/**
  * @see	\wcf\system\dashboard\box\AbstractContentDashboardBox::render()
  */
 protected function render()
 {
     if (count($this->eventList)) {
         $this->titleLink = LinkHandler::getInstance()->getLink('RecentActivityList');
         WCF::getTPL()->assign(array('eventList' => $this->eventList));
         return WCF::getTPL()->fetch('dashboardBoxRecentActivitySidebar');
     }
 }

作者:nick-stroh    项目:WC   
/**
  * @see	\wcf\system\user\notification\event\IUserNotificationEvent::getLink()
  */
 public function getLink()
 {
     $owner = WCF::getUser();
     if ($this->additionalData['objectID'] != WCF::getUser()->userID) {
         $owner = CommentDataHandler::getInstance()->getUser($this->additionalData['objectID']);
     }
     return LinkHandler::getInstance()->getLink('User', array('object' => $owner), '#wall');
 }

作者:nick-stroh    项目:WC   
/**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // add breadcrumbs
     if (MODULE_MEMBERS_LIST) {
         WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('wcf.user.members'), LinkHandler::getInstance()->getLink('MembersList')));
     }
 }

作者:nick-stroh    项目:WC   
/**
  * @see	\wcf\system\menu\ITreeMenuItem::getLink()
  */
 public function getLink()
 {
     // external link
     if (!$this->menuItemController) {
         return $this->menuItemLink;
     }
     $this->parseController();
     return LinkHandler::getInstance()->getLink($this->controller, array('application' => $this->application), $this->menuItemLink);
 }

作者:nick-stroh    项目:WC   
/**
  * @see	\wcf\form\IForm::save()
  */
 public function save()
 {
     parent::save();
     WCF::getSession()->register('disclaimerAccepted', true);
     $this->saved();
     WCF::getSession()->update();
     HeaderUtil::redirect(LinkHandler::getInstance()->getLink('Register'));
     exit;
 }

作者:ZerGabrie    项目:WC   
/**
  * @see wcf\system\menu\ITreeMenuItem::getLink()
  */
 public function getLink()
 {
     $abbreviation = ApplicationHandler::getInstance()->getAbbreviation($this->packageID);
     $parameters = array();
     if ($abbreviation) {
         $parameters['application'] = $abbreviation;
     }
     return LinkHandler::getInstance()->getLink(null, $parameters, $this->menuItemLink);
 }

作者:nick-stroh    项目:WC   
/**
  * @see	\wcf\system\dashboard\box\AbstractContentDashboardBox::render()
  */
 protected function render()
 {
     if (empty($this->usersOnlineList) || !count($this->usersOnlineList->getObjects())) {
         return '';
     }
     $this->titleLink = LinkHandler::getInstance()->getLink('UsersOnlineList');
     WCF::getTPL()->assign(array('usersOnlineList' => $this->usersOnlineList));
     return WCF::getTPL()->fetch('dashboardBoxUsersOnlineSidebar');
 }

作者:nick-stroh    项目:WC   
/**
  * @see	\wcf\system\menu\ITreeMenuItem::getLink()
  */
 public function getLink()
 {
     // external link
     if (!$this->menuItemController) {
         return WCF::getLanguage()->get($this->menuItemLink);
     }
     $this->parseController();
     return LinkHandler::getInstance()->getLink($this->controller, array('application' => $this->application, 'forceFrontend' => true), WCF::getLanguage()->get($this->menuItemLink));
 }

作者:joshuarueswe    项目:de.voolia.new   
/**
  * @see	\wcf\form\IForm::save()
  */
 public function save()
 {
     MessageForm::save();
     // save the news update
     $this->objectAction = new NewsUpdateAction(array($this->update), 'update', array('data' => array('subject' => $this->subject, 'text' => $this->text)));
     $this->objectAction->executeAction();
     $this->saved();
     HeaderUtil::redirect(LinkHandler::getInstance()->getLink('News', array('application' => 'news', 'object' => $this->news)));
     exit;
 }

作者:nick-stroh    项目:WC   
/**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     $this->eventList = new ViewableUserActivityEventList();
     $this->eventList->readObjects();
     // add breadcrumbs
     if (MODULE_MEMBERS_LIST) {
         WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('wcf.user.members'), LinkHandler::getInstance()->getLink('MembersList')));
     }
 }

作者:jacbo    项目:JCoin   
/**
  * @see \wcf\system\jcoins\shop\item\type\IShopItem::boughtAction()
  */
 public function boughtAction(array $paramters)
 {
     parent::boughtAction($paramters);
     $paramters = $this->prepare($paramters);
     if ($paramters['redirect'] == 1) {
         return array('location' => $paramters['source']);
     }
     // @TODO
     return array('location' => LinkHandler::getInstance()->getLink('JCoinsShopDownload', array('id' => $paramters['itemID'])));
 }

作者:jacbo    项目:Fireball_New   
public function readData()
 {
     parent::readData();
     VisitCountHandler::getInstance()->count();
     WCF::getBreadcrumbs()->add(new Breadcrumb(WCF::getLanguage()->get('cms.page.news'), LinkHandler::getInstance()->getLink('NewsCategoryList', array('application' => 'cms'))));
     // get categories
     $categoryTree = new NewsCategoryNodeTree('de.codequake.cms.category.news');
     $this->categoryList = $categoryTree->getIterator();
     $this->categoryList->setMaxDepth(0);
 }


问题


面经


文章

微信
公众号

扫码关注公众号