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


PHP categories::generateSelect方法代码示例

本文整理汇总了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>';
        }
开发者ID:yunsite,项目名称:demila,代码行数:31,代码来源:edit.php

示例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';
开发者ID:yunsite,项目名称:demila,代码行数:31,代码来源:edit.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';
开发者ID:yunsite,项目名称:demila,代码行数:31,代码来源:edit.php


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