Example #1
0
 function __construct($view_class = null)
 {
     if ($view_class === null) {
         $view_class = "DevView";
     }
     $this->request = Project::getRequest();
     parent::__construct($view_class);
 }
Example #2
0
 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();
 }
Example #3
0
 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);
 }
Example #4
0
 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);
 }
Example #5
0
 /**
  * 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;
     }
 }
Example #6
0
 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;
 }
Example #7
0
 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');
 }
Example #8
0
 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();
     }
 }
Example #9
0
 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;
     }
 }
Example #10
0
							    	  </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'];
?>
Example #11
0
 /**
  *  Выборка 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;
 }
Example #12
0
<?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 -->
Example #13
0
 public function IndexAction()
 {
     $this->_view->assign('text', Project::getRequest()->text);
     $this->_view->Test();
     $this->_view->parse();
 }
Example #14
0
 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();
 }
Example #15
0
 private function createUrl($controller = null, $action = null, $param = null, $user = null)
 {
     return Project::getRequest()->createUrl($controller, $action, $param, $user);
 }
Example #16
0
 function ChangeAccessAction()
 {
     $request = Project::getRequest();
     $group_model = new UserTypeModel();
     $group_data = $group_model->load($request->gid);
     if (!count($group_data)) {
         // Bad request:: group not exists
         return;
     }
     $controller_model = new ControllerModel();
     $controller_data = $controller_model->load($request->cid);
     if (!count($controller_data)) {
         // Bad request:: controller not exists
         return;
     }
     $action_model = new ActionModel();
     $action_data = $action_model->load($request->id);
     if (!count($action_data)) {
         // Bad request:: action not exists
         return;
     }
     $right_model = new UserRightModel();
     $right_data = $right_model->loadByTypeControllerAction($request->gid, $request->cid, $request->id);
     if (!count($right_data)) {
         $right_model->user_type_id = $request->gid;
         $right_model->controller_id = $request->cid;
         $right_model->action_id = $request->id;
         $right_model->access = 1;
     } else {
         $right_model->access = 1 - (int) $right_model->access;
     }
     $right_model->save();
 }
Example #17
0
					<? if ($item['user_age'] != '') { ?>
            			 <?=$item['user_age'];?> лет<br />
          			<? } ?>
          			<? if ($item['registration_date'] != '') { ?>
            			Зарегистрирован : <?=date_format(new DateTime($item['registration_date']),'d.m.Y');?><br />
          			<? } ?>
				</dd>
				<dd>
					<?php if($item['time_online']) { ?>
						<span>последний раз был на сайте:</span> <?=(int) date("m",time() - $item['time_online']); ?> минуты назад
					<? } ?>
				</dd>
				<dd>
					<ul>
						<li><a href="<?php echo $this->createUrl('Blog', 'PostList', null, $item['login']); ?>">Блог пользователя</a> (<?=$item['cnt_blog']?>)</li>
						<li><a href="<?php echo $this->createUrl('Album', 'List', null, $item['login']); ?>">Фото пользователя</a> (<?=$item['count_photos']; ?>)</li>
					</ul>
				</dd>
			</dl>
			<ul class="links">
				<li><a href="<?=$request->createUrl('Index','Index', null, $item['login']); ?>">Профиль пользователя</a></li>
				<li><a href="<?=Project::getRequest() -> createUrl('Messages', 'CorrespondenceWith',null,$this->current_user->login).'/corr_user_id:'.$item['id']; ?>" class="new-link">Переписка</a> (<?=$item['cnt_msg']; ?>)</li>
				<li><a href="<?php echo $this -> createUrl('Messages', 'SendMessage',null,$this->current_user->login);?>">Написать сообщение</a></li>
				<li><a href="<?php echo $this->createUrl('Messages', 'Friend',null,$this->current_user->login); ?>">Добавить в друзья</a></li>
				<li><a href="<?php echo $this -> createUrl('Messages', 'SendMessage',null,$this->current_user->login);?>/message_to:admin" class="spam-link">Пожаловаться на пользователя</a></li>
			</ul>
		</li>
	<? } ?>					
	</ul>
<? } ?> 
Example #18
0
 protected function checkAlbumList(&$list)
 {
     foreach ($list as $key => $value) {
         $login = trim($value['login']);
         $thumb = false;
         if (strlen($login) > 0) {
             $dir = USER_UPLOAD_DIR . DIRECTORY_SEPARATOR . $login;
             $err = false;
             $ok = $this->checkDir($dir);
             if ($ok === true) {
                 $album = $dir . DIRECTORY_SEPARATOR . 'album';
                 $ok = $this->checkDir($album);
             }
             if ($ok === true) {
                 $images = $album . DIRECTORY_SEPARATOR . 'images';
                 $ok = $this->checkDir($images);
             }
             if ($ok === true) {
                 $thumbs = $album . DIRECTORY_SEPARATOR . 'thumbs';
                 $ok = $this->checkDir($thumbs);
             }
             if ($ok === true && isset($value['thumbnail'])) {
                 $f = $thumbs . DIRECTORY_SEPARATOR . $value['thumbnail'];
                 if (file_exists($f) && is_file($f)) {
                     $thumb = Project::getRequest()->getHost() . 'users/' . $login . '/album/thumbs/' . $value['thumbnail'];
                 }
             }
         }
         $list[$key]['thumbnail'] = $thumb;
     }
 }
 function CatalogDeleteTagAction()
 {
     $request = Project::getRequest();
     $catalog_id = (int) $request->getKeyByNumber(0);
     $page_number = (int) $request->getKeyByNumber(1);
     $tag_page_number = (int) $request->getKeyByNumber(2);
     $tag_id = (int) $request->getKeyByNumber(3);
     $tag_model = new BlogTagModelSocieties();
     $tag_model->delete($tag_id);
     Project::getResponse()->redirect($request->createUrl('BlogAdminSocieties', 'CatalogEdit', array($catalog_id, $page_number, $tag_page_number)));
 }
Example #20
0
 public function createMessagesTree()
 {
     $messages = $this->_stack['messages'];
     $access_mod_messages = $this->_stack['access_mod_messages'];
     $pid = $this->_stack['tid'];
     foreach ($messages as $message) {
         if ($access_mod_messages) {
             $result .= '<br /><div style="font-weight: bold;">' . $message['message_name'] . '</div><div><div>' . $message['message_content'] . '</div><div><a href="' . Project::getRequest()->createUrl('Groups', 'messageDelete') . '/pid:' . $pid . '/tid:' . $message['id_topic'] . '/mid:' . $message['id'] . '">удалить</a>&nbsp;&nbsp;<a href="' . Project::getRequest()->createUrl('Groups', 'messageAlter') . '/pid:' . $pid . '/tid:' . $message['id_topic'] . '/mid:' . $message['id'] . '">изменить</a></div></div>';
         } else {
             $result .= '<br /><div style="font-weight: bold;">' . $message['message_name'] . '</div><div><div>' . $message['message_content'] . '</div></div>';
         }
     }
     return $result;
 }
Example #21
0
    						<form method="post" action="<?php echo Project::getRequest() -> createUrl('Messages', 'Friend'); ?>">
    						<input type="hidden" value="<?php echo $this->group_id; ?>" name="group_id" />
            				<input type="hidden" value="changeGroup" name="messageAction" />
                        	Имя:  <input type="text" value="<?php echo $this->groupName; ?>" name="group_name" style="width: 200px;"/> 
                        		<input type="submit" value="Сохранить" name="save_group"/> 
                        		<input type="submit" value="Удалить" onclick="return confirm('После удаления группы все пользователи из нее\nбудут перемещены в группу Общая.\nВы уверены?');" name="del_group"/>
                        	<input type="hidden" value="edit_group" name="action"/>
                        	<input type="hidden" value="178" name="groupid"/>
                        	</form>
						</div>				
					   <? }elseif ($this->pageAction == 'changeFriend'){ ?> 
					    <div>
							<h2><a href="<?php echo Project::getRequest() -> createUrl('Messages', 'Friend'); ?>">Управление группами</a> » Редактирование друга  <?php echo $this->friend['friend_login']; ?></h2>
						</div>
						<div>
    						<form method="post" action="<?php echo Project::getRequest() -> createUrl('Messages', 'Friend'); ?>">
    						<input type="hidden" value="<?php echo $this->friend['id']; ?>" name="friend_table_id" />
            				<input type="hidden" value="changeFriend" name="messageAction" />          
                        	Заметка:  <input type="text" value="<?php echo $this->friend['note']; ?>" name="note" style="width: 200px;"/><br/><br/>
                        	Группа:  
                        		<select style="width: 200px;" name="group_id">
                        			<option selected value="0"> Общая
                        			<?php foreach ($this->aFriendGroups as $friendGroup){
                        			    $selected = ($this->friend['group_id'] == $friendGroup['id'])?"selected='1'":"";
                        			    echo '<option '.$selected.' value="'.$friendGroup['id'].'"> '.$friendGroup['name'];
                        			} ?>                       		
                        		</select>
                        	<div class="submBut">
                        		<input type="submit" class="button" value="Сохранить" name="save_friend"/>  
                        	</div>
                        	<input type="hidden" value="edit_friend" name="action"/>
Example #22
0
 public function SaveSubjectAction()
 {
     $request = Project::getRequest();
     $article_model = new ArticleModel();
     if (count($article_model->loadByParentId(0, array(ARTICLE_COMPETITION_STATUS::NEW_ARTICLE), Project::getUser()->getDbUser()->id)) < 5) {
         $article_model->title = $request->title;
         $article_model->articles_tree_id = $request->parent_id;
         $article_model->user_id = Project::getUser()->getDbUser()->id;
         $article_model->rate_status = ARTICLE_COMPETITION_STATUS::NEW_ARTICLE;
         $article_model->creation_date = date("Y-m-d H:i:s");
         $article_model->save();
     }
     Project::getResponse()->redirect($request->createUrl('Article', 'CompetitionCatalog'));
 }
Example #23
0
    function returnCorrespondentPage($message)
    {
        $response = Project::getAjaxResponse();
        $htmlMess = "";
        $i = 1;
        foreach ($message['aMessages'] as $userMessage) {
            if ($i / 2 == 1) {
                $i = 1;
            } else {
                $i++;
            }
            $htmlMess .= '
		    <div class="cmod_tab' . $i . '">
				<h3>' . $userMessage['author_login'] . '</h3>,  <h3>' . $userMessage['header'] . '</h3>,  ' . $userMessage['send_date'] . '  
				
				';
            if ($userMessage['author_id'] != $this->user_id) {
                $htmlMess .= '
					<a href="' . Project::getRequest()->createUrl('Messages', 'SendMessage') . '/message_action:reply/mess_id:' . $userMessage['id'] . '"><b>написать сообщение</b></a> | 
            		<a onclick="return DelMessageCorrespondence(' . $userMessage['messages_id'] . ', ' . $message['corr_user_id'] . ');" href="javascript: void(0);"><b>удалить</b></a>';
            }
            $htmlMess .= '
				<p>
					' . $userMessage['m_text'] . '
				</p>
			</div>';
        }
        $response->block('cmod_messages', true, $htmlMess);
    }
Example #24
0
 public function ChangeStatesAction()
 {
     $request = Project::getRequest();
     $state_id = $request->getKeyByNumber(0);
     if ($state_id) {
         $info = array();
         $state_model = new CityModel();
         $info['city_list'] = $state_model->loadByState($state_id);
         $this->_view->ChangeState($info);
         $this->_view->ajax();
     } else {
         $response = Project::getAjaxResponse();
         $response->block('city_div', true, '');
         $this->_view->ajax();
     }
 }
Example #25
0
 /**
  * Reloads the current page.
  * The effect of this method call is the same as user pressing the
  * refresh button on his browser (without post data).
  **/
 public function reload()
 {
     $this->redirect(Project::getRequest()->getRequestUri());
 }
Example #26
0
 public function messageDeleteAction()
 {
     $model = new GroupsModel();
     $model->deleteMessage($this->request['mid']);
     Project::getResponse()->redirect(Project::getRequest()->createUrl('Groups', 'messagesView') . '/pid:' . $this->request['pid'] . '/tid:' . $this->request['tid']);
 }
Example #27
0
 public function AllowDenyCategoryAction()
 {
     $request = Project::getRequest();
     $category = new BookmarksCategoryModel();
     $category->load($request->id);
     $category->active = $request->type;
     if ($request->rename) {
         $category->name = $request->name;
     }
     if ($category->save()) {
         // -- Отправка сообщения
         $admin = new UserModel();
         $admin->loadAdmin();
         $view = new BaseSiteView();
         $view->setTemplate('mail', 'bookmarks_category_allowdeny.tpl.php');
         $view->assign('category', $category);
         $view->assign('type', $request->type);
         $view->assign('comment', $request->comment);
         $body = $view->parse();
         $message = new MessagesModel();
         $message->sendMessage($admin->id, $category->user_id, 'Ответ на запрос на создание категории в закладках', $body);
         // ---------------------
     }
     $this->_view->CloseCategoryForm();
     $this->_view->parse();
 }
 function DeleteParamAction()
 {
     $request = Project::getRequest();
     $model = new ParamModel();
     $model->delete($request->id);
     Project::getResponse()->redirect($request->createUrl('AdminParameter', 'EditGroup', array('id' => $request->cid)));
 }
Example #29
0
<!-- TEMPLATE: Строка тегов, соответствующих выбранной категории -->
<?php 
if (count($this->bookmarks_tags_list) > 0) {
    ?>
<div class="tag-list">
	<i class="icon tags-list-icon"></i>
		<ul>		
						<?php 
    $v_request = Project::getRequest();
    $v_categoryID = $v_request->getKeyByNumber(0);
    $v_n_page = $v_request->getKeyByNumber(1);
    $v_count_tag_max = 1;
    foreach ($this->bookmarks_tags_list as $key => $value) {
        if ($value['count_tag'] > $v_count_tag_max) {
            $v_count_tag_max = $value['count_tag'];
        }
    }
    foreach ($this->bookmarks_tags_list as $key => $value) {
        $v_URL = $this->createUrl('Bookmarks', $this->action, array($v_categoryID, $value['id'], '0'));
        if ($v_count_tag_max > 1) {
            $v_size = 100 + ceil(75 * ($value['count_tag'] - 1) / $v_count_tag_max);
        } else {
            $v_size = 100;
            //style="font-size: '.$v_size.'%"
        }
        if ($value['tag_name'] != $this->tag_name_selected) {
            $tags_set[] = '<li><a rel="tag" href="' . $v_URL . '" title="' . $value['count_tag'] . ' раз(а)">' . $value['tag_name'] . '</a></li>';
        } else {
            $tags_set[] = '<li><b>' . $value['tag_name'] . '</b></li>';
        }
    }
Example #30
0
 public function ReloadDropDownsAction()
 {
     $request = Project::getRequest();
     $this->setFormParams();
     // Depends check
     $depends = $this->_view->getReverceDependsList($request->changed_list);
     foreach ($depends as $depend) {
         $name_id = $depend . '_id';
         $this->session->{$name_id} = 0;
     }
     // Setting view vars
     $this->setViewVars();
     $this->_view->ReloadDropDowns($depends);
     $this->_view->ajax();
     //$response ->
 }