static public function array_merge($a1, $a2)
 {
   $n = $a1;
   foreach($a2 as $k => $v)
     if(is_array($v) &&  isset($n[$k]) &&  is_array($n[$k]))
       $n[$k] = ComplexArray :: array_merge($n[$k], $v);
     else
       $n[$k] = $v;
   return $n;
 }
 protected function _defineDatamap()
 {
     $datamap = array('_FILES_' => 'files_data');
     $ini = Limb::toolkit()->getINI('image_variations.ini');
     $image_variations = $ini->getAll();
     foreach ($image_variations as $variation => $variation_data) {
         $datamap['upload_' . $variation . '_max_size'] = 'upload_' . $variation . '_max_size';
         $datamap['generate_' . $variation . '_max_size'] = 'generate_' . $variation . '_max_size';
         $datamap[$variation . '_action'] = $variation . '_action';
         $datamap[$variation . '_base_variation'] = $variation . '_base_variation';
     }
     return ComplexArray::array_merge(parent::_defineDatamap(), $datamap);
 }
 protected function _defineDatamap()
 {
     return ComplexArray::array_merge(parent::_defineDatamap(), array('question' => 'question', 'question_author' => 'question_author', 'question_author_email' => 'question_author_email', 'answer' => 'answer', 'answer_author' => 'answer_author', 'answer_author_email' => 'answer_author_email'));
 }
  public function merge($valuelist)
  {
    if(is_array($valuelist) &&  sizeof($valuelist))
      $this->vars = ComplexArray :: array_merge($this->vars, $valuelist);

    if(!is_array($this->vars))
      $this->vars = array();
  }
 function _defineColumns()
 {
   return ComplexArray :: array_merge(
     parent :: _defineColumns(),
     array(
       'annotation' => '',
       'content' => '',
       'news_date' => array('type' => 'date'),
     )
   );
 }
 protected function _doGetShippingOptions($shipping_configuration)
 {
     $this->_cleanCookie();
     $this->_browseToHomePage();
     $express_html = $this->_getExpressShippingOptionsHtml($shipping_configuration);
     $ground_html = $this->_getGroundShippingOptionsHtml($shipping_configuration);
     if ($express_html === false) {
         $express_options = array();
     } else {
         $express_options = $this->_parseHtmlOptions($express_html);
     }
     if ($ground_html === false) {
         $ground_options = array();
     } else {
         $ground_options = $this->_parseHtmlOptions($ground_html);
     }
     $options = ComplexArray::array_merge($express_options, $ground_options);
     if (empty($options)) {
         return false;
     }
     return $options;
 }
 protected function _defineDatamap()
 {
     return ComplexArray::array_merge(parent::_defineDatamap(), array('article_content' => 'content', 'annotation' => 'annotation', 'author' => 'author', 'source' => 'source', 'uri' => 'uri'));
 }
 protected function _defineColumns()
 {
     return ComplexArray::array_merge(parent::_defineColumns(), array('name' => '', 'lastname' => '', 'email' => '', 'password' => '', 'generated_password' => ''));
 }
 protected function _defineDatamap()
 {
     return ComplexArray::array_merge(parent::_defineDatamap(), array('annotation' => 'annotation', 'news_content' => 'content', 'news_date' => 'news_date'));
 }
 protected function _defineDatamap()
 {
     return ComplexArray::array_merge(parent::_defineDatamap(), array('message' => 'message', 'sender' => 'sender', 'sender_email' => 'sender_email'));
 }
 protected function _defineDatamap()
 {
     return ComplexArray::array_merge(parent::_defineDatamap(), array('start_date' => 'start_date', 'finish_date' => 'finish_date', 'restriction' => 'restriction'));
 }
 protected function _defineDatamap()
 {
     return ComplexArray::array_merge(parent::_defineDatamap(), array('identifier' => 'identifier', 'password' => 'password', 'second_password' => 'second_password'));
 }
 protected function _defineColumns()
 {
     return ComplexArray::array_merge(parent::_defineColumns(), array('description' => '', 'media_id' => ''));
 }
 function _defineDatamap()
 {
     return ComplexArray::array_merge(parent::_defineDatamap(), array('description' => 'description'));
 }
<?php
/**********************************************************************************
* Copyright 2004 BIT, Ltd. http://limb-project.com, mailto: support@limb-project.com
*
* Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html)
***********************************************************************************
*
* $Id$
*
***********************************************************************************/
require_once(LIMB_DIR . '/class/lib/util/ComplexArray.class.php');

$url = parse_url($_SERVER['REQUEST_URI']);

$_SERVER['QUERY_STRING'] = $url['query'];
$_SERVER['PHP_SELF'] = $url['path'];

if($url['query'])
{
  parse_str($url['query'], $output);

  $_GET = ComplexArray :: array_merge($_GET, $output);
}

?>
 function _defineDatamap()
 {
     return ComplexArray::array_merge(parent::_defineDatamap(), array('url' => 'url', 'new_window' => 'new_window'));
 }
 protected function _defineDatamap()
 {
     return ComplexArray::array_merge(parent::_defineDatamap(), array('name' => 'name', 'lastname' => 'lastname', 'password' => 'password', 'email' => 'email', 'second_password' => 'second_password'));
 }
 protected function _defineDatamap()
 {
     return ComplexArray::array_merge(parent::_defineDatamap(), array('annotation' => 'annotation', 'object_content' => 'content', 'image_id' => 'image_id'));
 }
 function _defineColumns()
 {
     return ComplexArray::array_merge(parent::_defineColumns(), array('annotation' => '', 'content' => '', 'author' => '', 'source' => '', 'uri' => ''));
 }
 protected function _defineColumns()
 {
     return ComplexArray::array_merge(parent::_defineColumns(), array('count' => array('type' => 'numeric')));
 }
 function _defineDatamap()
 {
     return ComplexArray::array_merge(parent::_defineDatamap(), array('document_content' => 'content', 'annotation' => 'annotation'));
 }
 protected function _defineColumns()
 {
     return ComplexArray::array_merge(parent::_defineColumns(), array('message' => '', 'sender_email' => '', 'sender' => '', 'comment' => '', 'comment_author' => '', 'comment_author_email' => ''));
 }
 protected function _defineColumns()
 {
     return ComplexArray::array_merge(parent::_defineColumns(), array('url' => '', 'new_window' => array('type' => 'numeric')));
 }
 protected function _defineColumns()
 {
     return ComplexArray::array_merge(parent::_defineColumns(), array('restriction' => array('type' => 'numeric'), 'start_date' => array('type' => 'date'), 'finish_date' => array('type' => 'date')));
 }
 protected function _defineDatamap()
 {
     return ComplexArray::array_merge(parent::_defineDatamap(), array('content' => 'content'));
 }
 protected function _defineColumns()
 {
     return ComplexArray::array_merge(parent::_defineColumns(), array('content' => ''));
 }
  /**
  * Return the URI to a specific page in the list.
  */
  public function getPageUri($page)
  {
    $params = ComplexArray :: array_merge($_GET, $_POST);
    if ($page <= 1)
    {
    unset($params[$this->pager_variable.'_'. $this->getServerId()]);
    }
    else
    {
      $params[$this->pager_variable .'_'. $this->getServerId()] = $page;
    }

    $sep = '';
    $query = '';

    $flat_params = array();
    ComplexArray :: toFlatArray($params, $flat_params);

    foreach ($flat_params as $key => $value)
    {
      $query .= $sep . $key . '=' . urlencode($value);
      $sep = '&';
    }
    if (empty($query))
    {
      return $this->base_url;
    }
    else
    {
      return $this->base_url . '?' . $query;
    }
  }