Overview

Classes

  • CMLLanguage
  • CMLPost
  • CMLTranslations
  • CMLUtils

Functions

  • cml_dropdown_langs
  • cml_get_browser_lang
  • cml_get_menu
  • cml_get_notice
  • cml_get_the_link
  • cml_is_homepage
  • cml_show_flags
  • Overview
  • Function
  • Tree
  1: <?php
  2: /**
  3:  * Check if current url ( or $url ) is the homepage
  4:  *
  5:  * If is set a static page as homepage, the plugin check if
  6:  * current page is front page or its translation
  7:  *
  8:  * @param string $url - ( optional ) url to check
  9:  * 
 10:  */
 11: function cml_is_homepage( $url = null ) {
 12:   global $wpdb;
 13: 
 14:   if( ! empty( $wpdb ) && method_exists( $wpdb, 'is_category' ) ) {
 15:     if( is_category() || is_archive() ) return false;
 16:   }
 17: 
 18:   //Controllo se è stata impostata una pagina "statica" se l'id di questa è = a quello della statica
 19:   if( cml_use_static_page() ) {
 20:     global $wp_query;
 21:     $static_id = array( get_option( "page_for_posts" ), get_option( "page_on_front" ) );
 22: 
 23:     $lang_id = CMLLanguage::get_current_id();
 24: 
 25:     /*
 26:      * on some site get_queried_object_id isn't available on start
 27:      * and I get:
 28:      * Fatal error: Call to a member function get_queried_object_id() on a non-object
 29:      *
 30:      * So ensure that method exists, otherwise I use get_the_ID() method
 31:      */
 32:     /*
 33:      * If I call get_queried_object_id in the footer can happens that
 34:      * queried_object_id is different from "real" queried_object,
 35:      * so I store that info in $GLOBALS to avoid this problem :)
 36:      */
 37:     if( ! isset( $GLOBALS[ '_cml_get_queried_object_id' ] ) ) {
 38:       if( ! empty( $wpdb ) && method_exists( $wpdb, 'get_queried_object' ) ) {
 39:         $GLOBALS[ '_cml_get_queried_object_id' ] = get_queried_object()->ID;
 40:         $GLOBALS[ '_cml_get_queried_object' ] = get_queried_object();
 41: 
 42:         $the_id = & $GLOBALS[ '_cml_get_queried_object_id' ];
 43:       } else {
 44:         if( is_object( get_post() ) ) {
 45:           $the_id = get_the_ID();
 46:           
 47:           $GLOBALS[ '_cml_get_queried_object_id' ] = $the_id;
 48:         }
 49:       }
 50:     } else {
 51:       $the_id = $GLOBALS[ '_cml_get_queried_object_id' ];
 52:     }
 53: 
 54:     if( ! empty( $the_id ) ) {
 55:       if( in_array( $the_id, $static_id ) ) return true;    //Yes, it is :)
 56: 
 57:       //Is a translation of front page?
 58:       $linked = CMLPost::get_translation( CMLLanguage::get_current_id(), $the_id  );
 59:       if( ! empty( $linked ) ) {
 60:         return in_array( $linked, $static_id );
 61:       }
 62:     }
 63:   }
 64: 
 65:   //I can't use is_home(), because it return empty value, so I have to check
 66:   //it manually
 67:   if( ! empty( $wpdb ) && method_exists( $wpdb, 'is_home' ) ) {
 68:     return is_home();
 69:   }
 70: 
 71:   //Remove language information by url
 72:   CMLUtils::clear_url();
 73: 
 74:   return trailingslashit( CMLUtils::get_clean_url() ) == trailingslashit( CMLUtils::home_url() );
 75: }
 76: 
 77: /**
 78:  * @ignore
 79:  * @internal
 80:  *
 81:  * get page by path
 82:  *
 83:  * On some site I can't use url_to_postid() because
 84:  * $wp_reqruite is empty...
 85:  * 
 86:  */
 87: function cml_get_page_id_by_path($url, $types = null) {
 88:   $url = untrailingslashit( $url );
 89:   $plinks = explode( "/", $url );
 90: 
 91:   if( $types == null ) {
 92:     $types = array_keys( get_post_types() );
 93:   }
 94: 
 95:   $p = cml_get_page_by_path( $url, OBJECT, $types );
 96:   $the_id = is_object( $p ) ? $p->ID : 0;
 97: 
 98:   return $the_id;
 99: }
100: 
101: /**
102:  * @ignore
103:  * @internal
104:  *
105:  * This is modified version of wordpress function get_page_by_path,
106:  * because original one doesn't works correctly for me
107:  *
108:  * @since 2.1.0
109:  * @uses $wpdb
110:  *
111:  * @param string $page_path Page path
112:  * @param string $output Optional. Output type. OBJECT, ARRAY_N, or ARRAY_A. Default OBJECT.
113:  * @param array $post_type Optional. Post type. Default page.
114:  * @return WP_Post|null WP_Post on success or null on failure
115:  */
116: function cml_get_page_by_path($page_path, $output = OBJECT, $post_type = array('page')) {
117:     global $wpdb;
118: 
119:     $page_path = rawurlencode(urldecode($page_path));
120:     $page_path = str_replace('%2F', '/', $page_path);
121:     $page_path = str_replace('%20', ' ', $page_path);
122:     $parts = explode( '/', trim( $page_path, '/' ) );
123:     $parts = array_map( 'esc_sql', $parts );
124:     $parts = array_map( 'sanitize_title_for_query', $parts );
125: 
126:     $in_string = "'". implode( "','", $parts ) . "'";
127:     $post_type_sql = implode( "','", $post_type );
128: //     $wpdb->escape_by_ref( $post_type_sql );
129: 
130:     if( empty( $in_string ) ) {
131:       return;
132:     }
133: 
134:     $query = "SELECT ID, post_name, post_parent, post_type FROM $wpdb->posts WHERE post_name IN ($in_string) AND (post_type IN ( '$post_type_sql' ) ) AND post_status = 'publish'";
135:     $pages = $wpdb->get_results( $query, OBJECT_K );
136:     $revparts = array_reverse( $parts );
137: 
138:     $foundid = 0;
139:     foreach ( (array) $pages as $page ) {
140:         if ( $page->post_name == $revparts[0] ) {
141:             $count = 0;
142:             $p = $page;
143: 
144:             while ( $p->post_parent != 0 && isset( $pages[ $p->post_parent ] ) ) {
145:                 $count++;
146:                 $parent = $pages[ $p->post_parent ];
147:                 if ( ! isset( $revparts[ $count ] ) || $parent->post_name != $revparts[ $count ] )
148:                     break;
149:                 $p = $parent;
150:             }
151: 
152:             //if ( $p->post_parent == 0 && $count + 1 == count( $revparts ) && $p->post_name == $revparts[ $count ] ) {
153:             if ( $p->post_parent == 0 && $p->post_name == $revparts[ $count ] ) {
154:               $foundid = $page->ID;
155:               if ( $page->post_type == $post_type )
156:                   break;
157:             }
158:         }
159:     }
160: 
161:     if ( $foundid )
162:         return get_post( $foundid, $output );
163: 
164:     return null;
165: }
166: 
167: /**
168:  * return link of current page in according to selected $language, so if $result != current language
169:  * this function will return its translation link.
170:  *
171:  * @param stdObject $result - language object ( i.e. CMLLanguage::get_default() ) used to translate current link
172:  * @param boolean $linked - true, return linked translation, false return homepage link
173:  * @param boolean $only_existings - return linked post only if it exists, otherwise return blank link
174:  * @param boolean $queried - use get_queried_object_id instead of get_the_ID
175:  *
176:  * return string
177:  */
178: function cml_get_the_link( $result, $linked = true, $only_existings = false, $queried = false ) {
179:   global $wpCeceppaML, $_cml_settings;
180: 
181:   if( defined( 'CML_DEBUG' ) && isset( $_GET[ 'cdb' ] ) ) {
182:     echo "queried: $queried<br />";
183:     echo "is_home: " . cml_is_homepage() . "<br />";
184:   }
185:   if( $queried && ( cml_is_homepage() || is_search() ) ) { //&& cml_use_static_page() ) {
186:     //current page is homepage?
187:     $link = CMLUtils::get_home_url( $result->cml_language_slug );
188: 
189:     if( is_search() ) {
190:       if( isset( $_GET[ 's' ] ) ) {
191:         $args[ 's' ] = esc_attr( $_GET[ 's' ] );
192:       }
193: 
194:       if( CMLUtils::get_url_mode() <= PRE_LANG ) {
195:         $args[ 'lang' ] = $result->cml_language_slug;
196:       }
197: 
198:       $link = add_query_arg( $args, trailingslashit( $link ) );
199:     }
200:   } else {
201:     $GLOBALS[ '_cml_force_home_slug' ] = $result->cml_language_slug;
202: 
203:     //I have to force language to $result one
204:     $wpCeceppaML->force_category_lang( $result->id );
205: 
206:     if( $queried ) {
207:       if( empty( $GLOBALS[ '_cml_get_queried_object' ] ) ) {
208:         $GLOBALS[ '_cml_get_queried_object' ] = get_queried_object();
209:       }
210:       $q = & $GLOBALS[ '_cml_get_queried_object' ];
211:       
212:       $is_category = isset( $q->taxonomy ) && "category" == $q->taxonomy;
213:       $is_single = isset( $q->ID );
214:       $is_page = $is_single;
215:       $the_id = ( $is_single ) ? $q->ID : 0;
216:       $is_tag = isset( $q->taxonomy ) && "post_tag" == $q->taxonomy;
217: 
218:       if( empty( $q ) ) {
219:         $is_404 = is_404();
220:       }
221:     } else {
222:       $is_category = is_category();
223:       $is_single = is_single();
224:       $is_page = is_page();
225:       $the_id = get_the_ID();
226:       $is_404 = is_404();
227:       $is_tag = is_tag();
228:     }
229: 
230:     /* Collego la categoria della lingua attuale con quella della linga della bandierina */
231:     $link = "";
232: 
233:     if( ! in_the_loop() ) {
234:       $lang_id = CMLLanguage::get_current_id();
235:     } else
236:       $lang_id = CMLLanguage::get_id_by_post_id( $the_id );
237: 
238:     /*
239:      * I must check that is_category is false, or wp will display 404
240:      * is_single is true also for category and in this case
241:      * the plugin will return wrong link
242:      */
243:     if( ( ( $is_single || $is_page ) ||  $linked ) && ! $is_category ) {
244:       $linked_id = CMLPost::get_translation( $result->id, $the_id );
245: 
246:       if( ! empty( $linked_id ) ) {
247:         $link = get_permalink( $linked_id );
248:         $link = CMLPost::remove_extra_number( $link, get_post( $linked_id ) );
249: 
250:         if( CMLUtils::_get( '_real_language' ) != CMLLanguage::get_current_id()
251:             && $linked_id == $the_id ) {
252: 
253:           if( CMLUtils::get_url_mode() == PRE_PATH ) {
254:             $link = $wpCeceppaML->convert_url( $link, $result->cml_language_slug );
255:           }
256:         }
257:       }
258:     }
259: 
260:     if( is_archive() && ! $is_category && ! is_post_type_archive() ) {
261:       global $wp;
262: 
263:       $link = trailingslashit( home_url( $wp->request ) );
264: 
265:       if( CMLUtils::get_url_mode() == PRE_NONE ||
266:           CMLUtils::get_url_mode() == PRE_LANG ) {
267:         $link = add_query_arg( array( "lang" => $result->cml_language_slug ), $link );
268:       }
269:     }
270: 
271:     //Collego le categorie delle varie lingue
272:     if( $is_category ) {
273:       if( $queried && isset( $q->term_id ) ) {
274:         $cat = array( "term_id" => $q->term_id );
275:       } else {
276:         $cat = get_the_category();
277:       }
278: 
279:       if( is_array( $cat ) ) {
280:         $cat_id = ( isset( $cat[ 'term_id' ] ) ) ? $cat[ 'term_id' ] : ( $cat[ count($cat) - 1 ]->term_id );
281: 
282:         //Mi recupererà il link tradotto dal mio plugin ;)
283:         CMLUtils::_set( '_force_category_lang', $result->id );
284:         $link = get_category_link( $cat_id );
285:         
286:         CMLUtils::_del( '_force_category_lang' );
287:       } //endif;
288:     }
289:     
290:     if( $queried && $is_tag ) { //&& false !== strpos( CMLUtils::get_clean_url(), "/tag/" ) ) ) {
291:       if( ! empty( $q ) ) {
292:         $term_id = $q->term_id;
293:       } else {
294:         $term_id = CMLUtils::_get( "_reverted" );
295:       }
296: 
297:       if( ! empty( $term_id ) ) {
298:         CMLUtils::_set( '_force_category_lang', $result->id );
299: 
300:         $link = get_tag_link( $term_id );
301: 
302:         CMLUtils::_del( '_force_category_lang' );
303:       }
304:     }
305: 
306:     if( is_paged() ) {
307:       $link = add_query_arg( array( "lang" => $result->cml_language_slug ) );
308:     }
309: 
310:     unset( $GLOBALS[ '_cml_force_home_slug' ] );
311:     $wpCeceppaML->unset_category_lang();
312: 
313:     /* Controllo se è stata impostata una pagina statica,
314:         perché così invece di restituire il link dell'articolo collegato
315:         aggiungo il più "bello" ?lang=## alla fine della home.
316: 
317:         Se non ho trovato nesuna traduzione per l'articolo, la bandiera punterà alla homepage
318:     */
319:     if( empty( $link ) && ! $only_existings ) {
320:       if( 1 === CMLUtils::_get( "is_crawler" ) ) {
321:         return;
322:       }
323: 
324:       //If post doesn't exists in current language I'll return the link to default language, if exists :)
325:       if( $_cml_settings[ 'cml_force_languge' ] == 1 ) {
326:         /*
327:          * return translation, if exists :)
328:          */
329:         if( is_single() || is_page() ) {
330:           $l = cml_get_linked_post( $the_id, CMLLanguage::get_default_id() );
331:           // if( ! empty( $l ) ) return get_permalink( $l );
332:         }
333: 
334:         /*
335:          * no translation found, and user choosed to force page to flag language,
336:          * I add parameter "lang=##" to url
337:          */
338:         $link = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
339:         if( CMLPost::get_language_by_id( $the_id ) != $result->id ) {
340:           $link = add_query_arg( array( "lang" => $result->cml_language_slug ), $link );
341:         }
342:       } else {
343:         $link = CMLUtils::get_home_url( $result->cml_language_slug );
344:       }
345: 
346:       if( ( $is_tag || ( isset( $is_404 ) && $is_404 ) ) && CMLUtils::get_url_mode() > PRE_LANG ) {
347:         $clean = CMLUtils::get_clean_url();
348:         $url = CMLUtils::home_url();
349:         
350:         //Change slug in url instead of append ?lang arg
351:         $link = str_replace( $url, "", $clean );
352:         $link = CMLUtils::get_home_url( $result->cml_language_slug ) . $link;
353:       }
354:     }
355:   }
356: 
357:   return $link;
358: }
359: 
360: /**
361:  * @ignore
362:  * @internal
363:  *
364:  * use static page?
365:  */
366: function cml_use_static_page() {
367:   return (get_option("page_for_posts") > 0) ||
368:       (get_option("page_on_front") > 0);
369: }
370: 
371: /**
372:  * grab browser language
373:  *
374:  * @return string
375:  */
376: function cml_get_browser_lang() {
377:   if( isset( $GLOBALS[ '_browser_lang' ] ) ) return $GLOBALS[ '_browser_lang' ];
378: 
379:   global $wpdb;
380: 
381:   $browser_langs = @explode( ";", $_SERVER['HTTP_ACCEPT_LANGUAGE'] );
382:   $lang = null;
383: 
384:   //Se la lingua del browser coincide con una di quella attuale della pagina, ignoro tutto
385:   foreach( $browser_langs as $blang ) {
386:     @list( $code1, $code2 ) = explode( ",", $blang );
387: 
388:     $locale[] = str_replace( "-", "_", $code1 );
389:     $locale[] = str_replace( "-", "_", $code2 );
390: 
391:     //Per ogni codice che trovo verifico se è gestito, appena ne trovo 1 mi fermo
392:     //Perché il mio browser mi restituisce sia it-IT, che en-EN, quindi mi devo fermare appena trovo un riscontro
393:     //Senno mi ritrovo sempre la lingua en-EN come $browser_langs;
394:     $i = 0;
395:     while( empty( $lang ) && $i < count( $locale ) ) {
396:       $l = $locale[$i];
397:     
398:       if( strlen( $l ) > 2 ) {
399:         $lang = CMLLanguage::get_id_by_locale( $l );
400:       } else {
401:         //Se ho solo 2 caratteri, cerco negli "slug"
402:         $lang = CMLLanguage::get_id_by_slug( $l );
403:       }
404:     
405:       $i++;
406:     } //endwhile;
407: 
408:     if( ! empty ($lang ) ) {
409:       break;
410:     }
411:   }  //endforeach;
412: 
413:   $GLOBALS[ '_browser_lang' ] = $lang;
414: 
415:   return $lang;
416: }
417: 
418: /**
419:  * return post/page notice in selected language
420:  *
421:  * @param sting $lang_slug - language slug
422:  * 
423:  * @return string return translated notice
424:  */
425: function cml_get_notice( $lang ) {
426:   global $wpdb, $wpCeceppaML;
427: 
428:   //$type - type of notice ( post or page )
429:   $type = ( is_single() ) ? "post" : "page";
430: 
431:   $r = CMLTranslations::get( $lang,
432:                             "_notice_$type",
433:                             "N", true, true );
434: 
435:   if( ! empty( $r ) )
436:     return $r;
437:   else
438:     CMLLanguage::get_current()->cml_language;
439: }
440: 
441: /**
442:  * Return flag &lt;ul&gt;&lt;li&gt;....&lt;/li&gt;&lt;/ul&gt; list
443:  *
444:  * @param array $args is parameters list:
445:  *              <ul>
446:  *                <li>
447:  *                  show ( string ) - choose what to display:<br />
448:  *                  <i>default: text</i>
449:  *                </li>
450:  *                <ul>
451:  *                   <li>text: show only language name</li>
452:  *                   <li>slug: show language slug</li>
453:  *                   <li>none: show no text</li>
454:  *               </ul>
455:  *               <li>
456:  *                show_flag ( boolean ) - show flag?<br />
457:  *                <i>default: true</i>
458:  *               </li>
459:  *               <li>size ( string ) - flag size<br />
460:  *                you can use constants:<br />
461:  *                  CML_FLAG_TINY ( 16x11 )<br />
462:  *                  CML_FLAG_SMALL ( 32x23 )<br />
463:  *                  <i>default: CML_FLAG_TINY</i>
464:  *                <ul>
465:  *                  <li>tiny</li>
466:  *                  <li>small</li>
467:  *                </ul>
468:  *               <li>
469:  *                class_name ( string ) - secondary classname to assign to the list
470:  *                <i>default: ""</i>
471:  *                generated &gt;ul&lt; list has primary class "cml_flags", with that parameter you
472:  *                can assign a secondary one.
473:  *               </li>
474:  *               <li>
475:  *                echo ( boolean ) - If true print list, otherwise return string containing generated list<br />
476:  *                <i>default: true</i>
477:  *               </li>
478:  *               <li>
479:  *                linked ( boolean ) - If true flags link to current translation, false will link to homepage<br />
480:  *                <i>default: true</i>
481:  *               </li>
482:  *               <li>
483:  *                only_existings ( boolean ) - show only flags in which current page exists.<br />
484:  *                <i>default: false</i>
485:  *               </li>
486:  *               <li>
487:  *                queried ( boolean ) - use queried object instead of get_the_ID() or other methods, so output will be
488:  *                                      generated in according to main query, not current one.
489:  *                <i>default: false</i>
490:  *               <li>
491:  *              </ul>
492:  */
493: function cml_show_flags( $args ) {
494:   global $wpdb;
495: 
496:   $args = extract( shortcode_atts( array(
497:                       "show" => "text",
498:                       "size" => "tiny",
499:                       "class" => "",
500:                       "image_class" => "",
501:                       "echo" => true,
502:                       "linked" => true,
503:                       "only_existings" => false,
504:                       "sort" => false,
505:                       "queried" => false,
506:                       "show_flag" => true,
507:                       ), $args ) );
508: 
509:   $_cml_settings = & $GLOBALS[ '_cml_settings' ];
510:   $redirect = $_cml_settings[ 'cml_option_redirect' ];
511: 
512:   $results = cml_get_languages( true, false );
513:   $width = ( $size == "tiny" ) ? 16 : 32;
514: 
515:   $r = "<ul class=\"cml_flags $class\">";
516:   
517:   //Post language...
518:   $lang_id = ( ! $sort ) ? -1 : CMLPost::get_language_by_id( get_the_ID() );
519:   $items = array();
520: 
521:   foreach($results as $result) {
522:     $lang = ( $show == "text" ) ? $result->cml_language : "";
523:     $lang = ( $show == "slug" ) ? $result->cml_language_slug : $lang;
524: 
525:     $link = cml_get_the_link( $result, $linked, $only_existings, $queried );
526:     if( empty( $link) ) continue;
527: 
528:     if( $show_flag ) {
529:       $img = "<img class=\"$size $image_class\" src='" . cml_get_flag_by_lang_id( $result->id, $size ) . "' title='$result->cml_language' width=\"$width\"/>";
530:     } else {
531:       $img = "";
532:     }
533: 
534:     $class = ( $result->id == CMLLanguage::get_current_id() ) ? "current" : "";
535:     $li = "<li class=\"$class\"><a href=\"$link\">{$img}{$lang}</a></li>";
536:     if( $sort && is_array( $items ) && $result->id == $lang_id ) {
537:       array_unshift( $items, $li );
538:     } else {
539:       $items[] = $li;
540:     }
541: 
542:   } //endforeach;
543: 
544: 
545:   $r .= join( "\n", $items );
546:   $r .= "</ul>";
547: 
548:   if( $echo ) 
549:     echo $r;
550:   else
551:     return $r;
552: }
553: 
554: /**
555:  * @ignore
556:  * 
557:  * Check if current post is a custom post
558:  */
559: function cml_is_custom_post_type() {
560:   $types = get_post_types( array ( '_builtin' => FALSE ), 'names' );
561:   
562:   if( empty( $types) ) return FALSE;
563: 
564:   $name = get_post_type();
565:   return in_array( $name, $types );
566: }
567: 
568: /**
569:  * @ignore
570:  */
571: function removesmartquotes($content) {
572:   $content = str_replace('&#8220;', '&quot;', $content);
573:   $content = str_replace('&#8221;', '&quot;', $content);
574:   $content = str_replace('&#8216;', '&#39;', $content);
575:   $content = str_replace('&#8217;', '&#39;', $content);
576:  
577:   return $content;
578: }
579: 
580: /**
581:  * @ignore
582:  * 
583:  * http://www.cult-f.net/detect-crawlers-with-php/
584:  *
585:  * Questa funzione server per evitare di reindirizzare o nascondere i post nella lingua differente
586:  * da quella del browser se schi stà visitando il sito è un crawler, al fine di permettere l'indicizzazione di tutti
587:  * gli articoli
588:  *
589:  */
590: function isCrawler()
591: {
592:   global $wp_query;
593:   
594:   if( ! empty( $wp_query ) && $wp_query->is_robots() ) {
595:     CMLUtils::_set( "is_crawler", 1 );
596: 
597:     return true;
598:   }
599:   
600:     $USER_AGENT = $_SERVER['HTTP_USER_AGENT'];
601: 
602:     // to get crawlers string used in function uncomment it
603:     // it is better to save it in string than use implode every time
604:     // global $crawlers
605:     // $crawlers_agents = implode('|',$crawlers);
606:     $crawlers_agents = 'Google|msnbot|Rambler|Yahoo|AbachoBOT|accoona|AcioRobot|ASPSeek|CocoCrawler|Dumbot|FAST-WebCrawler|GeonaBot|Gigabot|Lycos|MSRBOT|Scooter|AltaVista|IDBot|eStyle|Scrubby';
607:  
608:     if ( strpos($crawlers_agents , $USER_AGENT) === false )
609:        return false;
610:     // crawler detected
611:     // you can use it to return its name
612:     /*
613:     else {
614:        return array_search($USER_AGENT, $crawlers);
615:     }
616:     */
617:     return true;
618: }
619: 
620: /**
621:  * return the id of menu to use in according to current language
622:  * return value can be used as wp_nav_menu function.
623:  *
624:  * The plugin automatically switch menu in according to current language,
625:  * you can use this function if automatic switch doesn't works with your theme/framework
626:  * or if you to force a theme.
627:  * 
628:  * @example
629:  * <?php;<br />
630:  *  $menu = cml_get_menu();<br />
631:  *  wp_nav_menu(array('theme_location' => $menu));<br />
632:  * ?>
633:  */
634: function cml_get_menu() {
635:   //Restituisco il nome del menù da utilizzare a seconda della lingua
636:   $lang = cml_get_current_language();
637: 
638:   return "cml_menu_" . $lang->cml_language_slug;
639: }
640: ?>
641: 
API documentation generated by ApiGen 2.8.0