本文整理汇总了PHP中core函数的典型用法代码示例。如果您正苦于以下问题:PHP core函数的具体用法?PHP core怎么用?PHP core使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了core函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Show
function Show()
{
if (!empty($GLOBALS['_POST'])) {
$actions = get('actions', '', 'p');
if ($actions) {
return $this->{$actions}();
}
}
// проверим есть ли pid и если есть то относится ли к нужному root_id
$filter = get('filter', array());
if ($filter['all_pids']) {
$page_root_id = sql_getValue("SELECT root_id FROM `tree` WHERE id='" . (int) $filter['all_pids'] . "'");
if ($page_root_id != domainRootID()) {
$_GET['filter']['all_pids'] = 0;
}
}
$tree = array();
$root_id = domainRootId();
if ($root_id > 0 && allowDomainForUser($root_id)) {
$tree = $tree + $this->getPages((int) $root_id);
$temp = $tree;
$tree = array();
foreach ($temp as $val) {
$tree[$val['id']] = $val['name'];
}
}
$filter_pid_value = array('' => 'все') + $tree;
// строим таблицу
require_once core('list_table');
$data['table'] = list_table(array('columns' => array(array('select' => 'p.id', 'display' => 'id', 'type' => 'checkbox'), array('select' => 'p.name', 'display' => 'name', 'flags' => FLAG_SORT | FLAG_SEARCH), array('select' => 'UNIX_TIMESTAMP(p.date)', 'as' => 'date', 'display' => 'date', 'flags' => FLAG_SORT | FLAG_FILTER, 'filter_type' => 'date', 'filter_value' => 'date', 'type' => 'date'), array('select' => 'p.pid', 'display' => 'pid', 'type' => 'dir'), $root_id > 0 ? array('select' => 'CAST(CONCAT(p.pid,\',\',p.pids) AS CHAR)', 'as' => 'all_pids', 'flags' => FLAG_FILTER, 'filter_type' => 'array', 'filter_value' => $filter_pid_value, 'filter_display' => 'pid', 'filter_rule' => 'find_in_set') : array('select' => 'CAST(CONCAT(p.pid,\',\',p.pids) AS CHAR)', 'as' => 'all_pids'), array('select' => 'p.visible', 'display' => 'visible', 'type' => 'visible', 'flags' => FLAG_SORT | FLAG_FILTER, 'filter_type' => 'array', 'filter_value' => array('') + array('1' => 'Да', '2' => 'Нет'), 'filter_field' => 'IF(p.visible=0,2,1)'), array('select' => 'p.id', 'display' => 'showInSite', 'type' => 'show'), array('select' => 't.dir'), array('select' => 't.root_id'), array('select' => 't.name', 'as' => 't_name', 'flags' => FLAG_SEARCH), array('select' => 'p.notice', 'flags' => FLAG_SEARCH), array('select' => 'p.text', 'flags' => FLAG_SEARCH)), 'from' => $this->table . " as p\n\t\t\tLEFT JOIN `tree` as t ON t . id = p . pid\n\t\t\t", 'where' => (domainRootId() > 0 ? ' (t.root_id=' . domainRootId() . ' OR t.root_id IS NULL OR FIND_IN_SET(' . domainRootId() . ', (SELECT GROUP_CONCAT( DISTINCT CAST(root_id AS CHAR)) FROM tree WHERE FIND_IN_SET(id, CONCAT(p.pid, ",", p.pids)))) )' : '') . $this->where_extra, 'orderby' => 'p.date DESC', 'params' => array('page' => $this->name, 'do' => 'show'), 'dblclick' => 'editItem(p.id)', 'click' => 'ID=cb.value'), $this);
$data['table'] .= "<script type='text/javascript'>\n \$('ul.navPanel').find('a:first').attr('onclick','').click(function(){\n \$('.createbox').show().find('input[type=text]').focus();\n });\n </script>\n <style type='text/css'>\n .createbox {\n width:307px;\n height:100px;\n background-color:#fff;\n border:2px solid #FAAE3E;\n position:fixed;\n left:550px;\n top:400px;\n display:none;\n padding:10px;\n box-shadow:5px 5px 5px rgba(0,0,0,0.5);\n }\n .createbox .close {\n text-decoration:none;\n position:relative;\n top:-7px;\n left:304px;\n font-size:16px;\n color:#f00;\n }\n </style>\n <div class='createbox'>\n <a href='javascript:void(0);' onclick='\$(\".createbox\").hide();' class='close'>X</a>\n <form action='' method='post'>\n <input type='hidden' name='page' value='{$this->name}' />\n <input type='hidden' name='do' value='editCreate' />\n <!--input type='hidden' name='ref' value='/admin/editor.php?page={$this->name}' /-->\n <label>Введите название новой публикации:</label>\n <input type='text' class='text' name='fld[name]' id='fld_name' value='' />\n <a href='javascript:void(0);' onclick='if(\$(this).parent().find(\"#fld_name\").val()) \$(this).parent().submit(); else alert(\"Вы не ввели название публикации\");' class='button' style='position:relative;left:90px;top:5px;'><span>Создать</span></a>\n </form>\n </div>";
$this->AddStrings($data);
return $this->Parse($data, LIST_TEMPLATE);
}
示例2: Show
function Show()
{
if (!empty($GLOBALS['_POST'])) {
$actions = get('actions', '', 'p');
if ($actions) {
return $this->{$actions}();
}
}
$positions = $this->getFilterPositions();
if (!$positions) {
echo "<p style='color: red;'>Не задан массив infoblocks_positions в файле settings.cfg.php</p>";
}
// строим таблицу
require_once core('list_table');
$columns = array(array('select' => 'p.id', 'display' => 'id', 'type' => 'checkbox'), array('select' => 'p.name', 'display' => 'name', 'flags' => FLAG_SORT | FLAG_SEARCH), domainRootID() > 0 ? array('select' => 'p.position', 'display' => 'position', 'type' => 'position', 'flags' => FLAG_FILTER, 'filter_type' => 'array', 'filter_value' => array('') + $positions) : array('select' => 'p.position', 'display' => 'position', 'type' => 'position', 'flags' => FLAG_SEARCH), array('select' => 'IF(p.visible=1,1,2)', 'as' => 'visible', 'display' => 'visible', 'type' => 'visible', 'flags' => FLAG_SORT | FLAG_FILTER, 'filter_type' => 'array', 'filter_value' => array('') + array('1' => 'Да', '2' => 'Нет')), array('select' => 'IF(p.publ_announce=1,1,2)', 'as' => 'publ_announce', 'flags' => FLAG_FILTER, 'filter_type' => 'array', 'filter_display' => 'announce', 'filter_value' => array('') + array('1' => 'Да', '2' => 'Нет')), array('select' => 'p.priority', 'display' => 'priority', 'flags' => FLAG_SORT), array('select' => 'p.id', 'display' => 'showurl', 'type' => 'showurl'), array('select' => 'p.id', 'display' => 'hiddenurl', 'type' => 'hiddenurl'), array('select' => 'p.title', 'flags' => FLAG_SEARCH), array('select' => 'p.header_text', 'flags' => FLAG_SEARCH), array('select' => '(SELECT GROUP_CONCAT(",", ir.url) FROM infoblocks_rules AS ir WHERE p.id=ir.pid GROUP BY p.id)', 'flags' => FLAG_SEARCH));
// проверим сколько сайтов, если несколько то выводим колонку
global $site_domains;
$current = current($site_domains);
if (count($site_domains) > 1 || count($current['langs']) > 1) {
$columns[] = array('select' => 'p.root_id', 'display' => 'root_id', 'type' => 'showsites');
}
$data['table'] = list_table(array('columns' => $columns, 'from' => $this->table . " as p", 'orderby' => 'p.name ASC', 'where' => domainRootId() > 0 ? 'root_id=' . domainRootID() : '', 'params' => array('page' => $this->name, 'do' => 'show'), 'dblclick' => 'editItem(p.id)', 'click' => 'ID=cb.value'), $this);
$this->AddStrings($data);
return $this->Parse($data, LIST_TEMPLATE);
}
示例3: Show
function Show()
{
$return = '
<script langauge = "JavaScript">
function deleteItems()
{
}
</script>
<script language = "JavaScript">
var Ahistory0 = new Array(0,0,0,0,0,0,0,0,1);
var Ahistory1 = new Array(0,1,1,1,0,0,0,0,1);
var Ahistory2 = new Array(0,1,0,0,0,0,0,0,1);
window.parent.elemActions(\'history\', 0);
</script>
<script language="JavaScript" src="tooltip/tooltip.js"></script>
';
require_once core('ajax_table');
// Create templorary table
sql_query("DROP TABLE tmp_history");
sql_query("CREATE TABLE tmp_history (\n\t\t\ttype VARCHAR(50) NOT NULL,\n\t\t\tid INT UNSIGNED NOT NULL,\n\t\t\tdate INT UNSIGNED NOT NULL,\n\t\t\tdescription VARCHAR(255) NOT NULL,\n\t\t\ttext TEXT NOT NULL,\n\t\t\tPRIMARY KEY (type, id)\n\t\t)");
// insert notes
sql_query("INSERT INTO tmp_history SELECT 'note', id, date, name, text FROM notes WHERE client_id=" . $this->client_id);
// insert notes
sql_query("INSERT INTO tmp_history SELECT 'order', id, order_date, id, '' FROM orders WHERE client_id=" . $this->client_id);
// insert notes
sql_query("INSERT INTO tmp_history SELECT 'mail', id, UNIX_TIMESTAMP(em.date), em.subject, em.body FROM email_sent AS em LEFT JOIN email_log AS log ON em.id=log.email_id WHERE log.client_id=" . $this->client_id);
$return .= ajax_table(array('columns' => array(array('select' => 'date', 'display' => 'date', 'type' => 'datetime', 'nowrap' => true), array('select' => 'type', 'display' => 'type', 'type' => 'type'), array('select' => 'description', 'display' => 'description', 'type' => 'description', 'width' => '50%'), array('select' => 'text'), array('select' => 'id', 'display' => 'edit', 'type' => 'edit', 'width' => '30', 'align' => 'center')), 'from' => 'tmp_history', 'orderby' => 'date DESC', 'params' => array('page' => $this->name, 'do' => 'show', 'client_id' => $this->client_id)), $this);
return $return;
}
示例4: __construct
public function __construct()
{
$this->request = core('request');
$this->method = $this->request->method();
$routes = (include path('config') . DS . 'routes.php');
$routes = isAke($routes, $this->method, []);
$this->handling($routes);
if (is_callable($this->route)) {
$cb = $this->route;
$args = call_user_func_array($cb, $this->params);
if (!is_array($args)) {
$args = ['main', $args, true];
}
if (count($args) == 2) {
$args[] = true;
}
$this->controller = current($args);
$this->action = $args[1];
$this->render = end($args);
} else {
$this->controller = 'main';
$this->action = 'is404';
$this->render = true;
}
$this->boot();
}
示例5: 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');
}
示例6: Show
function Show()
{
if (!empty($GLOBALS['_POST'])) {
$actions = get('actions', '', 'p');
if ($actions) {
return $this->{$actions}();
}
}
require_once core('ajax_table');
$ret['id'] = 0;
$ret['auth_group'] = (int) get('auth_group');
$ret['auth_groups'] = sql_getRows('select id, name from auth_groups order by priority, name', true);
if (!$ret['auth_group']) {
$ret['auth_group'] = key($ret['auth_groups']);
}
$ret['auth_group_type'] = sql_getValue('
SELECT dt.type
FROM auth_groups AS ag
LEFT JOIN discount_types AS dt ON dt.id = ag.discount_type
WHERE ag.id = ' . $ret['auth_group']);
if ($ret['auth_group_type'] == 'fix') {
$ret['table'] = ajax_table(array('columns' => array(array('select' => 'dg.id', 'type' => 'checkbox'), array('select' => 'dg.name', 'display' => 'product_group'), array('select' => 'discounts.discount', 'display' => 'discount', 'type' => 'edit', 'align' => 'right', 'text-align' => 'right', 'maxlength' => 2, 'size' => 2), array('select' => '""', 'display' => '', 'width' => '50%')), 'from' => 'discount_groups AS dg
LEFT OUTER JOIN discounts ON discounts.discount_group_id = dg.id AND discounts.user_discount_group_id=' . $ret['auth_group'], 'orderby' => 'priority, name', 'params' => array('page' => $this->name, 'do' => 'show', 'id' => '', 'auth_group' => $ret['auth_group']), 'click' => 'ID=cb.value;'), $this);
} else {
$ret['table'] = ajax_table(array('columns' => array(array('select' => 'id', 'type' => 'checkbox', 'display' => 'id'), array('select' => 'volume', 'display' => 'upvolume', 'type' => 'edit', 'align' => 'right', 'text-align' => 'right', 'maxlength' => 10, 'size' => 10), array('select' => 'discount', 'display' => 'discount', 'type' => 'edit', 'align' => 'right', 'text-align' => 'right', 'maxlength' => 2, 'size' => 2), array('select' => '""', 'display' => '', 'width' => '50%')), 'from' => 'discounts_volume', 'where' => 'auth_group_id=' . $ret['auth_group'], 'orderby' => 'volume', 'params' => array('page' => $this->name, 'do' => 'show', 'id' => '', 'auth_group' => $ret['auth_group']), 'click' => 'ID=cb.value;'), $this);
}
$this->AddStrings($ret);
return $this->Parse($ret, $this->name . '.tmpl');
}
示例7: Show
function Show()
{
// обязательная фигня
if (!empty($GLOBALS['_POST'])) {
$actions = get('actions', '', 'p');
if ($actions) {
return $this->{$actions}();
}
}
global $settings;
$types = array();
foreach ($settings['subscribe_categories'] as $key => $val) {
if (isset($val['sub'])) {
foreach ($val['sub'] as $k => $v) {
$types[$v['type']] = $v['title'];
}
}
}
require_once core('ajax_table');
$data['table'] = ajax_table(array('columns' => array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox', 'width' => '1px'), array('select' => 'email', 'display' => 'email', 'flags' => FLAG_SORT | FLAG_SEARCH), array('select' => 'type', 'display' => 'type', 'type' => 'type', 'flags' => FLAG_SORT | FLAG_FILTER, 'filter_display' => 'type', 'filter_type' => 'array', 'filter_value' => array('' => '-- Все --') + $types, 'filter_field' => 'type')), 'from' => $this->table, 'where' => 'root_id=' . domainRootId(), 'params' => array('page' => $this->name, 'do' => 'show'), 'click' => 'ID=cb.value'), $this);
$this->AddStrings($data);
$data['thisname'] = $this->name;
$data['thisname2'] = str_replace('/', '', $this->name);
return Parse($data, "notify/tmpls/properties.tmpl");
}
示例8: load_core
protected function load_core()
{
include core("url");
include core("controller");
include core("model");
$this->url = new Url();
}
示例9: ShowRecipientsAdmins
function ShowRecipientsAdmins()
{
$data = sql_getRows("SELECT id, login, fullname FROM admins");
require_once core('ajax_table');
$ret['thisname'] = $this->name;
$ret['table'] = ajax_table(array('from' => "admins", 'columns' => array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox', 'width' => '1px'), array('select' => 'login', 'display' => 'client_login', 'flags' => FLAG_SEARCH), array('select' => 'email', 'display' => 'email', 'flags' => FLAG_SEARCH)), 'where' => 'LENGTH(email)>0 ', 'orderby' => 'id', 'params' => array('page' => 'notify/send', 'do' => 'showplugin', 'func' => 'ShowRecipientsAdmins', 'plugin' => 'email'), 'click' => 'ID=cb.value;', 'target' => 'tmpemailshowrecipients', 'dblclick' => 'PasteRecipientsAdmins(id)'), $this);
//pr($ret);
return $ret;
}
示例10: Show
function Show()
{
require_once core('ajax_table');
$rows = $this->getChilds($this->table, 'ORDER BY priority');
$types = array();
$this->getList($rows, $types, 1);
$columns = array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox'), array('select' => 'name', 'display' => 'name', 'type' => 'name', 'flags' => FLAG_SEARCH | FLAG_SORT), array('select' => 'belong', 'type' => 'sell_type', 'display' => 'transaction'));
return $this->Show_base($columns, $types);
}
示例11: ShowRecycle
function ShowRecycle()
{
global $limit;
$limit = -1;
require_once core('ajax_table');
$this->AddStrings($row);
$row['table'] = ajax_table(array('columns' => array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox'), array('select' => "description", 'display' => 'comment'), array('select' => "subject", 'display' => 'subject')), 'where' => "visible<=0 AND (user_id IS NULL OR user_id=" . $GLOBALS['user']['id'] . ")", 'orderby' => 'updated DESC', 'params' => array('page' => $this->name, 'do' => 'show')), $this);
return $this->Parse($row, 'recycle.tmpl');
}
示例12: reply
function reply(string $text)
{
$myNick = core(Client::class)->user()->nickname();
$senderNick = core(InboundMessage::class)->nickname();
$targets = core(InboundMessage::class)->targets();
$targets = array_map(function ($target) use($myNick, $senderNick) {
return $target === $myNick ? $senderNick : $target;
}, $targets);
send_to($targets, $text);
}
示例13: param
function param($usuario, $password)
{
session_start();
$_SESSION['A'] = param($_POST['Usuario'], $_POST['Password']);
$client = core();
//Paramtros LOGIN
$params = array("UserName" => $usuario, "Password" => $password, "ApplicationID" => "");
$response = $client->__soapCall('Login', array($params));
$token = $response->LoginResult->Token;
}
示例14: ShowRecycle
function ShowRecycle()
{
global $limit;
$limit = -1;
require_once core('ajax_table');
$columns = sql_getRows('SHOW columns FROM ' . $this->table, 'Field');
$name = isset($columns['name']) ? 'name' : 'address';
$this->AddStrings($row);
$row['table'] = ajax_table(array('columns' => array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox'), array('select' => $name, 'display' => 'name')), 'where' => 'visible<0 and obj_type_id="room"', 'orderby' => 'address', 'params' => array('page' => $this->name, 'do' => 'Show')), $this);
return Parse($row, 'recycle.tmpl');
}
示例15: editGroupUsers
function editGroupUsers()
{
$group_id = (int) get('id', 0, 'gp');
if (!$group_id) {
return;
}
$ret = array();
$_GET['limit'] = -1;
require_once core('ajax_table');
$ret['table'] = ajax_table(array('columns' => array(array('select' => 'auth_users.name', 'display' => 'user_name', 'flags' => FLAG_SORT), array('select' => 'auth_users.login', 'display' => 'user_login', 'flags' => FLAG_SORT)), 'from' => 'auth_users LEFT JOIN auth_users_groups ON (auth_users_groups.user_id = auth_users.id)', 'params' => array('page' => $this->name, 'do' => 'editgroupusers', 'id' => $group_id), 'orderby' => 'auth_users.name', 'where' => 'auth_users_groups.group_id=' . $group_id, 'roll' => 0), $this);
$this->AddStrings($ret);
return $this->Parse($ret, $this->name . '.groupusers.tmpl');
}