本文整理汇总了PHP中_assign函数的典型用法代码示例。如果您正苦于以下问题:PHP _assign函数的具体用法?PHP _assign怎么用?PHP _assign使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_assign函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array_key_exists
<?php
$attributes['xcode'] = array_key_exists("xcode", $attributes) ? $attributes['xcode'] : "";
$attributes['order'] = empty($attributes['order']) ? "pos" : $attributes['order'];
$attributes['sort'] = empty($attributes['sort']) ? "DESC" : $attributes['sort'];
$attributes['pagesize'] = empty($attributes['pagesize']) ? $oSettingsManager->getValue("AdminTableSize", 25, "INT", "Number of elements in tables of administrator backend") : (int) $attributes['pagesize'];
$attributes['asort'] = $attributes['sort'] == "ASC" ? "DESC" : "ASC";
$attributes['page'] = empty($attributes['page']) ? 1 : (int) $attributes['page'];
if (!empty($attributes['code'])) {
$oPaging = new Paging($attributes['pagesize'], $oPropertyManager->getDictionaryCount($attributes['code'], $attributes['xcode']), $attributes['page']);
$oPaging->setLinkFormat($here . "&page=%d");
$arrPageSizes = array(10, 25, 50, 100, 200);
if ($arrProperty = $oPropertyManager->getProperty($attributes['code'])) {
_assign("arrProperty", $arrProperty);
}
if ($arrPropertyDictionary = $oPropertyManager->getDictionary($attributes['code'], $attributes['xcode'], $attributes['order'], $attributes['sort'], $oPaging->getOffSet(), $oPaging->getPageSize())) {
_assign("arrPages", $oPaging->getPages());
_assign("arrPageSizes", $arrPageSizes);
_assign("arrPropertyDictionary", $arrPropertyDictionary);
}
} else {
_error("ENoPropertyFound", "No property found");
}
_display("admin/dspPropertyDictionary.tpl");
示例2: _assign
<?php
$arrArticleComments = $ogArticleManager->getComments($attributes['token']);
_assign('arrArticleComments', $arrArticleComments);
_display("admin/dspArticlesComments.tpl");
示例3: _assign
<?php
if (!empty($attributes['token'])) {
$arrArticleAttachments = $ogArticleAttachmentManager->getAttachments($attributes['token']);
_assign('arrArticleAttachments', $arrArticleAttachments);
}
if (!empty($attributes['id'])) {
$arrAttachment = $ogArticleAttachmentManager->getAttachment(intval($attributes['id']));
}
if (isset($arrAttachment)) {
_assign('arrAttachment', $arrAttachment);
}
_display('admin/dspArticleAttachments.tpl');
示例4: Paging
if ($ogGalleryManager->checkGallery($attributes['gallery'])) {
$arrGalleries = $ogGalleryManager->getGalleries();
$oPaging = new Paging($attributes['page_size'], $ogGalleryManager->getImagesCount($attributes['gallery']), $attributes['page']);
$arrImages = $ogGalleryManager->getImages($attributes['gallery'], $oPaging->getOffSet(), $oPaging->getPageSize());
$oPaging->setLinkFormat($attributes['gallery'] . '.gallery/' . "%d");
$intAuthorID = $ogGalleryManager->getGalleryAuthorID($attributes['gallery']);
$intEditorID = $ogGalleryManager->getGalleryEditorID($attributes['gallery']);
$oAuthor = false;
$oEditor = false;
if ($intAuthorID) {
$oAuthor = $oUserManager->getUserByID($intAuthorID);
}
if ($intEditorID) {
$oEditor = $oUserManager->getUserByID($intEditorID);
}
if ($oAuthor) {
_assign('oAuthor', $oAuthor);
}
if ($oEditor) {
_assign('oEditor', $oEditor);
}
_assign("arrPages", $oPaging->getPages());
_assign("arrGalleries", $arrGalleries);
_assign("arrImages", $arrImages);
_display("home/dspGallery.tpl");
} else {
_error("EGalleryNotExists", "Gallery not exists");
}
} else {
_error("ENoGalleryGiven", "No gallery given");
}
示例5: _assign
<?php
_assign("arrContentPages", $arrContentPages);
_assign("arrPageSizes", $arrPageSizes);
_assign("arrPages", $oPaging->getPages());
_display("admin/dspContentPages.tpl");
示例6: empty
<?php
$attributes['order'] = empty($attributes['order']) ? "code" : $attributes['order'];
$attributes['pagesize'] = empty($attributes['pagesize']) ? $oSettingsManager->getValue("AdminTableSize", 25, "INT", "Number of elements in tables of administrator backend") : (int) $attributes['pagesize'];
if (!isset($attributes['sort'])) {
$attributes['sort'] = "ASC";
} else {
if (!in_array($attributes['sort'], array("ASC", "DESC"))) {
$attributes['sort'] = "ASC";
}
}
$attributes['asort'] = $attributes['sort'] == "ASC" ? "DESC" : "ASC";
$attributes['page'] = empty($attributes['page']) ? 1 : (int) $attributes['page'];
$oPaging = new Paging($attributes['pagesize'], $oLanguageManager->getLanguagesCount(), $attributes['page']);
$oPaging->setLinkFormat($here . "&page=%d");
$arrPageSizes = array(10, 25, 50, 100, 200);
if ($arrLanguages = $oLanguageManager->getLanguages($attributes['order'], $attributes['sort'], $oPaging->getOffSet(), $oPaging->getPageSize())) {
_assign("arrLanguages", $arrLanguages);
_assign("arrPages", $oPaging->getPages());
_assign("arrPageSizes", $arrPageSizes);
}
_display("admin/dspLanguages.tpl");
示例7: User
<?php
if (!$oUser->isDefaultUser()) {
$tmpUser = $oUser;
} else {
$tmpUser = new User();
if (isset($attributes['fLogin']) && isset($attributes['fPwd']) && isset($attributes['fPwd2']) && isset($attributes['fEmail'])) {
if (!$tmpUser->setLogin($attributes['fLogin'])) {
_warning("WInvalidLogin", "Login is invalid or empty");
}
if (!$tmpUser->setEmail($attributes['fEmail'])) {
_warning("WInvalidEmail", "Email address is invalid or empty");
}
$tmpUser->setFirstName($attributes['fFirstName']);
$tmpUser->setMiddleName($attributes['fMiddleName']);
$tmpUser->setLastName($attributes['fLastName']);
$tmpUser->setBirthDate($attributes['fBirthDate']);
}
}
$oCaptcha = new Captcha($fusebox['pathAssets'] . "fonts");
if (!$oCaptcha->initialize()) {
_warning("WCaptchaNotInitialized", "Captcha not initialized");
}
_assign("arrCountries", $oPropertyManager->getDictionary("fCountry"));
_assign("tmpUser", $tmpUser);
_display("home/dspRegistrationForm.tpl");
示例8: Group
<?php
$tmpoGroup = new Group();
if (!empty($attributes['id'])) {
if (!($tmpoGroup = $oSecurityManager->getGroupByID($attributes['id']))) {
_error("ENoGroupFound", "No security group with ID={$attributes['id']} found");
}
}
if (isset($attributes['fCode'])) {
$tmpoGroup->setCode($attributes['fCode']);
}
if (isset($attributes['fName'])) {
$tmpoGroup->setName($attributes['fName']);
}
if (isset($attributes['fDescription'])) {
$tmpoGroup->setDescription($attributes['fDescription']);
}
if (isset($attributes['fHomePage'])) {
$tmpoGroup->setHomePage($attributes['fHomePage']);
}
_assign("tmpoGroup", $tmpoGroup);
_display("admin/dspGroupForm.tpl");
示例9: empty
<?php
$attributes['order'] = empty($attributes['order']) ? "relevance" : $attributes['order'];
if (!isset($attributes['sort']) || !in_array($attributes['sort'], array("ASC", "DESC"))) {
if ($attributes['order'] == "title") {
$attributes['sort'] = "ASC";
} else {
$attributes['sort'] = "DESC";
}
}
$attributes['page'] = empty($attributes['page']) ? 1 : intval($attributes['page']);
$attributes['page_size'] = empty($attributes['page_size']) ? $oSettingsManager->getValue("SearchResultsPageSize", 10, "INT", "Number of elements in search results") : intval($attributes['page_size']);
$attributes['asort'] = $attributes['sort'] == "ASC" ? "DESC" : "ASC";
$oPaging = new Paging($attributes['page_size'], $ogArticleManager->getSearchCount($attributes['fSearch']), $attributes['page']);
$oPaging->setLinkFormat($here . "&page=%d");
$arrSearchResults = $ogArticleManager->searchContent($attributes['fSearch'], true, $attributes['order'], $attributes['sort'], $oPaging->getOffSet(), $oPaging->getPageSize());
_assign("arrPages", $oPaging->getPages());
_assign("arrSearchResults", $arrSearchResults);
_display("home/dspSearchResults.tpl");
示例10: array
<?php
$filter = array();
_assign('arrItems', $oSitemap->getItems($filter));
_display("admin/dspSitemap.tpl");
示例11: header
<?php
// sending content headers
header("Content-Type: text/html; charset=" . $oLanguage->getEncoding());
header("Content-Language: " . $oLanguage->getCode());
$arrHeaderLanguages = $oLanguageManager->getLanguages();
_assign("arrHeaderLanguages", $arrHeaderLanguages);
$arrRootArticle = $ogArticleTree->getRootNode(array('token'));
if (isset($attributes['article']) && $attributes['article'] != $arrRootArticle['token']) {
$article_id = $ogArticleManager->checkToken($ogFuseaction->getID(), $attributes['article'], "", false);
$sql = "SELECT id, level FROM " . $fusebox['tableArticlesTree'] . " WHERE data_id = " . $article_id;
$node_id = $oDB->getQueryField($sql, 0, 0);
$arrArticleFamily = $ogArticleTree->getNodeFamily($node_id, array('token'));
} else {
$arrArticleFamily = $ogArticleTree->getNodeFamily(0, array('token'));
}
_assign("arrRootArticle", $arrRootArticle);
_assign("arrArticleFamily", $arrArticleFamily);
_display("home/layHeader.tpl");
示例12: _assign
<?php
if (!empty($attributes['key'])) {
if ($arrSetting = $oSettingsManager->getSetting($attributes['key'])) {
_assign("arrSetting", $arrSetting);
_display("admin/dspSettingForm.tpl");
} else {
_error("ENoSettingRetrieved", "No setting retrieved from DB");
}
} else {
_error("ENoSettingGiven", "No setting given to edit");
}
示例13: _assign
<?php
if (!empty($attributes['id'])) {
if (is_numeric($attributes['id'])) {
if ($arrLogRecord = $oLogManager->getLogByID($attributes['id'])) {
_assign("arrLogRecord", $arrLogRecord);
} else {
_error("ECannotGetLogRecord", "Cannot get log record");
}
} else {
_error("EInvalidLogID", "Invalid log record ID");
}
} else {
_error("ENoLogIDGiven", "No log record ID given");
}
_display("admin/dspLogRecord.tpl");
示例14: empty
<?php
$attributes['page_size'] = empty($attributes['page_size']) ? $oSettingsManager->getValue("GalleriesPageSize", 10, "INT", "Number of elements in galleries list") : intval($attributes['page_size']);
$attributes['page'] = empty($attributes['page']) ? 1 : intval($attributes['page']);
$oPaging = new Paging($attributes['page_size'], $ogGalleryManager->getGalleriesCount(), $attributes['page']);
$oPaging->setLinkFormat($here . "&page=%d");
$arrAllGalleries = $ogGalleryManager->getGalleries("id", "DESC", $oPaging->getOffSet(), $oPaging->getPageSize());
_assign("arrPages", $oPaging->getPages());
_assign("arrAllGalleries", $arrAllGalleries);
_display("home/dspGalleries.tpl");
示例15: empty
<?php
$attributes['page_size'] = empty($attributes['page_size']) ? $oSettingsManager->getValue("ArticlesPageSize", 10, "INT", "Number of elements in galleries list") : intval($attributes['page_size']);
$attributes['page'] = empty($attributes['page']) ? 1 : intval($attributes['page']);
$oPaging = new Paging($attributes['page_size'], $ogArticleManager->getTokensCount(0), $attributes['page']);
$oPaging->setLinkFormat($here . "&page=%d");
$arrAllArticles = $ogArticleManager->pullTokens(0, "", "id", "DESC", $oPaging->getOffSet(), $oPaging->getPageSize());
_assign("arrPages", $oPaging->getPages());
_assign("arrAllArticles", $arrAllArticles);
_display("home/dspArticles.tpl");