Exemplo n.º 1
0
 public function GetChunk()
 {
     if ($this->IsActive()) {
         $title = str_replace(' ', '_', $this->title);
         $return = '<div class="adblock-' . strtolower($title) . '">' . "\n";
         if ($this->ad_mode == 2) {
             $return .= stripcslashes($this->ad_code);
         } elseif ($this->ad_mode == 3) {
             $the_block =& OnePanelConfig::GetAdBlock($this->title);
             $the_palette =& $the_block->GetPalette(OnePanelTheme::GetActiveSkin()->GetName());
             $return .= '<script type="text/javascript"><!--' . "\n";
             $return .= 'google_ad_client = "' . $this->adsense_id . '";' . "\n";
             $return .= 'google_ad_width = "' . $the_block->GetWidth() . '";' . "\n";
             $return .= 'google_ad_height = "' . $the_block->GetHeight() . '";' . "\n";
             $return .= 'google_ad_format = "' . $the_block->GetWidth() . 'x' . $the_block->GetHeight() . '_as";' . "\n";
             $return .= 'google_ad_type = "text_image";' . "\n";
             $return .= 'google_color_border = "' . $the_palette->GetBorderColor() . '";' . "\n";
             $return .= 'google_color_bg = "' . $the_palette->GetBackgroundColor() . '";' . "\n";
             $return .= 'google_color_link = "' . $the_palette->GetLinkColor() . '";' . "\n";
             $return .= 'google_color_text = "' . $the_palette->GetTextColor() . '";' . "\n";
             $return .= 'google_color_url = "' . $the_palette->GetUrlColor() . '";' . "\n";
             $return .= is_null($this->adsense_channel) ? '' : 'google_ad_channel = "' . $this->adsense_channel . '";' . "\n";
             $return .= '//--></script>' . "\n";
             $return .= '<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">' . "\n";
             $return .= '</script>' . "\n";
         }
         $return .= '</div>' . "\n";
         return $return;
     }
 }
Exemplo n.º 2
0
 public function BuildChunks()
 {
     // Get the skin switcher chunks
     $enabled = $this->features['SkinFeatureSwitcher']->IsActive();
     if ($enabled == false) {
         return false;
     }
     // Get the skins
     $skins =& $this->GetSkinFeatures();
     $active_skin =& OnePanelTheme::GetActiveSkin();
     // Do the select
     $select = '<select class="select" onchange="OnePanelTheme.SwitchSkin( this.value )">' . "\n";
     foreach ($skins as $key => &$skin) {
         if ($skin->IsActive()) {
             $select .= '<option value="' . $skin->GetName() . '">' . $skin->GetName() . '</option>' . "\n";
         }
     }
     $select .= '</select>' . "\n";
     $this->chunks['Select'] =& $select;
     // Do the list
     $list = '<ul>' . "\n";
     foreach ($skins as $key => &$skin) {
         if ($skin->IsActive()) {
             $list .= '<li class="' . $skin->GetName() . ' ' . ($active_skin->GetName() == $skin->GetName() ? 'active' : 'inactive') . '"><a href="javascript:;" onclick="OnePanelTheme.SwitchSkin( \'' . $skin->GetName() . '\' )">' . $skin->GetName() . '</a></li>' . "\n";
         }
     }
     $list .= '</ul>' . "\n";
     $this->chunks['List'] =& $list;
 }