コード例 #1
0
 /**
  * @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();
     }
 }
コード例 #2
0
 /**
  * @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());
 }
コード例 #3
0
 /**
  * @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;
 }
コード例 #4
0
	/**
	 * @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;
	}
コード例 #5
0
 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();
 }
 /**
  * @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();
 }
コード例 #7
0
 /**
  * @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;
 }
コード例 #8
0
 /**
  * @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);
     }
 }
コード例 #9
0
 /**
  * @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');
     }
 }
 /**
  * @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');
 }
コード例 #11
0
ファイル: TeamPage.class.php プロジェクト: nick-strohm/WCF
 /**
  * @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')));
     }
 }
コード例 #12
0
 /**
  * @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);
 }
コード例 #13
0
 /**
  * @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;
 }
コード例 #14
0
ファイル: PageMenuItem.class.php プロジェクト: ZerGabriel/WCF
 /**
  * @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);
 }
コード例 #15
0
 /**
  * @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');
 }
コード例 #16
0
 /**
  * @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));
 }
コード例 #17
0
 /**
  * @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;
 }
コード例 #18
0
 /**
  * @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')));
     }
 }
コード例 #19
0
ファイル: DownloadItem.class.php プロジェクト: jacboy/JCoins
 /**
  * @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'])));
 }
コード例 #20
0
 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);
 }
コード例 #21
0
 /**
  * @see	\wcf\system\dashboard\box\AbstractContentDashboardBox::render()
  */
 protected function render()
 {
     if ($this->userProfileList == null) {
         return '';
     }
     if (MODULE_MEMBERS_LIST) {
         $this->titleLink = LinkHandler::getInstance()->getLink('MembersList', array(), 'sortField=activityPoints&sortOrder=DESC');
     }
     WCF::getTPL()->assign(array('mostActiveMembers' => $this->userProfileList));
     return WCF::getTPL()->fetch('dashboardBoxMostActiveMembers');
 }
コード例 #22
0
 /**
  * @see	\wcf\form\IForm::save()
  */
 public function save()
 {
     MessageForm::save();
     // save file
     $data = array_merge($this->additionalFields, array('description' => $this->text, 'subject' => $this->subject));
     $this->objectAction = new EntryFileAction(array($this->entryFile), 'update', array('data' => $data));
     $this->objectAction->executeAction();
     $this->saved();
     HeaderUtil::redirect(LinkHandler::getInstance()->getLink('Entry', array('application' => 'filebase', 'object' => $this->entry)));
     exit;
 }
コード例 #23
0
 /**
  * @see	\wcf\action\IAction::execute()
  */
 public function execute()
 {
     parent::execute();
     // do logout
     WCF::getSession()->delete();
     $this->executed();
     // forward to index page
     // warning: if doLogout() writes a cookie this is buggy in MS IIS
     HeaderUtil::redirect(LinkHandler::getInstance()->getLink('Login'));
     exit;
 }
コード例 #24
0
 /**
  * @see	\wcf\page\IPage::readData()
  */
 public function readData()
 {
     parent::readData();
     // remove default breadcrumb entry and set current page as 'website'
     if (PageMenu::getInstance()->getLandingPage()->menuItem == 'ict.header.menu.tracker') {
         WCF::getBreadcrumbs()->remove(0);
         MetaTagHandler::getInstance()->addTag('og:url', 'og:url', LinkHandler::getInstance()->getLink('ProjectList', array('application' => 'ict')), 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);
     }
 }
コード例 #25
0
 /**
  * @see	wcf\action\IAction::execute()
  */
 public function execute()
 {
     parent::execute();
     // mark as trashed
     $this->statementAction = new UserJcoinsStatementAction($this->statementList->objectIDs, 'trashAll');
     $this->statementAction->executeAction();
     $this->statementAction = new UserJcoinsStatementAction(array(), 'create', array('data' => array('reason' => 'wcf.jcoins.summaryOfAccountBalances', 'sum' => WCF::getUser()->jCoinsBalance, 'time' => TIME_NOW, 'userID' => WCF::getUser()->userID)));
     $this->statementAction->executeAction();
     $this->executed();
     $url = LinkHandler::getInstance()->getLink('OwnCoinsStatement');
     HeaderUtil::delayedRedirect($url, WCF::getLanguage()->get('wcf.jcoins.statement.successfullsumup'));
     exit;
 }
コード例 #26
0
 /**
  * @see wcf\system\template\IBlockTemplatePlugin::execute()
  */
 public function execute($tagArgs, $blockContent, TemplateEngine $tplObj)
 {
     if (!isset($tagArgs['controller'])) {
         throw new SystemException("missing 'controller' argument in link tag");
     }
     if (!isset($tagArgs['application']) || empty($tagArgs['application'])) {
         $tagArgs['application'] = 'wcf';
     }
     if (isset($tagArgs['encode']) && !$tagArgs['encode']) {
         return LinkHandler::getInstance()->getLink($tagArgs['controller'], $tagArgs, $blockContent);
     }
     return StringUtil::encodeHTML(LinkHandler::getInstance()->getLink($tagArgs['controller'], $tagArgs, $blockContent));
 }
コード例 #27
0
 /**
  * @see	\wcf\system\search\acp\IACPSearchResultProvider::search()
  */
 public function search($query)
 {
     $results = array();
     // search by language item
     $conditions = new PreparedStatementConditionBuilder();
     $conditions->add("languageID = ?", array(WCF::getLanguage()->languageID));
     $conditions->add("languageItem LIKE ?", array('wcf.acp.group.option.%'));
     $conditions->add("languageItemValue LIKE ?", array('%' . $query . '%'));
     $sql = "SELECT\t\tlanguageItem, languageItemValue\n\t\t\tFROM\t\twcf" . WCF_N . "_language_item\n\t\t\t" . $conditions . "\n\t\t\tORDER BY\tlanguageItemValue ASC";
     $statement = WCF::getDB()->prepareStatement($sql);
     // don't use a limit here
     $statement->execute($conditions->getParameters());
     $languageItems = array();
     while ($row = $statement->fetchArray()) {
         // ignore descriptions
         if (substr($row['languageItem'], -12) == '.description') {
             continue;
         }
         $itemName = preg_replace('~^([a-z]+)\\.acp\\.group\\.option\\.~', '', $row['languageItem']);
         $languageItems[$itemName] = $row['languageItemValue'];
     }
     if (empty($languageItems)) {
         return array();
     }
     $conditions = new PreparedStatementConditionBuilder();
     $conditions->add("optionName IN (?)", array(array_keys($languageItems)));
     $sql = "SELECT\toptionID, optionName, categoryName, permissions, options\n\t\t\tFROM\twcf" . WCF_N . "_user_group_option\n\t\t\t" . $conditions;
     $statement = WCF::getDB()->prepareStatement($sql);
     // don't use a limit here
     $statement->execute($conditions->getParameters());
     $optionCategories = UserGroupOptionCacheBuilder::getInstance()->getData(array(), 'categories');
     while ($userGroupOption = $statement->fetchObject('wcf\\data\\user\\group\\option\\UserGroupOption')) {
         // category is not accessible
         if (!$this->isValid($userGroupOption->categoryName)) {
             continue;
         }
         // option is not accessible
         if (!$this->validate($userGroupOption)) {
             continue;
         }
         $link = LinkHandler::getInstance()->getLink('UserGroupOption', array('id' => $userGroupOption->optionID));
         $categoryName = $userGroupOption->categoryName;
         $parentCategories = array();
         while (isset($optionCategories[$categoryName])) {
             array_unshift($parentCategories, 'wcf.acp.group.option.category.' . $optionCategories[$categoryName]->categoryName);
             $categoryName = $optionCategories[$categoryName]->parentCategoryName;
         }
         $results[] = new ACPSearchResult($languageItems[$userGroupOption->optionName], $link, WCF::getLanguage()->getDynamicVariable('wcf.acp.search.result.subtitle', array('pieces' => $parentCategories)));
     }
     return $results;
 }
コード例 #28
0
 /**
  * @see	\wcf\system\clipboard\action\IClipboardAction::execute()
  */
 public function execute(array $objects, ClipboardAction $action)
 {
     $item = parent::execute($objects, $action);
     if ($item === null) {
         return null;
     }
     // handle actions
     switch ($action->actionName) {
         case 'revertContentChanges':
             $item->setURL(LinkHandler::getInstance()->getLink('UserContentRevertChanges'));
             break;
     }
     return $item;
 }
コード例 #29
0
 /**
  * @see wcf\form\IForm::save()
  */
 public function save()
 {
     parent::save();
     // update session
     WCF::getSession()->register('masterPassword', 1);
     WCF::getSession()->update();
     WCF::getSession()->disableUpdate();
     // forward
     if (empty($this->url)) {
         $this->url = LinkHandler::getInstance()->getLink('Index');
     }
     HeaderUtil::redirect($this->url, false);
     exit;
 }
コード例 #30
0
 public function readData()
 {
     parent::readData();
     $categoryTree = new NewsCategoryNodeTree('de.codequake.cms.category.news');
     $this->categoryList = $categoryTree->getIterator();
     $this->categoryList->setMaxDepth(0);
     if (PageMenu::getInstance()->getLandingPage()->menuItem == 'cms.page.news') {
         WCF::getBreadcrumbs()->remove(0);
         MetaTagHandler::getInstance()->addTag('og:url', 'og:url', LinkHandler::getInstance()->getLink('NewsList', array('application' => 'cms')), 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);
         MetaTagHandler::getInstance()->addTag('generator', 'generator', 'Fireball CMS');
     }
 }