Ejemplo n.º 1
0
 /**
  * Get tree
  * @todo only for editor!
  */
 function action_api_editor_node_tree()
 {
     $id = 0 + $this->_params->id;
     if (!$id) {
         throw new controller_exception('Bad ID');
     }
     $tree = array_values($this->context->get_tree($id, tf_sat::TREE_ID));
     $this->renderer->set_ajax_answer($tree)->ajax_flush();
 }
Ejemplo n.º 2
0
 function run($file)
 {
     if (empty($file) || !file_exists($file)) {
         throw new tf_exception('Empty file');
     }
     $response = file_get_contents($file);
     $xmldoc = new SimpleXMLElement($response);
     $this->module = core::module('sat');
     $this->collection = $this->module->get_node_handle();
     $this->collection->remove_all_fast();
     foreach ($xmldoc->node as $node) {
         $this->import_node($node);
     }
     $this->collection->sync_children_count();
 }
Ejemplo n.º 3
0
 /**
  * Call this on finish
  */
 function done()
 {
     // upd.counters
     $this->psat->update_tree($this->site_id, true);
     core::dprint('Done');
 }