function ListAction() { $request = Project::getRequest(); $request_user_id = (int) Project::getUser()->getShowedUser()->id; $user_id = (int) Project::getUser()->getDbUser()->id; $this->BaseSiteData(); $info = array(); $this->BaseSubscribeData($info); $filter = (int) $request->getKeyByNumber(0); $blog_catalog_page = (int) $request->getKeyByNumber(1); if ($filter === 1) { $info['only_subscribed'] = true; $info['all_tree'] = false; } else { $info['only_subscribed'] = false; $info['all_tree'] = true; } $info['only_subscribed_link'] = $request->createUrl('Subscribe', 'List', array(1, $blog_catalog_page)); $info['all_link'] = $request->createUrl('Subscribe', 'List', array(0, $blog_catalog_page)); $blog_catalog_model = new BlogCatalogModel(); $pager = new DbPager($blog_catalog_page, $this->getParam('blog_catalog_per_page', 10)); $blog_catalog_model->setPager($pager); if ($filter === 1) { $info['blog_catalog'] = $blog_catalog_model->loadSubscribedPage($user_id); } else { $info['blog_catalog'] = $blog_catalog_model->loadAll(); } $info['level'] = 0; foreach ($info['blog_catalog'] as &$item) { $item['ajax_param'] = AjaxRequest::getJsonParam('Subscribe', 'AjaxBlogCatalogTree', array($item['id'], $info['level'], $filter, 1)); } $info['direction'] = 1; $this->_view->SubscribeList($info); $this->_view->parse(); }
function AjaxActionList($info) { $response = Project::getAjaxResponse(); $response->save(); $response->hide('action_list_' . $info['controller_id']); //$response -> enable('list_block'); $info['cancel_param'] = $response->getResponse(); $response->restore(); $number = 1; foreach ($info['actions_list'] as &$item) { $item['number'] = $number; $item['change_access_link'] = AjaxRequest::getJsonParam($info['change_access_controller'], $info['change_access_action'], array('id' => $item['id'], 'gid' => $info['user_type_id'], 'cid' => $info['controller_id'])); $number++; } $this->set($info); $this->setTemplate($this->_dir, 'action_list.tpl.php'); $response->block('action_list_' . $info['controller_id'], true, $this->parse()); //$response -> disable('list_block'); }
function AjaxBlogTree($info) { $response = Project::getAjaxResponse(); if ($info['direction'] === 1) { foreach ($info['blog_catalog'] as $key => &$item) { if ($info['id'] == $item['id']) { unset($info['blog_catalog'][$key]); } else { $item['ajax_param'] = AjaxRequest::getJsonParam('Subscribe', 'AjaxBlogTree', array($item['id'], $info['level'], $info['filter'], 1)); $item['subscribe_param'] = AjaxRequest::getJsonParam('Subscribe', 'Change', array($item['id'])); } } $ajax_param = AjaxRequest::getJsonParam('Subscribe', 'AjaxBlogTree', array($info['id'], $info['level'], $info['filter'], 0)); $response->block('bti_' . $info['id'] . '_' . ($info['level'] - 1), true, '<a href="#" onClick=\'ajax(' . $ajax_param . ');\'><img src="' . $this->image_url . 'icons/minus.gif" /></a>'); $this->set($info); $this->setTemplate($this->_dir, 'blog_tree.tpl.php'); $response->block('btl_' . $info['id'] . '_' . ($info['level'] - 1), true, $this->parse()); } else { $response->hide('btl_' . $info['id'] . '_' . ($info['level'] - 1)); $ajax_param = AjaxRequest::getJsonParam('Subscribe', 'AjaxBlogTree', array($info['id'], $info['level'] - 1, $info['filter'], 1)); $response->block('bti_' . $info['id'] . '_' . ($info['level'] - 1), true, '<a href="#" onClick=\'ajax(' . $ajax_param . ');\'><img src="' . $this->image_url . 'icons/plus.gif" /></a>'); } }
echo $n['name']; ?> <br> </td> <td> <a href="#" onclick='ajax(<?php echo AjaxRequest::getJsonParam('AdminArticle', 'EditSection', array($n['id'])); ?> )'>[Редактировать]</a> <a href="#" onclick='ajax(<?php echo AjaxRequest::getJsonParam('AdminArticle', 'DeleteSection', array($n['id'])); ?> )'>[Удалить]</a> <a href="#" onclick='ajax(<?php echo AjaxRequest::getJsonParam('AdminArticle', 'SetActive', array($n['id'])); ?> )'>[Активировать]</a> <a href="#" onclick='ajax(<?php echo AjaxRequest::getJsonParam('AdminArticle', 'UpSection', array($n['id'])); ?> )'>[Поднять категорию]</a> <a href="#" onclick='ajax(<?php echo AjaxRequest::getJsonParam('AdminArticle', 'DownSection', array($n['id'])); ?> )'>[Опустить категорию]</a> </td> </tr> <? endforeach;?> </table> </div>
public function ChangeCountryAction() { $request = Project::getRequest(); $country_id = $request->getKeyByNumber(0); if ($country_id) { $info = array(); $state_model = new StateModel(); $info['state_list'] = $state_model->loadByCountry($country_id); $info['change_state_param'] = AjaxRequest::getJsonParam("Social", "ChangeStates", array('#id#')); $this->_view->ChangeCountry($info); $this->_view->ajax(); } else { $response = Project::getAjaxResponse(); $response->block('state_div', true, ''); $response->block('city_div', true, ''); $this->_view->ajax(); } }
</option> <?endforeach;?> </select> </div> </td> </tr> </tbody></table> </form> <!-- --> </td> <td class="c_right"> </td> </tr> <tr> <td class="b_left"> </td> <td class="b_cen"><div class="b_delim"> <div class="button bbig" style="float: right;"><a href="#" onclick='cancel(<?php echo $this->cancel_param; ?> );'>Отмена</a></div> <div class="button bbig" style="float: right;"><a href="#" onclick='save(<?php echo AjaxRequest::getJsonParam('AdminArticle', 'SaveSection', array($this->cat['id'], 'form_id' => 'edit_form'), "POST"); ?> )'>Сохранить</a></div> </td> <td class="b_right"> </td> </tr> </tbody> </table>
Изменить статус</a>'; } echo ' </td> <td>' . $newsTreeFeeds['url'] . '</td> <td>' . $newsTreeFeeds['category_tag'] . '</td> <td>'; if ($newsTreeFeeds['news_banner_id']) { // we have a banner echo ' <a href="javascript:void(0);" class="show_banner">Показать код баннера</a><div class="banner_code"><pre>' . htmlspecialchars($newsTreeFeeds['code']) . '</pre></div><div class="list_status" id="news_banners' . $newsTreeFeeds['news_banner_id'] . '">' . $news_banners_state . '</div>'; if ($this->isAdmin) { echo '<a onclick=\' document.getElementById("news_banners' . $newsTreeFeeds['news_banner_id'] . '").innerHTML="<img src=' . $this->image_url . 'loader2.gif >"; ajax (' . AjaxRequest::getJsonParam("News", "ChangeState", array("id" => $newsTreeFeeds['news_banner_id'], "element" => "news_banners"), "POST") . ', true ); \' href="javascript: void(0);"> Изменить статус</a>'; } } else { // no banners in this RSS echo 'нет кода баннера'; } echo ' </td> <td>' . $this->ShowNewsTreeBreadCrumbByNewsTreeId($newsTreeFeeds['news_tree_id']) . '<div class="list_status" id="news_tree' . $newsTreeFeeds['news_tree_id'] . '">' . $news_tree_state . '</div>'; echo ' </td> <td>' . $text_parse_type . '</td> <td><a href="' . $this->createUrl('User', 'Profile', null, $newsTreeFeeds['user_login']) . '">' . $newsTreeFeeds['user_login'] . '</a> [' . $is_partner . ']</td>
function ChangeCountryAction() { $request = Project::getRequest(); $country_id = $request->getKeyByNumber(0); $info = array(); $state_model = new StateModel(); $info['state_list'] = $state_model->loadByCountry($country_id); $info['change_state_param'] = AjaxRequest::getJsonParam("User", "ChangeState", array('#id#')); $this->_view->ChangeCountry($info); $this->_view->ajax(); }
/** * Edit post action */ public function PostEditAction() { $info = array(); $request = Project::getRequest(); $request_user_id = (int) Project::getUser()->getShowedUser()->id; $user_id = (int) Project::getUser()->getDbUser()->id; $info['user_id'] = (int) $user_id; $info['request_user_id'] = (int) $request_user_id; $this->BaseSiteData(); $this->BaseBlogData($info); $post_id = (int) $request->getKeyByNumber(0); $page_number = (int) $request->getKeyByNumber(1); $post_model = new BlogPostModel(); $post_model->load($post_id); if ($post_model->id) { $tree_model = new BlogTreeModel(); $tree_model->load($post_model->ub_tree_id); $blog_model = new BlogModel(); $blog_model->load($tree_model->blog_id); if ($blog_model->user_id != $user_id) { Project::getResponse()->redirect($request->createUrl('Blog', 'PostList')); } } $info['post_id'] = (int) $post_model->id; $info['full_text'] = $post_model->full_text; $info['small_text'] = $post_model->small_text; $info['post_title'] = $post_model->title; $info['post_creation_date'] = $post_model->creation_date; $info['post_tree_id'] = (int) $post_model->ub_tree_id; $info['post_mood'] = $post_model->mood; $info['post_access'] = (int) $post_model->access; $info['post_allow_comments'] = (int) $post_model->allowcomments; $info['best_post'] = (int) $post_model->bbp_status; $tag_model = new BlogTagModel(); $tag_model->load($post_model->bc_tag_id); $info['post_tag'] = $tag_model->name; $info['post_tag_id'] = $tag_model->id; $info['post_page_number'] = $page_number; $info['access_list'] = HelpFunctions::getBlogAccessList(); $mood_model = new MoodModel(); $info['mood_list'] = $mood_model->getList($request_user_id); $userModel = new UserModel(); $info['user_avatars'] = $userModel->getAllUserAvatars($user_id); $info['avatar_id'] = $post_model->avatar_id; $info['tag_list'] = $tag_model->loadList($tree_model->blog_catalog_id, true); foreach ($info['branch_list'] as &$item) { $item['change_branch_param'] = AjaxRequest::getJsonParam('Blog', 'AjaxChangeBranch', array($post_id, $item['id'])); } $this->_view->PostEdit($info); $this->_view->parse(); return; }
?> " /> </span> </li> <li> <span class="field"> <?php //onchange="changeList(=AjaxRequest::getJsonParam("SearchUser", "ChangeCountry", array('#id#'));, this);" //echo AjaxRequest::getJsonParam("SearchUser", "ChangeCountry", array('#id#')); //print '<pre>'; // print_r(AjaxRequest::getParam()); //print '</pre>'; ?> <label for="country" class="label">Страна</label> <select id="country" name="select_search_counrty" onchange='changeList(<?php echo AjaxRequest::getJsonParam("SearchUser", "ChangeCountry", array('#id#')); ?> , this);'> <option value="0">не важно</option> <? foreach($this->list_country as $key=>$val) { ?> <option value="<?php echo $val['id']; ?> " <? if ($this->p_search_counrty == $val['id']) echo 'selected="selected"';?>><?php echo $val['name']; ?> </option> <? } ?> </select> </span> <div id="state_div" style="margin-top:5px; margin-bottom:5px;">
private function _createLinks(&$data, $num_page = null, $id = 0) { $request = Project::getRequest(); $num_page === null ? $data['num_page'] = $request->getKeyByNumber(0) + 1 : ($data['num_page'] = $num_page); $request->getKeyByNumber(1) > 0 ? $id = $request->getKeyByNumber(1) : ($id = $id); $data['add_page_link'] = AjaxRequest::getJsonParam('AdminArticle', 'AddPage', array($data['num_page'], $id)); for ($i = 0; $i < $data['num_page']; $i++) { $editors[] = "content_page[{$i}]"; } $data['save_param'] = AjaxRequest::getJsonParam('AdminArticle', 'SaveArticle', array('id' => $id, 'form_id' => 'edit_form', 'editor_form' => $editors), "POST"); }
</td> <td><?php echo $item['comments']; ?> </td> <td> <? if($item['rate_status'] == ARTICLE_COMPETITION_STATUS::COMPLETE || $item['rate_status'] == ARTICLE_COMPETITION_STATUS::SHOW_IN_CATALOG || $item['rate_status'] == ARTICLE_COMPETITION_STATUS::WINNER) echo "Готова"; if($item['rate_status'] == ARTICLE_COMPETITION_STATUS::EDITED) echo "В редакции"; if($item['rate_status'] == ARTICLE_COMPETITION_STATUS::NEW_ARTICLE || $item['rate_status'] == ARTICLE_COMPETITION_STATUS::IN_RATE) echo "Новая тема"; ?> </td> <td> <a href='#' onclick='ajax(<?php echo AjaxRequest::getJsonParam($this->controller, $this->edit_action, array($item['id'])); ?> )'>[Редактировать]</a> <a href="#" onclick='ajax(<?php echo AjaxRequest::getJsonParam($this->controller, $this->delete_article_action, array($item['id'])); ?> )'>[Удалить]</a> <a href="#" onclick='ajax(<?php echo AjaxRequest::getJsonParam($this->controller, $this->reset_rate_action, array($item['id'])); ?> )' >[Сбросить рейтинг]</a> </td> </tr> <? endforeach;?> </table> <?php echo $this->list_pager_html;
<div class="full-view"> <h3> <a href="#"> <?php echo $this->news['news_title']; ?> <?php if ($this->news['favorite_news_id']) { $star_class = 'class="star-icon full-star"'; echo '<i class="star-icon full-star"></i>'; } else { $star_class = 'class="star-icon empty-star"'; echo '<i class="star-icon empty-star"></i>'; } if ($this->user_id) { echo '<i id="imgstar' . $this->news['news_id'] . '" ' . $star_class . ' onclick=\'if($(this).hasClass("full-star")) {$(this).removeClass("full-star"); $(this).addClass("empty-star");} else {$(this).removeClass("empty-star"); $(this).addClass("full-star");} ajax(' . AjaxRequest::getJsonParam("News", "ChangeNewsFavorite", array("news_id" => $this->news['news_id'], "imgUrl" => $imgUrl), "POST") . ', true);\'></i></a>'; } else { echo '<i ' . $star_class . ' ></i>'; } //<img src="'.$this -> image_url.$starGif.'" id="imgstar'.$this->news['news_id'].'"> ?> </a> </h3> <div class="breadcrumbs"> <?php echo $this->ShowNewsTreeBreadCrumbByNewsTreeId($this->news['news_tree_id'], true); ?> </div> <!-- <a href="#"><img src="assets/i/temp/temp.5.jpg" alt="Что же в имени твоем! 3.0D" /></a> --> <p> <?php
public function ShowNewsListPreviewViewNova($newsViewType, $aNews, $nShowRows = 4, $user_id) { $newsUrl = Project::getRequest()->createUrl('News', 'News'); $imgUrl = $this->image_url; $countNews = count($aNews); if ($newsViewType == 'report') { // report news list if ($countNews > 0) { // $countNews --; } if ($countNews != 1) { $nRows = $countNews > 3 ? 3 : $countNews; $htmlNewsListPreview .= '<ul class="short-view">'; for ($i = 1; $i < $nRows + 1; $i++) { if ($aNews[$i]['favorite_news_id']) { $star_class = 'class="star-icon full-star"'; } else { $star_class = 'class="star-icon empty-star"'; } $htmlNewsListPreview .= ' <li><a href="' . $newsUrl . '/news_id:' . $aNews[$i]['news_id'] . '"><i class="icon this-icon"></i>' . $aNews[$i]['news_title'] . '</a>'; if ($user_id) { $htmlNewsListPreview .= '<i id="imgstar' . $aNews[$i]['news_id'] . '" ' . $star_class . ' onclick=\'if($(this).hasClass("full-star")) {$(this).removeClass("full-star"); $(this).addClass("empty-star");} else {$(this).removeClass("empty-star"); $(this).addClass("full-star");} ajax(' . AjaxRequest::getJsonParam("News", "ChangeNewsFavorite", array("news_id" => $aNews[$i]['news_id'], "imgUrl" => $imgUrl), "POST") . ', true);\'></i>'; } else { $htmlNewsListPreview .= '<i ' . $star_class . '></i>'; } $htmlNewsListPreview .= '</li>'; } $htmlNewsListPreview .= '</ul>'; } if ($countNews > 0) { $news = array_shift($aNews); if ($news['favorite_news_id']) { $star_class = 'class="star-icon full-star"'; } else { $star_class = 'class="star-icon empty-star"'; } $htmlNewsListPreview .= '<div class="full-view">'; $htmlNewsListPreview .= '<h3><a href="' . $newsUrl . '/news_id:' . $news['news_id'] . '">' . $news['news_title'] . '</a>'; if ($user_id) { $htmlNewsListPreview .= '<i id="imgstar' . $news['news_id'] . '" ' . $star_class . ' onclick=\'if($(this).hasClass("full-star")) {$(this).removeClass("full-star"); $(this).addClass("empty-star");} else {$(this).removeClass("empty-star"); $(this).addClass("full-star");} ajax(' . AjaxRequest::getJsonParam("News", "ChangeNewsFavorite", array("news_id" => $news['news_id'], "imgUrl" => $imgUrl), "POST") . ', true);\'></i>'; } else { $htmlNewsListPreview .= '<i ' . $star_class . '></i>'; } $htmlNewsListPreview .= '</h3>'; $htmlNewsListPreview .= '<div class="breadcrumbs"> ▪ ' . $this->ShowNewsTreeBreadCrumbByNewsTreeId($news['news_tree_id']) . ' </div>'; // $htmlNewsListPreview .= '<a href="'.$newsUrl.'/news_id:'.$news['news_id'].'"><img src="assets/i/temp/temp.5.jpg" alt="Что же в имени твоем! 3.0D" /></a>'; $htmlNewsListPreview .= '<p>' . $news['news_short_text'] . ' ... </p>'; if ($countNews > 1) { $htmlNewsListPreview .= '<div class="more"><a href="' . $newsUrl . '/news_id:' . $news['news_id'] . '">читать дальше</a> →</div>'; } $htmlNewsListPreview .= '</div>'; } } else { // full news list if ($nShowRows) { $nRows = $countNews > $nShowRows ? $nShowRows : $countNews; } else { $nRows = $countNews; } for ($i = 0; $i < $nRows; $i++) { if ($aNews[$i]['favorite_news_id']) { $star_class = 'class="star-icon full-star"'; } else { $star_class = 'class="star-icon empty-star"'; } $htmlNewsListPreview .= '<div class="full-view">'; $htmlNewsListPreview .= '<h3><a href="' . $newsUrl . '/news_id:' . $aNews[$i]['news_id'] . '">' . $aNews[$i]['news_title'] . '</a>'; if ($user_id) { $htmlNewsListPreview .= '<i id="imgstar' . $aNews[$i]['news_id'] . '" ' . $star_class . ' onclick=\'if($(this).hasClass("full-star")) {$(this).removeClass("full-star"); $(this).addClass("empty-star");} else {$(this).removeClass("empty-star"); $(this).addClass("full-star");} ajax(' . AjaxRequest::getJsonParam("News", "ChangeNewsFavorite", array("news_id" => $aNews[$i]['news_id'], "imgUrl" => $imgUrl), "POST") . ', true);\'></i>'; } else { $htmlNewsListPreview .= '<i ' . $star_class . '></i>'; } $htmlNewsListPreview .= '</h3>'; $htmlNewsListPreview .= '<div class="breadcrumbs"> ▪ ' . $this->ShowNewsTreeBreadCrumbByNewsTreeId($aNews[$i]['news_tree_id']) . ' </div>'; // $htmlNewsListPreview .= '<a href="'.$newsUrl.'/news_id:'.$news['news_id'].'"><img src="assets/i/temp/temp.5.jpg" alt="Что же в имени твоем! 3.0D" /></a>'; $htmlNewsListPreview .= '<p>' . $aNews[$i]['news_short_text'] . ' ... </p>'; // if($countNews > 1) { $htmlNewsListPreview .= '<div class="more"><a href="' . $newsUrl . '/news_id:' . $news['news_id'] . '">читать дальше</a> →</div>'; // } //$aNews[$i]['pub_date'] $htmlNewsListPreview .= '</div>'; } } return $htmlNewsListPreview; }
<?php } else { echo ' <a href="javascript: void(0);" onclick=\'ajax(' . AjaxRequest::getJsonParam($this->current_controller, $this->current_action, is_array($this->pager_params) ? array_merge($this->pager_params, array("current_page" => $i)) : array("current_page" => $i), "POST") . ', true);\' > ' . ($i + 1) . '</a>'; ?> <?php } ?> <?php } ?> <?php if ($this->current_page_number < $this->pages_number - 1) { echo ' <a href="javascript: void(0);" onclick=\'ajax(' . AjaxRequest::getJsonParam($this->current_controller, $this->current_action, is_array($this->pager_params) ? array_merge($this->pager_params, array("current_page" => $this->current_page_number + 1)) : array("current_page" => $this->current_page_number + 1), "POST") . ', true);\' title="Следующая страница" > »</a>'; ?> <?php } ?> <?php } ?> </div> </div> <!-- /Листинг -->
echo $this->cat_list[$i]['name']; ?> </td> <td> <a href="<?php echo $this->createUrl('AdminQuestionAnswer', 'MoveCat', array($this->cat_list[$i]['id'], $this->cat_list[$i - 1]['id'])); ?> ">[Up]</a> <a href="<?php echo $this->createUrl('AdminQuestionAnswer', 'MoveCat', array($this->cat_list[$i]['id'], $this->cat_list[$i + 1]['id'])); ?> ">[Down]</a> </td> <td> <div class="button bsmall" style="float: left;"><a href="#" onclick='ajax(<?php echo AjaxRequest::getJsonParam('AdminQuestionAnswer', 'ManagedCat', array($question['id'])); ?> )'><img src="<?php echo $this->image_url; ?> icons/small_edit.gif" alt="Правка"/></a></div> <div class="button bsmall" style="float: left;"><a href="<?php echo $this->createUrl('AdminQuestionAnswer', 'DeleteCat', array($this->cat_list[$i]['id'])); ?> "><img src="<?php echo $this->image_url; ?> icons/small_del.gif" alt="Удалить"/></a></div> </td> </tr> <?php
?> </td> <td><?php echo $question['login']; ?> </td> <td><?php echo $question['a_count']; ?> </td> <td><?php echo $question['creation_date']; ?> </td> <td><div class="button bsmall" style="float: left;"><a href="#" onclick='ajax(<?php echo AjaxRequest::getJsonParam('AdminQuestionAnswer', 'EditQuestion', array($question['id'])); ?> )'><img src="<?php echo $this->image_url; ?> icons/small_edit.gif" alt="Правка"/></a></div> <div class="button bsmall" style="float: left;"><a href="<?php echo $this->createUrl('AdminQuestionAnswer', 'DeleteQuestion', array($question['id'])); ?> "><img src="<?php echo $this->image_url; ?> icons/small_del.gif" alt="Удалить"/></a></div></td> </tr> <?endforeach;?> </table>