test.php in Gallery Assist 7
File
test.phpView source
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
$c = variable_get("gallery_assist_default_data", array());
#$c['thm_border'] = 1;
#$c = variable_set("gallery_assist_default_data", $c);
$c['tstyle'] = image_style_load($c['thumbnail_image_style']);
$end = end($c['tstyle']['effects']);
$c['width'] = $end['data']['width'];
$c['height'] = $end['data']['height'];
$c['thumbnail_size'] = $c['width'] >= $c['height'] ? $c['width'] : $c['height'];
$c['rows'] = ceil($c['teaser_items_per_row'] * $c['teaser_rows_per_page'] / $c['teaser_items_per_row']);
#$c['ct_width'] = (($c['thm_border'] + $c['thm_margin'] + $c['thm_padding']) * 2) * 3 + ($c['width']) * $c['teaser_items_per_row'];
$c['ct_width'] = ($c['thm_padding'] * 2 + $c['thm_border'] * 2 + $c['thm_margin'] + $c['thumbnail_size']) * $c['teaser_items_per_row'];
dsm($c);
// $c['rows'] = ceil(($settings['teaser_items_per_row']*$settings['teaser_rows_per_page'])/$settings['teaser_items_per_row']);
//
//
// $rows = ceil(($settings['teaser_items_per_row']*$settings['teaser_rows_per_page'])/$settings['teaser_items_per_row']);
// $ct_width = (($settings['thm_border'] + $settings['thm_margin'] + $settings['thm_padding']) * 2) * 3 + ($thm['width']) * $settings['teaser_items_per_row'];
// $ct_height = (($settings['thm_border'] + $settings['thm_margin'] + $settings['thm_padding']) * 2) * 3 + ($thm['width']) * $settings['page_items_per_row'];
// $settings['ga_container_width'] = $ct_width;
//
// dsm($settings['page_items_per_row']);
// $rows = ceil(($settings['page_items_per_row']*$settings['page_rows_per_page'])/$settings['page_items_per_row']);
// $cp_width = (($settings['thm_border'] + $settings['thm_margin'] + $settings['thm_padding']) * 2) * 3 + ($thm['width']) * $settings['page_items_per_row'];
// $cp_height = (($settings['thm_border'] + $settings['thm_margin'] + $settings['thm_padding']) * 2) * 3 + ($thm['width']) * $rows;
//
// $classes = array(
// 'container_class' => '.gallery-container.'. $type,
// );
//
// // Create or replace the css file.
// $css_path = variable_get('gallery_assist_directory', FALSE) .'/css';
// $destination = $css_path .'/'. $type .'.gallery_assist.css';
//
// // Float.
// // Teaser view.
// $settings['float_margin_value'] = '10px;';
// if ($settings['teaser_container_float'] != 'none') {
// $settings['t_float'] = "float:{$settings['teaser_container_float']};";
// if ($settings['teaser_container_float'] == 'right') {
// $settings['t_float_margin'] = 'margin-left:';
// }
// if ($settings['teaser_container_float'] == 'left') {
// $settings['t_float_margin'] = 'margin-right:';
// }
// $settings['t_float_margin'] .= 0;
// //$settings['float_margin_value'];
// }
// // Page view.
// if ($settings['page_container_float'] != 'none') {
// if ($settings['ga_page_float'] == 'right') {
// $settings['p_float_margin'] = 'margin-left:';
// }
// if ($settings['page_container_float'] == 'left') {
// $settings['p_float_margin'] = 'margin-right:';
// }
// $settings['p_float'] = "float:{$settings['page_container_float']};";
// $settings['p_float'] .= $settings['p_float_margin'] . $settings['float_margin_value'];
// }
//
// $css = array();
// $css[] = '/* CSS file for the '. $type .' assignment. */';
// $css[] = $classes['container_class'] .'.teaser {
// width:' . $ct_width .'px;
// height:'.$ct_height.'px;
// border:5px solid red;
// }';
// $css[] = $classes['container_class'] .'.full {
// ' . (isset($settings['p_float']) && $settings['p_float'] ? $settings['p_float'] : '')
// . 'width:' . $cp_width .'px;
// height:'.$cp_height.'px;
// border:5px solid green;
// }';
// $css[] = $classes['container_class'] .' .ga-image-box{
// float:left;
// width:' . $thm['width'] .'px;
// height:' . $thm['height'] .'px;
// border:' . $settings['thm_border'] .'px solid '. $settings['thm_border_color'] .';
// margin:' . $settings['thm_margin'] .'px;
// padding:' . $settings['thm_padding'] .'px;
// text-align:center;
//}';
// $css[] = '.gallery-assist-pager-top, .gallery-assist-pager-bottom {
// /*padding:0 '. $settings['thm_padding'] .'px;*/
// width:' . ($cp_width + ($settings['thm_padding'] + $settings['thm_margin'] + 5)/2) .'px;
// }';
// $css[] = '';
//
// $data = implode("\n", $css);
drupal_add_css(drupal_get_path('module', 'gallery_assist') . '/css/gallery_assist.css');