Example #1
0
 /**
  * Stores own values in addition to children values in associative array that
  * can be stored in Wordpress database.
  * 
  * @return array $result		Array of options to store in database.
  * @access public
  */
 function store()
 {
     $result = array();
     $result[$this->_name] = $this->_value;
     $result = array_merge(parent::store(), $result);
     return $result;
 }
Example #2
0
 /**
  * Check whether we find a value for this option in the array pulled from 
  * the database. If so adopt this value. Pass the array on to all the children
  * such that they can do the same.
  * 
  * @param array $storedOptions		Array pulled from database.
  * @access public
  */
 function load($storedOptions)
 {
     if (is_array($storedOptions)) {
         if (array_key_exists($this->_name, $storedOptions)) {
             $this->setValue($storedOptions[$this->_name]);
         }
         parent::load($storedOptions);
     } elseif ($storedOptions) {
         //option was not stored in an associative array
         $this->setValue($storedOptions);
     }
 }
 function __construct($exifKey, $exifExampleValue)
 {
     parent::__construct($exifKey);
     $this->_exifExampleValue = $exifExampleValue;
     $this->addChild(new TextFieldOption($exifKey . '-displayName', '', __('Display Name', 'PhotoQ') . ': ', '', '<br/>', '20'));
     //whether to use it for tagFromExif
     $this->addChild(new CheckBoxOption($exifKey . '-tag', '0', __('Create post tags from EXIF data', 'PhotoQ') . '', '', ''));
 }
Example #4
0
 function accept(&$visitor)
 {
     //render selected first, deselected after
     if (is_a($visitor, 'RenderOptionVisitor')) {
         $this->_acceptSelected($visitor, true);
         $this->_acceptSelected($visitor, false);
     } else {
         parent::accept($visitor);
     }
 }
 /**
  * PHP5 type constructor
  */
 function __construct($name, $defaultValue, $label = '', $textBefore = '', $textAfter = '')
 {
     parent::__construct($name, $defaultValue, $label, $textBefore, $textAfter);
     $this->deselect();
 }