本文整理汇总了PHP中ui类的典型用法代码示例。如果您正苦于以下问题:PHP ui类的具体用法?PHP ui怎么用?PHP ui使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ui类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index($parameters)
{
$pageModel = new pageModel();
$view = new ui($this);
$view->assign('pages', $allowedPages);
$startlevel = isset($parameters['startlevel']) ? $parameters['startlevel'] : 1;
$id = myauth::getCurrentpageid();
$page = $pageModel->getfromId($id);
$page = $page[0];
$tree[] = $page;
while ($page->getParentid() != 0) {
$page = $pageModel->getfromId($page->getParentid());
$page = $page[0];
$tree[] = $page;
$this->tree_id[$page->getId()] = $page->getId();
}
$this->tree = array_reverse($tree);
if ($startlevel != 1) {
$startbelow = $this->tree[$startlevel - 2]->getId();
} else {
$startbelow = 0;
}
$this->maxdepth = isset($parameters['maxdepth']) ? $parameters['maxdepth'] : -1;
$depth = 1;
$pages = $this->recursivegetpages($startbelow, $depth);
$view->assign('menu', $pages);
$this->response->assign($this->self, 'innerHTML', $view->fetch($parameters['viewprefix'] . 'menu_index.tpl'));
}
示例2: showhtml
public function showhtml($parameters = array())
{
if (isset($parameters['template'])) {
$template = new ui($this);
$this->response->assign($this->self, 'innerHTML', $template->fetch($parameters['template'] . '.tpl'));
}
}
示例3: createErrorView
function createErrorView($exception)
{
$ui = new ui();
$ui->assign('exceptionid', uniqid());
$ui->assign('exception', $exception);
$template = VERBOSE_ERRORS ? 'detailederror.tpl' : 'shorterror.tpl';
return $ui->fetch($template);
}
示例4: confirm
protected function confirm($controller, $title = '')
{
$view = new ui($controller);
$view->assign('form', $this);
$view->assign('title', $title);
//$popup = new popupController();
//$popup->create(array('name' => 'confirm','title' => $title, 'content' => $view->fetch('confirmform.tpl')));
$response = responseLib::getInstance();
$response->assign($controller->getSelf(), 'innerHTML', $view->fetch('confirmform.tpl'));
}
示例5: loginform
public function loginform($parameters = array())
{
require FRAMEWORK . DS . 'conf' . DS . 'auth.php';
require FRAMEWORK . DS . 'conf' . DS . 'dispatcher.php';
$currentuser = myauth::getCurrentuser();
$groups = $currentuser->getGroupid();
$groupfound = false;
foreach ($groups as $groupname => $groupid) {
if (isset($defaultPageids[$groupname])) {
$groupfound = true;
$defaultPageid = $defaultPageids[$groupname];
}
}
if (!$groupfound) {
$defaultPageid = $defaultPageids['default'];
}
if ($currentuser->getId() == $defaultUserid) {
$form = new form($parameters);
$username = new textField('username', 'Gebruiker', '', array('required'));
$password = new passwordField('password', 'Wachtwoord', array('required'));
$form->addField($username);
$form->addField($password);
$form->setSubmittext('Log in');
$form->setResettext('Herbegin');
$template = new ui($this);
if ($form->validate()) {
$usermodel = new userModel();
$authuser = $usermodel->auth($parameters['username'], $parameters['password']);
if ($authuser instanceof userObject) {
myauth::setCurrentuser($authuser);
// Refresh the page
$this->response->redirect('?pageid=' . $defaultPageid);
} else {
$this->response->assign('formerror_' . $form->getId(), 'innerHTML', 'De ingevulde gegevens zijn niet correct.', true);
}
} elseif (!$form->isSent()) {
$template->assign('form', $form);
$this->response->assign($this->self, 'innerHTML', $template->fetch($parameters['viewprefix'] . 'myauth_loginform.tpl'));
} else {
$this->response->assign('formerror_' . $form->getId(), 'innerHTML', 'Alle velden moeten ingevuld worden.', true);
}
} else {
$template = new ui($this);
$defrequest = new pagerequest($defaultPageid);
$template->assign('defrequest', $defrequest);
$template->assign('logoutRequest', myauth::getLogoutrequest());
$template->assign('currentuser', $currentuser);
$this->response->assign($this->self, 'innerHTML', $template->fetch($parameters['viewprefix'] . 'myauth_loginform_loggedin.tpl'));
//$this->response->assign($this->self , 'innerHTML' , '');
}
}
示例6: showallowed
public function showallowed($parameter = array())
{
$view = new ui($this);
$grid = new mygrid('allowed');
$grid->setModel(new ftgdallowedModel());
$grid->setDefaultorder(array('fields' => array('time'), 'type' => 'DESC'));
$grid->setPagesize(15);
$grid->registerRequest('user', 'mygrid', 'search', array('directsearch' => 'true', 'gridid' => $grid->getId(), 'search' => '{user}'));
$grid->registerRequest('group', 'mygrid', 'search', array('directsearch' => 'true', 'gridid' => $grid->getId(), 'search' => '{group}'));
$grid->registerRequest('sourceip', 'mygrid', 'search', array('directsearch' => 'true', 'gridid' => $grid->getId(), 'search' => '{sourceip}'));
$grid->registerRequest('host', 'mygrid', 'search', array('directsearch' => 'true', 'gridid' => $grid->getId(), 'search' => '{host}'));
$grid->registerRequest('cat', 'mygrid', 'search', array('directsearch' => 'true', 'gridid' => $grid->getId(), 'search' => '{cat}'));
$grid->registerRequest('destip', 'mygrid', 'search', array('directsearch' => 'true', 'gridid' => $grid->getId(), 'search' => '{destip}'));
$view->assign('blocked', $grid);
$this->response->assign($this->self, 'innerHTML', $view->fetch('ftgd_allowed.tpl'));
}
示例7: defAction
public function defAction()
{
$count = ormObjects::getCountTrashObjects();
$max_count = uiTable::getMaxCount();
if (uiTable::getCurPage() != 1) {
$niz = empty($start_pos) ? uiTable::getCurPage() * $max_count - $max_count : 0;
$objects = ormObjects::getTrashObjects($niz, $max_count);
} else {
$objects = ormObjects::getTrashObjects($max_count);
}
if (user::issetRight('object_del') && !empty($objects)) {
ui::newButton(lang::get('BTN_NEW_CLEAК_TRASH'), 'javascript:clearTrash();');
}
$table = new uiTable($objects, $count);
$table->addColumn('name', lang::get('TRASH_TABLE_1'), 400);
$table->addColumn('class', lang::get('TRASH_TABLE_2'));
$table->addColumn('date', lang::get('TRASH_TABLE_3'), 0, false, false, 'viewDateTime');
$table->addColumn('user', lang::get('TRASH_TABLE_4'), 200);
$table->addRight('object_restore', 'restore', multi, 'restoreObj(this)', lang::get('TRASH_TABLE_RESTORE'));
$table->addRight('object_del', 'drop', multi);
$table->setDelMessage(lang::get('TRASH_DEL_TITLE'), lang::get('TRASH_DEL_MSG'));
$table->setMultiDelMessage(lang::get('TRASH_DEL_TITLE2'), lang::get('TRASH_DEL_MSG2'));
$table->emptyText(lang::get('TRASH_EMPTY_MSG'));
$html = '
<script type="text/javascript" src="/css_mpanel/restore_objects.js"></script>
<input id="clearTrashTitle" type="hidden" value="' . lang::get('TRASH_DEL_TITLE3') . '">
<input id="clearTrashText" type="hidden" value="' . lang::get('TRASH_DEL_MSG3') . '">
';
return $html . $table->getHTML();
}
示例8: defAction
public function defAction()
{
// Формируем список классов для быстрого добавления
$types = ormClasses::get('user')->getAllInheritors();
if (count($types) > 1) {
$class_list = '';
while (list($id, $name) = each($types)) {
$bclass = ormClasses::get($id);
$class_list .= '<li><a href="' . system::au() . '/users/user_add/0/' . $bclass->getSName() . '" >' . $bclass->getName() . '</a></li>';
}
$java = '<script> $("#usel").parent().css("width", "150px"); </script>';
ui::newButton(lang::get('BTN_NEW_USER'), "/users/user_add", 'class_list', '<ul id="usel">' . $class_list . '</ul>' . $java);
} else {
ui::newButton(lang::get('BTN_NEW_USER'), "/users/user_add");
}
ui::newButton(lang::get('BTN_NEW_UGROUP'), "/users/group_add");
$sel = new ormSelect('user_group');
$sel->orderBy('name', asc);
$table = new uiTable($sel);
$table->showSearch(true);
$table->addColumn('name', lang::get('USERS_TABLE_FIELD_5'), 0, true);
$table->addColumn('children', lang::get('USERS_TABLE_FIELD_6'), 0, true, true, 'count');
$table->defaultRight('userlist');
$table->addRight('userlist', 'users', single);
$table->addRight('group_upd', 'edit', single);
$table->addRight('group_act', 'active', multi);
$table->addRight('group_del', 'drop', multi);
$table->setDelMessage(lang::get('USERS_DEL_TITLE2'), lang::get('USERS_DEL_TEXT2'));
$table->setMultiDelMessage(lang::get('USERS_DEL_TITLE_MULTI2'), lang::get('USERS_DEL_TEXT_MULTI2'));
return $table->getHTML();
}
示例9: defAction
public function defAction()
{
ui::newButton(lang::get('BTN_SAVE'), "javascript:sendForm('save');");
ui::newButton(lang::get('BTN_APPLY'), "javascript:sendForm('apply');");
if (isset($_SESSION['STRUCTURE_LIST_FLAG']) && $_SESSION['STRUCTURE_LIST_FLAG']) {
ui::setCancelButton('/structure/list');
} else {
ui::setCancelButton('/structure/tree');
}
$list = reg::getList(ormPages::getPrefix() . '/minitext', true);
$texts = $js = array();
foreach ($list as $val) {
$texts[] = array('id' => $val['id'], 'description' => $val['description'], 'num' => '<center>%text_' . $val['id'] . '%</center>', 'text' => $val['value']);
$js['text_' . $val['id'] . '_vvv'] = $val['value'];
}
// Форма редактирования
$form = new uiMultiForm('change');
if (reg::getKey('/core/noDelMiniTexts')) {
$form->withoutRemoving();
}
$form->setRight('minitext_proc');
$form->setData($texts);
$form->addColumn('description', lang::get('STRUCTURE_TABLE_FIELD_12'), 200, lang::get('STRUCTURE_TABLE_FIELD_13'));
$form->addColumn('text', lang::get('STRUCTURE_TABLE_FIELD_9'), 500, lang::get('STRUCTURE_TABLE_FIELD_10'));
$form->addColumn('num', lang::get('STRUCTURE_TABLE_FIELD_8'), 150, lang::get('STRUCTURE_TABLE_FIELD_11'), false);
$js = '<script language="javascript"> var textlist = ' . json_encode($js) . ';</script>';
return $js . $form->getHTML('multi_form_memo');
}
示例10: proc
public function proc()
{
//reg::setKey('/users/errorCountCapcha', system::POST('errorCountCapcha'));
reg::setKey('/users/errorCountBlock', system::POST('errorCountBlock'));
reg::setKey('/users/reg', system::POST('reg', isBool));
reg::setKey('/users/activation', system::POST('activation', isBool));
reg::setKey('/users/confirm', system::POST('confirm', isBool));
reg::setKey('/users/ask_email', system::POST('ask_email', isBool));
//авторизация чере соц. сети
reg::setKey('/users/twitter_bool', system::POST('twitter_bool'), isBool);
reg::setKey('/users/twitter_id', system::POST('twitter_id'), isString);
reg::setKey('/users/twitter_secret', system::POST('twitter_secret'), isString);
reg::setKey('/users/vk_bool', system::POST('vk_bool'), isBool);
reg::setKey('/users/vk_id', system::POST('vk_id'), isString);
reg::setKey('/users/vk_secret', system::POST('vk_secret'), isString);
reg::setKey('/users/ok_bool', system::POST('ok_bool'), isBool);
reg::setKey('/users/ok_id', system::POST('ok_id'), isString);
reg::setKey('/users/ok_public', system::POST('ok_public'), isString);
reg::setKey('/users/ok_secret', system::POST('ok_secret'), isString);
reg::setKey('/users/facebook_bool', system::POST('facebook_bool'), isBool);
reg::setKey('/users/facebook_id', system::POST('facebook_id'), isString);
reg::setKey('/users/facebook_secret', system::POST('facebook_secret'), isString);
reg::setKey('/users/yandex_bool', system::POST('yandex_bool'), isBool);
reg::setKey('/users/google_bool', system::POST('google_bool'), isBool);
ui::MessageBox(lang::get('CONFIG_SAVE_OK'), lang::get('CONFIG_SAVE_OK_MSG'));
reg::clearCache();
system::log(lang::get('CONFIG_LOG_SAVE'), warning);
system::redirect('/users/settings');
}
示例11: proc_upd
public function proc_upd()
{
$obj = ormPages::get(system::POST('obj_id'));
$obj->tabuList('pseudo_url', 'h1', 'keywords', 'title', 'description', 'active', 'is_home_page', 'view_in_menu', 'view_submenu', 'in_search', 'in_index', 'in_new_window', 'other_link', 'img_act', 'img_no_act', 'img_h1');
$obj->loadFromPost();
// Публикация на сайте
if (system::POST('publ', isBool)) {
if ($obj->isInheritor('faq') && $obj->newVal('answer') == '') {
ui::MessageBox(lang::get('TEXT_MESSAGE_ERROR'), lang::get('FEEDBACK_MSG_3'));
ui::selectErrorFields(array('select' => '', 'focus' => 'answer'));
} else {
$obj->active = 1;
}
}
$obj_id = $obj->save();
// Если объект не сохранился, выводим пользователю текст ошибки.
if ($obj_id === false) {
system::savePostToSession();
ui::MessageBox(lang::get('TEXT_MESSAGE_ERROR'), $obj->getErrorListText());
ui::selectErrorFields($obj->getErrorFields());
system::redirect('/feedback/message_upd/' . $_POST['obj_id']);
}
if (system::POST('send_to_email', isBool) && !$obj->send_answer_to_user && ($form_obj = ormObjects::get($obj->form_id))) {
if ($form_obj->send_answer) {
if ($obj->answer != '') {
$fields = $obj->getClass()->loadFields();
while (list($num, $field) = each($fields)) {
if (!empty($field['f_sname'])) {
page::assign($field['f_sname'], $obj->__get($field['f_sname']));
}
}
page::assign('site_name', domains::curDomain()->getSiteName());
page::assign('base_email', domains::curDomain()->getEmail());
$mail = new phpmailer();
$mail->From = $this->parse($form_obj->answer_sender_address);
$mail->FromName = $this->parse($form_obj->answer_sender_name);
$mail->AddAddress($obj->email);
$mail->WordWrap = 50;
$mail->IsHTML(true);
$mail->Subject = $this->parse($form_obj->answer_subject);
$mail->Body = $this->parse($form_obj->answer_template);
$mail->Send();
// Помечаем, что ответ отправлен
$obj->send_answer_to_user = 1;
$obj->save();
ui::MessageBox(lang::get('FEEDBACK_MSG_1'), '');
} else {
ui::MessageBox(lang::get('TEXT_MESSAGE_ERROR'), lang::get('FEEDBACK_MSG_2'));
ui::selectErrorFields(array('select' => '', 'focus' => 'answer'));
}
}
}
// Если данные изменились корректно перенаправляем на соответствующию страницу
if ($_POST['parram'] == 'apply') {
system::redirect('/feedback/message_upd/' . $obj_id);
} else {
system::redirect('/feedback');
}
}
示例12: view
public function view()
{
if (user::issetRight('delete')) {
ui::newButton(lang::get('BTN_CLEAR_JORNAL'), 'javascript:clearJornal();');
}
ui::addLeftButton('Системный журнал', 'system_view');
ui::addLeftButton('Журнал БД', 'db_view');
function getState($val)
{
if ($val == info) {
return 'info';
} else {
if ($val == error) {
return 'error';
} else {
if ($val == warning) {
return 'warning';
}
}
}
}
function getEditUser($val, $obj)
{
if (user::issetRight('user_upd', 'users')) {
return '<a href="' . system::au() . '/users/user_upd/' . $obj['rev_user_id'] . '" target="_blank">' . $val . '</a>';
} else {
return $val;
}
}
$count = db::q('SELECT count(rev_id) count FROM <<revue>>, <<objects>> WHERE rev_obj_id = o_id;', value);
$max_count = uiTable::getMaxCount();
if (uiTable::getCurPage() != 1) {
$niz = empty($start_pos) ? uiTable::getCurPage() * $max_count - $max_count : 0;
$limit = ' LIMIT ' . $niz . ', ' . $max_count;
} else {
$limit = ' LIMIT ' . $max_count;
}
$mas = db::q('SELECT rev_state, rev_user, rev_user_id, rev_datetime,
concat(rev_message, " <b>", o_name, "</b>") rev_msg, rev_ip
FROM <<revue>>, <<objects>>
WHERE rev_obj_id = o_id
ORDER BY rev_datetime DESC ' . $limit, records);
/*
Сделать фильтры:
- важность
- пользователь
- тип данных
- периуд времени
- IP
*/
$table = new uiTable($mas, $count);
$table->addColumn('rev_state', 'Важность', 0, false, false, 'getState');
$table->addColumn('rev_user', 'Пользователь', 0, false, false, 'getEditUser');
$table->addColumn('rev_msg', 'Действие', 400);
$table->addColumn('rev_datetime', 'Дата / Время', 0, false, false, 'viewDateTime2');
$table->addColumn('rev_ip', 'IP');
$table->emptyText('В журнале нет записей!');
return $table->getHTML();
}
示例13: __construct
public function __construct()
{
ui::checkClasses('handbook');
ui::addLeftButton(lang::right('list'), 'list');
ui::addLeftButton(lang::right('state'), 'state');
ui::addLeftButton(lang::right('delivery'), 'delivery');
ui::addLeftButton(lang::right('payment'), 'payment');
}
示例14: view
public function view()
{
if (user::issetRight('delete')) {
ui::newButton(lang::get('BTN_CLEAR_JORNAL'), 'javascript:clearJornal();');
}
ui::addLeftButton('Системный журнал', 'system_view');
ui::addLeftButton('Журнал БД', 'db_view');
function removeQuotes($val, $obj)
{
return substr($val, 1, strlen($val) - 2);
}
function rqDateTime($val, $obj)
{
return date('d.m.Y H:i:s', $val);
}
function sortByTime($a, $b)
{
if ($a[1] == $b[1]) {
return 0;
}
return $a[1] > $b[1] ? -1 : 1;
}
$mas = array();
$system_file = ROOT_DIR . '/revue.log';
if (file_exists($system_file)) {
// Читаем файл, формируем массив
$tmp_mas = array();
$file = file($system_file);
while (list($key, $val) = each($file)) {
$tmp = explode(Chr(9), $val);
if (!empty($tmp[1])) {
$tmp[1] = strtotime(removeQuotes($tmp[1], $tmp[1]));
$tmp_mas[] = $tmp;
}
}
// Сортиуем массив по времени
usort($tmp_mas, 'sortByTime');
// Выбераем часть массива в соотвествии с постраничной навигацией
$count = count($tmp_mas);
$max_count = uiTable::getMaxCount();
if (uiTable::getCurPage() != 1) {
$niz = empty($start_pos) ? uiTable::getCurPage() * $max_count - $max_count : 0;
$mas = array_slice($tmp_mas, $niz, $max_count);
} else {
$mas = array_slice($tmp_mas, 0, $max_count);
}
} else {
$count = 0;
}
$table = new uiTable($mas, $count);
$table->emptyText('В системном журнале нет записей!');
$table->addColumn('2', 'Важность', 0, false, false, 'removeQuotes');
$table->addColumn('3', 'Пользователь', 0, false, false, 'removeQuotes');
$table->addColumn('4', 'Действие', 400);
$table->addColumn('1', 'Дата / Время', 0, false, false, 'rqDateTime');
$table->addColumn('0', 'IP');
return $table->getHTML();
}
示例15: updatesuggestselectfield
public function updatesuggestselectfield($parameters = array())
{
$result = array();
$view = new ui($this);
if ($parameters['value'] != '') {
$controller = $parameters['callbackcontroller'] . 'Controller';
$function = $parameters['callbackfunction'];
$extra = $parameters['extraparams'];
$extralist = explode(',', $extra);
$extraparams = array();
foreach ($extralist as $extraparam) {
list($key, $value) = explode('|', $extraparam);
$extraparams[$key] = $value;
}
$theController = new $controller();
$result = $theController->{$function}(rawurldecode($parameters['value']), $extraparams);
$form = new form($parameters);
list($id, $name) = explode('_', $parameters['id'], 2);
$form->setId($id);
$select = new selectField(str_replace('_text', '', $name), '', '', true);
$form->addField($select);
foreach ($result as $row) {
$select->addOption(new selectoptionField($row, $row, false));
}
$view->assign('form', $form);
$view->assign('field', $select);
$this->response->assign(str_replace('_text', '', $parameters['id']) . '_container', 'innerHTML', $view->fetch('selectField.tpl'));
} else {
$form = new form($parameters);
$select = new selectField($parameters['id'], '', '', true);
$view->assign('form', $form);
$view->assign('field', $select);
$this->response->assign(str_replace('_text', '', $parameters['id']) . '_container', 'innerHTML', $view->fetch('selectField.tpl'));
}
}