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


PHP select::modules方法代码示例

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


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

示例1: select

 static function select($path, $fields, $where, $order, $limit, $vars, $mfolder)
 {
     $rows = array();
     $modules = select::modules();
     asort($modules);
     foreach ($modules as $module => $name) {
         if ($name[0] == " ") {
             continue;
         }
         $file = sys_find_module($module);
         $row = array("id" => $file, "name" => $name, "modulename" => $module, "created" => @filectime($file), "lastmodified" => @filemtime($file), "lastmodifiedby" => "", "searchcontent" => $file, "filename" => $file, "filemtime" => @filemtime($file), "filectime" => @filectime($file), "filesize" => @filesize($file), "filecontent" => "");
         if (sys_select_where($row, $where, $vars)) {
             $rows[$file] = $row;
         }
     }
     return sys_select($rows, $order, $limit, $fields);
 }
开发者ID:drognisep,项目名称:Simple-Groupware,代码行数:17,代码来源:modules.php

示例2: folder_build_tree

function folder_build_tree($visible)
{
    $vars = array();
    $sel_folder = $GLOBALS["sel_folder"];
    $schemas = select::modules();
    if (empty($_REQUEST["popup"])) {
        $where = array("(flevel<2 or parent in (@states@))", $_SESSION["permission_sql_read"]);
        $vars["states"] = array_filter(array_keys($_SESSION["folder_states"]), "is_numeric");
        if (count($vars["states"]) == 0) {
            $vars["states"] = 0;
        }
    }
    $treelimit = 100;
    $treepage = 1;
    $tree_count = db_count("simple_sys_tree", $where, $vars);
    $last_treepage = ceil($tree_count / $treelimit);
    if ($last_treepage < 1) {
        $last_treepage = 1;
    }
    if (isset($_REQUEST["treepage"])) {
        $_SESSION["treepage"] = $_REQUEST["treepage"];
    }
    if (isset($_SESSION["treepage"]) and $_SESSION["treepage"] > $last_treepage) {
        $_SESSION["treepage"] = $last_treepage;
    }
    if (isset($_SESSION["treepage"]) and is_numeric($_SESSION["treepage"]) and $_SESSION["treepage"] > 0) {
        $treepage = $_SESSION["treepage"];
    }
    $tree = array();
    $limit = array(($treepage - 1) * $treelimit, $treelimit);
    $rows = db_select("simple_sys_tree", array("*"), $where, "lft asc", $limit, $vars);
    if (is_array($rows) and count($rows) > 0) {
        _folder_process_folders($rows, $tree, 0);
    }
    $prev_treepage = $treepage <= 1 ? 1 : $treepage - 1;
    $next_treepage = $treepage == $last_treepage ? $last_treepage : $treepage + 1;
    sys::$smarty->assign("sys_schemas", $schemas);
    sys::$smarty->assign("tree", array("tree" => $tree, "visible" => $visible, "page" => $treepage, "lastpage" => $last_treepage, "prevpage" => $prev_treepage, "nextpage" => $next_treepage));
}
开发者ID:drognisep,项目名称:Simple-Groupware,代码行数:39,代码来源:funcs.php

示例3: folder_options

 /**
  * Return folder create or rename form
  * 
  * @param int|string $folder Folder ID or String (/Workspace/.../)
  * @param bool $create true for create, false for rename
  * @return html form
  */
 static function folder_options($folder, $create)
 {
     self::_require_access($folder, "write");
     $sel_folder = folder_build_selfolder($folder, "");
     $tpl = new template();
     $tpl->schemas = select::modules();
     $tpl->icons = select::icons_modules();
     $tpl->isdbfolder = is_numeric($folder);
     $tpl->style = $_SESSION["theme"];
     $tpl->folder = array("name" => $sel_folder["ftitle"], "description" => $sel_folder["fdescription"], "type" => $sel_folder["ftype"], "assets" => $sel_folder["fcount"], "icon" => $sel_folder["icon"], "notification" => $sel_folder["notification"], "id" => $folder);
     return $tpl->render($create ? "templates/ajax_folder_create.php" : "templates/ajax_folder_rename.php");
 }
开发者ID:drognisep,项目名称:Simple-Groupware,代码行数:19,代码来源:ajax.php

示例4: rename

 static function rename($folder, $ftitle, $type, $description = null, $icon = null, $notification = null)
 {
     if (!array_key_exists($type, select::modules())) {
         $type = "";
     }
     $ftitle = ltrim($ftitle, "!^/");
     $row = db_select_first("simple_sys_tree", array("id", "lft", "rgt", "parent"), "id=@id@", "", array("id" => $folder));
     if (isset($row["lft"])) {
         $duplicate = db_select_value("simple_sys_tree", "id", array("id!=@id@", "parent=@parent@", "ftitle=@ftitle@"), array("id" => $row["id"], "parent" => $row["parent"], "ftitle" => $ftitle));
         if (empty($duplicate)) {
             $fields = array("ftitle" => $ftitle);
             if ($type != "") {
                 $fields["ftype"] = $type;
             }
             if ($description !== null) {
                 $fields["fdescription"] = $description;
             }
             if ($icon !== null) {
                 $fields["icon"] = $icon;
             }
             if ($notification !== null) {
                 $fields["notification"] = $notification;
             }
             db_update("simple_sys_tree", $fields, array("id=@id@"), array("id" => $folder));
             db_search_update("simple_sys_tree", $folder, array(), _folder_searchtypes());
             return $folder;
         }
     }
     return "";
 }
开发者ID:drognisep,项目名称:Simple-Groupware,代码行数:30,代码来源:folders.php


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