2 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
3 include_once(
"Services/Style/System/classes/Utilities/class.ilSystemStyleSkinContainer.php");
4 include_once(
"Services/Style/System/classes/Less/class.ilSystemStyleLessFile.php");
5 include_once(
"Services/Style/System/classes/Utilities/class.ilSystemStyleMessageStack.php");
55 $this->ctrl = $DIC->ctrl();
56 $this->lng = $DIC->language();
57 $this->tpl = $DIC[
"tpl"];
62 $skin_id =
$_GET[
"skin_id"];
65 $style_id =
$_GET[
"style_id"];
86 $cmd = $this->ctrl->getCmd();
107 $style_id =
$_GET[
'style_id'];
112 if(file_exists($less_path)){
113 $less_variables_name = $this->
getStyleContainer()->getLessVariablesName($style_id);
116 $content = file_get_contents($less_path);
124 $reg_exp =
"/".preg_quote ($less_variables_name,
"/").
"/";
126 if(!preg_match($reg_exp,$content)){
128 new ilSystemStyleMessage($this->lng->txt(
"less_variables_file_not_included").
" ".$less_variables_name
156 }
else if(!shell_exec(PATH_TO_LESSC)){
166 if(!
$pass && shell_exec(
"which lessc")){
189 $this->tpl->setContent($form->getHTML());
205 $form->setTitle($this->lng->txt(
"adapt_less"));
206 $form->setDescription($this->lng->txt(
"adapt_less_description"));
207 $focus_variable =
$_GET[
'id_less_variable'];
209 $this->tpl->addOnLoadCode(
"setTimeout(function() { $('#".$focus_variable.
"').focus();}, 100);");
212 foreach($this->
getLessFile()->getCategories() as $category){
214 $section->setTitle($category->getName());
215 $section->setInfo($category->getComment());
218 foreach($this->
getLessFile()->getVariablesPerCategory($category->getName()) as $variable){
219 $input =
new ilTextInputGUI($variable->getName(), $variable->getName());
221 $input->setDisabled(!$modify);
223 $references = $this->
getLessFile()->getReferencesToVariableAsString($variable->getName());
225 if($references !=
""){
226 if($variable->getComment()){
227 $info = $variable->getComment().
"</br>".$this->lng->txt(
"usages").
" ".$references;
229 $info = $this->lng->txt(
"usages").
" ".$references;
232 $info = $variable->getComment();
234 $input->setInfo(
$info);
236 $form->addItem($input);
242 $form->addCommandButton(
"update", $this->lng->txt(
"update_variables"));
243 $form->addCommandButton(
"reset", $this->lng->txt(
"reset_variables"));
244 $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
248 $form->setFormAction($this->ctrl->getFormAction($this));
260 foreach($this->
getLessFile()->getCategories() as $category){
261 foreach($this->
getLessFile()->getVariablesPerCategory($category->getName()) as $variable){
262 $values[$variable->getName()] = $variable->getValue();
288 if ($form->checkInput())
290 foreach($this->
getLessFile()->getCategories() as $category){
291 foreach($this->
getLessFile()->getVariablesPerCategory($category->getName()) as $variable){
292 $variable->setValue($form->getInput($variable->getName()));
299 $skin->getVersionStep($skin->getVersion());
307 $form->setValuesByPost();
308 $this->tpl->setContent($form->getHTML());
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
executeCommand()
Execute command.
__construct($skin_id="", $style_id="")
ilSystemStyleLessGUI constructor.
setMessageStack($message_stack)
This class represents a text property in a property form.
getVariablesValues(ilPropertyFormGUI $form)
setStyleContainer($style_container)
Class for advanced editing exception handling in ILIAS.
static generateFromId($skin_id, ilSystemStyleMessageStack $message_stack=null, ilSystemStyleConfig $system_styles_conf=null)
Generate the container class by parsing the corresponding XML.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Used to stack messages to be shown to the user.
initSystemStyleLessForm($modify=true)