Exemplo n.º 1
0
    ?>
')">$<?php 
    echo $var;
    ?>
</a></h3>
            <div id="<?php 
    echo $env_id;
    ?>
" class="collapsed">
                <table cellspacing="0">
                    <?php 
    foreach ($GLOBALS[$var] as $key => $value) {
        ?>
                        <tr>
                            <td><code><?php 
        echo \mii\util\HTML::chars($key);
        ?>
</code></td>
                            <td><pre><?php 
        echo \mii\util\Debug::dump($value);
        ?>
</pre></td>
                        </tr>
                    <?php 
    }
    ?>
                </table>
            </div>
        <?php 
}
?>
Exemplo n.º 2
0
 public function label($field_name, $label_name, $attributes = null)
 {
     $this->labels[$field_name] = $label_name;
     return HTML::label($field_name, $label_name, $attributes);
 }
Exemplo n.º 3
0
 /**
  * Recursively process a block and its dependencies
  *
  * @param $block_name
  * @param $files link to assets files array
  * @return bool|string
  */
 public function process_block_assets($block_name, $parent_block, $depends)
 {
     if (isset($this->_used_blocks[$block_name])) {
         return false;
     }
     if ($this->process_assets) {
         foreach ($this->libraries as $base_path) {
             if (is_dir($base_path . $this->_block_paths[$block_name] . 'assets')) {
                 $this->_build_assets_dir($block_name, $base_path . $this->_block_paths[$block_name] . 'assets');
             }
             break;
         }
     }
     if (!empty($depends)) {
         foreach ($this->libraries as $base_path) {
             foreach ($depends as $depend) {
                 //if (!is_dir($base_path . '/' . $this->_block_paths[$depend]))
                 //continue;
                 if (isset($this->_used_blocks[$depend])) {
                     continue;
                 }
                 $this->process_block_assets($depend, $parent_block, $this->_blocks[$depend]->_depends);
                 $this->_used_blocks[$depend] = true;
             }
         }
     }
     $path = $this->_block_paths[$block_name];
     $types = ['.css', '.js'];
     foreach ($types as $type) {
         foreach ($this->libraries as $base_path) {
             if (is_file($base_path . $path . $block_name . $type)) {
                 $this->_files[$type][$parent_block]['files'][$block_name . $type] = $base_path . $path . $block_name . $type;
                 break;
             }
         }
     }
     if ($this->_blocks[$block_name]->__remote_js !== null) {
         foreach ($this->_blocks[$block_name]->__remote_js as $link => $settings) {
             if (!empty($settings) and isset($settings['position'])) {
                 $position = $settings['position'];
                 unset($settings['position']);
             } else {
                 $position = Blocks::END;
             }
             if (isset($settings['condition'])) {
                 $condition = $settings['condition'];
                 unset($settings['condition']);
                 $this->_files['.js'][$parent_block]['remote'][$position][] = '<!--[if ' . $condition . ']>' . HTML::script($link, $settings) . '<![endif]-->';
             } else {
                 $this->_files['.js'][$parent_block]['remote'][$position][] = HTML::script($link, $settings);
             }
         }
     }
     if ($this->_blocks[$block_name]->__remote_css !== null) {
         if (!isset($this->_files['.css'][$parent_block]['remote'])) {
             $this->_files['.css'][$parent_block]['remote'] = [];
         }
         foreach ($this->_blocks[$block_name]->__remote_css as $r_css => $r_options) {
             $condition = $r_options['condition'] ?? '';
             $this->_files['.css'][$parent_block]['remote'][$condition][] = $r_css;
         }
     }
     if (!empty($this->_blocks[$block_name]->__inline_js)) {
         foreach ($this->_blocks[$block_name]->__inline_js as $inline) {
             $position = (!empty($inline[1]) and isset($inline[1]['position'])) ? $inline[1]['position'] : Blocks::END;
             if (!isset($this->_files[$type][$parent_block]['inline'][$position])) {
                 $this->_files[$type][$parent_block]['inline'][$position] = [];
             }
             $this->_files[$type][$parent_block]['inline'][$position][] = $inline[0];
         }
     }
     if (!empty($this->_blocks[$block_name]->__inline_css)) {
         if (!isset($this->_files['.css'][$parent_block]['inline'])) {
             $this->_files['.css'][$parent_block]['inline'] = $this->_blocks[$block_name]->__inline_css;
         } else {
             $this->_files['.css'][$parent_block]['inline'] = array_merge($this->_files['.css'][$parent_block]['inline'], $this->_blocks[$block_name]->__inline_css);
         }
     }
 }