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;
91 $this->
setHeight($i[
"height"] ? (
int) $i[
"height"] : null);
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,
"components/ILIAS/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"));
121 $tpl->setVariable(
"CS_POST_VAR", $this->
getPostVar());
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((
string) $this->
getWidth())));
132 $tpl->setVariable(
"VAL_HEIGHT", strtolower(trim((
string) $this->
getHeight())));
134 $tpl->setVariable(
"POST_VAR", $this->
getPostVar());
141 ->addJavaScript(
"assets/js/ServiceMediaObjectPropWidthHeight.js");
142 $this->main_tpl->addOnLoadCode(
143 'prop_width_height["prop_' . $this->
getPostVar() .
'"] = ' . $ratio .
';' 149 $w = $a_values[$this->
getPostVar()][
"width"] ??
false;
150 $h = $a_values[$this->
getPostVar()][
"height"] ??
false;
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...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
setVariable($variable, $value='')
Sets a variable value.
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
__construct(Container $dic, ilPlugin $plugin)