本文整理匯總了PHP中categories::generateSelect方法的典型用法代碼示例。如果您正苦於以下問題:PHP categories::generateSelect方法的具體用法?PHP categories::generateSelect怎麽用?PHP categories::generateSelect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類categories
的用法示例。
在下文中一共展示了categories::generateSelect方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: foreach
///////////////////
if (!isset($_POST['category'])) {
if (isset($_POST['save'])) {
$_POST['category'] = 0;
} else {
if ($item['categories']) {
foreach ($item['categories'] as $c) {
$_POST['category'][] = end($c);
}
} else {
$_POST['category'] = 0;
}
}
}
$allCategories = $categoriesClass->getAllWithChilds(0, " `visible` = 'true' ");
$categoriesSelect = $categoriesClass->generateSelect($allCategories, $_POST['category'], $first_category);
abr('categoriesSelect', $categoriesSelect);
/////////////////////
#檢查作品更新隊列
if ($itemsClass->isInUpdateQueue($itemID)) {
abr('inUpdateQueue', 'yes');
}
if (isset($_POST['save'])) {
$s = $itemsClass->edit($itemID);
if ($s === true) {
refresh('/' . $languageURL . 'items/' . $itemID . '/', $langArray['complete_update_item'], 'complete');
} else {
$message = '<ul>';
foreach ($s as $e) {
$message .= '<li>' . $e . '</li>';
}
示例2: refresh
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
_setView(ROOT_PATH . "/apps/" . $_GET['m'] . "/admin/add.php");
_setTitle($langArray['edit']);
if (!isset($_GET['id']) || !is_numeric($_GET['id'])) {
refresh('?m=' . $_GET['m'] . '&c=list', 'INVALID ID', 'error');
}
if (!isset($_GET['p'])) {
$_GET['p'] = '';
}
$cms = new categories();
if (isset($_POST['edit'])) {
$status = $cms->edit($_GET['id']);
if ($status !== true) {
abr('error', $status);
} else {
refresh("?m=" . $_GET['m'] . "&c=list&sub_of=" . $_GET['sub_of'] . "&p=" . $_GET['p'], $langArray['edit_complete']);
}
} else {
$_POST = $cms->get($_GET['id']);
}
$pagesArr = $cms->getAllWithChilds($_GET['id']);
$select = $cms->generateSelect($pagesArr, $_POST['sub_of']);
abr('select', $select);
if ($_GET['sub_of'] != 0) {
$pdata = $cms->get($_GET['sub_of']);
abr('pdata', $pdata);
}
require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
示例3: categories
$_POST = $data;
}
#加載類別
require_once ROOT_PATH . '/apps/categories/models/categories.class.php';
$categoriesClass = new categories();
if (!isset($_POST['categories'])) {
$_POST['categories'] = array();
}
$tmp = array();
if (isset($_POST['category'])) {
$tmp = (array) $_POST['category'];
} else {
foreach ($_POST['categories'] as $row => $categories1) {
$cid = end($categories1);
$tmp[$cid] = $cid;
}
}
$allCategories = $categoriesClass->getAllWithChilds(0, " `visible` = 'true' ");
$categoriesSelect = $categoriesClass->generateSelect($allCategories, $tmp, (int) $first_category);
abr('categoriesSelect', $categoriesSelect);
//獲取所有推薦標簽
require_once ROOT_PATH . '/apps/tags/models/tags.class.php';
$tagsClass = new tags();
$tags_all = $tagsClass->getAll();
$all_tags = json_encode($tags_all);
abr('all_tags', $all_tags);
//獲取當前作品推薦標簽
$tag_relation = $tagsClass->get_tags_by_item_id($_GET['id']);
abr('item_tags', json_encode($tag_relation));
abr('sessID', session_id());
require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';