public function up() { $navi = new Navigation(); $navi->Translation['en']->caption = 'Profile'; $navi->Translation['ja_JP']->caption = '[i:140]プロフィール'; $navi->setType('mobile_home_center'); $navi->setUri('member/profile'); $navi->setSortOrder(0); $navi->save(); }
public function up() { $navi = new Navigation(); $navi->Translation['en']->caption = 'Profile'; $navi->Translation['ja_JP']->caption = '[i:140]プロフィール'; $navi->setType('mobile_home_center'); $navi->setUri('member/profile'); $navi->setSortOrder(0); $navi->save(); // and try to fix community topic revision if the plugin is exists $conn = Doctrine_Manager::getInstance()->getConnectionForComponent('SnsConfig'); $result = $conn->fetchOne('SELECT value FROM sns_config WHERE name = ?', array('opCommunityTopicPlugin_revision')); if (!$result) { Doctrine::getTable('SnsConfig')->set('opCommunityTopicPlugin_revision', '4'); } }
public function up() { $criteria = new Criteria(); $criteria->add(NavigationPeer::TYPE, 'mobile_home_side'); $criteria->add(NavigationPeer::URI, 'message/index'); if (!NavigationPeer::doSelectOne($criteria)) { $navigation = new Navigation(); $navigation->setType('mobile_home_side'); $navigation->setUri('message/index'); $navigation->setSortOrder(20); $navigation->setCulture('ja_JP'); $navigation->setCaption('メッセージ'); $navigation->setCulture('en'); $navigation->setCaption('Message'); $navigation->save(); } }
public function up() { $navi = new Navigation(); $navi->Translation['en']->caption = 'Footprint'; $navi->Translation['ja_JP']->caption = 'あしあと'; $navi->setType('default'); $navi->setUri('ashiato/list'); $navi->setSortOrder(12); $navi->save(); $navi = new Navigation(); $navi->Translation['en']->caption = 'Footprint'; $navi->Translation['ja_JP']->caption = '[i:91]あしあと'; $navi->setType('mobile_home'); $navi->setUri('ashiato/list'); $navi->setSortOrder(12); $navi->save(); }
<?php /** * Removes a page from the navigation. Called via a hook from * the page delete handler. */ if (!$this->internal) { die('Must be called by another handler'); } $n = new Navigation(); $n->remove($this->data['page'], false); $n->save(); require_once 'apps/navigation/lib/Functions.php'; navigation_clear_cache();
header('WWW-Authenticate: Basic realm="Navigation"'); header('HTTP/1.0 401 Unauthorized'); echo json_encode($res); return; } $error = false; $out = null; $nav = new Navigation(); switch ($this->params[0]) { case 'add': $id = $_POST['page']; $parent = $_POST['parent']; if ($parent === 'false') { $parent = false; } if ($nav->add($id, $parent) && $nav->save()) { $out = array('msg' => sprintf('Page %s added to tree under %s.', $id, $parent), 'page' => $id, 'parent' => $parent); } else { $error = $nav->error; } break; case 'move': $id = $_POST['page']; $ref = $_POST['ref']; $pos = $_POST['pos']; if ($nav->move($id, $ref, $pos) && $nav->save()) { $out = array('msg' => sprintf('Page %s moved to %s %s.', $id, $pos, $ref), 'page' => $id, 'ref' => $ref, 'pos' => $pos); } else { $error = $nav->error; } break;
header('WWW-Authenticate: Basic realm="Navigation"'); header('HTTP/1.0 401 Unauthorized'); echo json_encode($res); return; } $error = false; $out = null; $nav = new Navigation(); switch ($this->params[0]) { case 'update': $tree = $_POST['tree']; if (empty($tree)) { $tree = array(); } require_once 'apps/navigation/lib/Functions.php'; if ($nav->update($tree) && $nav->save()) { $out = array('msg' => sprintf('Nav json has been updated')); } else { $error = $nav->error; } break; default: $error = 'Unknown method'; break; } if (!$error) { require_once 'apps/navigation/lib/Functions.php'; navigation_clear_cache(); } $res = new StdClass(); if ($error) {