Ejemplo n.º 1
0
 /**
  * Alters the dataset with the `base-url`, `actions` and `external-css` attributes.
  *
  * @see Brickrouge.Element::alter_dataset()
  */
 public function alter_dataset(array $dataset)
 {
     global $core;
     $dataset = parent::alter_dataset($dataset);
     $document = $core->document;
     $css = $this[self::STYLESHEETS] ?: array();
     $css[] = Document::resolve_url(\Brickrouge\ASSETS . 'brickrouge.css');
     if (!$css) {
         $info = \Icybee\Modules\Pages\Module::get_template_info('page.html');
         if (isset($info[1])) {
             $css = $info[1];
         }
     }
     array_unshift($css, Document::resolve_url('assets/body.css'));
     $try = \ICanBoogie\DOCUMENT_ROOT . 'public/page.css';
     if (file_exists($try)) {
         $css[] = Document::resolve_url($try);
     }
     $actions = $this[self::ACTIONS] ?: 'standard';
     if ($actions == 'standard') {
         $actions = 'bold italic underline strikethrough | formatBlock justifyleft justifyright justifycenter justifyfull | insertunorderedlist insertorderedlist indent outdent | undo redo | createlink unlink | image | removeformat paste outline toggleview';
         if (0) {
             $actions .= ' / tableadd | tableedit | tablerowspan tablerowsplit tablerowdelete | tablecolspan tablecolsplit tablecoldelete';
             $document->css->add('mooeditable/Assets/MooEditable/MooEditable.Table.css');
             $document->js->add('mooeditable/Source/MooEditable/MooEditable.Table.js');
         }
     } else {
         if ($actions == 'minimal') {
             $actions = 'bold italic underline strikethrough | insertunorderedlist insertorderedlist | undo redo | createlink unlink | removeformat paste toggleview';
         }
     }
     $dataset['base-url'] = '/';
     $dataset['actions'] = $actions;
     $dataset['external-css'] = $css;
     return $dataset;
 }
Ejemplo n.º 2
0
 /**
  * Adds an asset to the collection.
  *
  * @param string $path Path, or relative path to the asset.
  * @param int $weight Weight of the asset in the collection.
  * @param string|null $root Root used to resolve the asset path into a URL.
  *
  * @return AssetsCollector Return the object itself for chainable calls.
  */
 public function add($path, $weight = 0, $root = null)
 {
     $url = Document::resolve_url($path, $root);
     $this->collected[$url] = $weight;
     return $this;
 }