Project

General

Profile

Download (19.5 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
// $Id$
3

    
4
/**
5
 * Overrides of generic themeing functions in cdm_datportal.theme.php
6
 */
7

    
8

    
9
/**
10
 * The description page is supposed to be the front page for a taxon.
11
 *
12
 * @param TaxonTO $taxonTO
13
 * @return
14
 */
15
function garland_cichorieae_cdm_taxon_page_description($taxon, $mergedTrees, $media, $hideImages = false){
16

    
17
	RenderHints::pushToRenderStack('taxon_page_description');
18
	// description TOC
19
	$out = theme('cdm_featureTreeTOCs', $mergedTrees);
20

    
21
	// preferred image
22
	// 2 lines hard coded for testing
23
	if( variable_get('cdm_dataportal_show_default_image', false) && !$hideImages){
24

    
25
		//$defaultPreferredImage = drupal_get_path('theme', 'garland_cichorieae').'/images/nopic_400x300.jpg';
26
		$defaultRepresentationPart = false;
27
		$defaultRepresentationPart->width = 400;
28
		$defaultRepresentationPart->height = 300;
29
		$defaultRepresentationPart->uri = drupal_get_path('theme', 'garland_cichorieae').'/images/nopic_400x300_4x3cm.jpg';
30

    
31
		$imageUriParams = '&width=400&height=300&quality=95&format=jpeg';
32

    
33
		$imageMaxExtend = 400;
34
		$out .= '<div class="preferredImage">'.theme('cdm_preferredImage', $media, $defaultRepresentationPart, $imageMaxExtend, $imageUriParams).'</div>';
35
	}
36

    
37
	// description
38
	$out .= theme('cdm_featureTrees', $mergedTrees, $taxon);
39
	RenderHints::popFromRenderStack();
40

    
41
	return $out;
42
}
43

    
44
/*
45
 function garland_cichorieae_cdm_descriptionElementTextData($element){
46

    
47
 $description = str_replace("\n", "<br/>", $element->multilanguageText_L10n->text);
48
 $referenceCitation = '';
49
 $sourceRefs = '';
50

    
51
 if($element->reference){
52
 // disabling references for cichorieae description Elements because they all have faulty references
53
 $referenceCitation = '; '.theme('cdm_fullreference', $element->reference, TRUE);
54
 }
55
 //return '<p class="descriptionText">' . $description . $referenceCitation.'</p>';
56

    
57
 foreach($element->sources as $source){
58
 $referenceCitation = theme('cdm_DescriptionElementSource', $source);
59
 if($description && strlen($description) > 0 && $referenceCitation ){
60
 $sourceRefs .= ' ('.$referenceCitation.')' ;
61
 /*
62
 * TODO: why does not belongs this code to the cichorieae theme ??
63
 *
64
 }else if ($referenceCitation){
65
 $sourceRefs = $referenceCitation;
66
 }
67
 }
68
 return '<p class="descriptionText">' . $description . $sourceRefs . '</p>';
69
 }
70
 */
71
function garland_cichorieae_cdm_descriptionElementTextData($element, $asListElement, $feature_uuid){
72

    
73
	$description = str_replace("\n", "<br/>", $element->multilanguageText_L10n->text);
74
	$sourceRefs = '';
75
	$result = array();
76
	$res_author;
77
	$res_date;
78
	$no_links = false;
79
	$default_theme = variable_get('theme_default', 'garland_cichorieae');
80

    
81
	if (($default_theme == 'flora_malesiana' || $default_theme == 'flore_afrique_centrale')
82
	    && $element->feature->titleCache == 'Citation'){
83
		$asListElement = true;
84
	}elseif ($element->feature->uuid == UUID_CHROMOSOMES_NUMBERS){
85
	   	$asListElement = true;
86
	}else{
87
		$asListElement = false;
88
	}
89

    
90
	if ($feature_uuid == UUID_NAME_USAGE || $feature_uuid == UUID_CHROMOSOMES){
91
		$no_links = true;
92
	}
93

    
94
	if(is_array($element->sources)){
95
		foreach($element->sources as $source){
96
			//initialize some variables
97
			if ($feature_uuid == UUID_NAME_USAGE){
98
				$referenceCitation = cdm_ws_get(CDM_WS_NOMENCLATURAL_REFERENCE_CITATION,
99
				                                array($source->citation->uuid),
100
									            "microReference=".urlencode($source->citationMicroReference));
101
				$referenceCitation = $referenceCitation->String;
102
			}else{
103
				$referenceCitation = theme('cdm_DescriptionElementSource',
104
			                               $source,
105
									       ($no_links) ? false : true);
106
			}
107
			if($description && strlen($description) > 0 && $referenceCitation ){
108
				$sourceRefs .= ' ('.$referenceCitation.')' ;
109
			}else if ($referenceCitation){
110
				$sourceRefs = $referenceCitation;
111
			}
112
			//generate the output
113
			if(strlen($sourceRefs) > 0){
114
				$sourceRefs = '<span class="sources">' . $sourceRefs . '</span>';
115
			}
116
			if ($source->nameUsedInSource->uuid && ($feature_uuid != UUID_NAME_USAGE)){
117
				//do a link to name page
118
				$name_used_in_source_link_to_show = l($source->nameUsedInSource->titleCache,
119
												  path_to_name($source->nameUsedInSource->uuid),
120
												  array(), NULL, NULL, FALSE ,TRUE);
121
			}else if ($source->nameUsedInSource->uuid && ($feature_uuid == UUID_NAME_USAGE)){
122
				//do not do link for NAME USAGE feature
123
				$name_used_in_source_link_to_show = $source->nameUsedInSource->titleCache;
124
			}else if (strlen($source->nameUsedInSource->originalNameString) > 0){
125
				//show a text without link
126
				$name_used_in_source_link_to_show = $source->nameUsedInSource->originalNameString;
127
			}
128

    
129
			if($asListElement && ($feature_uuid == UUID_NAME_USAGE)){
130
				$out = '<li class="descriptionText">' . $name_used_in_source_link_to_show;
131
				//adding ":" if necesary
132
				if ($name_used_in_source_link_to_show && ($description || $sourceRefs)){
133
					$out .= ': ';
134
				}
135
				$out .= $description . $sourceRefs . theme('cdm_annotations_as_footnotekeys', $element) . '</li>';
136
			}else if ($asListElement){
137
				$out = '<li class="descriptionText">' . $name_used_in_source_link_to_show;
138
				//adding ":" if necesary
139
				if ($name_used_in_source_link_to_show && ($description || $sourceRefs)){
140
					$out .= ': ';
141
				}
142
				$out .= $description . $sourceRefs . theme('cdm_annotations_as_footnotekeys', $element) . '</li>';
143
			//special handling for flora malesiana TODO: possible better way to implement this case?
144
			}else{
145
				if ($name_used_in_source_link_to_show){
146
					$name_used_in_source_link_to_show = ' (name in source: '. $name_used_in_source_link_to_show . ')';
147
				}
148
				$out = $description . $sourceRefs . $name_used_in_source_link_to_show;
149
			}
150
		}
151
	}
152

    
153
    //if no sources, print the description
154
    if(!isset($out)) {
155
      $out = $description;
156
    }
157
    //printing annotations footnotes
158
    $out .= theme('cdm_annotations_as_footnotekeys', $element);
159
/*
160
	if ($feature_uuid == UUID_NAME_USAGE){
161
		foreach($element->sources as $source){
162
			$referenceCitation = cdm_ws_get(CDM_WS_NOMENCLATURAL_REFERENCE_CITATION,
163
			                                array($source->citation->uuid),
164
								            "microReference=".urlencode($source->citationMicroReference));
165
			$referenceCitation = $referenceCitation->String;
166
			if($description && strlen($description) > 0 && $referenceCitation ){
167
				$sourceRefs .= ' ('.$referenceCitation.')' ;
168
			}else if ($referenceCitation){
169
				$sourceRefs = $referenceCitation;
170
			}
171
		}
172
	}else{
173
		foreach($element->sources as $source){
174
			$referenceCitation = theme('cdm_DescriptionElementSource',
175
		                               $source,
176
								       ($feature_uuid == UUID_NAME_USAGE) ? false : true);
177
			if($description && strlen($description) > 0 && $referenceCitation ){
178
				$sourceRefs .= ' ('.$referenceCitation.')' ;
179
			}else if ($referenceCitation){
180
				$sourceRefs = $referenceCitation;
181
			}
182
		}
183
	}
184

    
185
	if(strlen($sourceRefs) > 0){
186
		$sourceRefs = '<span class="sources">' . $sourceRefs . '</span>';
187
	}
188

    
189
	if ($source->nameUsedInSource->uuid && ($feature_uuid != UUID_NAME_USAGE)){
190
	//do a link to name page
191
		$name_used_in_source_link_to_show = l($source->nameUsedInSource->titleCache,
192
											  path_to_name($source->nameUsedInSource->uuid),
193
											  array(), NULL, NULL, FALSE ,TRUE);
194
	}else if ($source->nameUsedInSource->uuid && ($feature_uuid == UUID_NAME_USAGE)){
195
	//do not do link for NAME USAGE feature
196
		$name_used_in_source_link_to_show = $source->nameUsedInSource->titleCache;
197
	}else if (strlen($source->nameUsedInSource->originalNameString) > 0){
198
	//show a text without link
199
		$name_used_in_source_link_to_show = $source->nameUsedInSource->originalNameString;
200
	}
201

    
202
	if($asListElement && ($feature_uuid == UUID_NAME_USAGE)){
203
		$out = '<li class="descriptionText">' . $name_used_in_source_link_to_show;
204
		//adding ":" if necesary
205
		if ($name_used_in_source_link_to_show && ($description || $sourceRefs)){
206
			$out .= ': ';
207
		}
208
		$out .= $description . $sourceRefs . theme('cdm_annotations_as_footnotekeys', $element) . '</li>';
209
	}else if ($asListElement){
210
		$out = '<li class="descriptionText">' . $name_used_in_source_link_to_show;
211
		//adding ":" if necesary
212
		if ($name_used_in_source_link_to_show && ($description || $sourceRefs)){
213
			$out .= ': ';
214
		}
215
		$out .= $description . $sourceRefs . theme('cdm_annotations_as_footnotekeys', $element) . '</li>';
216
	//special handling for flora malesiana TODO: possible better way to implement this case?
217
	}else{
218
		if ($name_used_in_source_link_to_show){
219
			$name_used_in_source_link_to_show = ' (name in source: '. $name_used_in_source_link_to_show . ')';
220
		}
221
		$out = $description . $sourceRefs . $name_used_in_source_link_to_show;
222
		$out .= theme('cdm_annotations_as_footnotekeys', $element);
223
	}
224
*/
225
	// add annotations as footnote key
226
	//$out .= theme('cdm_annotations_as_footnotekeys', $element); move above
227

    
228
	return $out;
229
}
230

    
231

    
232

    
233

    
234

    
235

    
236
function garland_cichorieae_cdm_taxon_page_images($taxon, $media){
237

    
238
	$flashLink = isset($media[0]);
239

    
240
	if($flashLink){
241

    
242
		$taggedName = $taxon->name->taggedName;
243

    
244
		$nameArray = array();
245
		foreach($taggedName as $taggedText){
246
			if($taggedText->type == 'name'){
247
				$nameArray[] = $taggedText->text;
248
			}
249
		}
250

    
251
		$query = join("%5F", $nameArray) . '%20AND%20EditWP6%20AND%20jpg';
252

    
253
		$out = '
254

    
255
<script type="text/javascript" src="http://media.bgbm.org/erez/js/fsiwriter.js"></script>
256

    
257
<script type="text/javascript">
258
<!--
259
	writeFlashCode( "http://media.bgbm.org/erez/fsi/fsi.swf?&cfg=showcase_presets/showcase_info.fsi&effects=%26quality%3D95&showcase_query='.$query.'&skin=silver&showcase_labeltextheight=50&textbox_textfrom=IPTC_WP6&textbox_height=50&param_backgroundcolor=454343&publishwmode=opaque&showcase_hscroll=true&showcase_basecolor=454343&plugins=textbox,fullscreen",
260
		"http://media.bgbm.org/erez/erez?src=erez-private/flashrequired.svg&tmp=Large&quality=97&width=620&height=400",
261
		"width=620;height=400;bgcolor=454343;wmode=opaque");
262
// -->
263
</script>
264
<noscript>
265
	<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,65,0" width="470" height="400">
266
		<param name="movie" value="http://media.bgbm.org/erez/fsi/fsi.swf?&cfg=showcase_presets/showcase_info.fsi&effects=%26quality%3D95&showcase_query='.$query.'&skin=silver&showcase_labeltextheight=50&textbox_textfrom=IPTC_WP6&textbox_height=50&param_backgroundcolor=454343&publishwmode=opaque&showcase_hscroll=true&showcase_basecolor=454343plugins=textbox,fullscreen"/>
267
		<param name="bgcolor" value="454343" />
268
		<param name="wmode" value="opaque" />
269
		<param name="allowscriptaccess" value="always" />
270
		<param name="allowfullscreen" value="true" />
271
		<param name="quality" value="high" />
272
		<embed src="http://media.bgbm.org/erez/fsi/fsi.swf?&cfg=showcase_presets/showcase_info.fsi&effects=%26quality%3D95&showcase_query='.$query.'&skin=silver&showcase_labeltextheight=50&textbox_textfrom=IPTC_WP6&textbox_height=50&param_backgroundcolor=454343&publishwmode=opaque&showcase_hscroll=true&showcase_basecolor=454343plugins=PrintSave,textbox,fullscreen"
273
			width="620"
274
			height="400"
275
			bgcolor="454343"
276
			wmode="opaque"
277
			allowscriptaccess="always"
278
			allowfullscreen="true"
279
			quality="high"
280
			type="application/x-shockwave-flash"
281
			pluginspage="http://www.adobe.com/go/getflashplayer">
282
		</embed>
283
	</object>
284

    
285
</noscript>';
286

    
287
	}else{
288
		$out = 'No images available.';
289

    
290
	}
291
	return $out;
292
}
293

    
294
function garland_cichorieae_cdm_taxon_page_images_cichorieae_copyright(){
295
	$default_theme = variable_get('theme_default', 'garland_cichorieae');
296
	if ($default_theme == 'cyprus'){
297
		$out = '<div id="cyprus-copyright">';
298
        $out .= '<p>';
299
        //$out .= '&copy; Images used on this website remain copyright of the individual photographer.<br> To obtain permission to use images in publications or websites please contact the network at <a href="edit-wp6-cichorieae@bgbm.org">edit-wp6-cichorieae@bgbm.org</a>. Images may be used for personal use, such as PowerPoint presentations, without permission.';
300
        $out .= '&copy; Images used on this website remain copyright of the individual photographer.<br> To obtain permission to use images in publications or websites please contact the editors at <a href="r.hand@bgbm.org">r.hand@bgbm.org</a>. Images may be used for personal use, such as PowerPoint presentations, without permission.';
301
        $out .= '</p>';
302
        $out .= '</div>';
303
	}else{
304
		$out = '<div id="cichorieae-copyright">';
305
        $out .= '<p>';
306
        $out .= '&copy; Images used on this website remain copyright of the individual photographer.<br> To obtain permission to use images in publications or websites please contact the network at <a href="edit-wp6-cichorieae@bgbm.org">edit-wp6-cichorieae@bgbm.org</a>. Images may be used for personal use, such as PowerPoint presentations, without permission.';
307
        $out .= '</p>';
308
        $out .= '</div>';
309
	}
310

    
311

    
312
	return $out;
313
}
314

    
315
/**
316
 * @overrides theme_cdm_taggedtext2html in order to replace t.infr and t.infgen. with '[unranked]'
317
 */
318
function garland_cichorieae_cdm_taggedtext2html(array &$taggedtxt, $tag = 'span', $glue = ' ', $skiptags = array()){
319
	$out = '';
320
	$i = 0;
321
	foreach($taggedtxt as $tt){
322
		if(!in_array($tt->type, $skiptags) && strlen($tt->text) > 0){
323
			$out .= (strlen($out) > 0 && ++$i < count($taggedtxt)? $glue : '').'<'.$tag.' class="'.$tt->type.'">';
324
			if($tt->type == "rank" && ($tt->text == "t.infr." || $tt->text == "t.infgen.")){
325
				$out .= t('[unranked]');
326
			}else{
327
				$out .= t($tt->text);
328
			}
329
			$out .= '</'.$tag.'>';
330
		}
331
	}
332
	return $out;
333
}
334

    
335
function garland_cichorieae_cdm_descriptionElementArray($elementArray, $feature, $glue = '', $sortArray = false, $enclosingHtml = 'ul'){
336
	$enclosingHtml = 'div';
337
	$out = '<'.$enclosingHtml.' class="description" id="'.$feature->representation_L10n.'">';
338

    
339
	if($sortArray) sort($elementArray);
340

    
341
	$out .= join($elementArray, $glue);
342

    
343
	$out .= '</'.$enclosingHtml.'>';
344
	return $out;
345
}
346

    
347

    
348
/**
349
 * all reference links switched of
350
 */
351
function garland_cichorieae_cdm_nomenclaturalReferenceSTO($referenceSTO, $doLink = FALSE, $cssClass = '', $separator = '<br />' , $enclosingTag = 'li'){
352

    
353
	$doLink = FALSE;
354

    
355
	if(isset($referenceSTO->microReference)){
356
		// it is a ReferenceTO
357
		$nomref_citation = theme('cdm_fullreference', $referenceSTO);
358
	} else {
359
		// it is ReferenceSTO
360
		$nomref_citation = $referenceSTO->fullCitation;
361
	}
362

    
363
	$is_IN_reference = str_beginsWith($nomref_citation, 'in');
364

    
365
	if($doLink){
366
		$nomref_citation = l($nomref_citation, "/cdm_dataportal/reference/".$referenceSTO->uuid, array(), NULL, NULL, FALSE, TRUE);
367
	}
368

    
369
	if(!empty($nomref_citation)){
370
		$nomref_citation = ($is_IN_reference ? '&nbsp;':',&nbsp;') . $nomref_citation;
371
	}
372

    
373
	return $nomref_citation;
374
}
375

    
376

    
377
/***** GARLAND OVERRIDES ******/
378

    
379
/**
380
 * Sets the body-tag class attribute.
381
 *
382
 * Adds 'sidebar-left', 'sidebar-right' or 'sidebars' classes as needed.
383
 */
384
function phptemplate_body_class($sidebar_left, $sidebar_right) {
385
	if ($sidebar_left != '' && $sidebar_right != '') {
386
		$class = 'sidebars';
387
	}
388
	else {
389
		if ($sidebar_left != '') {
390
			$class = 'sidebar-left';
391
		}
392
		if ($sidebar_right != '') {
393
			$class = 'sidebar-right';
394
		}
395
	}
396

    
397
	if (isset($class)) {
398
		print ' class="'. $class .'"';
399
	}
400
}
401

    
402
/**
403
 * Return a themed breadcrumb trail.
404
 *
405
 * @param $breadcrumb
406
 *   An array containing the breadcrumb links.
407
 * @return a string containing the breadcrumb output.
408
 */
409
function phptemplate_breadcrumb($breadcrumb) {
410
	if (!empty($breadcrumb)) {
411
		return '<div class="breadcrumb">'. implode(' › ', $breadcrumb) .'</div>';
412
	}
413
}
414

    
415
/**
416
 * Allow themable wrapping of all comments.
417
 */
418
function phptemplate_comment_wrapper($content, $type = null) {
419
	static $node_type;
420
	if (isset($type)) $node_type = $type;
421

    
422
	if (!$content || $node_type == 'forum') {
423
		return '<div id="comments">'. $content . '</div>';
424
	}
425
	else {
426
		return '<div id="comments"><h2 class="comments">'. t('Comments') .'</h2>'. $content .'</div>';
427
	}
428
}
429

    
430
/**
431
 * Override or insert PHPTemplate variables into the templates.
432
 */
433
function _phptemplate_variables($hook, $vars) {
434
	if ($hook == 'page') {
435

    
436
		if ($secondary = menu_secondary_local_tasks()) {
437
			$output = '<span class="clear"></span>';
438
			$output .= "<ul class=\"tabs secondary\">\n". $secondary ."</ul>\n";
439
			$vars['tabs2'] = $output;
440
		}
441

    
442
		// Hook into color.module
443
		if (module_exists('color')) {
444
			_color_page_alter($vars);
445
		}
446
		return $vars;
447
	}
448
	return array();
449
}
450

    
451
/**
452
 * Returns the rendered local tasks. The default implementation renders
453
 * them as tabs.
454
 *
455
 * @ingroup themeable
456
 */
457
function phptemplate_menu_local_tasks() {
458
	$output = '';
459

    
460
	if ($primary = menu_primary_local_tasks()) {
461
		$output .= "<ul class=\"tabs primary\">\n". $primary ."</ul>\n";
462
	}
463

    
464
	return $output;
465
}
466

    
467
function garland_cichorieae_get_partDefinition($nameType){
468
	if($nameType == 'BotanicalName'){
469
		return array(
470
        'namePart' => array(
471
          'name' => true
472
		),
473
        'nameAuthorPart' => array(
474
          'name' => true,
475
          'authors' => true
476
		),
477
        'referencePart' => array(
478
          'reference' => true,
479
          'microreference' => true,
480
		),
481
        'statusPart' => array(
482
          'status' => true,
483
		),
484
        'descriptionPart' => array(
485
          'description' => true,
486
		),
487
		);
488
	}
489
	return false;
490
}
491

    
492
function garland_cichorieae_get_nameRenderTemplate($renderPath){
493

    
494
	switch($renderPath) {
495
		case 'taxon_page_title':
496
		case 'polytomousKey':
497
			$template = array(
498
            'namePart' => array('#uri'=>true)
499
			);
500
			break;
501
		case 'taxon_page_synonymy':
502
		case 'related_taxon':
503
			$template = array(
504
          'nameAuthorPart' => array('#uri'=>true),
505
          'referencePart' => true,
506
          'statusPart' => true,
507
          'descriptionPart' => true
508
			);
509
			break;
510
		case 'acceptedFor':
511
			$template = array(
512
            'nameAuthorPart' => array('#uri'=>true),
513
            'referencePart' => true
514
			);
515
			break;
516
		case 'typedesignations':
517
		case 'list_of_taxa':
518
		case '#DEFAULT':
519
			$template = array(
520
            'nameAuthorPart' => array('#uri'=>true),
521
            'referencePart' => true
522
			);
523
	}
524
	return $template;
525
}
526

    
527
/**
528
 */
529
function garland_cichorieae_cdm_taxon_list_thumbnails($taxon){
530

    
531
	$gallery_name = $taxon->uuid;
532

    
533
	$showCaption = variable_get('cdm_dataportal_findtaxa_show_thumbnail_captions', 0);
534
	$prefMimeTypeRegex = 'image:.*';
535
	$prefMediaQuality = '*';
536
	$cols = variable_get('cdm_dataportal_findtaxa_media_cols', 3);
537
	$maxRows = variable_get('cdm_dataportal_findtaxa_media_maxRows', 1);
538
	$maxExtend = variable_get('cdm_dataportal_findtaxa_media_maxextend', 120);
539

    
540
	if($showCaption){
541
		$captionElements = array('title', '#uri'=>t('open Image'));
542
	}
543

    
544
	$galleryLinkUri = path_to_taxon($taxon->uuid, true).'/images';
545
	$mediaList = cdm_ws_get(CDM_WS_PORTAL_TAXON_MEDIA, array($taxon->uuid, $prefMimeTypeRegex, $prefMediaQuality));
546
	$out .= theme('cdm_media_gallerie', $mediaList, $gallery_name ,$maxExtend, $cols, $maxRows, $captionElements, 'NORMAL', $galleryLinkUri, null);
547

    
548
	return $out;
549
}
550

    
551
function garland_cichorieae_cdm_feature_name($feature_name){
552
  switch($feature_name){
553
    case "Protologue": return t("Original Publication");
554
    default: return t(ucfirst($feature_name));
555
  }
556
}
557

    
558
/* ======================== Special functions for subtheme handling ================  */
559

    
560
function sub_theme() {
561
	global $user, $custom_theme;
562

    
563
	// Only select the user selected theme if it is available in the
564
  // list of enabled themes.
565
  $theme = $user->theme && $themes[$user->theme]->status ? $user->theme : variable_get('theme_default', 'garland');
566

    
567
  // Allow modules to override the present theme... only select custom theme
568
  // if it is available in the list of installed themes.
569
  $theme = $custom_theme && $themes[$custom_theme] ? $custom_theme : $theme;
570

    
571
  return $theme;
572
}
573

    
574

    
575
/**
576
 * Return the path to the currently selected sub theme.
577
 */
578
function path_to_sub_theme() {
579
  $themes = list_themes();
580
  $theme = sub_theme();
581
  return dirname($themes[$theme]->filename);
582
}
(12-12/13)