Example #1
0
 case 'edit':
     # get the id, find the item, then try replacing the attributes
     $item_id = $ufUf->s_post_var("item_id", false);
     if ($item_id) {
         // we have an item id, now we'll try and get the corresponding item information
         $o_item = $flot->datastore->get_item_data($item_id);
         $o_full_item = $flot->datastore->o_get_full_item($item_id);
         if ($o_item && isset($o_full_item)) {
             $Item = new Item($o_item);
             $Item->_set_full_item($o_full_item);
             $Item->update_from_post();
             $s_preview = $ufUf->s_post_var_from_allowed("preview", array("true", "false"), "false");
             if ($s_preview === "true") {
                 echo $Item->html_page;
                 //ob_clean();
                 $Item->render();
                 exit;
             } else {
                 // save datastore
                 $Item->persist_after_update_from_post();
                 # persist (or not) the item
                 // save does a render and update wbepage render
                 $Item->save();
                 # change location to view the item
                 $flot->_page_change("/flot-admin/admin/index.php?section=items&oncology=page&action=list");
             }
         } else {
             echo "no loaded item & full item";
         }
     }
     break;
Example #2
0
File: flot.php Project: Divian/flot
 function _render_all_pages()
 {
     foreach ($this->datastore->items as $item) {
         $item_to_render = new Item($item);
         $item_to_render->_set_full_item($this->datastore->o_get_full_item($item->id));
         $item_to_render->render();
         $item_to_render->update();
     }
 }
Example #3
0
 public function render()
 {
     $html = "<li{$this->li_attributes_str}>\n            <a href=\"{$this->href}\"{$this->a_attributes_str}>{$this->title}</a>\n";
     if (!empty($this->children)) {
         $html .= "<ul>";
         foreach ($this->children as $child) {
             $childItem = new Item($child->title, $child->id, $child->url, $child->params);
             $childItem->setActiveItems($this->active_items);
             $childItem->make();
             $html .= $childItem->render();
         }
         $html .= "</ul>";
     }
     $html .= "</li>\n";
     return $html;
 }