Ejemplo n.º 1
0
 public function action_render()
 {
     //Very strange to have to encode then decoe but we want objects
     //at the end of the day not arrays and this is the easiest way
     //to get one!
     $content = json_decode(json_encode($_POST["content"]));
     //do some work on organisng the tags
     $tags = array("general" => array(), "who" => array(), "what" => array(), "where" => array());
     if (isset($content->tags)) {
         foreach ($content->tags as $tag) {
             switch ($tag->type) {
                 case "General":
                     $tags["general"][] = $tag->text;
                     break;
                 case "who":
                     $tags["who"][] = $tag->text;
                     break;
                 case "what":
                     $tags["what"][] = $tag->text;
                     break;
                 case "where":
                     $tags["where"][] = $tag->text;
                     break;
             }
         }
     }
     $content->tags = $tags;
     $this->template->content = $content;
     $logincheck = RiverId::is_logged_in();
     $this->template->enableActions = $logincheck["IsLoggedIn"];
 }
Ejemplo n.º 2
0
 private function set_menu()
 {
     $loggedinstatus = RiverId::is_logged_in();
     if (!$loggedinstatus["IsLoggedIn"]) {
         $this->template->menu = new View("contentmenu/user");
     } else {
         if ($loggedinstatus["Role"] == "sweeper") {
             $this->template->menu = new View("contentmenu/sweeper");
         } else {
             if ($loggedinstatus["Role"] == "editor") {
                 $this->template->menu = new View("contentmenu/editor");
             } else {
                 if ($loggedinstatus["Role"] == "admin") {
                     $this->template->menu = new View("contentmenu/editor");
                 }
             }
         }
     }
     $this->template->menu->state = $this->state;
     $this->template->menu->new_content_class = $this->state == "new_content" ? "selected" : "";
     $this->template->menu->accurate_class = $this->state == "accurate" ? "selected" : "";
     $this->template->menu->inaccurate_class = $this->state == "inaccurate" ? "selected" : "";
     $this->template->menu->irrelevant_class = $this->state == "irrelevant" ? "selected" : "";
     $this->template->menu->chatter_class = $this->state == "chatter" ? "selected" : "";
 }
Ejemplo n.º 3
0
 public function before()
 {
     parent::before();
     $this->template->title = 'Swiftriver';
     $this->template->theme = Theming::get_theme();
     $this->template->header = new View('defaults/header');
     $this->template->content = '';
     $this->template->rightbar = new View('defaults/rightbar');
     $this->template->footer = new View('defaults/footer');
     $loggedinstatus = RiverId::is_logged_in();
     if (!$loggedinstatus["IsLoggedIn"]) {
         $this->template->admin = new View("adminbar/user");
     } else {
         if ($loggedinstatus["Role"] == "sweeper") {
             $this->template->admin = new View("adminbar/sweeper");
         } else {
             if ($loggedinstatus["Role"] == "editor") {
                 $this->template->admin = new View("adminbar/editor");
             } else {
                 if ($loggedinstatus["Role"] == "admin") {
                     $this->template->admin = new View("adminbar/admin");
                 }
             }
         }
     }
 }
 public function action_getterms($withcontrols)
 {
     $json = API::channel_api()->get_all_channels();
     $widget = View::factory("parts/termstomonitorwidget")->set('json', $json);
     $loggedinstatus = RiverId::is_logged_in();
     $loggedinstatus = $loggedinstatus["IsLoggedIn"];
     if ($withcontrols == "true") {
         $widget->set('withcontrols', true);
     } else {
         $widget->set('withcontrols', false);
     }
     $widget->set('isloggedin', $loggedinstatus);
     // Render the widget
     $this->request->response = $widget;
 }