PHP Classes

File: engine/modules/core/box/box.hook.inc

Recommend this page to a friend!
  Classes of Aldo Tripiciano   Quanta CMS   engine/modules/core/box/box.hook.inc   Download  
File: engine/modules/core/box/box.hook.inc
Role: Example script
Content type: text/plain
Description: Example script
Class: Quanta CMS
Manage content that works without a database
Author: By
Last change:
Date: 6 years ago
Size: 808 bytes
 

Contents

Class file image Download
<?php

/**
 * Implements hook_load_includes().
 *
 * @param Environment $env
 * The Environment.
 * @param $vars
 * An array of variables.
 */
function box_load_includes($env, $vars) {
 
$module_path = $env->getModulePath('box');

 
$env->addInclude($module_path . '/css/box.css');
}

/**
 * Renders a Quanta box.
 *
 * @see Box.class.inc
 *
 * @param Environment $env
 * The Environment.
 * @param $vars
 * An array of variables.
 */
function box_qtag($env, $vars) {
  if (!empty(
$vars['attributes']['box'])) {
   
$boxsize = explode('x', $vars['attributes']['box']);
   
$w = empty($boxsize[1]) ? NULL : $boxsize[0];
   
$h = empty($boxsize[1]) ? NULL : $boxsize[1];
   
$box = new Box($env, $w, $h, $vars['attributes']);
   
$box->setHtml($vars['qtag']);
   
$vars['qtag'] = $box->render();
  }
}