Beispiel #1
0
 protected function _set_title(h\string $text)
 {
     $c = $this->create_element(h\string('channel'), h\c(array('rdf:about' => '/')));
     $t = $this->create_element(h\string('title'), h\c(array($text)));
     $c->appendChild($t);
     return $this->root->appendChild($c);
 }
Beispiel #2
0
 protected function &_get_footer()
 {
     if (is_null($this->_footer)) {
         $div = $this->canvas->create_div_element(h\c(array('id' => 'footer')));
         $this->canvas->body->appendChild($div);
         $this->_footer = $div;
     }
     return $this->_footer;
 }
Beispiel #3
0
function build(h\configuration $configuration, context $ctx)
{
    $component = null;
    // We build the onion from core to skin
    $components = h\c($configuration['components'])->reverse();
    foreach ($components as $layer) {
        h\import('lib/component/' . $layer);
        $component_class = "\\horn\\lib\\component\\{$layer}";
        $component = new $component_class($configuration, $component);
        $component->do_touch($ctx);
    }
    return $component;
}
Beispiel #4
0
function make_configuration()
{
    $files = func_get_args();
    $files = h\c($files);
    $composed_configuration = null;
    foreach ($files as $file) {
        $file_configuration = $file;
        $file_configuration = h\c($file_configuration);
        $composed_configuration = new composed_configuration($file_configuration, $composed_configuration);
    }
    $configuration = new configuration($composed_configuration);
    return $configuration;
}
Beispiel #5
0
 public function _test_jsonserialize()
 {
     $a = array('key' => 'value', 'first');
     $o = h\c($a);
     $messages = array('Try to Jsonify a collection');
     $callback = function () use($a, $o) {
         return json_encode($a) === json_encode($o);
     };
     $this->add_test($callback, $messages);
 }
Beispiel #6
0
 private function do_populate_head(context $ctx)
 {
     $cors_headers = h\c(array('Access-Control-Allow-Credentials' => 'true', 'Access-Control-Allow-Methods' => 'POST, GET, OPTIONS, PUT, DELETE', 'Access-Control-Allow-Headers' => 'Content-Type', 'Access-Control-Allow-Origin' => h\string::format('https://%s', $this->configuration['front_base_url'])));
     $ctx->out->head->join($cors_headers);
 }
Beispiel #7
0
 protected function do_before(context $ctx)
 {
     $ctx->error_handling = h\c(array('status' => true, 'messages' => h\collection()));
     ob_start();
 }