예제 #1
0
파일: help.php 프로젝트: Desertsnowman/UIX
 /**
  * Add defined contextual help to current screen
  *
  * @since 1.0.0
  * @access public
  */
 public function render()
 {
     $this->screen = get_current_screen();
     if (!$this->is_active()) {
         return;
     }
     $this->screen->add_help_tab(array('id' => $this->slug, 'title' => $this->struct['title'], 'content' => $this->struct['content']));
 }
 function updateAction()
 {
     $screen = new screen($this->args[1]);
     if (!$screen->set) {
         $this->flash("Screen not found", "error");
         redirect_to("../");
     }
     $dat = $_POST['screen'];
     $screen->name = $dat['name'];
     $screen->group_id = $dat['group'];
     $screen->location = $dat['location'];
     $screen->mac_inhex = $dat['mac_inhex'];
     $screen->width = $dat['width'];
     $screen->height = $dat['height'];
     $screen->template_id = $dat['template'];
     $screen->latitude = $dat['latitude'];
     $screen->longitude = $dat['longitude'];
     if (isAdmin()) {
         $screen->controls_display = $dat['controls_display'];
     }
     $screen->time_on = $dat['time_on'];
     $screen->time_off = $dat['time_off'];
     if ($screen->set_properties()) {
         $this->flash('Screen updated successfully!');
         redirect_to(ADMIN_URL . '/screens/show/' . $screen->id);
     } else {
         $this->flash('Your submission was not valid. Please try again.', 'error');
         redirect_to(ADMIN_URL . '/screens/show/' . $this->args[1]);
     }
 }