Beispiel #1
0
 /**
  * Render all items
  */
 public function render_items()
 {
     // render scheme stuff
     $this->render_scheme(ICE_Scheme::instance()->directives());
     // render component stuff
     $this->render_components(ICE_Policy::all());
 }
 /**
  * Register all scripts
  */
 public final function register_scripts()
 {
     // check if at least one theme defined this dep
     if ($this->scheme->directives()->has(ICE_Scheme::DIRECTIVE_SCRIPT_DEPS)) {
         // get dep directives for all themes
         $script_depends = $this->scheme->directives()->get_map(ICE_Scheme::DIRECTIVE_SCRIPT_DEPS);
         // create new map so we can write to it
         $script_depends_w = new ICE_Map($script_depends);
         // start with empty stacks
         $dep_stack = new ICE_Stack();
         $dep_admin_stack = new ICE_Stack();
         // add dynamic script depends for every policy
         foreach (ICE_Policy::all() as $policy) {
             // loop through all registered components
             foreach ($policy->registry()->get_all() as $component) {
                 // push deps onto stacks
                 $component->script()->push_deps($dep_stack);
                 $component->script()->section('admin')->push_deps($dep_admin_stack);
             }
         }
         // add addtl dependancies
         $dep_map = new ICE_Map();
         $dep_map->add('@:dynamic', $dep_stack->to_array());
         $dep_map->add('@:dynamic-admin', $dep_admin_stack->to_array());
         $directive_deps = new ICE_Init_Directive('@', 'script_depends', $dep_map);
         $script_depends_w->add('@', $directive_deps, true);
         // init script depends
         $this->depends($this->scripts, $script_depends_w);
     }
     // init script action triggers
     $this->triggers($this->scripts, ICE_Scheme::DIRECTIVE_SCRIPT_ACTS, self::TRIGGER_ACTS);
     // init script condition triggers
     $this->triggers($this->scripts, ICE_Scheme::DIRECTIVE_SCRIPT_CONDS, self::TRIGGER_CONDS, 'ice_enqueue_scripts');
     foreach ($this->scripts as $handle => $config_map) {
         $this->register_script($handle, $config_map);
     }
 }
Beispiel #3
0
 /**
  * Refresh one export
  *
  * @param ICE_Export $export
  * @return boolean
  */
 protected final function export_refresh(ICE_Export $export)
 {
     // loop all component registries and pass them the exporters
     foreach (ICE_Policy::all() as $policy) {
         // call accept on the registry for the export
         $policy->registry()->accept($export);
     }
     // update it
     $export->update();
     // all done
     return true;
 }