25 $this->lng = $DIC->language();
26 $lng = $DIC->language();
28 parent::__construct($a_title, $a_postvar);
30 $this->setAllowDeletion(
true);
31 $this->
setSuffixes(array(
"jpg",
"jpeg",
"png",
"gif"));
43 $this->allow_deletion = $a_val;
63 $this->cache = ($a_cache) ?
true :
false;
83 $this->image = $a_image;
123 $quota_exceeded = $quota_legend =
false;
124 if (self::$check_wsp_quota) {
125 include_once
"Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
127 $lng->loadLanguageModule(
"file");
128 $quota_exceeded =
$lng->txt(
"personal_workspace_quota_exceeded_warning");
132 $quota_legend =
"<br />" . $quota_legend;
137 $i_tpl =
new ilTemplate(
"tpl.prop_image_file.html",
true,
true,
"Services/Form");
141 $i_tpl->setCurrentBlock(
"delete_bl");
142 $i_tpl->setVariable(
"POST_VAR_D", $this->
getPostVar());
144 "TXT_DELETE_EXISTING",
145 $lng->txt(
"delete_existing_file")
147 $i_tpl->parseCurrentBlock();
151 $i_tpl->setCurrentBlock(
"has_value");
152 $i_tpl->setVariable(
"TEXT_IMAGE_NAME", $this->
getValue());
153 $i_tpl->parseCurrentBlock();
155 $i_tpl->setCurrentBlock(
"image");
157 $pos = strpos($this->
getImage(),
'?');
158 if ($pos !==
false) {
159 $i_tpl->setVariable(
"SRC_IMAGE", $this->
getImage() .
"&time=" . time());
161 $i_tpl->setVariable(
"SRC_IMAGE", $this->
getImage() .
"?time=" . time());
164 $i_tpl->setVariable(
"SRC_IMAGE", $this->
getImage());
166 $i_tpl->setVariable(
"ALT_IMAGE", $this->
getAlt());
167 $i_tpl->parseCurrentBlock();
172 $i_tpl->setCurrentBlock(
"pending");
173 $i_tpl->setVariable(
"TXT_PENDING",
$lng->txt(
"file_upload_pending") .
175 $i_tpl->parseCurrentBlock();
178 $i_tpl->setVariable(
"POST_VAR", $this->
getPostVar());
179 $i_tpl->setVariable(
"ID", $this->
getFieldId());
183 $i_tpl->setVariable(
"TXT_BROWSE",
$lng->txt(
"select_file"));
186 if (!$quota_exceeded) {
187 $i_tpl->setVariable(
"TXT_MAX_SIZE",
$lng->txt(
"file_notice") .
" " .
192 $i_tpl->setVariable(
"TXT_MAX_SIZE", $quota_exceeded);
198 " disabled=\"disabled\"" 202 $a_tpl->setCurrentBlock(
"prop_generic");
203 $a_tpl->setVariable(
"PROP_GENERIC", $i_tpl->get());
204 $a_tpl->parseCurrentBlock();
special template class to simplify handling of ITX/PEAR
static isUploadPossible($a_additional_size=null)