Zikula_System_Modules
[ class tree: Zikula_System_Modules ] [ index: Zikula_System_Modules ] [ all elements ]

Source for file pntables.php

Documentation is available at pntables.php

  1. <?php
  2. /**
  3.  * Zikula Application Framework
  4.  * @copyright (c) 2001, Zikula Development Team
  5.  * @link http://www.zikula.org
  6.  * @version $Id: pntables.php 24342 2008-06-06 12:03:14Z markwest $
  7.  * @license GNU/GPL - http://www.gnu.org/copyleft/gpl.html
  8.  * @package Zikula_System_Modules
  9.  * @subpackage Blocks
  10.  */
  11.  
  12. /**
  13.  * Populate pntables array for Blocks module
  14.  *
  15.  * This function is called internally by the core whenever the module is
  16.  * loaded. It delivers the table information to the core.
  17.  * It can be loaded explicitly using the pnModDBInfoLoad() API function.
  18.  *
  19.  * @author       Mark West
  20.  * @return       array       The table information.
  21.  */
  22. function Blocks_pntables()
  23. {
  24.     // Initialise table array
  25.     $pntable array();
  26.  
  27.     // get the db driver 
  28.     $dbdriver DBConnectionStack::getConnectionDBDriver();
  29.     
  30.     $blocks DBUtil::getLimitedTablename('blocks';
  31.     $pntable['blocks'$blocks;
  32.     $pntable['blocks_column'array ('bid'         => 'pn_bid',
  33.                                        'bkey'        => 'pn_bkey',
  34.                                        'title'       => 'pn_title',
  35.                                        'content'     => 'pn_content',
  36.                                        'url'         => 'pn_url',
  37.                                        'mid'         => 'pn_mid',
  38.                                        'filter'      => 'pn_filter',
  39.                                        'active'      => 'pn_active',
  40.                                        'collapsable' => 'pn_collapsable',
  41.                                        'defaultstate'=> 'pn_defaultstate',
  42.                                        'refresh'     => 'pn_refresh',
  43.                                        'last_update' => 'pn_last_update',
  44.                                        'blanguage'   => 'pn_language',
  45.                                        'language'    => 'pn_language');
  46.  
  47.     // column definition
  48.     $pntable['blocks_column_def'array ('bid'          => "I AUTO PRIMARY",
  49.                                            'bkey'         => "C(255) NOTNULL DEFAULT ''",
  50.                                            'title'        => "C(255) NOTNULL DEFAULT ''",
  51.                                            'content'      => "XL NOTNULL",
  52.                                            'url'          => "XL NOTNULL",
  53.                                            'mid'          => "I NOTNULL DEFAULT 0",
  54.                                            'filter'       => "XL NOTNULL",
  55.                                            'active'       => "I1 NOTNULL DEFAULT 1",
  56.                                            'refresh'      => "I NOTNULL DEFAULT 0",
  57.                                            'last_update'  => "T DEFTIMESTAMP NOTNULL",
  58.                                            'language'     => "C(30) NOTNULL DEFAULT ''",
  59.                                            'collapsable'  => "I NOTNULL DEFAULT 1",
  60.                                            'defaultstate' => "I NOTNULL DEFAULT 1");
  61.  
  62.     // additional indexes
  63.     $pntable['blocks_column_idx'array ('active_idx' => 'active');
  64.  
  65.     // additional indexes
  66.     $userblocks DBUtil::getLimitedTablename('userblocks';
  67.     $pntable['userblocks'$userblocks;
  68.     $pntable['userblocks_column'array ('uid'         => 'pn_uid',
  69.                                            'bid'         => 'pn_bid',
  70.                                            'active'      => 'pn_active',
  71.                                            'lastupdate'  => 'pn_last_update');
  72.  
  73.     // column definition
  74.     $pntable['userblocks_column_def'array ('uid'         => "I NOTNULL DEFAULT 0",
  75.                                                'bid'         => "I NOTNULL DEFAULT 0",
  76.                                                'active'      => "I1 NOTNULL DEFAULT 1",
  77.                                                'lastupdate'  => "T DEFTIMESTAMP");
  78.  
  79.     // additional indexes
  80.     $pntable['userblocks_column_idx'array ('bid_uid_idx'    => array('uid''bid'));
  81.  
  82.     $block_positions DBUtil::getLimitedTablename('block_positions';
  83.     $pntable['block_positions'$block_positions;
  84.     $pntable['block_positions_column'array ('pid'         => 'pn_pid',
  85.                                                 'name'        => 'pn_name',
  86.                                                 'description' => 'pn_description');
  87.  
  88.     // column definitions
  89.     $pntable['block_positions_column_def'array('pid'         => "I AUTO PRIMARY",
  90.                                                    'name'        => "C(255) NOTNULL DEFAULT ''",
  91.                                                    'description' => "C(255) NOTNULL DEFAULT ''");
  92.  
  93.     // additional indexes
  94.     $pntable['block_positions_column_idx'array ('name_idx' => 'name');
  95.  
  96.     $block_placements DBUtil::getLimitedTablename('block_placements';
  97.     $pntable['block_placements'$block_placements;
  98.     $pntable['block_placements_column'array ('pid'   => 'pn_pid',
  99.                                                  'bid'   => 'pn_bid',
  100.                                                  'order' => 'pn_order');
  101.  
  102.     // column definitions
  103.     $pntable['block_placements_column_def'array('pid'    => "I NOTNULL DEFAULT 0",
  104.                                                     'bid'    => "I NOTNULL DEFAULT 0",
  105.                                                     'order'  => "I NOTNULL DEFAULT 0");
  106.  
  107.     // additional indexes
  108.     $pntable['block_placements_column_idx'array ('bid_pid_idx'    => array('bid''pid'));
  109.  
  110.     // Return the table information
  111.     return $pntable;
  112. }

Documentation generated on Fri, 18 Jul 2008 21:54:27 +0200 by phpDocumentor 1.4.1