本文整理汇总了PHP中Project::getRequest方法的典型用法代码示例。如果您正苦于以下问题:PHP Project::getRequest方法的具体用法?PHP Project::getRequest怎么用?PHP Project::getRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Project
的用法示例。
在下文中一共展示了Project::getRequest方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct($view_class = null)
{
if ($view_class === null) {
$view_class = "DevView";
}
$this->request = Project::getRequest();
parent::__construct($view_class);
}
示例2: SaveAction
function SaveAction()
{
$request = Project::getRequest();
$user_id = (int) Project::getUser()->getDbUser()->id;
$model = new UserModel();
$model->load($request->id);
$do_save = true;
$this->_view->clearFlashMessages();
if (!strlen(trim($request->login))) {
$this->_view->addFlashMessage(FM::ERROR, "Не заполнено поле логин");
$do_save = false;
}
if ($request->unbann) {
$ban_model = new BanHistoryModel();
$ban_model->unban($request->id, $user_id);
}
if ($request->bann) {
if (strlen($request->warning)) {
$ban_date = $request->ban_date;
if (strlen($ban_date) && strtotime($ban_date) > time()) {
$warning_model = new WarningModel();
$warning_id = $warning_model->add($request->id, $request->warning);
$ban_model = new BanHistoryModel();
$ban_model->ban($request->id, $user_id, $warning_id, $request->ban_date);
} else {
$this->_view->addFlashMessage(FM::ERROR, "Неверная дата бана");
$do_save = false;
}
} else {
$this->_view->addFlashMessage(FM::ERROR, "Не заполнено предупреждение");
$do_save = false;
}
}
if ($do_save) {
$this->_view->clearFlashMessages();
$model->login = $request->login;
$model->user_type_id = $request->user_group;
if ($request->bann) {
$model->banned = 1;
$model->banned_date = strtotime($request->ban_date);
} else {
$model->banned = 0;
}
$ban_date = $request->ban_date;
if (strlen($ban_date)) {
//$ban_model = new Ban
}
$id = $model->save();
$model = new UserTypeModel();
$info = array();
$info['group_list'] = $model->loadAll();
$info['edit_controller'] = null;
$info['edit_action'] = 'Edit';
$this->makeUserList($info);
$this->_view->AjaxList($info);
}
$this->_view->ajax();
}
示例3: CatalogEdit
function CatalogEdit($info)
{
$request = Project::getRequest();
foreach ($info['tag_list'] as &$item) {
$p = $info['common_param'];
$p[] = $item['id'];
$item['delete_link'] = $request->createUrl('BlogAdmin', 'CatalogDeleteTag', $p);
}
$this->setTemplate($this->_dir, 'catalog_edit.tpl.php');
$this->set($info);
}
示例4: ParamList
function ParamList($info)
{
$number = 1;
$request = Project::getRequest();
foreach ($info['param_list'] as &$item) {
$item['number'] = $number;
$item['delete_link'] = Project::getRequest()->createUrl($info['delete_controller'], $info['delete_action'], array('id' => $item['id'], 'cid' => $info['controller_id']));
//$item['delete_link'] = $request -> createUrl($info['delete_controller'], $info['delete_action'], array('id' => $item['id']));
$number++;
}
$info['save_action'] = Project::getRequest()->createUrl($info['save_controller'], $info['save_action']);
$this->setTemplate($this->_dir, 'param_list.tpl.php');
$this->set($info);
}
示例5: open
/**
* Start session
*/
public function open()
{
if (!$this->_started) {
if (ini_get('session.auto_start') !== '1') {
if (($session_name = $this->_config->get('session_name')) !== null) {
$this->setSessionName($session_name);
}
session_name($session_name);
if (($sid = Project::getRequest()->getRequestSessionId()) !== null) {
session_id($sid);
}
session_start();
}
$this->_started = true;
}
}
示例6: getParam
static function getParam($controller, $action, $params, $method, $async = false, $dataType = 'json')
{
$router = Project::getRequest();
if (!is_array($params)) {
$params = array();
}
if (!in_array($method, array("POST", "GET"))) {
$method = "POST";
$url = $router->createUrl($controller, $action);
} else {
$url = $router->createUrl($controller, $action, $params);
//$url = str_replace(":", "___", $url);
}
$param = array('url' => $url, 'type' => $method, 'async' => $async, 'data' => $method == "POST" ? $params : '', 'dataType' => $dataType);
return $param;
}
示例7: Profile
function Profile()
{
$this->_js_files[] = 'relations.js';
$request = Project::getRequest();
// Имя пользователя
$tmp = array();
if ($this->user_profile['last_name']) {
$tmp[] = $this->user_profile['last_name'];
}
if ($this->user_profile['first_name']) {
$tmp[] = $this->user_profile['first_name'];
}
if ($this->user_profile['middle_name']) {
$tmp[] = $this->user_profile['middle_name'];
}
$this->user_name = $tmp ? implode(' ', $tmp) : false;
// Местоположение
$tmp = array();
if ($this->user_profile['country']) {
$tmp[] = $this->user_profile['country'];
}
if ($this->user_profile['state']) {
$tmp[] = $this->user_profile['state'];
}
if ($this->user_profile['city']) {
$tmp[] = $this->user_profile['city'];
}
$this->user_location = $tmp ? implode(' ', $tmp) : false;
// Список друзей
$tmp = array();
foreach ($this->friend_list as &$item) {
$login = $item;
$tmp[] = '<a href="' . $request->createUrl('User', 'Profile', null, $login) . '">' . $login . '</a>';
}
$this->friend_list = $tmp ? implode(', ', $tmp) : false;
// У кого мы в друзьях
$tmp = array();
foreach ($this->in_friend_list as &$item) {
$login = $item['login'];
$tmp[] = '<a href="' . $request->createUrl('User', 'Profile', null, $login) . '">' . $login . '</a>';
}
$this->in_friend_list = $tmp ? implode(', ', $tmp) : false;
// Наши интересы
$this->assign('user_interests', implode(', ', $this->user_interests));
$this->setTemplate(null, 'profile.tpl.php');
}
示例8: AddComplaintAction
public function AddComplaintAction()
{
$messagesModel = new MessagesModel();
$user = Project::getUser()->getDbUser();
$userModel = new UserModel();
$arbitrationModel = new ArbitrationModel();
$request = Project::getRequest();
$user_login = $request->user_login;
$complaint_on_user = $userModel->getUserByLogin($user_login);
if ($complaint_on_user) {
$arbitrationModel->load(0);
$arbitrationModel->user_id = $user->id;
$arbitrationModel->complaint_on_user = $complaint_on_user['id'];
$arbitrationModel->complaint_text = $_SERVER['HTTP_REFERER'] . " " . htmlspecialchars($request->complaint_text);
$arbitrationModel->arbitration_group_id = $request->arbitration_group_id;
$arbitrationModel->save();
$message['item_id'] = (int) $request->item_id;
$this->_view->returnArbitrationAdded($message);
$this->_view->ajax();
}
}
示例9: __construct
function __construct(IManager $autorization)
{
$this->_dbUser = new UserModel();
if ($autorization->needAutorization() === true) {
$session = Project::getSession();
$logged = $session->getKey('logged', false);
if ($logged) {
$this->_guest = false;
$this->_dbUser->load($session->getKey('logged_user_id'));
$this->_is_admin = $this->_dbUser->user_type_id == 1 ? true : false;
} else {
$this->_guest = true;
}
} else {
$this->_guest = true;
}
$username = Project::getRequest()->getUsername();
$this->_showed_user = new UserModel();
if ($username) {
$this->_showed_user->loadByLogin($username);
if ((int) $this->_showed_user->id > 0) {
if ($this->_showed_user->id == $this->_dbUser->id) {
$this->_is_my_area = true;
$this->_is_friend = true;
} else {
$friend_model = new FriendModel();
$friend_id = (int) $friend_model->isFriend($this->_showed_user->id, $this->_dbUser->id);
if ($friend_id == $this->_dbUser->id) {
$this->_is_friend = true;
}
}
}
}
if ($this->_is_admin) {
$this->_is_my_area = true;
}
}
示例10:
</li>';
}
?>
</ul>
</div>
<!-- /chat-entry -->
</div>
<!-- /chat -->
<?php
echo $this->flash_messages;
?>
<h2>Новое сообщение</h2>
<div class="new-mess">
<form action="<?php
echo Project::getRequest()->createUrl('Messages', 'SendMessage');
?>
" method="post">
<div>
<input type="text" name="mess_header" style="width: 99%; margin-bottom: 3px;" />
<textarea rows="10" cols="50" name="m_text"></textarea>
<input type="hidden" value="new_message" name="message_action" />
<input type="hidden" value="Messages" name="redirect_controller" />
<input type="hidden" value="CorrespondenceWith" name="redirect_action" />
<input type="hidden" value="/corr_user_id:<?php
echo $this->correspondent_user['id'];
?>
" name="redirect_url" />
<input type="hidden" value="<?php
echo $this->correspondent_user['login'];
?>
示例11: loadSocialRows
/**
* Выборка 1 строки конкретной соц.позиции
* Используется для просмотра закладки SocialViewAction
*/
public function loadSocialRows($p_id = 0)
{
$v_id = (int) $p_id;
$sql = "\r\n SELECT\r\n sp.`id`,\r\n sp.`user_id`,\r\n sp.`social_tree_id`,\r\n sp.`name`,\r\n IF (CHAR_LENGTH(sp.`name`)<=" . self::C_MAX_LENGTH_NAME . ", sp.`name`, CONCAT( LEFT(sp.`name`, " . self::C_MAX_LENGTH_NAME . "), '...')) as name_cut,\r\n sp.`creation_date`,\r\n users.`login`,\r\n IF (spt_pr.`name` is null, spt_ch.`name`, CONCAT(' ▪ <a href=\"" . Project::getRequest()->createUrl('Social', 'SocialMainList', null, false) . "/',spt_pr.`id`,'\">',spt_pr.`name`, '</a> » <a href=\"" . Project::getRequest()->createUrl('Social', 'SocialMainList', null, false) . "/',sp.`social_tree_id`,'/\">',spt_ch.`name`,'</a> » ',sp.`name`)) as social_category,\r\n sc.`id` as criteria_id,\r\n sc.`name` as criteria_name,\r\n spcv.`votes_sum`,\r\n spcv.`votes_count`,\r\n spcv.`votes_sum`/spcv.`votes_count` as votes_avg,\r\n spc.avg_rating\r\n FROM social_pos sp\r\n LEFT JOIN users\r\n ON sp.`user_id` = users.`id`\r\n LEFT JOIN social_tree spt_ch\r\n ON sp.`social_tree_id` = spt_ch.`id`\r\n LEFT JOIN social_tree spt_pr\r\n ON spt_ch.`parent_id` = spt_pr.`id`\r\n LEFT JOIN `social_tree_criteria` stc\r\n ON sp.`social_tree_id` = stc.`social_tree_id`\r\n LEFT JOIN `social_criteria` sc\r\n ON stc.`social_criteria_id` = sc.`id`\r\n LEFT JOIN `social_pos_criteria_votes` spcv\r\n ON spcv.`social_criteria_id` = sc.`id` and spcv.`social_pos_id` = sp.`id`\r\n LEFT JOIN (\r\n SELECT \r\n spcv2.`social_pos_id`, \r\n sum(spcv2.`votes_sum`) as votes_sum, \r\n sum(spcv2.`votes_count`) as votes_count,\r\n sum(spcv2.`votes_sum`/spcv2.`votes_count`)/count(*) as avg_rating\r\n FROM social_pos_criteria_votes spcv2\r\n GROUP BY spcv2.`social_pos_id`\r\n ) spc\r\n ON spc.`social_pos_id` = sp.`id`\r\n WHERE sp.`id` = ?d\r\n ";
$result = Project::getDatabase()->select($sql, $v_id);
// $result = Project::getDatabase() -> selectRow($sql, $v_id);
$this->bind($result);
// - пока не знаю надо ли или это только для selectRow
return $result;
}
示例12: include
<?php include($this -> _include('../header.tpl.php')); ?>
<?php $request = Project::getRequest();
$v_categoryID = $request->getKeyByNumber(0);
if($v_categoryID) {
$add = '/'.$v_categoryID.'';
}
else {
$add = '';
}
$v_session = Project::getSession();
$bpp = $v_session->getKey('bpp'); ?>
<!-- TEMPLATE: "Каталог закладок" - основная вкладка раздела закладки -->
<div class="columns-page clearfix">
<div class="main"><div class="wrap">
<ul class="view-filter clearfix">
<?php include($this -> _include('../tab_panel.tpl.php')); ?>
</ul>
<!-- /view-filter -->
<div class="display-filter clearfix">
<div class="number-filter">
показывать по:
<?php if(!$bpp || $bpp == 10){ ?>
<strong>10</strong> | <a href="<?php echo $this->createUrl('Bookmarks', 'BookmarksList', null, false).$add; ?>/bpp:20">20</a> | <a href="<?php echo $this->createUrl('Bookmarks', 'BookmarksList', null, false).$add; ?>/bpp:30">30</a> закладок
<?php }elseif($bpp == 20) { ?>
<a href="<?php echo $this->createUrl('Bookmarks', 'BookmarksList', null, false).$add; ?>/bpp:10">10</a> | <strong>20</strong> | <a href="<?php echo $this->createUrl('Bookmarks', 'BookmarksList', null, false).$add; ?>/bpp:30">30</a> закладок
<?php } elseif($bpp == 30) { ?>
<a href="<?php echo $this->createUrl('Bookmarks', 'BookmarksList', null, false).$add; ?>/bpp:10">10</a> | <a href="<?php echo $this->createUrl('Bookmarks', 'BookmarksList', null, false).$add; ?>/bpp:20">20</a> | <strong>30</strong> закладок
<? } ?>
</div>
</div>
<!-- /display-filter -->
示例13: IndexAction
public function IndexAction()
{
$this->_view->assign('text', Project::getRequest()->text);
$this->_view->Test();
$this->_view->parse();
}
示例14: LastListAction
function LastListAction($info = array())
{
$this->BaseSiteData();
$info['tab_list'] = TabController::getMainAlbumTabs(false, true, false);
$request_user_id = (int) Project::getUser()->getShowedUser()->id;
$user_id = (int) Project::getUser()->getDbUser()->id;
$album_id = isset($album_id) && (int) $album_id > 0 ? $album_id : (int) Project::getRequest()->getKeyByNumber(0);
$this->BaseAlbumData($info, $album_id);
$photo_model = new PhotoModel();
$pager = new DbPager(Project::getRequest()->getValueByNumber(1), $this->getParam('last_photo_per_page', self::DEFAULT_PHOTO_PER_PAGE));
$photo_model->setPager($pager);
$list = $photo_model->loadAll($request_user_id, $album_id);
$this->checkImages($list);
$info['photo_list'] = $list;
$info['list_pager'] = $photo_model->getPager();
$info['list_controller'] = 'Photo';
$info['list_action'] = 'Album';
$info['list_user'] = null;
$this->_view->LastList($info);
$this->_view->parse();
}
示例15: createUrl
private function createUrl($controller = null, $action = null, $param = null, $user = null)
{
return Project::getRequest()->createUrl($controller, $action, $param, $user);
}