本文整理汇总了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();
}
示例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);
}
示例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'));
}
示例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);
}
示例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);
}
}
}
示例6: getPackageID
/**
* @see NotificationObjectType::getPackageID()
*/
public function getPackageID()
{
return WCF::getPackageID('de.easy-coding.wcf.contest');
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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);
}
}
}
示例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);
}
示例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);
}