当前位置: 首页>>代码示例>>PHP>>正文


PHP WCF::getPackageID方法代码示例

本文整理汇总了PHP中WCF::getPackageID方法的典型用法代码示例。如果您正苦于以下问题:PHP WCF::getPackageID方法的具体用法?PHP WCF::getPackageID怎么用?PHP WCF::getPackageID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WCF的用法示例。


在下文中一共展示了WCF::getPackageID方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: show

 /**
  * @see Page::show()
  */
 public function show()
 {
     $max = min(WCF::getUser()->getPermission('user.contest.maxAttachmentCount'), 1);
     $extensions = WCF::getUser()->getPermission('user.contest.allowedAttachmentExtensions');
     $extensions = explode("\n", $extensions);
     $extensions = array_filter($extensions, create_function('$a', 'return in_array($a, array("jpeg", "jpg", "gif", "png"));'));
     $extensions = implode("\n", $extensions);
     require_once WCF_DIR . 'lib/data/attachment/MessageAttachmentListEditor.class.php';
     $this->attachmentListEditor = new MessageAttachmentListEditor(array($this->priceID), 'contestPriceEntry', WCF::getPackageID('de.easy-coding.wcf.contest'), WCF::getUser()->getPermission('user.contest.maxAttachmentSize'), $extensions, $max);
     parent::show();
 }
开发者ID:CaribeSoy,项目名称:contest-wcf,代码行数:14,代码来源:ContestPriceEditForm.class.php

示例2: easyUpdateItems

    /**
     * Updates the language items of a language category.
     * 
     * @param	array		$items
     * @param	integer		$categoryID
     * @param	integer		$packageID
     * @param 	array		$useCustom
     */
    public function easyUpdateItems($categoryString, $items, $packageID = null)
    {
        $packageID = $packageID === null ? WCF::getPackageID('de.easy-coding.wcf.contest') : $packageID;
        $language = new LanguageEditor($this->languageID);
        $xmlString = '<?xml version="1.0" encoding="' . CHARSET . '"?>
		<language languagecode="' . $this->getLanguageCode() . '">
			<category name="' . $categoryString . '">';
        foreach ($items as $key => $val) {
            if ($val === null) {
                continue;
            }
            $xmlString .= '<item name="' . $key . '"><![CDATA[' . $val . ']]></item>';
        }
        $xmlString .= '
			</category>
		</language>';
        $xml = new XML();
        $xml->loadString($xmlString);
        $language->updateFromXML($xml, $packageID);
    }
开发者ID:CaribeSoy,项目名称:contest-wcf,代码行数:28,代码来源:ContestLanguageEditor.class.php

示例3: execute

 /**
  * @EventListener::execute()
  */
 public function execute($eventObj, $className, $eventName)
 {
     // read the trackbacks
     $this->readTrackbacks($eventObj);
     // absolute url
     $permalink = PAGE_URL . '/index.php?page=Contest&contestID=' . $eventObj->contestID;
     $socialBookmarks = null;
     if (MODULE_SOCIAL_BOOKMARK) {
         $socialBookmarks = SocialBookmarks::getInstance()->getSocialBookmarks($permalink, $eventObj->entry->subject);
     }
     // assign data to template
     WCF::getTPL()->assign(array('trackback' => $this->trackback, 'trackbacks' => $this->trackbacks, 'socialBookmarks' => $socialBookmarks));
     $objectPackageID = WCF::getPackageID('de.easy-coding.wcf.contest.socialBookmarks');
     // get rdf code
     if ($this->trackback) {
         $tmp = $this->trackback->getRdfAutoDiscover($eventObj->entry->subject, $permalink, $eventObj->contestID, 'contestEntry', $objectPackageID);
         WCF::getTPL()->append('additionalContent3', $tmp);
     }
     WCF::getTPL()->append('additionalContent3', WCF::getTPL()->fetch('contestTrackbacks'));
     WCF::getTPL()->append('additionalButtonBar', WCF::getTPL()->fetch('contestSocialBookmarks'));
 }
开发者ID:CaribeSoy,项目名称:contest-wcf,代码行数:24,代码来源:ContestSocialBookmarksListener.class.php

示例4: create

 /**
  * Creates a new help item.
  * 
  * @param 	string		$name
  * @param 	string		$text
  * @param 	string		$parentItem
  * @param 	string		$refererPattern
  * @param 	integer		$showOrder
  * @param 	boolean		$isDisabled
  * @param 	integer		$languageID
  * @param	integer		$packageID
  *
  * @return	HelpItemEditor
  */
 public static function create($name, $text = '', $parentItem = '', $refererPattern = '', $showOrder = 0, $isDisabled = 0, $languageID = 0, $packageID = PACKAGE_ID)
 {
     // get show order
     if ($showOrder == 0) {
         // get next number in row
         $sql = "SELECT\tMAX(showOrder) AS showOrder\n\t\t\t\tFROM\twcf" . WCF_N . "_help_item\n\t\t\t\tWHERE\tparentHelpItem = '" . escapeString($parentItem) . "'";
         $row = WCF::getDB()->getFirstRow($sql);
         if (!empty($row)) {
             $showOrder = intval($row['showOrder']) + 1;
         } else {
             $showOrder = 1;
         }
     } else {
         $sql = "UPDATE\twcf" . WCF_N . "_help_item\n\t\t\t\tSET \tshowOrder = showOrder + 1\n\t\t\t\tWHERE \tshowOrder >= " . $showOrder . "\n\t\t\t\t\tAND parentHelpItem = '" . escapeString($parentItem) . "'";
         WCF::getDB()->sendQuery($sql);
     }
     // get menu item name
     $helpItem = '';
     if ($languageID == 0) {
         $helpItem = $name;
     }
     // save
     $sql = "INSERT INTO\twcf" . WCF_N . "_help_item\n\t\t\t\t\t(packageID, helpItem, parentHelpItem, refererPattern, showOrder, isDisabled)\n\t\t\tVALUES\t\t(" . $packageID . ", '" . escapeString($helpItem) . "', '" . escapeString($parentItem) . "', '" . escapeString($refererPattern) . "', " . $showOrder . ", " . $isDisabled . ")";
     WCF::getDB()->sendQuery($sql);
     // get item id
     $helpItemID = WCF::getDB()->getInsertID("wcf" . WCF_N . "_help_item", 'helpItemID');
     if ($languageID != 0) {
         // set name
         $helpItem = "item" . $helpItemID;
         $sql = "UPDATE\twcf" . WCF_N . "_help_item\n\t\t\t\tSET\thelpItem = '" . escapeString($helpItem) . "'\n\t\t\t\tWHERE \thelpItemID = " . $helpItemID;
         WCF::getDB()->sendQuery($sql);
         // save language variables
         $language = new LanguageEditor($languageID);
         $language->updateItems(array('wcf.help.item.' . $helpItem => $name, 'wcf.help.item.' . $helpItem . '.description' => $text), 0, WCF::getPackageID('com.woltlab.wcf.data.help'));
         LanguageEditor::deleteLanguageFiles($languageID, 'wcf.help.item');
     }
     return new HelpItemEditor($helpItemID);
 }
开发者ID:joaocustodio,项目名称:EmuDevstore-1,代码行数:52,代码来源:HelpItemEditor.class.php

示例5: readAttachments

 /**
  * Gets a list of attachments.
  */
 protected function readAttachments()
 {
     // read attachments
     if (MODULE_ATTACHMENT == 1 && count($this->attachmentEntryIDArray) > 0) {
         require_once WCF_DIR . 'lib/data/attachment/MessageAttachmentList.class.php';
         $this->attachmentList = new MessageAttachmentList($this->attachmentEntryIDArray, 'contestEntry', '', WCF::getPackageID('de.easy-coding.wcf.contest'));
         $this->attachmentList->readObjects();
         $this->attachments = $this->attachmentList->getSortedAttachments(WCF::getUser()->getPermission('user.contest.canViewAttachmentPreview'));
         // set embedded attachments
         if (WCF::getUser()->getPermission('user.contest.canViewAttachmentPreview')) {
             require_once WCF_DIR . 'lib/data/message/bbcode/AttachmentBBCode.class.php';
             AttachmentBBCode::setAttachments($this->attachments);
         }
         // remove embedded attachments from list
         if (count($this->attachments) > 0) {
             MessageAttachmentList::removeEmbeddedAttachments($this->attachments);
         }
     }
 }
开发者ID:CaribeSoy,项目名称:contest-wcf,代码行数:22,代码来源:ViewableContestList.class.php

示例6: getPackageID

 /**
  * @see NotificationObjectType::getPackageID()
  */
 public function getPackageID()
 {
     return WCF::getPackageID('de.easy-coding.wcf.contest');
 }
开发者ID:CaribeSoy,项目名称:contest-wcf,代码行数:7,代码来源:ContestNotificationObjectType.class.php

示例7: show

 /**
  * @see Page::show()
  */
 public function show()
 {
     // check upload permission
     if (MODULE_ATTACHMENT != 1 || !WCF::getUser()->getPermission('user.contest.canUploadAttachment')) {
         $this->showAttachments = false;
     }
     // get attachments editor
     if ($this->attachmentListEditor === null) {
         $max = min(WCF::getUser()->getPermission('user.contest.maxAttachmentCount'), 1);
         $extensions = WCF::getUser()->getPermission('user.contest.allowedAttachmentExtensions');
         $extensions = explode("\n", $extensions);
         $extensions = array_filter($extensions, create_function('$a', 'return in_array($a, array("jpeg", "jpg", "gif", "png"));'));
         $extensions = implode("\n", $extensions);
         require_once WCF_DIR . 'lib/data/attachment/MessageAttachmentListEditor.class.php';
         $this->attachmentListEditor = new MessageAttachmentListEditor(array(), 'contestPriceEntry', WCF::getPackageID('de.easy-coding.wcf.contest'), WCF::getUser()->getPermission('user.contest.maxAttachmentSize'), $extensions, $max);
     }
     parent::show();
 }
开发者ID:CaribeSoy,项目名称:contest-wcf,代码行数:21,代码来源:ContestPriceAddForm.class.php

示例8: show

 /**
  * @see Page::show()
  */
 public function show()
 {
     require_once WCF_DIR . 'lib/data/attachment/MessageAttachmentListEditor.class.php';
     $this->attachmentListEditor = new MessageAttachmentListEditor(array($this->solutionID), 'contestSolutionEntry', WCF::getPackageID('de.easy-coding.wcf.contest'), WCF::getUser()->getPermission('user.contest.maxAttachmentSize'), WCF::getUser()->getPermission('user.contest.allowedAttachmentExtensions'), WCF::getUser()->getPermission('user.contest.maxAttachmentCount'));
     parent::show();
 }
开发者ID:CaribeSoy,项目名称:contest-wcf,代码行数:9,代码来源:ContestSolutionEditForm.class.php

示例9: show

 /**
  * @see Page::show()
  */
 public function show()
 {
     if (!MODULE_PM) {
         throw new IllegalLinkException();
     }
     // check permission
     WCF::getUser()->checkPermission('user.pm.canUsePm');
     if (!WCF::getUser()->userID) {
         throw new PermissionDeniedException();
     }
     // check max pm permission
     if (WCF::getUser()->pmTotalCount >= WCF::getUser()->getPermission('user.pm.maxPm')) {
         throw new NamedUserException(WCF::getLanguage()->get('wcf.pm.error.mailboxIsFull'));
     }
     // get max text length
     $this->maxTextLength = WCF::getUser()->getPermission('user.pm.maxLength');
     // check upload permissin
     if (MODULE_ATTACHMENT != 1 || !WCF::getUser()->getPermission('user.pm.canUploadAttachment')) {
         $this->showAttachments = false;
     }
     // get attachments editor
     require_once WCF_DIR . 'lib/data/attachment/MessageAttachmentListEditor.class.php';
     $this->attachmentListEditor = new MessageAttachmentListEditor($this->pmID && !$this->forwarding && !$this->reply ? array($this->pmID) : array(), 'pm', WCF::getPackageID('com.woltlab.wcf.data.message.pm'), WCF::getUser()->getPermission('user.pm.maxAttachmentSize'), WCF::getUser()->getPermission('user.pm.allowedAttachmentExtensions'), WCF::getUser()->getPermission('user.pm.maxAttachmentCount'));
     // show form
     parent::show();
 }
开发者ID:joaocustodio,项目名称:EmuDevstore-1,代码行数:29,代码来源:PMNewForm.class.php

示例10: show

 /**
  * @see Page::show()
  */
 public function show()
 {
     // set active header menu item
     PageMenu::setActiveMenuItem('wcf.header.menu.user.contest');
     // set active menu item
     ContestMenu::getInstance()->setContest($this->contest);
     ContestMenu::getInstance()->setActiveMenuItem('wcf.contest.menu.link.solution');
     // check permission
     WCF::getUser()->checkPermission('user.contest.canViewContest');
     if (!MODULE_CONTEST) {
         throw new IllegalLinkException();
     }
     // check upload permission
     if (MODULE_ATTACHMENT != 1 || !WCF::getUser()->getPermission('user.contest.canUploadAttachment')) {
         $this->showAttachments = false;
     }
     // get attachments editor
     if ($this->attachmentListEditor === null) {
         require_once WCF_DIR . 'lib/data/attachment/MessageAttachmentListEditor.class.php';
         $this->attachmentListEditor = new MessageAttachmentListEditor(array(), 'contestSolutionEntry', WCF::getPackageID('de.easy-coding.wcf.contest'), WCF::getUser()->getPermission('user.contest.maxAttachmentSize'), WCF::getUser()->getPermission('user.contest.allowedAttachmentExtensions'), WCF::getUser()->getPermission('user.contest.maxAttachmentCount'));
     }
     parent::show();
 }
开发者ID:CaribeSoy,项目名称:contest-wcf,代码行数:26,代码来源:ContestSolutionAddForm.class.php

示例11: deleteData

 /**
  * Deletes the data of the specified messages completely.
  * 
  * @param	string		$pmIDs
  */
 protected static function deleteData($pmIDs)
 {
     // delete recipients
     $sql = "DELETE FROM\twcf" . WCF_N . "_pm_to_user\n\t\t\tWHERE\t\tpmID IN (" . $pmIDs . ")";
     WCF::getDB()->sendQuery($sql);
     // delete messages
     $sql = "DELETE FROM\twcf" . WCF_N . "_pm\n\t\t\tWHERE\t\tpmID IN (" . $pmIDs . ")";
     WCF::getDB()->sendQuery($sql);
     // delete pm hashes
     $sql = "DELETE FROM\twcf" . WCF_N . "_pm_hash\n\t\t\tWHERE\t\tpmID IN (" . $pmIDs . ")";
     WCF::getDB()->registerShutdownUpdate($sql);
     // delete attachments
     require_once WCF_DIR . 'lib/data/attachment/MessageAttachmentListEditor.class.php';
     $attachmentList = new MessageAttachmentListEditor(explode(',', $pmIDs), 'pm', WCF::getPackageID('com.woltlab.wcf.data.message.pm'));
     $attachmentList->deleteAll();
 }
开发者ID:joaocustodio,项目名称:EmuDevstore-1,代码行数:21,代码来源:PMAction.class.php

示例12: show

 /**
  * @see Page::show()
  */
 public function show()
 {
     // set active header menu item
     PageMenu::setActiveMenuItem('wcf.header.menu.user.contest');
     if (WCF::getUser()->userID == 0) {
         // forward to login page
         WCF::getTPL()->assign(array('url' => 'index.php?form=UserLogin' . SID_ARG_2ND, 'message' => WCF::getLanguage()->get('wcf.contest.register.message')));
         WCF::getTPL()->display('redirect');
         return;
     }
     // check permission
     WCF::getUser()->checkPermission('user.contest.canUseContest');
     WCF::getUser()->checkPermission('user.contest.canAddContest');
     if (!MODULE_CONTEST) {
         throw new IllegalLinkException();
     }
     // check upload permission
     if (MODULE_ATTACHMENT != 1 || !WCF::getUser()->getPermission('user.contest.canUploadAttachment')) {
         $this->showAttachments = false;
     }
     // get attachments editor
     if ($this->attachmentListEditor == null) {
         require_once WCF_DIR . 'lib/data/attachment/MessageAttachmentListEditor.class.php';
         $this->attachmentListEditor = new MessageAttachmentListEditor(array(), 'contestEntry', WCF::getPackageID('de.easy-coding.wcf.contest'), WCF::getUser()->getPermission('user.contest.maxAttachmentSize'), WCF::getUser()->getPermission('user.contest.allowedAttachmentExtensions'), WCF::getUser()->getPermission('user.contest.maxAttachmentCount'));
     }
     parent::show();
 }
开发者ID:CaribeSoy,项目名称:contest-wcf,代码行数:30,代码来源:ContestAddForm.class.php

示例13: readAttachments

 /**
  * Gets a list of attachments.
  */
 protected function readAttachments()
 {
     // read attachments
     if (MODULE_ATTACHMENT == 1 && count($this->attachmentPMIDArray)) {
         require_once WCF_DIR . 'lib/data/attachment/MessageAttachmentList.class.php';
         $this->attachmentList = new MessageAttachmentList($this->attachmentPMIDArray, 'pm', '', WCF::getPackageID('com.woltlab.wcf.data.message.pm'));
         $this->attachmentList->readObjects();
         $this->attachments = $this->attachmentList->getSortedAttachments();
         require_once WCF_DIR . 'lib/data/message/bbcode/AttachmentBBCode.class.php';
         AttachmentBBCode::setAttachments($this->attachments);
         if (count($this->attachments) > 0) {
             MessageAttachmentList::removeEmbeddedAttachments($this->attachments);
         }
     }
 }
开发者ID:joaocustodio,项目名称:EmuDevstore-1,代码行数:18,代码来源:PMList.class.php

示例14: readData

 /**
  * @see Page::readData()
  */
 public function readData()
 {
     parent::readData();
     // show 5 entries on first page, but 20 on the following pages
     $this->eventmixList->sqlLimit = $this->pageNo <= 1 ? $this->itemsOnLandingpage : $this->itemsPerPage;
     $this->eventmixList->sqlOffset = $this->pageNo <= 1 ? 0 : ($this->pageNo - 2) * $this->itemsPerPage + $this->itemsOnLandingpage;
     // fire sql query
     $this->eventmixList->readObjects();
     // get previous entry
     $sql = "SELECT\t\t*\n\t\t\tFROM\t\twcf" . WCF_N . "_contest\n\t\t\tWHERE\t\tuserID = " . intval($this->entry->userID) . "\n\t\t\t\t\tAND (\n\t\t\t\t\t\ttime > " . intval($this->entry->time) . "\n\t\t\t\t\t\tOR (time = " . intval($this->entry->time) . " AND contestID < " . intval($this->entry->contestID) . ")\n\t\t\t\t\t)\n\t\t\tORDER BY\ttime ASC, contestID DESC";
     $this->previousEntry = new Contest(null, WCF::getDB()->getFirstRow($sql));
     if (!$this->previousEntry->contestID) {
         $this->previousEntry = null;
     }
     // get next entry
     $sql = "SELECT\t\t*\n\t\t\tFROM\t\twcf" . WCF_N . "_contest\n\t\t\tWHERE\t\tuserID = " . intval($this->entry->userID) . "\n\t\t\t\t\tAND (\n\t\t\t\t\t\ttime < " . intval($this->entry->time) . "\n\t\t\t\t\t\tOR (time = " . intval($this->entry->time) . " AND contestID > " . intval($this->entry->contestID) . ")\n\t\t\t\t\t)\n\t\t\tORDER BY\ttime DESC, contestID ASC";
     $this->nextEntry = new Contest(null, WCF::getDB()->getFirstRow($sql));
     if (!$this->nextEntry->contestID) {
         $this->nextEntry = null;
     }
     // read attachments
     if (MODULE_ATTACHMENT == 1 && $this->entry->attachments > 0) {
         require_once WCF_DIR . 'lib/data/attachment/MessageAttachmentList.class.php';
         $this->attachmentList = new MessageAttachmentList($this->contestID, 'contestEntry', '', WCF::getPackageID('de.easy-coding.wcf.contest'));
         $this->attachmentList->readObjects();
         $this->attachments = $this->attachmentList->getSortedAttachments(WCF::getUser()->getPermission('user.contest.canViewAttachmentPreview'));
         // set embedded attachments
         if (WCF::getUser()->getPermission('user.contest.canViewAttachmentPreview')) {
             require_once WCF_DIR . 'lib/data/message/bbcode/AttachmentBBCode.class.php';
             AttachmentBBCode::setAttachments($this->attachments);
         }
         // remove embedded attachments from list
         if (count($this->attachments) > 0) {
             MessageAttachmentList::removeEmbeddedAttachments($this->attachments);
         }
     }
     if ($this->entry->isOwner()) {
         // init todo list
         require_once WCF_DIR . 'lib/data/contest/owner/todo/ContestOwnerTodoList.class.php';
         $this->todoList = new ContestOwnerTodoList();
         $this->todoList->sqlConditions .= 'contest.contestID = ' . intval($this->contestID);
         $this->todoList->readObjects();
     }
     // init sidebar
     $this->sidebar = new ContestSidebar($this->entry);
 }
开发者ID:CaribeSoy,项目名称:contest-wcf,代码行数:49,代码来源:ContestPage.class.php

示例15: readData

 /**
  * @see Form::readData()
  */
 public function readData()
 {
     parent::readData();
     if ($this->sendPickNotification) {
         $this->solutionObj->getEditor()->sendPickNotification();
     }
     // init todo list
     $this->todoList = new ContestParticipantTodoList();
     $this->todoList->sqlConditions .= 'contest_participant.contestID = ' . intval($this->contestID);
     $this->todoList->readObjects();
     // read comments
     $this->commentList->sqlOffset = ($this->pageNo - 1) * $this->itemsPerPage;
     $this->commentList->sqlLimit = $this->itemsPerPage;
     $this->commentList->readObjects();
     // read ratings
     $this->ratingList->readObjects();
     // read attachments
     if (MODULE_ATTACHMENT == 1 && $this->solutionObj->attachments > 0) {
         require_once WCF_DIR . 'lib/data/attachment/MessageAttachmentList.class.php';
         $this->attachmentList = new MessageAttachmentList($this->solutionObj->solutionID, 'contestSolutionEntry', '', WCF::getPackageID('de.easy-coding.wcf.contest'));
         $this->attachmentList->readObjects();
         $this->attachments = $this->attachmentList->getSortedAttachments(WCF::getUser()->getPermission('user.contest.canViewAttachmentPreview'));
         // set embedded attachments
         if (WCF::getUser()->getPermission('user.contest.canViewAttachmentPreview')) {
             require_once WCF_DIR . 'lib/data/message/bbcode/AttachmentBBCode.class.php';
             AttachmentBBCode::setAttachments($this->attachments);
         }
         // remove embedded attachments from list
         if (count($this->attachments) > 0) {
             MessageAttachmentList::removeEmbeddedAttachments($this->attachments);
         }
     }
     // init sidebar
     $this->sidebar = new ContestSidebar($this->entry);
 }
开发者ID:CaribeSoy,项目名称:contest-wcf,代码行数:38,代码来源:ContestSolutionEntryPage.class.php


注:本文中的WCF::getPackageID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。