Example #1
0
 public function get($key)
 {
     if ($key == 'operator') {
         return $this->getOperator();
     }
     return parent::get($key);
 }
 public function get($key)
 {
     if ($key == 'className' || $key == 'class' || $key == 'name') {
         return $this->class;
     }
     return parent::get($key);
 }
Example #3
0
 /**
  * Get a value stored in this Process
  *
  */
 public function get($key)
 {
     if (($value = $this->getFuel($key)) !== null) {
         return $value;
     }
     return parent::get($key);
 }
 public function get($key)
 {
     if ($key == 'statusString') {
         return str_replace('_', ' ', $this->geocodeStatuses[$this->status]);
     }
     return parent::get($key);
 }
 public function get($key)
 {
     if ($key == 'user' || $key == 'createdUser') {
         if (!$this->settings['created_users_id']) {
             return $this->users->get(Users::guestUserID);
         }
         return $this->users->get($this->settings['created_users_id']);
     }
     return parent::get($key);
 }
 /**
  * Retrieve a value from the ImageMarker: date, location or notes
  *
  */
 public function get($key)
 {
     $value = parent::get($key);
     // if the page's output formatting is on, then we'll return formatted values
     if ($this->page && $this->page->of()) {
         // int sanitizer
         if ($key == 'info' || $key == 'x' || $key == 'y') {
             $value = (int) $value;
         }
     }
     return $value;
 }
Example #7
0
 public function get($key)
 {
     if ($key == 'user' || $key == 'createdUser') {
         if (!$this->settings['created_users_id']) {
             return $this->users->get($this->config->guestUserID);
         }
         return $this->users->get($this->settings['created_users_id']);
     } else {
         if ($key == 'gravatar') {
             return $this->gravatar();
         }
     }
     return parent::get($key);
 }
 /**
  * Return the requested path variable
  *
  */
 public function get($key)
 {
     $value = parent::get($key);
     if ($key == 'root') {
         return $value;
     }
     if (!is_null($value)) {
         if ($value[0] == '/' || DIRECTORY_SEPARATOR != '/' && $value[1] == ':') {
             return $value;
         } else {
             $value = $this->root . $value;
         }
     }
     return $value;
 }
 /**
  * Get a Template property
  *
  * @param string $key
  * @return mixed
  *
  */
 public function get($key)
 {
     if ($key == 'filename') {
         return $this->filename();
     }
     if ($key == 'fields') {
         $key = 'fieldgroup';
     }
     if ($key == 'fieldgroup') {
         return $this->fieldgroup;
     }
     if ($key == 'fieldgroupPrevious') {
         return $this->fieldgroupPrevious;
     }
     return isset($this->settings[$key]) ? $this->settings[$key] : parent::get($key);
 }
Example #10
0
 /**
  * Retrieve a value from the event: date, location or notes
  *
  */
 public function get($key)
 {
     $value = parent::get($key);
     // if the page's output formatting is on, then we'll return formatted values
     if ($this->page && $this->page->of()) {
         if ($key == 'date') {
             // format a unix timestamp to a date string
             $value = date(self::dateFormat, $value);
         } else {
             if ($key == 'location' || $key == 'notes') {
                 // return entity encoded versions of strings
                 $value = $this->sanitizer->entities($value);
             }
         }
     }
     return $value;
 }
 /**
  * Get the language-aware property
  * 
  * @param string $property Either 'title' or 'value'
  * @return string
  * 
  */
 protected function getProperty($property)
 {
     if ($this->wire('languages')) {
         $language = $this->wire('user')->language;
         if ($language->isDefault()) {
             $value = parent::get($property);
         } else {
             $value = parent::get("{$property}{$language}");
             // fallback to default language title if no title present for language
             if (!strlen($value)) {
                 $value = parent::get($property);
             }
         }
     } else {
         $value = parent::get($property);
     }
     if ($this->of) {
         $value = $this->wire('sanitizer')->entities($value);
     }
     return $value;
 }
Example #12
0
 /**
  * Get a Template property
  *
  * @param string $key
  * @return mixed
  *
  */
 public function get($key)
 {
     if ($key == 'filename') {
         return $this->filename();
     }
     if ($key == 'fields') {
         $key = 'fieldgroup';
     }
     if ($key == 'fieldgroup') {
         return $this->fieldgroup;
     }
     if ($key == 'fieldgroupPrevious') {
         return $this->fieldgroupPrevious;
     }
     if ($key == 'roles') {
         return $this->getRoles();
     }
     if ($key == 'cacheTime') {
         $key = 'cache_time';
     }
     // for camel case consistency
     if ($key == 'icon') {
         return $this->getIcon();
     }
     return isset($this->settings[$key]) ? $this->settings[$key] : parent::get($key);
 }
Example #13
0
 /**
  * Return the icon used by this field, or blank if none
  * 
  * @param bool $prefix Whether or not you want the fa- prefix included
  * @return mixed|string
  * 
  */
 public function getIcon($prefix = false)
 {
     $icon = parent::get('icon');
     if (empty($icon)) {
         return '';
     }
     if (strpos($icon, 'fa-') === 0) {
         $icon = str_replace('fa-', '', $icon);
     }
     if (strpos($icon, 'icon-') === 0) {
         $icon = str_replace('icon-', '', $icon);
     }
     return $prefix ? "fa-{$icon}" : $icon;
 }
Example #14
0
 /**
  * Get a user setting or data value
  *
  */
 public function get($key)
 {
     if ($key == 'roles') {
         return $this->rolesArray;
     }
     if (isset($this->settings[$key])) {
         return $this->settings[$key];
     }
     return parent::get($key);
 }
Example #15
0
 /**
  * Gets a setting or fuel from the Inputfield, while ignoring attributes and anything else
  *
  * To be used in cases where there is a potential name conflict, like the 'collapsed' field when in the Fields editor.
  * Otherwise don't bother using this method. 
  *
  */
 public function getSetting($key)
 {
     return parent::get($key);
 }
Example #16
0
 /**
  * Return the requested path variable
  *
  * @param object|string $key
  * @return mixed|null|string The requested path variable
  *
  */
 public function get($key)
 {
     static $_http = null;
     if ($key == 'root') {
         return $this->_root;
     }
     if (strpos($key, 'http') === 0) {
         if (is_null($_http)) {
             $scheme = $this->wire('input')->scheme;
             if (!$scheme) {
                 $scheme = 'http';
             }
             $httpHost = $this->wire('config')->httpHost;
             if ($httpHost) {
                 $_http = "{$scheme}://{$httpHost}";
             }
         }
         $http = $_http;
         $key = substr($key, 4);
         $key[0] = strtolower($key[0]);
     } else {
         $http = '';
     }
     if ($key == 'root') {
         $value = $http . $this->_root;
     } else {
         $value = parent::get($key);
         if (!is_null($value) && strlen($value)) {
             if ($value[0] == '/' || DIRECTORY_SEPARATOR != '/' && $value[1] == ':') {
                 $value = $http . $value;
             } else {
                 $value = $http . $this->_root . $value;
             }
         }
     }
     return $value;
 }
Example #17
0
 /**
  * Get a Field setting or dynamic data property
  *
  */
 public function get($key)
 {
     if ($key == 'table') {
         return $this->getTable();
     } else {
         if ($key == 'prevTable') {
             return $this->prevTable;
         } else {
             if ($key == 'prevFieldtype') {
                 return $this->prevFieldtype;
             } else {
                 if (isset($this->settings[$key])) {
                     return $this->settings[$key];
                 }
             }
         }
     }
     $value = parent::get($key);
     if (is_array($this->trackGets)) {
         $this->trackGets($key);
     }
     return $value;
 }
 public function get($key)
 {
     if ($key === 'role') {
         return $this->role ? $this->role : $this->getFuel('roles')->get($this->roles_id);
     } else {
         if ($key === 'page') {
             return $this->page ? $this->page : $this->getFuel('pages')->get($this->pages_id);
         } else {
             if ($key === 'pages_id' && $this->page) {
                 return $this->get('page')->id;
             } else {
                 if ($key === 'roles_id' && $this->role) {
                     return $this->get('role')->id;
                 } else {
                     return parent::get($key);
                 }
             }
         }
     }
 }
Example #19
0
 /**
  * Get or set a setting
  *
  * In get mode, you specify only a key and you get the value of the setting. 
  * In set mode, you specify both key and value and $this is returned. 
  *
  * @param string $key
  * @param string|int|object|null $value
  * @return mixed Returns $this if you set a setting, or returns the setting value if you are getting a setting. 
  *	Returns null if a requested setting does not exist (in get mode)
  *
  */
 public function settings($key, $value = null)
 {
     $settings = parent::get('settings');
     if (is_null($value)) {
         $value = isset($settings[$key]) ? $settings[$key] : null;
         return $value;
     }
     $settings[$key] = $value;
     parent::set('settings', $settings);
     return $this;
 }
Example #20
0
 public function get($key)
 {
     if ($key == 'version') {
         return $this->version;
     }
     return parent::get($key);
 }
Example #21
0
 /**
  * Get a set property from the template file, typically to check if a template has access to a given variable
  *
  * @param string $property
  * @return mixed Returns the value of the requested property, or NULL if it doesn't exist
  *	
  */
 public function get($property)
 {
     if ($property == 'filename') {
         return $this->filename;
     }
     if ($property == 'appendFilename') {
         return $this->appendFilename;
     }
     if ($property == 'prependFilename') {
         return $this->prependFilename;
     }
     if ($property == 'halt') {
         return $this->halt;
     }
     if ($value = parent::get($property)) {
         return $value;
     }
     if (isset(self::$globals[$property])) {
         return self::$globals[$property];
     }
     return null;
 }
Example #22
0
 /**
  * Retrieve a value from the Notification
  * 
  * @param string $key
  * @return mixed
  *
  */
 public function get($key)
 {
     if ($key == 'id') {
         return $this->getID();
     }
     if ($key == 'page') {
         return $this->page;
     }
     if ($key == 'hash') {
         return $this->getHash();
     }
     if ($key == 'flagNames') {
         $flags = parent::get('flags');
         $flagNames = array();
         foreach (self::$_flagNames as $val => $name) {
             if ($flags & $val) {
                 $flagNames[$val] = $name;
             }
         }
         return $flagNames;
     }
     $value = parent::get($key);
     // if the page's output formatting is on, then we'll return formatted values
     if ($this->page && $this->page->of()) {
         if ($key == 'created' || $key == 'expires' || $key == 'modified') {
             // format a unix timestamp to a date string
             $value = date('Y-m-d H:i:s', $value);
         } else {
             if ($key == 'title' || $key == 'text' || $key == 'from') {
                 // return entity encoded versions of strings
                 if ($key == 'title' && $this->flags & self::flagAllowMarkup) {
                     // leave title alone when markup is allowed
                 } else {
                     $value = $this->sanitizer->entities($value);
                 }
             }
         }
     } else {
         if ($key == 'created' && !$value) {
             $value = time();
         }
     }
     return $value;
 }
Example #23
0
 public function get($key)
 {
     if ($key == 'user' || $key == 'createdUser') {
         if (!$this->settings['created_users_id']) {
             return $this->users->get($this->config->guestUserID);
         }
         return $this->users->get($this->settings['created_users_id']);
     } else {
         if ($key == 'gravatar') {
             return $this->gravatar();
         } else {
             if ($key == 'page') {
                 return $this->getPage();
             } else {
                 if ($key == 'field') {
                     return $this->getField();
                 } else {
                     if ($key == 'parent') {
                         return $this->parent();
                     } else {
                         if ($key == 'children') {
                             return $this->children();
                         }
                     }
                 }
             }
         }
     }
     return parent::get($key);
 }
Example #24
0
 public function get($key)
 {
     if ($key == 'operator') {
         return $this->getOperator();
     }
     if ($key == 'str') {
         return $this->__toString();
     }
     if ($key == 'values') {
         $value = $this->value;
         if (is_array($value)) {
             return $value;
         }
         if (!is_object($value) && !strlen($value)) {
             return array();
         }
         return array($value);
     }
     if ($key == 'fields') {
         $field = $this->field;
         if (is_array($field)) {
             return $field;
         }
         if (!strlen($field)) {
             return array();
         }
         return array($field);
     }
     return parent::get($key);
 }
Example #25
0
 /**
  * Get a property from this Fieldtype's data
  *
  * @param string $key
  * @return mixed
  *
  */
 public function get($key)
 {
     if ($key == 'name') {
         return $this->className();
     }
     if ($key == 'shortName') {
         return str_replace('Fieldtype', '', $this->className());
     }
     return parent::get($key);
 }
Example #26
0
 /**
  * Return a unique MD5 hash representing this Pagefile
  *
  */
 public function hash()
 {
     if ($hash = parent::get('hash')) {
         return $hash;
     }
     $this->set('hash', md5($this->basename()));
     return parent::get('hash');
 }
Example #27
0
 /**
  * Prepare the page and it's fields for removal from runtime memory, called primarily by Pages::uncache()
  *
  */
 public function uncache()
 {
     $trackChanges = $this->trackChanges();
     if ($trackChanges) {
         $this->setTrackChanges(false);
     }
     if ($this->template) {
         foreach ($this->template->fieldgroup as $field) {
             $value = parent::get($field->name);
             if ($value != null && is_object($value)) {
                 if (method_exists($value, 'uncache') && $value !== $this) {
                     $value->uncache();
                 }
                 parent::set($field->name, null);
             }
         }
     }
     if ($this->filesManager) {
         $this->filesManager->uncache();
     }
     $this->filesManager = null;
     if ($trackChanges) {
         $this->setTrackChanges(true);
     }
 }
 /**
  * Retrieve a value from the booking: date and user
  *
  */
 public function get($key)
 {
     //we don't need to do much here + our values are already sanitized/formated for ouput in formatValue()
     return parent::get($key);
 }
Example #29
0
 public function get($key)
 {
     if ($key == 'page') {
         return $this->getPage();
     }
     if ($key == 'field') {
         return $this->getField();
     }
     if ($key == 'value') {
         return $this->getValue();
     }
     return parent::get($key);
 }
Example #30
0
 /**
  * Get a Field setting or dynamic data property
  *
  */
 public function get($key)
 {
     if ($key == 'table') {
         return $this->getTable();
     } else {
         if ($key == 'prevTable') {
             return $this->prevTable;
         } else {
             if ($key == 'prevFieldtype') {
                 return $this->prevFieldtype;
             } else {
                 if (isset($this->settings[$key])) {
                     return $this->settings[$key];
                 }
             }
         }
     }
     return parent::get($key);
 }