本文整理汇总了PHP中admin::build_js方法的典型用法代码示例。如果您正苦于以下问题:PHP admin::build_js方法的具体用法?PHP admin::build_js怎么用?PHP admin::build_js使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类admin
的用法示例。
在下文中一共展示了admin::build_js方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: write_config
static function write_config($no_hash, $no_hash2)
{
$out = array();
$out[] = "<?php";
$out[] = "define('CORE_VERSION','" . CORE_VERSION . "');";
$out[] = "define('CORE_VERSION_STRING','" . CORE_VERSION_STRING . "');";
$out[] = "define('CORE_SGSML_VERSION','" . CORE_SGSML_VERSION . "');";
$out[] = "define('SETUP_DB_TYPE','" . SETUP_DB_TYPE . "');";
foreach ($_POST as $key => $val) {
$val = $_REQUEST[$key];
if (is_array($val)) {
$val = implode("|", $val);
}
if (in_array($key, array("action_sys", "token"))) {
continue;
}
if ($key == "invalid_extensions") {
$val = trim(preg_replace("|\\s*,\\s*|", ",", $val));
}
if ($key == "setup_db_pw") {
$val = sys_encrypt($val, sha1($_REQUEST["setup_admin_user"]));
}
if (!$no_hash and $key == "setup_admin_pw") {
$val = sha1($val);
}
if (!$no_hash2 and $key == "setup_admin_pw2") {
$val = sha1($val);
}
if (!is_numeric($val)) {
if (strpos($val, "\n") or strpos($val, "'")) {
$val = "base64_decode('" . base64_encode($val) . "')";
} else {
$val = "'" . $val . "'";
}
}
$key = strtoupper($key);
if (isset(self::$bools[$key])) {
if ($val == "1") {
$val = "true";
} else {
$val = "false";
}
}
$out[] = "define('" . $key . "'," . $val . ");";
}
$out[] = "if (TIMEZONE!='') date_default_timezone_set(TIMEZONE);\n" . " elseif (!ini_get('date.timezone')) date_default_timezone_set(@date_default_timezone_get());";
$out[] = "if (!ini_get('display_errors')) @ini_set('display_errors','1');";
$out[] = "define('NOW',time());";
$out[] = "define('APC',function_exists('apc_store') and ini_get('apc.enabled'));";
$out[] = "?>";
file_put_contents("simple_store/config.php", implode("\n", $out), LOCK_EX);
admin::build_js($_REQUEST["lang"]);
if (SIMPLE_CACHE != $_REQUEST["simple_cache"]) {
self::dirs_clear_caches(SIMPLE_CACHE);
self::dirs_clear_caches($_REQUEST["simple_cache"]);
}
// TODO initialize simple_store if different
if (SIMPLE_CUSTOM != $_REQUEST["simple_custom"]) {
self::dirs_clear_custom($_REQUEST["simple_custom"]);
}
if (SIMPLE_EXT != $_REQUEST["simple_ext"]) {
self::dirs_clear_custom($_REQUEST["simple_ext"]);
}
sys_log_message_log("info", sprintf("{t}Setup: setup-data written to %s.{/t}", "simple_store/config.php"));
}
示例2: install
function install()
{
setup::out('
<html>
<head>
<title>Simple Groupware & CMS</title>
<style>
body { width:526px; margin:10px auto; }
body, a { color: #666666; font-size: 13px; font-family: Arial, Helvetica, Verdana, sans-serif; }
a { color: #0000FF; }
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div style="border-bottom: 1px solid #666666; letter-spacing: 2px; font-size: 18px; font-weight: bold;">Simple Groupware ' . CORE_VERSION_STRING . '</div>
');
$_SESSION["groups"] = array();
$_SESSION["username"] = "setup";
$_SESSION["password"] = "";
$_SESSION["permission_sql"] = "1=1";
$_SESSION["permission_sql_read"] = "1=1";
$_SESSION["permission_sql_write"] = "1=1";
define("SETUP_DB_TYPE", $_REQUEST["db_type"]);
$update = sgsml_parser::table_column_exists("simple_sys_tree", "id");
setup::out('<img src="http://www.simple-groupware.de/cms/logo.php/' . CORE_VERSION . '/' . SETUP_DB_TYPE . '/' . PHP_VERSION . '/' . (int) $update . '" style="width:1px; height:1px;">', false);
setup::out(t("{t}Processing %s ...{/t}", "schema updates"));
setup_update::change_database_pre();
if (SETUP_DB_TYPE == "sqlite") {
sql_query("begin");
admin::rebuild_schema(false);
sql_query("commit");
} else {
admin::rebuild_schema(false);
}
setup_update::change_database_post();
setup::out(t("{t}Processing %s ...{/t}", "sessions"));
db_delete("simple_sys_session", array(), array());
setup::out(t("{t}Processing %s ...{/t}", "default groups"));
$groups = array("admin_calendar", "admin_news", "admin_projects", "admin_bookmarks", "admin_contacts", "admin_inventory", "admin_helpdesk", "admin_organisation", "admin_files", "admin_payroll", "admin_surveys", "admin_hr", "admin_intranet", "users_self_registration");
foreach ($groups as $group) {
trigger::creategroup($group);
}
setup_update::database_triggers();
setup::out(t("{t}Processing %s ...{/t}", "folder structure"));
$count = db_select_value("simple_sys_tree", "id", array());
if (empty($count)) {
$folders = "modules/core/folders.xml";
if (!empty($_REQUEST["folders"]) and file_exists(sys_custom($_REQUEST["folders"]))) {
$folders = $_REQUEST["folders"];
}
if (SETUP_DB_TYPE == "sqlite") {
sql_query("begin");
folders::create_default_folders($folders, 0, true);
sql_query("commit");
} else {
folders::create_default_folders($folders, 0, true);
}
}
setup_update::database_folders();
setup::out(t("{t}Processing %s ...{/t}", "css"));
admin::build_css();
setup::out(t("{t}Processing %s ...{/t}", "js"));
admin::build_js();
setup::out(t("{t}Processing %s ...{/t}", "icons"));
admin::build_icons();
setup::out(t("{t}Processing %s ...{/t}", "config.php"));
$vars = array("SETUP_DB_TYPE" => "'" . $_REQUEST["db_type"] . "'", "SETUP_DB_HOST" => "'" . $_REQUEST["db_host"] . "'", "SETUP_DB_NAME" => "'" . $_REQUEST["db_name"] . "'", "SETUP_DB_USER" => "'" . $_REQUEST["db_user"] . "'", "SETUP_DB_PW" => "'" . sys_encrypt($_REQUEST["db_pw"], sha1($_REQUEST["admin_user"])) . "'", "SETUP_ADMIN_USER" => "'" . $_REQUEST["admin_user"] . "'", "SETUP_ADMIN_PW" => "'" . (isset($_REQUEST["auto_update"]) ? $_REQUEST["admin_pw"] : sha1($_REQUEST["admin_pw"])) . "'");
setup::save_config($vars);
setup::install_footer();
db_optimize_tables();
}
示例3: debug_check_tpl
/**
* in debug mode, refresh template cache automatically on change
*/
function debug_check_tpl()
{
$lastmod = filemtime(SIMPLE_CACHE . "/smarty");
$folders = array("lang/", "templates/", "templates/helper/", "templates/css/", "templates/js/", SIMPLE_CUSTOM . "templates/", SIMPLE_CUSTOM . "templates/helper/", SIMPLE_CUSTOM . "templates/js/");
foreach ($folders as $folder) {
if (!is_dir($folder)) {
continue;
}
foreach (scandir($folder) as $file) {
if ($file[0] == "." or filemtime($folder . $file) <= $lastmod) {
continue;
}
dirs_create_empty_dir(SIMPLE_CACHE . "/smarty");
admin::build_css();
admin::build_js();
admin::build_icons();
return;
}
}
}