_check = $icon_check; $this->_theme_dir = $theme_dir; $this->_default_icon = $default; $this->_custom_icons = $custom; // Set default icons $this->_loadStableIcons(); // Merge in additional ones $this->_stable_icons = array_merge($this->_stable_icons, array_column($custom, 'first_icon')); $this->_loadIcons(); } /** * Return the icon specified by idx, or the default icon for invalid names * * @param int|string $idx */ public function __get($idx) { if (isset($this->data[$idx])) { return $this->data[$idx]; } else { return $this->data[$this->_default_icon]; } } /** * Load the stable icon array */ protected function _loadStableIcons() { // Setup the default topic icons... $this->_stable_icons = array( 'xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'poll', 'moved', 'recycled', 'wireless', 'clip' ); } /** * This simple function returns the message topic icon array. */ protected function _loadIcons() { global $settings; // Allow addons to add to the message icon array call_integration_hook('integrate_messageindex_icons', array(&$this->_stable_icons)); $this->data = array(); foreach ($this->_stable_icons as $icon) { if ($this->_check) { $this->data[$icon] = $settings[file_exists($this->_theme_dir . '/images/post/' . $icon . '.png') ? self::IMAGE_URL : self::DEFAULT_URL] . '/post/' . $icon . '.png'; } else { $this->data[$icon] = $settings[self::IMAGE_URL] . '/post/' . $icon . '.png'; } } } }