/**
  * returns all the javascript that is required for easily
  * setting the target people/groups
  * this goes into the $htmlHeadXtra[] array
  */
 public static function to_javascript()
 {
     $www = api_get_path(WEB_PATH);
     $src = $www . 'main/announcements/resources/js/main.js';
     $result = Javascript::tag($src);
     $root = Chamilo::url();
     $code = "var www = '{$root}';\n";
     $code .= Javascript::get_lang('FieldRequired', 'Send2All', 'AddAnAttachment', 'Everybody');
     $result .= Javascript::tag_code($code);
     return $result;
 }
Пример #2
0
 /**
  * returns all the javascript that is required for easily
  * setting the target people/groups
  * this goes into the $htmlHeadXtra[] array
  */
 public static function to_javascript()
 {
     $www = api_get_path(WEB_PATH);
     /*
              * Do not allow this kind of behaviour. js minifieds should be manage by the template class or assetic or whatever see #4757 for more info
             if (api_get_setting('server_type') == 'test') {
                 $src = $www . 'main/announcements/resources/js/main.js';
             } else {
                 $src = $www . 'main/announcements/resources/js/main.min.js';
             }*/
     $src = $www . 'main/announcements/resources/js/main.js';
     $result = Javascript::tag($src);
     $root = Chamilo::url();
     $code = "var www = '{$root}';\n";
     $code .= Javascript::get_lang('FieldRequired', 'Send2All', 'AddAnAttachment', 'Everybody');
     $result .= Javascript::tag_code($code);
     return $result;
 }