本文整理汇总了PHP中is_root函数的典型用法代码示例。如果您正苦于以下问题:PHP is_root函数的具体用法?PHP is_root怎么用?PHP is_root使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_root函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: TFm2
function TFm2()
{
global $str, $actions;
TTable::TTable();
$str[get_class_name($this)] = array_merge($str[get_class_name($this)], array('title' => array('Файловый менеджер', 'File Manager')));
$field = get('field', false, 'gp');
if ($field) {
$actions[$this->name]['return'] = array('OK', 'OK', 'link' => "cnt.sendValues(); ", 'img' => '../third/restore_f2.png', 'display' => 'none');
}
$actions[$this->name]['load'] = array('Загрузить', 'Load', 'link' => "\n\t\t\t\t \t cnt.document.getElementById('createForm').style.visibility='hidden';\n\t\t\t\t \t cnt.direction = -1;\n\t\t\t\t\t cnt.startMainLoad();\n\t\t\t\t\t cnt.showDownloadFrom();\n\t\t\t\t ", 'img' => '../third/filesave.png', 'display' => 'none');
$actions[$this->name]['create'] = array('Создать директорию', 'Create', 'link' => "\n\t\t\t\t \t cnt.document.getElementById('downloadForm').style.visibility='hidden';\n\t\t\t\t \t cnt.direction = -1;\n\t\t\t\t\t cnt.startMainLoad();\n\t\t\t\t\t cnt.showCreateFrom();", 'img' => '../third/add_section.png', 'display' => 'none');
$actions[$this->name]['delete'] = array('Удалить', 'Delete', 'link' => "cnt.Delete();", 'img' => '../third/cancel_f2.png', 'display' => 'none');
$actions[$this->name]['rename'] = array('Переименовать', 'Rename', 'link' => "\n\t\t\t\t \t cnt.document.getElementById('changenameForm').style.visibility='hidden';\n\t\t\t\t \t cnt.direction = -1;\n\t\t\t\t\t cnt.startMainLoad();\n\t\t\t\t\t cnt.showChangenameForm();", 'img' => '../third/menu.png', 'display' => 'none');
$data = $this->ReadIni('modules/' . $this->name . '/module.ini');
if (isset($data['module']['watermark']) && $data['module']['watermark']) {
$actions[$this->name]['watermark'] = array('Водяной знак', 'Water Mark', 'link' => "\n\t\t\t\t\t \t cnt.document.getElementById('watermarkForm').style.visibility='hidden';\n\t\t\t\t\t \t cnt.direction = -1;\n\t\t\t\t\t\t cnt.startMainLoad();\n\t\t\t\t\t\t cnt.showWatermarkForm();", 'img' => '../third/generic.png', 'display' => 'block');
}
$data['dirs'] = array();
$data['defaults'] = array();
$dir = FILES_DIR . domainRootId();
if (!is_dir($dir) || is_root()) {
$dir = FILES_DIR;
}
$data['dirs'][] = $dir;
$data['defaults']['dir'] = $dir;
$this->config = $data;
}
开发者ID:romlg,项目名称:cms36,代码行数:27,代码来源:fm2.php
示例2: Show
function Show()
{
if (!empty($GLOBALS['_POST'])) {
$actions = get('actions', '', 'p');
if ($actions) {
return $this->{$actions}();
}
}
$this->SetValues();
require_once core('ajax_table');
$data['thisname'] = $this->name;
$data['root'] = is_root();
$this->AddStrings($data);
$_tables = sql_getRows('SHOW tables');
foreach ($_tables as $key => $val) {
$tables[$val] = $val;
}
$_transactions = sql_getColumn('SELECT distinct action FROM ' . $this->table . ' ORDER BY action');
foreach ($_transactions as $key => $val) {
$transactions[$val] = $val;
}
$where = '';
if ($this->from_date && $this->to_date) {
$where = ' UNIX_TIMESTAMP(date)>=' . $this->from_date . ' AND UNIX_TIMESTAMP(date)<=' . $this->to_date;
}
$data['table'] = ajax_table(array('columns' => array(array('select' => 'user', 'display' => 'user', 'width' => '1px', 'flags' => FLAG_SORT | FLAG_SEARCH), array('select' => 'object', 'display' => 'object', 'width' => '1px', 'flags' => FLAG_SORT | FLAG_FILTER | FLAG_SEARCH, 'filter_type' => 'array', 'filter_value' => array('' => '-- все --') + $tables, 'filter_rule' => 'find_in_set'), array('select' => 'action', 'display' => 'action', 'width' => '1px', 'flags' => FLAG_SORT | FLAG_FILTER | FLAG_SEARCH, 'filter_type' => 'array', 'filter_value' => array('' => '-- все --') + $transactions), array('select' => 'description', 'display' => 'description', 'type' => 'description', 'flags' => FLAG_SEARCH), array('select' => 'date', 'display' => 'date', 'type' => 'datetime', 'width' => '100px', 'flags' => FLAG_SORT)), 'from' => $this->table, 'where' => $where, 'orderby' => 'date DESC', 'params' => array('page' => $this->name, 'do' => 'show'), 'dblclick' => '', 'click' => ''), $this);
$data['navig'] = $this->NavigForm();
return $this->parse($data, $this->name . '.tmpl');
}
开发者ID:romlg,项目名称:cms36,代码行数:29,代码来源:log_change.php
示例3: Show
function Show()
{
if (!empty($GLOBALS['_POST'])) {
$actions = get('actions', '', 'p');
if ($actions) {
return $this->{$actions}();
}
}
require_once core('list_table');
$data['thisname'] = $this->name;
$logins = array('' => '-') + sql_getRows('SELECT DISTINCT login FROM ' . $this->table . ' ORDER BY login', true);
$data['root'] = is_root();
$this->AddStrings($data);
$data['table'] = list_table(array('columns' => array(array('select' => 'login', 'display' => 'login', 'flags' => FLAG_SORT | FLAG_SEARCH | FLAG_FILTER, 'filter_type' => 'array', 'filter_value' => $logins), array('select' => 'ip', 'display' => 'ip', 'width' => '1px', 'flags' => FLAG_SORT | FLAG_SEARCH), array('select' => 'date', 'display' => 'date', 'type' => 'datetime', 'width' => '100px', 'flags' => FLAG_SORT)), 'from' => ' log_access ', 'orderby' => 'date DESC', 'params' => array('page' => $this->name, 'do' => 'show'), 'dblclick' => '', 'click' => ''), $this);
$this->AddStrings($data);
return $this->Parse($data, LIST_TEMPLATE);
}
开发者ID:romlg,项目名称:cms36,代码行数:17,代码来源:log_access.php
示例4: Show
function Show()
{
if (!empty($_POST)) {
$action = get('actions', '', 'p');
if ($action) {
if ($this->Allow($action)) {
return $this->{$action}();
} else {
return $this->alert_method_not_allowed();
}
}
}
require_once core('ajax_table');
$client_id = get('client_id', 0, 'g');
$ret['thisname'] = $this->name;
$ret['table'] = ajax_table(array('columns' => array(array('select' => 'em.id', 'display' => 'id', 'type' => 'checkbox'), array('select' => 'COUNT(*)', 'as' => 'em_count'), array('select' => 'CONCAT(cl.name,CHAR(32),cl.lname,CHAR(32),"<",cl.login,">")', 'as' => 'to_field', 'display' => $client_id ? NULL : 'to', 'type' => 'to'), array('select' => 'u.id', 'display' => $client_id || is_root() ? 'from' : NULL, 'type' => 'from'), array('select' => 'em.subject', 'display' => 'subject'), array('select' => 'UNIX_TIMESTAMP(em.date)', 'as' => 'from_date', 'display' => 'date', 'type' => 'datetime'), array('select' => 'CONCAT(u.fullname,CHAR(32),"<",u.login,">")', 'as' => 'u_fullname')), 'from' => $this->table . ' AS em
LEFT JOIN email_log AS log ON em.id=log.email_id
LEFT JOIN auth_users AS cl ON log.client_id=cl.id
LEFT JOIN users AS u ON em.user_id=u.id', 'where' => $client_id ? 'log.client_id=' . $client_id : '', 'orderby' => 'em.date DESC', 'groupby' => 'em.id', 'params' => array('page' => $this->name, 'do' => 'show', 'client_id' => $client_id), 'click' => 'ID=cb.value;', 'dblclick' => 'editItem(id)'), $this);
return $this->Parse($ret, $this->name . '.tmpl');
}
开发者ID:romlg,项目名称:cms36,代码行数:21,代码来源:sent_emails.php
示例5: DownloadFile
function DownloadFile()
{
if (!is_root()) {
return;
}
if (!$this->makeDir(BACKUP_DIR)) {
return;
}
$filename = clearFileName($_GET['name']);
if (!isBackupPathCorrect($filename)) {
exit;
}
$dotpos = strrpos($filename, '.');
switch (substr($filename, $dotpos + 1, strlen($filename) - $dotpos - 1)) {
case "bz2":
$mime_type = "application/x-bzip";
break;
case "gz":
$mime_type = "application/x-gzip";
default:
$mime_type = "application/octet-stream";
}
if (!file_exists(BACKUP_DIR . '/' . $filename)) {
exit;
}
ob_end_clean();
Header('Content-Encoding: none');
Header("Content-Type: " . $mime_type);
header("Content-Disposition: attachment; filename=\"" . $filename . "\"");
header("Expires: 0");
header("Pragma: no-cache");
$fp = fopen(BACKUP_DIR . '/' . $filename, 'rb');
while (!feof($fp)) {
echo fread($fp, 10240);
}
fclose($fp);
exit;
}
开发者ID:romlg,项目名称:cms36,代码行数:38,代码来源:mysqldump.php
示例6: helper_result
if ($ftp->is_my_ftp($ftp_id) || is_root() || is_admin() && $ftp->is_my_ftp($ftp_id)) {
$ftp->set_id($ftp_id);
$ftp->get_ftp();
echo $layout->title(txt('edit_ftp'), 'icon.png');
echo $layout->txtdesc(txt('dsc_ftp_title'));
echo helper_result('update_ftp');
$form = new phpos_forms();
echo $form->form_start('update_ftp', helper_ajax('section.edit_account.php'), array('app_params' => ''));
$form->reload_after_submit(array('nowy'));
$form->input('hidden', 'action', '', '', 'update_ftp');
echo $layout->column('50%');
$form->title($ftp->get_title(), null, ICONS . 'edit.png');
$form->condition('not_null', true, txt('form_empty_field') . txt('title'));
$form->input('text', 'ftp_new_title', txt('title'), txt('dsc_ftp_name'), $ftp->get_title());
$form->input('text', 'ftp_new_desc', txt('desc'), txt('dsc_ftp_desc'), $ftp->get_desc());
if (is_root() || is_admin()) {
$items = array('0' => txt('no'), '1' => txt('yes'));
$form->radio('ftp_new_public', txt('ftp_form_public'), txt('ftp_form_public_desc'), $items, $ftp->get_is_public());
} else {
$form->input('hidden', 'ftp_new_public', '', '', '0');
}
echo $form->render();
echo $layout->end('column');
echo $layout->column('50%');
$form->title(txt('ftp_authentication'), '', ICONS . 'system_info/key_icon.png');
$form->condition('not_null', true, txt('form_empty_field') . 'Host');
$form->input('text', 'ftp_new_host', 'Host/IP', txt('dsc_ftp_host'), $ftp->get_host());
$form->condition('not_null', true, txt('form_empty_field') . 'Login');
$form->input('text', 'ftp_new_login', 'Login', txt('dsc_ftp_login'), $ftp->get_login());
$form->condition('not_null', true, txt('form_empty_field') . txt('password'));
$form->input('password', 'ftp_new_pass', txt('password'), txt('dsc_ftp_pass'), $ftp->get_password());
开发者ID:brian-clemont,项目名称:phpos,代码行数:31,代码来源:section.edit_account.php
示例7: die
die('<strong style="color:orangered">[ ! ] Cannot create cache folder. Please create it manually. It should have this address: <i>' . CACHE_DIR . '</i></strong>');
}
}
?>
<?php
$cnx = db_connect();
// is already installed?
if (mysql_query("DESCRIBE " . TBL_PREFIX . TBL_RECORDS, $cnx)) {
?>
<h3 class="ko">smt2 is already installed</h3>
<?php
// help the root user to unistall smt2 stuff
$msg = is_root() ? 'you need to <a href="uninstall.php">uninstall here</a> first' : 'please delete all <em>' . TBL_PREFIX . '</em> tables from database';
?>
<p>
If you want to re-install it, <?php
echo $msg;
?>
.
</p>
<?php
} else {
// before installing, ask user email (will be inserted on DB)
if (isset($_POST['email'])) {
$email = trim($_POST['email']);
}
// however, it can be changed later, so it won't be validated
开发者ID:sorincoza,项目名称:smt2-for-wordpress,代码行数:31,代码来源:install.php
示例8: unlink
<?php
if (empty($_POST)) {
exit;
}
// server settings are required - relative path to smt2 root dir
require '../../../config.php';
// protect extension from being browsed by anyone
require SYS_DIR . 'logincheck.php';
// only the root user can delete logs
if (!is_root()) {
die_msg($_loginMsg["NOT_ALLOWED"]);
}
if (isset($_GET['id'])) {
$logQuery = "id='" . (int) $_GET['id'] . "'";
} else {
if (isset($_GET['cid'])) {
$logQuery = "client_id='" . $_GET['cid'] . "'";
} else {
if (isset($_GET['pid'])) {
$pageId = (int) $_GET['pid'];
$logQuery = "cache_id='" . $pageId . "'";
// delete cached file
$cacheQuery = "id='" . $pageId . "'";
$page = db_select(TBL_PREFIX . TBL_CACHE, "file", $cacheQuery);
if (is_file(CACHE_DIR . $page['file'])) {
unlink(CACHE_DIR . $page['file']);
}
// now delete cache log
db_delete(TBL_PREFIX . TBL_CACHE, $cacheQuery);
}
开发者ID:sorincoza,项目名称:smt2-for-wordpress,代码行数:31,代码来源:delete.php
示例9:
break;
}
if (defined('DESKTOP')) {
$explorer->config('icon_size_class', 'phpos_icon_desktop_size_medium');
}
/*
**************************
*/
// Shortcucts for params
$action_id = $my_app->get_param('action_id');
$dir_id = $my_app->get_param('dir_id');
$root_id = $my_app->get_param('root_id');
/*
**************************
*/
if (globalconfig('readonly') && !is_root()) {
$my_app->set_param('readonly', 1);
$readonly = 1;
cache_param('readonly');
}
/*
**************************
*/
// Actions (new dir, upload, etc)
include MY_APP_DIR . 'controllers/explorerControllerActions.php';
/*
**************************
*/
// Reset params
$my_app->set_param('action_id', null);
$my_app->set_param('action_param', null);
开发者ID:brian-clemont,项目名称:phpos,代码行数:31,代码来源:explorerController.php
示例10: txt
?>
startmenu/switch_arrow_right.png" id="desktop_switch_right" title="<?php
echo txt('desktop_switch_tray_to_local');
?>
"/>
</div>
</div>
<div id="phpos-menustart_Window_container"></div>
<div id="phpos-menustart_WindowApps_container"> <?php
require_once PHPOS_DIR . 'controllers/menu_startAppsController.php';
?>
</div>
<?php
if (globalconfig('demo_mode') == 1 && !is_root()) {
echo '<div id="phpos-menustart_Desktop_demo"><span style="font-size:24px">' . txt('demo_mode') . '</span><br />' . txt('demo_mode_desc') . '</div>';
}
?>
<div id="phpos-menustart_Desktop_info"><img src="<?php
echo ICONS;
?>
desktop_switcher/db.png" style="display:inline-block; vertical-align:middle; padding-right:5px" /><b><?php
echo txt('desktop_switch_up_desktop');
?>
</b> <?php
echo txt('desktop_switch_up_db');
?>
</div>
<script>
开发者ID:brian-clemont,项目名称:phpos,代码行数:31,代码来源:menu_startController.php
示例11: GetTree
/**
* Построение дерева
*
* @param int $id - от какого элемента строить дерево
* @param int $level
* @param int $hidden - если hidden=0, то не показываем скрытые разделы
* @param int root_id
* @param array $params
* @return unknown
*/
function GetTree($id, $level = -1, $hidden = 1, $root_id, $params = array())
{
global $user;
$level++;
$root_id = $root_id ? $root_id : domainRootID();
$deny_ids = '';
if (!is_root() && !empty($user['deny_ids'])) {
$deny_ids = $user['deny_ids'];
}
if (defined('LANG_SELECT') && LANG_SELECT) {
$name_select = "IF (name_" . lang() . " <> '', name_" . lang() . ", name_" . LANG_DEFAULT . ") as name";
} else {
$name_select = "name";
}
if ($this->department_id) {
$sql = "\n \t\t\tSELECT\n \t\t\t\tid, {$name_select}, next, visible, pid, priority, page, type, root_id, pids, level, dir, protected, is_link\n \t\t\tFROM\n \t\t\t\t" . $this->table . "\n \t\t\tWHERE\n pid<>id\n " . ($this->pids[0] == $this->department_id && (int) $this->pids[$level] ? " AND pid=" . (int) $this->pids[$level] : ' AND pid=' . $this->department_id) . "\n " . (!$hidden ? " AND visible>'0'" : " AND visible>='0'") . "\n \t\t\t\t" . ($deny_ids ? " AND id NOT IN (" . $deny_ids . ")" : "") . "\n \t\t\tORDER BY\n \t\t\t\tpriority, name\n \t\t";
} else {
$sql = "\n\t\t\tSELECT\n\t\t\t\tid, {$name_select}, next, visible, pid, priority, page, type, root_id, pids, level, dir, protected, is_link\n\t\t\tFROM\n\t\t\t\t" . $this->table . "\n\t\t\tWHERE\n root_id='" . $root_id . "'\n " . ($this->pids[0] == $root_id && (int) $this->pids[$level] ? " AND pid=" . (int) $this->pids[$level] : ' AND pid=' . $root_id) . " AND pid<>id\n " . (!$hidden ? " AND visible>'0'" : " AND visible>='0'") . "\n\t\t\t\t" . ($deny_ids ? " AND id NOT IN (" . $deny_ids . ")" : "") . "\n\t\t\tORDER BY\n\t\t\t\tpriority, name\n\t\t";
}
$rows = sql_getRows($sql);
$items = array();
if ($rows) {
$hidden_url = !$hidden ? "&hidden=0" : "";
foreach ($rows as $row) {
$items[$row['id']] = $this->getOneItem($id, $row, $root_id, $hidden_url, $params);
if ($this->department_root) {
if (is_array($this->pids) && $this->pids['0'] == $root_id && in_array($row['id'], $this->pids) && $row['id'] != $row['pid']) {
$items[$row['id']]['subtree'] = $this->GetTree($id, $level, $hidden, $root_id, $params);
}
} else {
if (is_array($this->pids) && $this->pids['0'] == $this->department_id && in_array($row['id'], $this->pids) && $row['id'] != $row['pid']) {
$items[$row['id']]['subtree'] = $this->GetTree($id, $level, $hidden, $root_id, $params);
}
}
}
}
$items_data['items'] =& $items;
if (count($rows) && $level > 0) {
$items_data['ul_open'] = '<ul>';
$items_data['ul_close'] = '</ul>';
}
$tpl = 'tree/tree.items.tmpl';
if ($params['copy']) {
$tpl = 'tree/tree.items_copy.tmpl';
} elseif ($params['treeurl']) {
$tpl = 'tree/treeurl/treeurl.items.tmpl';
} elseif ($params['treeid']) {
$tpl = 'tree/treeid/treeid.items.tmpl';
} elseif ($params['checkboxtree']) {
$tpl = 'tree/treecheck/treecheck.items.tmpl';
}
$tree = Parse($items_data, $tpl);
return $tree;
}
开发者ID:romlg,项目名称:cms36,代码行数:64,代码来源:tree.php
示例12: txt
<div class="nav_icons_container">
<?php
echo $html['navbar'];
?>
</div>
<div class="nav_address_container">
<?php
echo $html['addressbar'];
?>
</div>
</div>
<?php
if (APP_ACTION == 'index' && $my_app->get_param('fs') == 'ftp' || $my_app->get_param('fs') == 'local_files' && (!$readonly && globalconfig('disable_upload') != 1 || is_root())) {
?>
<div id="phpos_explorer_uploader_container" class="easyui-tooltip" title="<?php
echo txt('tip_explorer_upload_file');
?>
">
<form enctype="multipart/form-data" method="post" action="<?php
echo helper_post('null', array('fs' => $app_param['fs']));
?>
" id="upload" style="background: transparent">
<input type="hidden" name="phpos_upload" value="1">
<input type="hidden" name="posttest" value="postyes">
<img style="height:29px" valign="middle" src="<?php
echo PHPOS_WEBROOT_URL;
开发者ID:brian-clemont,项目名称:phpos,代码行数:30,代码来源:inc.explorer_toolbar.php
示例13: first_replace
*
* изменения by [email protected] 2006-08:
* + дамп работает как подключаемый файл в движке
* + вывод кешируется в файл
* + соединение поддерживается передачей символов раз в секунду
* - исключен формат .zip
* + файл не отдается пользователю сразу, он сбрасывается на сервер
* и js возвращает ссылку для его загрузки
*****************************************************************************/
/**
* Get the variables sent or posted to this script and a core script
*/
$GLOBALS['ob_mode'] = 1;
$GLOBALS['gzip'] = false;
# check rights
if (!is_root() && $user['rights']['mysqldump'] != 15) {
die("Access denied.");
}
define("EXT_INC_COL", 100);
# max allowed count of extended insert syntax
$db = $_POST["db"];
$GLOBALS['asfile'] = $asfile = $_POST["as"] != "data";
header('Content-Encoding: none');
ob_end_clean();
echo "<html><head><title>Processing database</title></head>\n<body>Dumping: \n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r";
flush();
function first_replace($from, $to, $str)
{
$pos = strpos($str, $from);
$start = substr($str, 0, $pos);
$end = substr($str, $pos + strlen($from), strlen($str) - $pos - strlen($from));
开发者ID:romlg,项目名称:cms36,代码行数:31,代码来源:tbl_dump.php
示例14: array
**********************************
*/
if (!defined('PHPOS')) {
die;
}
global $my_app;
$workgroup_id = $my_app->get_param('workgroup_id');
$app_menu = array('title:' . txt('my_server') . ',action:actionGoServer,icon:icon-myserver');
if (is_root() || is_admin()) {
$app_menu[] = 'title:' . txt('group_section_new_group') . ',action:actionNewGroup,icon:icon-edit_add';
$app_menu[] = 'title:' . txt('group_section_list') . ',action:actionManageGroups,icon:icon-group';
}
if (!empty($workgroup_id)) {
$check_group = new phpos_groups();
if (is_root() || is_admin() && $check_group->im_owner($workgroup_id)) {
$app_menu[] = 'title:' . txt('group_section_edit_group') . ',action:actionEditGroup,icon:icon-edit';
$app_menu[] = 'title:' . txt('group_section_group_users') . ',action:actionEditGroupUsers,icon:icon-user';
}
}
function actionEditGroup($menu_item)
{
global $my_app;
$j = winopen(txt('group_section_edit_group'), 'cp', 'app_id:groups@groups_admin', 'section:edit_group,group_id:' . $my_app->get_param('workgroup_id'));
return $j;
}
function actionEditGroupUsers($menu_item)
{
global $my_app;
$j = winopen(txt('group_section_edit_group'), 'cp', 'app_id:groups@groups_admin', 'section:group_users,group_id:' . $my_app->get_param('workgroup_id'));
return $j;
开发者ID:brian-clemont,项目名称:phpos,代码行数:30,代码来源:workgroupMenu.php
示例15: glob
*/
if (!defined('PHPOS')) {
die;
}
$tray_icons = glob(PHPOS_DIR . 'plugins/tray.*.php');
$tray_data = array();
foreach ($tray_icons as $tray_plugin) {
$tray = array();
include $tray_plugin;
$tray_data[] = $tray;
}
$c = count($tray_data);
if ($c != 0) {
for ($i = 0; $i < $c; $i++) {
$this_tray = $tray_data[$i];
if ($this_tray['access_level'] < 2 || $this_tray['access_level'] == 2 && is_admin() || is_root()) {
$wintask = new api_wintask();
$wintask->setContextMenu($this_tray['context_menu']);
$js_context_menu .= $wintask->contextMenuRender('phpos_tray_icon_' . $this_tray['id'], 'img', 'left');
$txt = '';
if (!empty($this_tray['txt'])) {
$txt = '<span>' . $this_tray['txt'] . '</span>';
}
if ($this_tray['use_custom_icons']) {
echo '<div id="phpos_tray_icon_' . $this_tray['id'] . '" title="' . $this_tray['title'] . '" class="phpos_tray_item phpos_tray_item_mouseleave"><img src="' . $this_tray['icons'][0] . '" />' . $txt . '</div>';
} else {
echo '<div id="phpos_tray_icon_' . $this_tray['id'] . '" title="' . $this_tray['title'] . '" class="phpos_tray_item phpos_tray_item_mouseleave"><img src="' . PHPOS_WEBROOT_URL . '_phpos/icons_tray/' . $this_tray['icons'][0] . '" />' . $txt . '</div>';
}
}
}
}
开发者ID:brian-clemont,项目名称:phpos,代码行数:31,代码来源:menu_startTrayController.php
示例16: render_address_links
public function render_address_links()
{
$links = $this->get_address_links();
$c = count($links);
$separator = '<img class="arrow"
src="' . THEME_URL . 'icons/arrow_small_right.png">';
global $my_app;
$tmp_shared_id = $my_app->get_param('tmp_shared_id');
if (!empty($tmp_shared_id)) {
$shared = new phpos_shared();
$shared->set_id($tmp_shared_id);
$shared->get_shared();
$shared_dir = $shared->get_folder_id();
}
$in_shared = $my_app->get_param('in_shared');
/*.............................................. */
// If not in shared:
if (!$in_shared) {
if ($c != 0) {
for ($i = 0; $i < $c; $i++) {
$item = $this->filesystem->get_file_info($links[$i]);
if ($item['id'] != $shared_dir) {
if (is_root()) {
$item = $this->root_homedir_address_parse($item);
}
$address .= '<a
onclick="' . helper_reload(array('dir_id' => $item['id'])) . '"
href="javascript:void(0);">' . $item['basename'] . '</a>' . $separator;
}
}
}
}
$address_start = '<a onclick="' . helper_reload(array('dir_id' => $this->filesystem->get_root_directory_id())) . '"
href="javascript:void(0);"><b>' . $this->filesystem->protocol_name . '</b></a>';
/*.............................................. */
if (APP_ACTION == 'my_server') {
$address_start = '<a onclick="' . helper_reload(array('dir_id' => $this->filesystem->get_root_directory_id())) . '"
href="javascript:void(0);"><b>' . txt('my_server') . '</b></a>';
}
/*.............................................. */
if (APP_ACTION == 'cp') {
$address_start = '<a onclick="' . helper_reload(array('dir_id' => $this->filesystem->get_root_directory_id())) . '"
href="javascript:void(0);"><b>' . txt('control_panel') . '</b></a>';
}
/*.............................................. */
if (APP_ACTION == 'shared') {
$group = new phpos_groups();
$group_id = $my_app->get_param('workgroup_id');
if (!empty($group_id)) {
$group->set_id($group_id);
$group->get_group();
$group_user = new phpos_users();
$id_user = $my_app->get_param('workgroup_user_id');
$group_user->set_id_user($id_user);
$group_user->get_user_by_id();
$address_start = '<a onclick="phpos.windowActionChange(\'' . WIN_ID . '\', \'workgroup\', \'workgroup_id:' . $group_id . ',fs:local_files\')" href="javascript:void(0);"><b>' . $group->get_title() . '</b></a>' . $separator . '<a onclick="phpos.windowActionChange(\'' . WIN_ID . '\', \'shared\', \'workgroup_id:' . $group_id . ',workgroup_user_id:' . $id_user . ',fs:local_files\')" href="javascript:void(0);"><b>' . $group_user->get_user_login() . '</b></a>';
} else {
$id_user = logged_id();
$group_user = new phpos_users();
$group_user->set_id_user($id_user);
$group_user->get_user_by_id();
$address_start = '<a onclick="phpos.windowActionChange(\'' . WIN_ID . '\', \'shared\', \'workgroup_id:0,fs:local_files\')" href="javascript:void(0);"><b>' . $group_user->get_user_login() . '</b></a>';
}
}
/*.............................................. */
if (APP_ACTION == 'workgroup') {
$group = new phpos_groups();
$group_id = $my_app->get_param('workgroup_id');
if (!empty($group_id)) {
$group->set_id($group_id);
$group->get_group();
$address_start = '<a onclick="phpos.windowActionChange(\'' . WIN_ID . '\', \'workgroup\', \'workgroup_id:' . $group_id . ',fs:local_files\')" href="javascript:void(0);"><b>' . $group->get_title() . '</b></a>';
} else {
$address_start = '<a onclick="phpos.windowActionChange(\'' . WIN_ID . '\', \'workgroup\', \'workgroup_id:0,fs:local_files\')" href="javascript:void(0);"><b>Workgroups</b></a>';
}
}
$in_shared = $my_app->get_param('in_shared');
$tmp_shared_id = $my_app->get_param('tmp_shared_id');
/*.............................................. */
if (APP_ACTION == 'index' && (defined('SHARED') || $in_shared)) {
$group = new phpos_groups();
$group_id = $my_app->get_param('workgroup_id');
$group->set_id($group_id);
$group->get_group();
$shared_id = $my_app->get_param('tmp_shared_id');
$shared = new phpos_shared();
$shared->set_id($shared_id);
$shared->get_shared();
$group_user = new phpos_users();
$id_user = $shared->get_id_user();
$group_user->set_id_user($id_user);
$group_user->get_user_by_id();
$address_start = '<a
onclick="phpos.windowActionChange(\'' . WIN_ID . '\', \'shared\', \'workgroup_id:' . $group_id . ',workgroup_user_id:' . $id_user . ',fs:local_files\')" href="javascript:void(0);"><b>' . $group_user->get_user_login() . '</b></a>' . $separator . '<a onclick="phpos.windowActionChange(\'' . WIN_ID . '\', \'index\', \'shared_id:' . $shared_id . ',in_shared:1,fs:local_files\')" href="javascript:void(0);"><b>' . $shared->get_title() . '</b></a>';
}
/*.............................................. */
//if(APP_ACTION != 'index') $address = '';
$address_bar = $address_start . $separator . $address;
$ftp_id = $my_app->get_param('ftp_id');
if (!empty($ftp_id)) {
//.........这里部分代码省略.........
开发者ID:brian-clemont,项目名称:phpos,代码行数:101,代码来源:class.explorer.php
示例17: is_root
<?php
// server settings are required - relative path to smt2 root dir
require '../../../config.php';
// protect extension from being browsed by anyone
require SYS_DIR . 'logincheck.php';
// now you have access to all CMS API
include INC_DIR . 'header.php';
// only root user can perform certain operations
$ROOT = is_root();
// load maintenance configuration
require 'config.php';
?>
<h1 id="orphanlogs">Orphan cache logs</h1>
<?php
echo check_notified_request("orphanlogs");
?>
<?php
// get cache logs id
$cached = db_select_all(TBL_PREFIX . TBL_CACHE, "id", 1);
$cached = array_flatten($cached);
// get records cache id
$records = db_select_all(TBL_PREFIX . TBL_RECORDS, "cache_id", 1);
$records = array_flatten($records);
// compute difference
$diff = array_diff($cached, $records);
$num = count($diff);
if ($num > 0) {
?>
开发者ID:sorincoza,项目名称:smt2-for-wordpress,代码行数:31,代码来源:index.php
示例18: Editp
function Editp()
{
$root = is_root();
$whom = $_SESSION['user']['login'];
$temp = sql_getRow("SELECT *,(total - bonus) as total FROM bills WHERE id=" . $_POST['id']);
$client = sql_getRow("SELECT * FROM auth_users WHERE id=" . $temp['client_id']);
$order = sql_getRows("SELECT * FROM cart as c LEFT JOIN products as p on c.product_id=p.id WHERE c.order_id=" . $temp['order_id']);
if (!$root) {
if ($temp['received'] < $temp['total']) {
if ($_POST['fld']['received'] + $temp['received'] > $temp['total']) {
return "<script>alert('" . $this->str('rec_big') . "');</script>";
}
} else {
return "<script>alert('" . $this->str('rec_big2') . "');</script>";
}
}
if ($_POST['fld']['received'] > 0 || $root) {
//--- notify ---
$this->emailNotify($temp, 'bills_money');
//--------------
$temp['received'] += $_POST['fld']['received'];
if ($_POST['fld']['received'] != 0) {
$this->in_history('change_money', 'bill', $temp['client_id'], $temp['id'], $_POST['fld']);
if ($temp['received'] >= $temp['total'] & !empty($order)) {
$_POST['fld']['status'] = 'paid';
//--- notify ---
$this->emailNotify($temp, 'bills_status');
//--------------
$this->in_history('auto_ch_status', 'bill', $temp['client_id'], $temp['id'], $_POST['fld']);
} elseif ($temp['received'] < $temp['total']) {
$_POST['fld']['status'] = 'new';
if ($_POST['fld']['status'] != $temp['status']) {
//--- notify ---
$this->emailNotify($temp, 'bills_status');
//--------------
$this->in_history('auto_ch_status_no_money', 'bill', $temp['client_id'], $temp['id'], $_POST['fld']);
}
} elseif (empty($order)) {
$_POST['fld']['status'] = 'new';
//--- notify ---
$this->emailNotify($temp, 'bills_status');
//--------------
if ($_POST['fld']['status'] != $temp['status']) {
$this->in_history('auto_ch_status_no_bill', 'bill', $temp['client_id'], $temp['id'], $_POST['fld']);
}
}
}
}
//только root может отнимать от суммы
if ($_POST['fld']['received'] < 0 && !$root) {
return "<script>alert('" . $this->str('error') . "');</script>";
}
/*Бонусная система*/
if ($client['otkat'] != 0) {
//убираем участие в бриз клубе и перестаем считать откаты
if ($client['briz_club'] == 1) {
my_query("UPDATE auth_users SET briz_club = 0, bonus_bill = 0 WHERE id=" . $client['id']);
}
} else {
//проверяем, является ли клиент участником клуба
if ($client['briz_club'] != 1) {
//смотри, если текущих денег хватит для оплаты, то не собираем все счета за 2 месяца
if ($temp['received'] < 3000) {
//проверяем оплаченные счета за 2 месяца, на предмет добавления в клуб
$date = date('Y-m-d 00:00:00', time() - 60 * 60 * 24 * 61);
//время 61 день назад
$sql = 'SELECT sum(total) FROM `bills` WHERE client_id=' . $client['id'] . ' and status = "paid" and date_pay > "' . $date . '"';
if (sql_getValue($sql) >= 3000) {
$client['briz_club'] = 1;
}
} else {
$client['briz_club'] = 1;
}
//елси его добавляем в клуб то устанавливаем значение для $client['briz_club']
if ($client['briz_club'] == 1) {
my_query("UPDATE auth_users SET bonus_bill = 0, briz_club = 1 WHERE id=" . $client['id']);
}
}
if ($client['briz_club'] == 1) {
//зачисляем бонусы на счет
$money = $_POST['fld']['received'];
if (!empty($money)) {
if (abs($money) >= 3000 && abs($money) < 4999) {
$bonus = $money * 0.01;
}
if (abs($money) >= 5000 && abs($money) < 9999) {
$bonus = $money * 0.02;
}
if (abs($money) >= 10000) {
$bonus = $money * 0.03;
}
if (isset($bonus)) {
$bonus = round($bonus);
//округляем
//зачисляем на счет
my_query("UPDATE auth_users SET bonus_bill = bonus_bill + " . $bonus . " WHERE id=" . $client['id']);
//--- notify ---
$array = array('bonus' => $bonus, 'client' => $client);
SendNotify('SEND_ADD_BONUS', $client['id'], $array);
}
//.........这里部分代码省略.........
开发者ID:romlg,项目名称:cms36,代码行数:101,代码来源:bills.php
示例19: helper_result
if ($cloud->new_cloud($tmp_title, $tmp_desc, $tmp_cloud, $tmp_login, $tmp_pass, $tmp_public, $tmp_url, $tmp_param1, $tmp_param2, $tmp_param3, $tmp_param4)) {
helper_result('new_cloud', 'ok', txt('created'));
helper_result('new_cloud_result', 'result', 'success');
h
|
请发表评论