Пример #1
0
 public function moveAction()
 {
     $result = K_Request::call(array('module' => 'admin', 'controller' => 'tree', 'action' => 'move', 'params' => array()));
     json_decode($result, true);
     if ($result['status']) {
         $jsonReturn['error'] = false;
         $jsonReturn['msg'] = 'Блог успешно перемещен.';
         $jsonReturn['form'] = false;
     } else {
         $jsonReturn['error'] = true;
         $jsonReturn['msg'] = array('1' => array('label' => 'Раздел', 'error' => 'неправильнный раздел для новости'));
     }
     $this->putJSON($jsonReturn);
 }
Пример #2
0
 public function prevNextLoad()
 {
     $treeLink = $_POST['link'];
     $node = K_tree::getNode($treeLink);
     if (!$node) {
         $jsonReturn['error'] = true;
         $jsonReturn['msg'] = 'Ошибка: неправильная ссылка на элемент';
         $this->putJSON($jsonReturn);
     }
     $jsonReturn['error'] = false;
     $prevBro = K_tree::getPrevBro($node['tree_id']);
     $nextBro = K_tree::getNextBro($node['tree_id']);
     $jsonReturn['prev'] = !empty($prevBro['tree_link']) ? $prevBro['tree_link'] : false;
     $jsonReturn['next'] = !empty($nextBro['tree_link']) ? $nextBro['tree_link'] : false;
     $jsonReturn['html'] = K_Request::call(array('module' => 'default', 'controller' => 'index', 'action' => 'page', 'params' => array('0' => $treeLink), 'disableLayout' => false, 'layout' => 'contentlayout'));
     $this->putJSON($jsonReturn);
 }
Пример #3
0
 /** Методы блоков
  *  подключает html шаблоны блоков
  *
  *
  */
 private function bd_simpleTypeBlock($node)
 {
     $result = '';
     if (is_dir(APP_PATH . '/blocks/' . $node['tree_type'])) {
         include APP_PATH . '/blocks/' . $node['tree_type'] . '/item.phtml';
     }
     return K_Request::call(array('module' => 'typebloks', 'controller' => $node['tree_type'], 'action' => 'item', 'params' => array('node' => $node)));
 }