Exemplo n.º 1
0
/**
 * @return string
 */
function api_get_jquery_ui_css_web_path()
{
    return Container::getAsset()->getUrl("bundles/chamilocore/components/jquery-ui/themes/smoothness/jquery-ui.min.css");
}
Exemplo n.º 2
0
 /**
  * This public function returns the htmlcode for an icon
  *
  * @param string   The filename of the file (in the main/img/ folder
  * @param string   The alt text (probably a language variable)
  * @param array    Additional attributes (for instance height, width, onclick, ...)
  * @param integer  The wanted width of the icon (to be looked for in the corresponding img/icons/ folder)
  * @return string  An HTML string of the right <img> tag
  *
  * @author Patrick Cool <*****@*****.**>, Ghent University 2006
  * @author Julio Montoya 2010 Function improved, adding image constants
  * @author Yannick Warnier 2011 Added size handler
  * @version Feb 2011
  */
 public static function return_icon($image, $alt_text = '', $additional_attributes = array(), $size = ICON_SIZE_SMALL, $show_text = true, $return_only_path = false, $loadThemeIcon = true)
 {
     $image = trim($image);
     $size_extra = '';
     if (isset($size)) {
         $size_extra = $size . '/';
     }
     $icon = 'bundles/chamilocore/img/icons/' . $size_extra . $image;
     $icon = Container::getAsset()->getUrl($icon);
     if ($return_only_path) {
         return $icon;
     }
     $img = self::img($icon, $alt_text, $additional_attributes);
     if (SHOW_TEXT_NEAR_ICONS == true && !empty($alt_text)) {
         if ($show_text) {
             $img = "{$img} {$alt_text}";
         }
     }
     return $img;
 }
Exemplo n.º 3
0
 /**
  * This public function returns the htmlcode for an icon
  *
  * @param string   The filename of the file (in the main/img/ folder
  * @param string   The alt text (probably a language variable)
  * @param array    Additional attributes (for instance height, width, onclick, ...)
  * @param integer  The wanted width of the icon (to be looked for in the corresponding img/icons/ folder)
  * @return string  An HTML string of the right <img> tag
  *
  * @author Patrick Cool <*****@*****.**>, Ghent University 2006
  * @author Julio Montoya 2010 Function improved, adding image constants
  * @author Yannick Warnier 2011 Added size handler
  * @version Feb 2011
  */
 public static function return_icon($image, $alt_text = '', $additional_attributes = array(), $size = ICON_SIZE_SMALL, $show_text = true, $return_only_path = false)
 {
     $code_path = api_get_path(SYS_IMG_PATH);
     $w_code_path = api_get_path(WEB_CODE_PATH);
     $alternateCssPath = api_get_path(SYS_CSS_PATH);
     $alternateWebCssPath = api_get_path(WEB_CSS_PATH);
     $image = trim($image);
     $theme = 'themes/' . api_get_visual_theme() . '/icons/';
     $size_extra = '';
     if (isset($size)) {
         $size = intval($size);
         $size_extra = $size . '/';
     } else {
         $size = ICON_SIZE_SMALL;
     }
     //Checking the theme icons folder example: app/Resources/public/css/themes/chamilo/icons/XXX
     if (is_file($alternateCssPath . $theme . $size_extra . $image)) {
         $icon = $theme . $size_extra . $image;
     } elseif (is_file($code_path . 'icons/' . $size_extra . $image)) {
         //Checking the main/img/icons/XXX/ folder
         $icon = 'icons/' . $size_extra . $image;
     } else {
         //Checking the img/ folder
         $icon = $image;
     }
     // Special code to enable SVG - refs #7359 - Needs more work
     // The code below does something else to "test out" SVG: for each icon,
     // it checks if there is an SVG version. If so, it uses it.
     // When moving this to production, the return_icon() calls should
     // ask for the SVG version directly
     $testServer = api_get_setting('server_type');
     /*if ($testServer == 'test' && $return_only_path == false) {
                 $svgImage = substr($image, 0, -3) . 'svg';
                 if (is_file($code_path . $theme . 'svg/' . $svgImage)) {
                     $icon = $w_code_path . $theme . 'svg/' . $svgImage;
                 } elseif (is_file($code_path . 'img/icons/svg/' . $svgImage)) {
                     $icon = $w_code_path . 'img/icons/svg/' . $svgImage;
                 }
     
                 if (empty($additional_attributes['height'])) {
                     $additional_attributes['height'] = $size;
                 }
                 if (empty($additional_attributes['width'])) {
                     $additional_attributes['width'] = $size;
                 }
             }*/
     $icon = 'bundles/chamilocore/img/' . $icon;
     $icon = Container::getAsset()->getUrl($icon);
     //$icon = api_get_cdn_path($icon);
     if ($return_only_path) {
         return $icon;
     }
     $img = self::img($icon, $alt_text, $additional_attributes);
     if (SHOW_TEXT_NEAR_ICONS == true and !empty($alt_text)) {
         if ($show_text) {
             $img = "{$img} {$alt_text}";
         }
     }
     return $img;
 }
Exemplo n.º 4
0
 /**
  * This public function returns the htmlcode for an icon
  *
  * @param string   The filename of the file (in the main/img/ folder
  * @param string   The alt text (probably a language variable)
  * @param array    Additional attributes (for instance height, width, onclick, ...)
  * @param integer  The wanted width of the icon (to be looked for in the corresponding img/icons/ folder)
  * @return string  An HTML string of the right <img> tag
  *
  * @author Patrick Cool <*****@*****.**>, Ghent University 2006
  * @author Julio Montoya 2010 Function improved, adding image constants
  * @author Yannick Warnier 2011 Added size handler
  * @version Feb 2011
  */
 public static function return_icon($image, $alt_text = '', $additional_attributes = array(), $size = ICON_SIZE_SMALL, $show_text = true, $return_only_path = false)
 {
     $code_path = api_get_path(SYS_IMG_PATH);
     $w_code_path = api_get_path(WEB_IMG_PATH);
     $image = trim($image);
     $theme = 'css/' . api_get_visual_theme() . '/icons/';
     $size_extra = '';
     if (isset($size)) {
         $size = intval($size);
         $size_extra = $size . '/';
     } else {
         $size = ICON_SIZE_SMALL;
     }
     // Checking the theme icons folder example: main/css/chamilo/icons/XXX
     if (is_file($code_path . $theme . $size_extra . $image)) {
         $icon = $theme . $size_extra . $image;
     } elseif (is_file($code_path . 'icons/' . $size_extra . $image)) {
         //Checking the main/img/icons/XXX/ folder
         $icon = 'icons/' . $size_extra . $image;
     } else {
         //Checking the img/ folder
         $icon = $image;
     }
     $icon = 'bundles/chamilocore/img/' . $icon;
     $icon = Container::getAsset()->getUrl($icon);
     //$icon = api_get_cdn_path($icon);
     if ($return_only_path) {
         return $icon;
     }
     $img = self::img($icon, $alt_text, $additional_attributes);
     if (SHOW_TEXT_NEAR_ICONS == true and !empty($alt_text)) {
         if ($show_text) {
             $img = "{$img} {$alt_text}";
         }
     }
     return $img;
 }