$link) {
// $vars['links'][$lang]['title'] = $lang;
// // if($lang == $language->language)
// // unset($vars['link'][$lang]);
// }
$content = theme_links($vars);
return $content;
}
/**
* Returns HTML for an image using a specific image style.
*
* @param $variables
* An associative array containing:
* - style_name: The name of the style to be used to alter the original image.
* - path: The path of the image file relative to the Drupal files directory.
* This function does not work with images outside the files directory nor
* with remotely hosted images. This should be in a format such as
* 'images/image.jpg', or using a stream wrapper such as
* 'public://images/image.jpg'.
* - width: The width of the source image (if known).
* - height: The height of the source image (if known).
* - alt: The alternative text for text-based browsers.
* - title: The title text is displayed when the image is hovered in some
* popular browsers.
* - attributes: Associative array of attributes to be placed in the img tag.
*
* @ingroup themeable
*/
function perfarttimeline_image_style($vars) {
// dpm($vars);
$original_path = $vars['path'];
_perfarttimeline_getImageStyleDimensions($vars);
$figure = '';
$styles = array('grid_small', 'grid_medium', 'grid_large');
if(in_array($vars['style_name'], $styles)){
foreach ($styles as $style) {
$vars['attributes']['class'] = 'image '.$style;
if($style == $vars['style_name']){
// $vars['path'] = image_style_url($vars['style_name'], $original_path);
// $vars['path'] = image_style_path($vars['style_name'], $original_path);
$url = image_style_url($style, $original_path);
$url = parse_url($url);
$vars['path'] = $url['path'];
$figure .= theme('image', $vars);
}else{
$hidden_vars = array_merge(array(), $vars);
$hidden_vars['style_name'] = $style;
_perfarttimeline_getImageStyleDimensions($hidden_vars);
// $hidden_vars['attributes']['path'] = image_style_url($style, $original_path);
// $hidden_vars['attributes']['path'] = image_style_path($style, $original_path);
$url = image_style_url($style, $original_path);
$url = parse_url($url);
$hidden_vars['attributes']['path'] = $url['path'];
$hidden_vars['path'] = "";
$figure .= theme('image', $hidden_vars);
}
}
}else{
$vars['attributes']['class'] = 'image '.$vars['style_name'];
// $vars['path'] = image_style_url($vars['style_name'], $original_path);
// $style_path = image_style_path($vars['style_name'], $original_path);
// $url = file_create_url($style_path);
$url = image_style_url($vars['style_name'], $original_path);
$url = parse_url($url);
$vars['path'] = $url['path'];
$figure .= theme('image', $vars);
}
#gif
$gifvariables = array_merge(array(), $vars);
$gifvariables['path'] = '/'. drupal_get_path("theme", "perfarttimeline") .'/images/blank.gif';
$gifvariables['attributes']['class'] = 'blank';
$gifvariables['title'] = $gifvariables['alt'] = '';
$figure .= theme('image', $gifvariables);
#figcaption
$figure .= ''.$vars['title'].'';
$figure .= '';
return $figure;
}
function _perfarttimeline_getImageStyleDimensions(&$vars){
$dimensions = array(
'width' => $vars['width'],
'height' => $vars['height'],
);
image_style_transform_dimensions($vars['style_name'], $dimensions);
$vars['width'] = $dimensions['width'];
$vars['height'] = $dimensions['height'];
}
function perfarttimeline_menu_tree__main_menu($variables) {
// dsm($variables);
global $language;
preg_match_all('/