PHP Classes

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

Recommend this page to a friend!
  Classes of Aldo Tripiciano   Quanta CMS   engine/modules/core/box/box.qtags.inc   Download  
File: engine/modules/core/box/box.qtags.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: 1,120 bytes
 

Contents

Class file image Download
<?php
/**
 * Implements BOX qtag.
 *
 * A simple block, boxed and non editable by default.
 *
 * @param Environment $env
 * The Environment.
 *
 * @param string $target
 * The qtag's target.
 *
 * @param array $attributes
 * The qtag's attributes.
 *
 * @return string
 * The rendered qtag.
 */
function qtag_BOX($env, $target, $attributes) {
 
// Check if the box is editable.
 
if (!isset($attributes['editable'])) {
   
$attributes['editable'] = BOX_NON_EDITABLE;
  }
 
// TODO: accept sizing variables.
 
$box = new Box($env, NULL, NULL, $attributes);
  if (!empty(
$attributes['box'])) {
    unset(
$attributes['box']);
  }
 
$box->setHtml(qtag_BLOCK($env, $target, $attributes));
  return
$box->render();
}

/**
 * Implements qtag_CLOSE.
 *
 * Renders a button to Ajax-close a container.
 *
 * @param Environment $env
 * The Environment.
 *
 * @param string $target
 * The qtag's target.
 *
 * @param array $attributes
 * The qtag's attributes.
 *
 * @return string
 * The rendered qtag.
 */
function qtag_CLOSE($env, $target, $attributes) {
  return
'<a class="close-button" href="#">X Close</a>';
}