本文整理汇总了PHP中CUtils::_getVar方法的典型用法代码示例。如果您正苦于以下问题:PHP CUtils::_getVar方法的具体用法?PHP CUtils::_getVar怎么用?PHP CUtils::_getVar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUtils
的用法示例。
在下文中一共展示了CUtils::_getVar方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSInsert
function getSInsert()
{
global $PRJ_DIR, $THEME_REF, $smarty;
if (file_exists($PRJ_DIR . '/templates/admin/components/' . CUtils::_getVar('unit') . '.' . CUtils::_getVar('table') . '.tpl')) {
return $smarty->fetch('admin/components/' . CUtils::_getVar('unit') . '.' . CUtils::_getVar('table') . '.tpl');
} else {
reset($this->t->fields);
$ret = '';
$fields = '';
foreach ($this->t->fields as $k => $v) {
if (empty($v['readonly'])) {
$vis = '';
if ($this->t->getDBTableName() == 'table_attributes' && ($v['name'] == 'select_values' || $v['name'] == 'params')) {
$vis = ' style="display:none;"';
}
$fields .= '<tr' . $vis . ' id="add_' . $v['name'] . '" bgcolor="#fafafa"><td class="left" width="180" align="left"><b>' . $v['title'] . '</b>' . $this->getHelpLink($k, $v) . $this->getTemplateName($v) . '</td><td class="right">';
$ft = $this->t->createFieldType($v);
$fields .= $ft->getInput() . '</td></tr>' . "\n";
}
}
$ret .= '<form enctype="multipart/form-data" method="post" name="frmInsert" id="frmInsert" action="' . $this->fullRef . '&action=insert">';
$ret .= '<input type="hidden" id="utype" name="utype" value="0">';
$ret .= $this->getTableHeader();
$ret .= '<tr">' . "\n";
$ret .= '<td><b>Добавить</b><a name=add></a><br><img src="' . $THEME_REF . '/img/0.gif" width="150" height="1"></td>' . "\n";
$ret .= '<td><div class="empty"></div></td></tr>' . "\n";
$ret .= $fields;
$ret .= '</table><div class="ctlbtns"><input type="button" class="adm-btn" onClick="preSubmit(\'frmInsert\', 1)" value="Применить"><input type="button" class="adm-btn" onClick="preSubmit(\'frmInsert\', 0)" value="Сохранить"><input type="button" class="adm-btn" onClick="window.location = \'' . (!empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : $this->fullRef) . '\'" value="Отменить"></div></form>' . "\n";
return $ret;
}
}
示例2: getBody
function getBody()
{
$ret = $this->smarty->fetch('service/' . $this->props['lang'] . '/search.form.tpl');
$max_per_page = 20;
$this->page = CUtils::_getVar('page', true, 1);
if (CUtils::_getVar('text')) {
$search_array = array();
$simple_search_array = explode(' ', CUtils::_getVar('text'));
foreach ($simple_search_array as $ssa) {
inc_lib('tools/stemming/stemming.php');
$ssa = PorterStem::stemming($ssa);
$search_array[] = $ssa;
}
if (count($search_array)) {
$results = $this->getResults($search_array);
} else {
$results = $this->getResults(addslashes($this->text));
}
$this->smarty->assign('search_text', addslashes(CUtils::_getVar('text')));
if (sizeof($results) > 0) {
$pages_cnt = ceil(sizeof($results) / $max_per_page);
if ($pages_cnt > 1) {
$pages = '<div>';
if ($this->page > 1) {
$ref = '?text=' . urlencode(CUtils::_getVar('text')) . '&page=' . ($this->page - 1);
$pages .= '<a title="назад" href="' . $ref . '">←</a>';
}
for ($i = 1; $i <= $pages_cnt; $i++) {
$pages .= $i == $this->page ? ' ' . $i . ' ' : ' <a href="?text=' . urlencode(CUtils::_getVar('text')) . '&page=' . $i . '">' . $i . '</a> ';
}
if ($this->page < $pages_cnt) {
$ref = '?text=' . urlencode(CUtils::_getVar('text')) . '&page=' . ($this->page + 1);
$pages .= '<a title="вперед" href="' . $ref . '">→</a>';
}
$pages .= '</div>';
$this->smarty->assign('ptext', $pages);
}
if ($this->page == $pages_cnt && sizeof($results) % $max_per_page > 0) {
$max_per_page_cur = count($results) % $max_per_page;
} else {
$max_per_page_cur = $max_per_page;
}
$items = array();
for ($i = 1; $i <= $max_per_page_cur; $i++) {
$j = $i + ($this->page - 1) * $max_per_page;
$results[$j - 1]['num'] = $j;
$items[] = $results[$j - 1];
}
$this->smarty->assign('items', $items);
$ret .= $this->smarty->fetch('service/' . $this->props['lang'] . '/search.list.tpl');
} else {
$ret .= $this->smarty->fetch('service/' . $this->props['lang'] . '/search.no.tpl');
}
}
return $ret;
}
示例3: getInput
public function getInput($value = '', $name = '')
{
$name = $name ? $name : $this->getName();
$value = $value ? $value : $this->dbValue;
$input_id = strtr($name, '[]', '__');
$ret = '<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="100%"><input type="text" readonly style="width:100%;" value="' . $this->getStatic() . '" size="62" id="' . $input_id . '_title">';
$ret .= '<input type="hidden" name="' . $name . '" value="' . $value . '" id="' . $input_id . '">';
$ret .= '</td><td><input class="butt" type="button" value="…" onClick="show_list_popup(\'' . $input_id . '\',\'' . CUtils::_getVar('unit') . '_' . CUtils::_getVar('table') . '\',\'' . $this->getName() . '\', \'' . CUtils::_getVar('id', true, 0) . '\',\'' . $value . '\');"></td></tr></table>';
return $ret;
}
示例4: setOptions
protected function setOptions()
{
$this->unit = CUtils::_getVar('unit');
$this->state = CUtils::_getVar('state', false, 'content');
$this->smarty = $GLOBALS['smarty'];
$this->smarty->assign('user', CUtils::_sessionVar('user'));
$this->smarty->assign('state', $this->state);
$this->smarty->assign('lang', CUtils::_sessionVar('lang', false, 'ru'));
$this->smarty->assign('unit', $this->unit);
}
示例5: __construct
public function __construct(&$unitAdminInterface)
{
$this->uai = $unitAdminInterface;
$this->baseRef = $unitAdminInterface->getBaseTableRef();
if (is_object($this->t = $this->uai->getBaseTable())) {
$this->search_url = $this->t->getSeachURL();
$this->search_sql = $this->t->getSeachSQL();
$this->searchRef0 = $this->baseRef . ($this->search_url ? '&' . $this->search_url : '');
$this->searchRef = $this->searchRef0 . (CUtils::_getVar('rpp') ? '&rpp=' . CUtils::_getVar('rpp') : '');
$this->fullRef0 = $this->searchRef0 . (CUtils::_getVar('page') ? '&page=' . CUtils::_getVar('page') : '');
$this->fullRef = $this->searchRef . (CUtils::_getVar('page') ? '&page=' . CUtils::_getVar('page') : '');
}
}
示例6: select_tree_getInput
protected function select_tree_getInput($value, $name, $zeroTitle = 'Корень')
{
$name = $name ? $name : $this->getName();
$value = empty($value) ? intval($this->dbValue) : $value;
$unit = CUtils::_getVar('unit');
$table = CUtils::_getVar('table');
$id = empty($this->dbId) ? '-1' : $this->dbId;
$input_id = strtr($name, '[]', '__');
// узнаем имя категории, для текстового поля
$ret = '<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="100%"><input type="text" readonly style="width:100%;" value="' . $this->getStatic() . '" size="62" id="' . $input_id . '_title">';
$ret .= '<input type="hidden" name="' . $name . '" value="' . $value . '" id="' . $input_id . '"></td>';
$ret .= '</td><td><input class="butt" type="button" value="…" onClick="show_tree_popup(\'' . $input_id . '\',\'' . $unit . '_' . $table . '\',\'' . $name . '\', \'' . $id . '\', \'' . $zeroTitle . '\',\'' . $value . '\');"></td></tr></table>';
return $ret;
}
示例7: _getEntityList
private function _getEntityList()
{
global $db;
$this->_aEntities = null;
if (is_null($this->_aEntities)) {
$where = '';
if (!empty($this->props['query'])) {
$where .= $where ? ' AND (' . $this->props['query'] . ')' : $this->props['query'];
}
if (isset($this->props['dir'])) {
$module = $GLOBALS['rtti']->getComponent(CUtils::_getVar('unit'));
$where .= ($where ? ' AND ' : '') . ' module_id = ' . $module['id'];
}
$this->_aEntities = $GLOBALS['db']->getItems('select_items', "SELECT id," . $this->props['l_field'] . " FROM " . $this->props['l_table'] . ($where ? " WHERE " . $where : '') . ' ORDER BY ' . $this->props['l_sort']);
}
return $this->_aEntities;
}
示例8: getStatic
public function getStatic($value, $name)
{
$ret = '';
$unit = CUtils::_getVar('unit');
$table = CUtils::_getVar('table');
$value = empty($value) ? '' : $value;
$input_id = $this->dbId ? strtr($name, '[]', '__') . $this->dbId : strtr($name, '[]', '__');
$text = '';
// узнаем имя категории, для текстового поля
if ($id && ($items = $GLOBALS['rtti']->getItems($this->props['l_table'], $this->props['l_link'] . "=" . $id))) {
foreach ($items as $item) {
$text .= ($text ? ', ' : '') . $a[$this->props['l_field']];
}
return $ret . '<span id="' . $input_id . '">' . $text . '</span> <input class="butt" type="button" onClick="show_listbox(\'' . $input_id . '\',\'' . $unit . '\',\'' . $table . '\',\'' . $input_id . '\', \'' . $this->dbId . '\');" value="Просмотр">';
} else {
return '-';
}
}
示例9: getTableUpdate
function getTableUpdate()
{
global $smarty;
$unit = CUtils::_getVar('unit');
$table = CUtils::_getVar('table');
$ret = '';
$fields = '';
$types = array();
$svalues = explode(';', 'HTML|html;Булево|checkbox;Вещественное число|float;Выбор|select;Выбор из дерева|select_tree;Выбор множества|select_list;Дата|date;Дата и время|datetime;Мемо|text;Пароль|password;Перечисление|enum;Рисунок|image;Строка|string;Файл|file;Целое число|number;Шаблон|template');
foreach ($svalues as $a) {
$types[] = explode('|', $a);
}
$smarty->assign('types', $types);
$smarty->assign('fields', $this->t->fields);
$smarty->assign('groups', $GLOBALS['rtti']->getItems('users_groups'));
$smarty->assign('rights', array('' => 'По-умолчанию (чтение)', 'D' => 'Закрыт', 'R' => 'Чтение', 'W' => 'Чтение и запись', 'X' => 'Полный доступ'));
$smarty->assign('a', $GLOBALS['rtti']->getClass($unit . '_' . $table));
return $smarty->fetch('admin/table.edit.tpl');
}
示例10: getText
function getText()
{
global $db, $THEME_REF;
$ret = '';
$ret .= '<form enctype="multipart/form-data" method="post" name="frmInsert" id="frmInsert" action="' . $this->fullRef . '&action=methods">';
$ret .= $this->getTableHeader();
$ret .= '<tr>';
$ret .= '<th>Макет</th>';
$ret .= '<th>Шаблон</th>';
$ret .= '<th>Обработчик</th>';
$ret .= '<th align=center><img alt="Действия" src="' . $THEME_REF . '/img/action_head.gif" border=0></td></tr>' . "\n";
$component = $GLOBALS['rtti']->getComponent(CUtils::_getVar('unit'));
$methods = $GLOBALS['db']->getItems('config_methods', 'SELECT cm.*,tt.name as maket_name FROM config_methods cm LEFT JOIN templates_templates tt ON cm.maket=tt.id WHERE cm.seniorid=' . $component['id']);
foreach ($methods as $method) {
$ret .= '<tr><td class=left align=left width=250>' . $method['maket_name'] . '</td>';
$ret .= '<td>' . ($method['code'] ? $method['code'] : 'нет') . '</td>';
$ret .= '<td class="right">' . ($method['template'] ? $method['template'] : 'нет') . '</td>';
$ret .= $this->getUpdateDelete($method['id']) . '</tr>' . "\n";
}
$ret .= '</table></form>';
return $ret;
}
示例11: getText
function getText()
{
set_time_limit(0);
$this->messageAction($GLOBALS['rtti']->dublicateItem($this->t->getDBTableName(), CUtils::_getVar('id'), CUtils::_getVar('quantity', true, 5)) ? 'Скопировано' : 'Ошибка копирования');
}
示例12: getText
function getText()
{
$file = CUtils::_getVar('file');
@unlink($GLOBALS['PRJ_DIR'] . $file);
header('location: ' . $this->fullRef . '&action=s_backup');
}
示例13: showAuthForm
function showAuthForm()
{
global $smarty;
if (CUtils::_getVar('error')) {
$this->message['type'] = 'error';
$this->message['text'] = CUtils::_getVar('error');
}
if (CUtils::_getVar('ok')) {
$this->message['type'] = 'ok';
$this->message['text'] = CUtils::_getVar('ok');
}
$smarty->assign('message', CUtils::showMsg($this->message));
$smarty->display('admin/form.auth.tpl');
exit;
}
示例14: getText
function getText()
{
$q = 'id=' . CUtils::_getVar('id', true, 0);
$this->messageAction($GLOBALS['rtti']->deleteItem($this->t->getDBTableName(), $q) ? 'Удалено' : 'Ошибка удаления');
}
示例15: getTableOperations
protected function getTableOperations()
{
$ret = '<table align="center" cellpadding="0" cellspacing="0" border="0" class="contextmenu2">
<tr class="top">
<td class="left"><div class="empty"></div></td>
<td><div class="empty"></div></td>
<td class="right"><div class="empty"></div></td>
</tr>
<tr>
<td class="left"><div class="empty"></div></td>
<td class="content">
<table cellpadding="2" cellspacing="0" border="0">
<tr>';
if (!$this->p['noinsert']) {
$ret .= '<td><div class="section-separator first"></div></td>
<td align="center"><a href="' . $this->fullRef . '&action=s_insert' . (CUtils::_getVar('p_id') ? '&p_id=' . CUtils::_getVar('p_id') : '') . '" class="context-button">Добавить запись</a></td>';
}
$ret .= '<td><div class="section-separator"></div></td>
<td align="center"><a href="' . $this->fullRef . '&action=create" class="context-button">Создать таблицу</a></td>';
$ret .= '<td><div class="section-separator"></div></td>
<td align="center"><a href="' . $this->fullRef . '&action=alter" class="context-button">Обновить таблицу</a></td>';
$ret .= '</tr>
</table>
</td>
<td class="right"><div class="empty"></div></td>
</tr>
<tr class="bottom">
<td class="left"><div class="empty"></div></td>
<td><div class="empty"></div></td>
<td class="right"><div class="empty"></div></td>
</tr>
<tr class="bottom-all">
<td class="left"><div class="empty"></div></td>
<td><div class="empty"></div></td>
<td class="right"><div class="empty"></div></td>
</tr>
</table><br>';
return $ret;
}