Source for file t_globalscope_variable.class.php

Documentation is available at t_globalscope_variable.class.php

  1. <?php   /*
  2.    *@=@=@=@ START LICENSE @=@=@=@*
  3.    Copyright or © or Copr. Stéphane TRICHET and Nicolas SOTRON
  4.    
  5.    stephane.t@simpliciweb.net and nicolas.s@simpliciweb.net
  6.    
  7.    This software is a computer program whose purpose is to make a
  8.    web hosting platform
  9.    
  10.    This software is governed by the CeCILL  license under French law and
  11.    abiding by the rules of distribution of free software.  You can  use, 
  12.    modify and/ or redistribute the software under the terms of the CeCILL
  13.    license as circulated by CEA, CNRS and INRIA at the following URL
  14.    "http://www.cecill.info". 
  15.    
  16.    As a counterpart to the access to the source code and  rights to copy,
  17.    modify and redistribute granted by the license, users are provided only
  18.    with a limited warranty  and the software's author,  the holder of the
  19.    economic rights,  and the successive licensors  have only  limited
  20.    liability. 
  21.    
  22.    In this respect, the user's attention is drawn to the risks associated
  23.    with loading,  using,  modifying and/or developing or reproducing the
  24.    software by the user in light of its specific status of free software,
  25.    that may mean  that it is complicated to manipulate,  and  that  also
  26.    therefore means  that it is reserved for developers  and  experienced
  27.    professionals having in-depth computer knowledge. Users are therefore
  28.    encouraged to load and test the software's suitability as regards their
  29.    requirements in conditions enabling the security of their systems and/or 
  30.    data to be ensured and,  more generally, to use and operate it in the 
  31.    same conditions as regards security. 
  32.    
  33.    The fact that you are presently reading this means that you have had
  34.    knowledge of the CeCILL license and that you accept its terms.
  35.    *@=@=@=@ END   LICENSE @=@=@=@*
  36.  
  37. */?><?php  
  38. /**
  39.  * TGlobalScopeVariable Class
  40.  * 
  41.  * 
  42.  * @author SimpliciWeb
  43.  * @version $Id: t_globalscope_variable.class.php 606 2007-07-19 10:14:30Z stephanet $
  44.  * @package Common
  45.  * @subpackage FrameWork
  46.  */    
  47. /**
  48.  * Include the abstract class to manage scopes
  49.  */
  50. require_once('internal_components/common/scope/xt_globalscope.class.php');
  51.  
  52. /**
  53.  * Manage a global variable scope for all the website (a scope website)
  54.  *
  55.  * @author SimpliciWeb
  56.  * @version $Id: t_globalscope_variable.class.php 606 2007-07-19 10:14:30Z stephanet $
  57.  * @package Common
  58.  * @subpackage FrameWork
  59.  */
  60.  
  61.  
  62.     /**
  63.      * Constructor, init the requests and objects
  64.      *
  65.      * @return TGlobalScopeVariable 
  66.      */
  67.     function TGlobalScopeVariable(){
  68.         parent::XTGlobalScope();
  69.     }
  70.     
  71.     /**
  72.      * Is not valid type (declared in the {@link xTGlobalScope})
  73.      *
  74.      * @param unknown_type $p_gsc_type 
  75.      * @return unknown 
  76.      */
  77.     function xIsNotValidType($p_gsc_type{
  78.         return !isset($this->m_types[$p_gsc_type]);
  79.     
  80.     }
  81.     
  82.   
  83.  
  84.   /**
  85.    * Append array erors from import
  86.    *
  87.    * @param array $p_array_errors 
  88.    * @return array 
  89.    */
  90.   function appendArrayErrorsFromImport($p_array_errors{
  91.       if ($this->getArrayErrorsFromImport($result_array)) {
  92.           $result_array array();
  93.       }
  94.     
  95.     // on ajoute la nouvelle ligne en erreur
  96.     $result_array[sizeof($result_array)$p_array_errors;
  97.     
  98.     
  99.     return $this->xNewGlobal('array_import_errors'$result_array);
  100.     
  101.   }
  102.   /**
  103.    * Destroy array errors from import
  104.    *
  105.    * @return bool TRUE on error
  106.    */
  107.   function destroyArrayErrorsFromImport({
  108.       return $this->xDelete('array_import_errors');
  109.   }
  110.  
  111.   /**
  112.    * Get array errors from import
  113.    *
  114.    * @param array $r_array_errors 
  115.    * @return bool TRUE on error
  116.    */
  117.   function getArrayErrorsFromImport(&$r_array_errors{
  118.       if ($this->xGet('array_import_errors'$r_array_errors)) {
  119.           $r_array_errors array();
  120.         return true;
  121.       }
  122.     return false;
  123.   }
  124.  
  125.     //html_editor
  126.   /**
  127.    * Set html editor format
  128.    *
  129.    * @param array $p_array_default 
  130.    * @return bool TRUE on error
  131.    */
  132.   function setHtmlEditorFormat($p_array_default{
  133.     return $this->xNewGlobal('array_html_editor_format'$p_array_default);
  134.   }
  135.   /**
  136.    * Get html editor format
  137.    *
  138.    * @param array $p_array_default 
  139.    * @return bool TRUE on error
  140.    */
  141.   function getHtmlEditorFormat(&$p_array_default{
  142.     $p_array_default array();
  143.     return $this->xGet('array_html_editor_format'$p_array_default);
  144.   }
  145.  
  146.  
  147.   /**
  148.    * Set number of product by page fo
  149.    *
  150.    * @param integer $p_number_of_product 
  151.    * @return bool TRUE on error
  152.    */
  153.   function setNumberOfProductByPageFo($p_number_of_product{
  154.     return $this->xNewGlobal('number_product_pagefo'$p_number_of_product);
  155.   }
  156.   /**
  157.    * Get number of product by page
  158.    *
  159.    * @param integer $p_number_of_product 
  160.    * @return bool TRUE on error
  161.    */
  162.   function getNumberOfProductByPageFo(&$p_number_of_product{
  163.     return $this->xGet('number_product_pagefo'$p_number_of_product);
  164.   }
  165.   
  166.   
  167.   /**
  168.    * Set weight format
  169.    *
  170.    * @param array $p_array_default 
  171.    * @return bool TRUE on error
  172.    */
  173.   function setWeightFormat($p_array_default{
  174.     return $this->xNewGlobal('array_weight_format'$p_array_default);
  175.   }
  176.   /**
  177.    * Get weight format
  178.    *
  179.    * @param array $p_array_default 
  180.    * @return bool TRUE on error
  181.    */
  182.   function getWeightFormat(&$p_array_default{
  183.     $p_array_default array();
  184.     return $this->xGet('array_weight_format'$p_array_default);
  185.   }
  186.  
  187.   /**
  188.    * Set price format
  189.    *
  190.    * @param array $p_array_default 
  191.    * @return bool TRUE on error
  192.    */
  193.   function setPriceFormat($p_array_default{
  194.     return $this->xNewGlobal('array_price_format'$p_array_default);
  195.   }
  196.   /**
  197.    * Get price format
  198.    *
  199.    * @param array $p_array_default 
  200.    * @return bool TRUE on error
  201.    */
  202.   function getPriceFormat(&$p_array_default{
  203.     $p_array_default array();
  204.     return $this->xGet('array_price_format'$p_array_default);
  205.   }
  206.  
  207.   /**
  208.    * Set date format
  209.    *
  210.    * @param array $p_array_default 
  211.    * @return bool TRUE on error
  212.    */
  213.   function setDateFormat($p_array_default{
  214.     return $this->xNewGlobal('array_date_format'$p_array_default);
  215.   }
  216.   /**
  217.    * Get date format
  218.    *
  219.    * @param array $p_array_default 
  220.    * @return bool TRUE on error
  221.    */
  222.   function getDateFormat(&$p_array_default{
  223.     $p_array_default array();
  224.     return $this->xGet('array_date_format'$p_array_default);
  225.   }
  226.  
  227.   /**
  228.    * Set array default selected format
  229.    *
  230.    * @param array $p_array_default 
  231.    * @return bool TRUE on error
  232.    */
  233.   function setArrayDefaultSelectedForImport($p_array_default{
  234.     return $this->xNewGlobal('array_import_default'$p_array_default);
  235.   }
  236.  
  237.   /**
  238.    * Get array default selected for import
  239.    *
  240.    * @param array $p_array_default 
  241.    * @return bool TRUE on error
  242.    */
  243.   function getArrayDefaultSelectedForImport(&$p_array_default{
  244.     $p_array_default array();
  245.     return $this->xGet('array_import_default'$p_array_default);
  246.   }
  247.  
  248.   /**
  249.    * set default language id
  250.    *
  251.    * @param integer $p_default_lang_id 
  252.    * @return bool TRUE on error
  253.    */
  254.   function setDefaultLanguageId($p_default_lang_id{
  255.     return $this->xNewGlobal('default_lang_id'$p_default_lang_id);
  256.   }
  257.   /**
  258.    * Get default language id
  259.    *
  260.    * @param integer $p_default_lang_id 
  261.    * @return bool TRUE on error
  262.    */
  263.   function getDefaultLanguageId(&$p_default_lang_id{
  264.     $p_default_lang_id "";
  265.     return $this->xGet('default_lang_id'$p_default_lang_id);
  266.   }
  267.  
  268.   /**
  269.    * set rss udpated page suffix
  270.    *
  271.    * @param string $p_rss_updated_page_suffix 
  272.    * @return bool TRUE on error
  273.    */
  274.   function setRSSUpdatedPageSuffix($p_rss_updated_page_suffix{
  275.     return $this->xNewGlobal('rss_updated_page_suffix'$p_rss_updated_page_suffix);
  276.   }
  277.   /**
  278.    * Get rss updated page suffi
  279.    *
  280.    * @param string $p_rss_updated_page_suffix 
  281.    * @return bool TRUE on error
  282.    */
  283.   function getRSSUpdatedPageSuffix(&$p_rss_updated_page_suffix{
  284.     $p_rss_updated_page_suffix "";
  285.     if($this->xGet('rss_updated_page_suffix'$p_rss_updated_page_suffix)) {
  286.         $p_rss_updated_page_suffix "(Mise à jour)";
  287.         return true;
  288.     }
  289.     return false;
  290.   }
  291.  
  292.  
  293.   /**
  294.    * SDet value message if no delivery cost finded
  295.    *
  296.    * @param string $p_value 
  297.    * @return bool TRUE on error
  298.    */
  299.   function setValueMessageIfNoDeliveryCostFinded($p_value{
  300.     return $this->xNewGlobal('msg_no_deliverycosts_find'$p_value);
  301.   }
  302.  
  303.   /**
  304.    * get Values message if no delivery cost finded
  305.    *
  306.    * @param string $r_value 
  307.    * @return bool TRUE on error
  308.    */
  309.   function getValueMessageIfNoDeliveryCostFinded(&$r_value{
  310.     $r_value "";
  311.     $there_is_an_error $this->xGet('msg_no_deliverycosts_find'$r_value);
  312.     $r_value $this->m_object_dbconnexion->translate("DB_TO_INPUT"$r_value);
  313.     return $there_is_an_error
  314.   }
  315.     
  316.   /**
  317.    * Set mail settings
  318.    *
  319.    * @param array $p_value 
  320.    * @return bool TRUE on error
  321.    */
  322.   function setMailSettings($p_value{
  323.     return $this->xNewGlobal('array_mail_settings'$p_value);
  324.   }
  325.  
  326.   /**
  327.    * Get mail settings
  328.    *
  329.    * @param array $r_value 
  330.    * @param bool $encode 
  331.    * @param string $p_database_selected 
  332.    * @return bool TRUE on error
  333.    */
  334.   function getMailSettings(&$r_value$encode true$p_database_selected=""{
  335.     $r_value "";
  336.     $there_is_an_error $this->xGet('array_mail_settings'$r_value$p_database_selected);
  337.     
  338.     // on encode les valeurs
  339.     if (is_array($r_value)) {
  340.         $keys array_keys($r_value);
  341.         if ($encode)
  342.         for ($i=0$i<sizeof($keys)$i++{
  343.             $r_value[$keys[$i]] $this->m_object_dbconnexion->translate("DB_TO_INPUT"$r_value[$keys[$i]]);
  344.         }
  345.     }
  346.     return $there_is_an_error
  347.   }    
  348.     
  349.     
  350.   /**
  351.    * Set web site width informations
  352.    *
  353.    * @param array $p_array 
  354.    * @return bool TRUE on error
  355.    */
  356.   function setWebSiteWidthInformations($p_array{
  357.     return $this->xNewGlobal('array_web_site_width_informationprice_format'$p_array);
  358.   }
  359.   /**
  360.    * Get web sit width informations
  361.    *
  362.    * @param array $r_array 
  363.    * @return bool TRUE on error
  364.    */
  365.   function getWebSiteWidthInformations(&$r_array{
  366.     $r_array array();
  367.     if ($this->xGet('array_web_site_width_informationprice_format'$r_array)) {
  368.            $r_array array(
  369.                             'width' => '733px',
  370.                             'logo_top_background_color' => '',
  371.                             'logo_top_align' => 'left',
  372.                             );
  373.          return true;
  374.     else {
  375.         return false;
  376.     }
  377.   }    
  378.     
  379. }
  380.  
  381.  
  382.  
  383. ?>

Documentation generated on Tue, 25 Mar 2008 15:36:24 +0100 by phpDocumentor 1.3.2