예제 #1
0
 function get_super_css_tree($zones_array)
 {
     $final_string = "\n";
     $index = 0;
     $total = count($zones_array);
     $cAbstract = new abstract_front();
     foreach ($zones_array as $id => $zone) {
         $index++;
         if (!$cAbstract->get_entries($id)) {
             continue;
         }
         $zone_data = $cAbstract->get_zone_data($id, true);
         if (empty($zone_data)) {
             continue;
         }
         $zone_class = $cAbstract->get_zone_class($id);
         $script = FILENAME_COLLECTIONS;
         switch ($zone_class) {
             case 'image_zones':
                 $process_function = 'get_image_css_tree';
                 break;
             case 'super_zones':
                 $process_function = 'get_mixed_css_tree';
                 break;
             default:
                 $process_function = 'get_text_css_tree';
                 break;
         }
         $value2 = strtoupper($zone_data['abstract_zone_name']);
         $awidth = tep_string_length($value2) * 9 + 16;
         $value2 = htmlspecialchars(stripslashes($value2));
         //$value2 = str_replace(' ', ' ', $value2 );
         $final_string .= '<div class="css_top floater calign"><a href="' . tep_href_link($script, 'abz_id=' . $id) . '" style="width:' . $awidth . 'px">' . $value2 . '</a>' . "\n";
         $tmp_drop = $this->options['max_drop'];
         $max_width = $this->options['max_width'];
         $tmp_array = $this->{$process_function}($id, $tmp_drop, $max_width);
         if (!empty($tmp_array)) {
             $extra_style = ' style="width: ' . $max_width . 'px"';
             for ($i = 1, $width = 0; $i <= $this->options['max_cols']; $i++) {
                 if ((int) ($tmp_drop / $i) <= $this->options['max_drop']) {
                     break;
                 }
                 $width = $i;
             }
             if ($i > 1) {
                 if ($width > $this->options['max_cols']) {
                     $width = $this->options['max_cols'];
                 }
                 $extra_style = ' style="width: ' . $width * ($max_width + $this->options['border_width']) . 'px;"';
             }
             if ($tmp_drop != $this->options['max_drop']) {
                 $tmp_array = array_slice($tmp_array, 0, $this->options['max_drop'] * $this->options['max_cols']);
                 $tmp_string = '<div class="css_sub hideflow"';
                 if ($i > 1) {
                     $tmp_string .= ' style="width: ' . $max_width . 'px"';
                 }
                 $tmp_string .= '><a href="' . tep_href_link($script, 'abz_id=' . $id) . '">' . TEXT_SEE_ALL . '</a></div>';
                 $tmp_array[] = $tmp_string;
             }
             $tmp_string = implode('    ', $tmp_array);
             $max_width_string = '';
             if ($i > 1) {
                 $max_width_string = ' style="width: ' . $max_width . 'px;"';
             }
             $contents_array = array('MAX_WIDTH' => $max_width_string);
             $tmp_string = tep_templates_replace_entities($tmp_string, $contents_array);
             $final_string .= '  <div class="css_section"' . $extra_style . '>' . "\n" . $tmp_string . '  </div>' . "\n";
         }
         $final_string .= '</div>' . "\n";
         if ($index < $total) {
             $last_sep = '    <div class="css_sep hideflow">' . tep_image($this->web_template_path . 'words_space.gif') . '</div>' . "\n";
             $final_string .= $last_sep;
         }
     }
     return $final_string;
 }
예제 #2
0
 function check_collection()
 {
     extract(tep_load('defs'));
     $result = false;
     if (!$cDefs->abstract_id) {
         return $result;
     }
     $cAbstract = new abstract_front();
     $zone_class = $cAbstract->get_zone_class($cDefs->abstract_id);
     switch ($zone_class) {
         case 'generic_zones':
             if (!$this->options['text_collections']) {
                 return $result;
             }
             $result = $zone_class;
             break;
         case 'image_zones':
             if (!$this->options['image_collections']) {
                 return $result;
             }
             $result = $zone_class;
             break;
         default:
             break;
     }
     return $result;
 }
예제 #3
0
// Released under the GNU General Public License
//----------------------------------------------------------------------------
*/
require 'includes/application_top.php';
if (!$current_abstract_id) {
    tep_redirect();
}
$abstract_query = $g_db->fly("select abstract_zone_id, abstract_zone_name, abstract_zone_desc from " . TABLE_ABSTRACT_ZONES . " where abstract_zone_id='" . (int) $current_abstract_id . "'");
$abstract_array = $g_db->fetch_array($abstract_query);
$g_breadcrumb->add($abstract_array['abstract_zone_name'], tep_href_link($g_script, 'abz_id=' . $current_abstract_id));
require DIR_FS_OBJECTS . 'html_start_sub1.php';
require DIR_FS_OBJECTS . 'html_start_sub2.php';
$heading_row = true;
require DIR_FS_OBJECTS . 'html_body_header.php';
$cAbstract = new abstract_front();
$class = $cAbstract->get_zone_class($current_abstract_id);
$template_file = DIR_FS_TEMPLATE . 'html_' . $class . '.tpl';
if (is_file($template_file)) {
    include $template_file;
} else {
    ?>
            <div><h1><?php 
    echo TEXT_INVALID_COLLECTION;
    ?>
</h1></div>
            <div><?php 
    echo TEXT_INVALID_COLLECTION_INFO;
    ?>
</div>
<?php 
}