public function AddColorPalette(AdsenseColorPalette $palette, $skin_name) { // If debug, check for the existence of the skin if (is_string($skin_name)) { if (OnePanelConfig::UsingDebug()) { $skins =& OnePanelConfig::GetSkins(); if (!array_key_exists($skin_name, $skins)) { die('You are trying to add a color palette for a skin that has not been added.'); } } } else { die('You must pass a valid string name to AddColorPalette'); } $this->palettes[$skin_name] =& $palette; }
public function __construct($identifier, $custom_field) { if (is_string($identifier)) { $this->identifier = $identifier; } else { if (OnePanelConfig::UsingDebug()) { die('You did not specify an identifier for your thumbnail type.'); } } if (is_string($custom_field)) { $this->custom_field = $custom_field; } else { if (OnePanelConfig::UsingDebug()) { die('You did not specify a custom field for your thumbnail type.'); } } }
public static function GetDetailedChunk($module_name, $feature_name, $chunk_name) { $module =& self::$operational_data[1][$module_name]; if (OnePanelConfig::UsingDebug()) { if ($module == null) { die('The module ' . $module . ' does not exist.'); } } $chunk =& $module->GetDetailedChunk($feature_name, $chunk_name); if ($chunk == null) { $module->BuildChunks(); $chunk =& $module->GetDetailedChunk($feature_name, $chunk_name); } return $chunk; }
public static function LoadTerms($language_name, $terms_array, $default = null) { if (OnePanelConfig::UsingDebug()) { if (!is_string($language_name)) { die('Language Name must be a string'); } if (!is_array($terms_array)) { die('Language Terms must be an array'); } } self::$data[$language_name] = $terms_array; if (self::$default_language == null) { self::$default_language = $language_name; } elseif ($default == true) { self::$default_language = $language_name; } }
public function GetChunk() { if ($this->IsActive()) { if ($this->video_mode == 2) { if (empty($this->youtube_url)) { return; } // TODO need decent return messages. $the_data = FeaturedVideoModule::GetYouTubeVideo($this->youtube_url); // TODO check the url is not empty $the_chunk = ''; if ($the_data['xml_response'] == 'Video not found') { $the_chunk .= '<div id="video-not-found">' . "\n"; $the_chunk .= 'Sorry, the video has been removed.' . "\n"; $the_chunk .= '</div>' . "\n"; } else { $video_size = OnePanelConfig::GetYoutubeVideoSize(); if (!is_array($video_size)) { $video_size['Width'] = 216; $video_size['Height'] = 197; } $the_chunk .= '<div id="featured-video">' . "\n"; $the_chunk .= '<object data="' . $the_data['url'] . '" type="' . $the_data['type'] . '" width="' . $video_size['Width'] . '" height="' . $video_size['Height'] . '">' . "\n"; $the_chunk .= ' <param name="movie" value="' . $the_data['url'] . '"></param>' . "\n"; $the_chunk .= '</object>' . "\n"; $the_chunk .= '</div>' . "\n"; } return $the_chunk; } elseif ($this->video_mode == 3) { if (empty($this->embed_code)) { return; } // TODO need decent return messages. $the_chunk = ''; $the_chunk .= '<div id="featured-video">' . "\n"; $the_chunk .= stripcslashes($this->embed_code); $the_chunk .= '</div>' . "\n"; return $the_chunk; } else { if (OnePanelConfig::UsingDebug()) { return $this->GetInactiveMessage(); } } } }