<?php

class Zend_View_Helper_GetFlag extends Zend_View_Helper_Abstract {

  /**
   * get the full url to the language flag
   * check if the flag is enable
   * @param Boolean $active
   * @return String
   */
  public function getFlag($language, $active = TRUE){
    $path = BASE_URL."cms/assets/images/flags/";
    if($active){
      return $path.$language->icon;
    }
    // get the flag parts
    $flag_parts = explode(".", $language->icon);
    return $path.$flag_parts[0]."_off.".$flag_parts[1];
  }

}