aliroParameters Class Reference

Inheritance diagram for aliroParameters:

JParameter mosAdminParameters mosParameters mosSpecialAdminParameters

List of all members.

Public Member Functions

 __construct ($text='', $xml='')
 getParams ()
 set ($key, $value='')
 setAll ($keyedValues)
 def ($key, $value='')
 get ($key, $default='')
 __get ($property)
 processInput ($params)
 asString ()
 asPost ()
 render ($name='params')

Protected Attributes

 $params = array()
 $raw = null
 $xml = null


Detailed Description

Definition at line 45 of file aliroParameters.php.


Constructor & Destructor Documentation

aliroParameters::__construct ( text = '',
xml = '' 
)

Reimplemented in mosSpecialAdminParameters.

Definition at line 50 of file aliroParameters.php.

References $xml, and T_().

00050                                                     {
00051         $this->raw = is_null($text) ? '' : $text;
00052         if (!is_string($this->raw)) trigger_error (T_('Raw data for aliroParameters not a string'));
00053 
00054         $this->params = @unserialize($this->raw);
00055         if (!is_array($this->params)) $this->params = array();
00056         if ($this->raw AND count($this->params) == 0) trigger_error (T_('Raw data for aliroParameters was not null, but did not yield any values'));
00057 
00058         foreach ($this->params as &$param) $param = base64_decode($param);
00059         $this->xml = $xml;
00060     }


Member Function Documentation

aliroParameters::getParams (  ) 

Definition at line 62 of file aliroParameters.php.

00062                                  {
00063         die ('Aliro handles parameters differently, please review what you need');
00064     }

aliroParameters::set ( key,
value = '' 
)

Definition at line 66 of file aliroParameters.php.

00066                                            {
00067         $this->params[$key] = $value;
00068         return $value;
00069     }

aliroParameters::setAll ( keyedValues  ) 

Definition at line 71 of file aliroParameters.php.

00071                                           {
00072         $this->params = $keyedValues;
00073     }

aliroParameters::def ( key,
value = '' 
)

Definition at line 75 of file aliroParameters.php.

00075                                            {
00076         return $this->set ($key, $this->get($key, $value));
00077     }

aliroParameters::get ( key,
default = '' 
)

Definition at line 79 of file aliroParameters.php.

00079                                              {
00080         if (isset($this->params[$key])) return $this->params[$key] === '' ? $default : $this->params[$key];
00081         else return $default;
00082     }

aliroParameters::__get ( property  ) 

Definition at line 84 of file aliroParameters.php.

00084                                       {
00085         return $this->get ($property);
00086     }

aliroParameters::processInput ( params  ) 

Definition at line 88 of file aliroParameters.php.

References $params, and asString().

00088                                            {
00089         $inarray = (array) $params;
00090         foreach ($inarray as &$param) if (ini_get('magic_quotes-gpc')) $param = stripslashes($param);
00091         $this->params = $inarray;
00092         return $this->asString();
00093     }

aliroParameters::asString (  ) 

Definition at line 95 of file aliroParameters.php.

Referenced by processInput().

00095                                 {
00096         $encoded = array();
00097         foreach ($this->params as $key=>$param) $encoded[$key] = base64_encode($param);
00098         return serialize($encoded);
00099     }

aliroParameters::asPost (  ) 

Definition at line 101 of file aliroParameters.php.

00101                               {
00102         return $this->params;
00103     }

aliroParameters::render ( name = 'params'  ) 

Definition at line 105 of file aliroParameters.php.

References $params, and T_().

00105                                             {
00106         if ($this->xml) {
00107             $params = new aliroXMLParams;
00108             if (is_file($this->xml)) return $params->paramsFromFile($this->xml, $this, $name);
00109             else return $params->paramsFromString($this->xml, T_('Data passed to aliroParameters'), $this, $name);
00110         }
00111         return "<textarea name='$name' cols='40' rows='10' class='text_area'>$this->raw</textarea>";
00112     }


Member Data Documentation

aliroParameters::$params = array() [protected]

Definition at line 46 of file aliroParameters.php.

Referenced by processInput(), and render().

aliroParameters::$raw = null [protected]

Definition at line 47 of file aliroParameters.php.

aliroParameters::$xml = null [protected]

Definition at line 48 of file aliroParameters.php.

Referenced by __construct().


The documentation for this class was generated from the following file:

Generated on Wed May 14 13:01:59 2008 for ALIRO by  doxygen 1.5.5