36 string $a_postvar =
"" 40 $this->
lng = $DIC->language();
41 $this->
user = $DIC->user();
44 $this->main_tpl = $DIC->ui()->mainTemplate();
49 $this->support_constraint_props = $a_val;
59 $this->width = $a_width;
69 $this->height = $a_height;
79 $this->constrainproportions = $a_constrainproportions;
101 "width" => (string) ($val[
"width"] ??
""),
102 "height" => (string) ($val[
"height"] ??
""),
103 "constr_prop" => (bool) ($val[
"constr_prop"] ??
false)
111 $tpl =
new ilTemplate(
"tpl.prop_width_height.html",
true,
true,
"Services/MediaObjects");
117 $ratio = str_replace(
",",
".", round($wh_ratio, 6));
119 $tpl->setCurrentBlock(
"cs_prop");
120 $tpl->setVariable(
"TXT_CONSTR_PROP",
$lng->
txt(
"cont_constrain_proportions"));
123 $tpl->setVariable(
"CHECKED",
'checked="checked"');
125 $tpl->parseCurrentBlock();
126 $this->main_tpl->addOnLoadCode(
127 'prop_width_height["prop_' . $this->
getPostVar() .
'"] = ' . $ratio .
';' 131 $tpl->setVariable(
"VAL_WIDTH", strtolower(trim($this->
getWidth())));
132 $tpl->setVariable(
"VAL_HEIGHT", strtolower(trim($this->
getHeight())));
141 ->addJavaScript(
"./Services/MediaObjects/js/ServiceMediaObjectPropWidthHeight.js");
146 $w = $a_values[$this->
getPostVar()][
"width"] ??
false;
147 $h = $a_values[$this->
getPostVar()][
"height"] ??
false;
148 $this->
setWidth($w ? (
int) $w : null);
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setVariable($variable, $value='')
Sets a variable value.
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
__construct(Container $dic, ilPlugin $plugin)
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl