19 require_once(BASE.
"wcmf/lib/core/class.WCMFException.php");
20 require_once(BASE.
"wcmf/lib/util/class.InifileParser.php");
21 require_once(BASE.
"wcmf/lib/util/class.URIUtil.php");
22 require_once(BASE.
"wcmf/lib/presentation/class.View.php");
23 require_once(BASE.
"wcmf/lib/presentation/class.Controller.php");
24 require_once(BASE.
"wcmf/lib/presentation/class.InternalLink.php");
57 $MAX_FILE_SIZE = 200000;
61 if (($maxFileSize = $parser->getValue(
'maxFileSize',
'htmlform')) ===
false)
62 $maxFileSize = $MAX_FILE_SIZE;
80 function renderControl($type, $enabled, $name, $value, $error, $attributes, $listMap, $inputType)
88 $view->clear_all_assign();
92 $view->assign(
'enabled', $enabled);
93 $view->assign(
'name', $name);
94 $view->assign(
'value', $value);
95 $view->assign(
'error', $error);
96 $view->assign(
'attributes', $attributes);
97 $view->assign(
'listMap', $listMap);
98 $view->assign(
'inputType', $inputType);
101 $attributeList = array();
102 $attributeParts = preg_split(
"/[\s,;]+/", $attributes);
103 foreach($attributeParts as $attribute)
105 if (strlen($attribute) > 0)
107 list($key, $value) = preg_split(
"/[=:]+/", $attribute);
108 $key = trim(stripslashes($key));
109 $value = trim(stripslashes($value));
110 $attributeList[$key] = $value;
113 $view->assign(
'attributeList', $attributeList);
116 $configureFunction =
"configure_".$type;
117 if (method_exists($this, $configureFunction))
118 $this->$configureFunction(
$view);
120 if ($viewTpl = $parser->getValue($type,
'htmlform') ===
false)
123 $htmlString =
$view->fetch(BASE.$parser->getValue($type,
'htmlform'));
133 $inputType =
$view->get_template_vars(
'inputType');
134 if (preg_match(
"/^select.*?#async\:(.+)$/", $inputType, $matches))
138 $parts = split(
'\|', $list);
139 $entityType = array_shift($parts);
140 $filter = join(
'', $parts);
141 $view->assign(
'entityType', $entityType);
142 $view->assign(
'filter', $filter);
146 $listMap =
$view->get_template_vars(
'listMap');
147 $value =
$view->get_template_vars(
'value');
148 $view->assign(
'translatedValue', $listMap[$value]);
150 $view->assign(
'isAsync',
true);
153 $view->assign(
'isAsync',
false);
172 $view->assign(
'uploadDir', $parser->getValue(
'uploadDir',
'media'));
180 $view->assign(
'resourceBrowserCodeAdded', $this->resourceBrowserCodeAdded);
181 $view->assign(
'directory', dirname(
$view->get_template_vars(
'value')));
182 $this->resourceBrowserCodeAdded = 1;
190 $value =
$view->get_template_vars(
'value');
192 $view->assign(
'isExternal',
false);
194 $view->assign(
'isExternal',
true);
195 $view->assign(
'resourceBrowserCodeAdded', $this->resourceBrowserCodeAdded);
196 $this->resourceBrowserCodeAdded = 1;
205 if (($libDir = $parser->getValue(
'libDir',
'cms')) ===
false)
207 $libDir .=
'3rdparty/fckeditor/';
208 $view->assign(
'libDir', $libDir);
209 $view->assign(
'appDir', UriUtil::getProtocolStr().$_SERVER[
'HTTP_HOST'].str_replace(basename($_SERVER[
'SCRIPT_NAME']),
'', $_SERVER[
'SCRIPT_NAME']));
210 $view->assign(
'FCKeditorCodeAdded', $this->FCKeditorCodeAdded);
213 $trans = get_html_translation_table(HTML_ENTITIES);
214 $trans = array_flip($trans);
215 $value = strtr(
$view->get_template_vars(
'value'), $trans);
216 $view->assign(
'value', preg_replace(
"/[\n\r]/",
"", $value));
217 $this->FCKeditorCodeAdded = 1;
226 if (($libDir = $parser->getValue(
'libDir',
'cms')) ===
false)
228 $libDir .=
'3rdparty/colorpicker/';
229 $view->assign(
'libDir', $libDir);
230 $view->assign(
'colorCodeAdded', $this->colorCodeAdded);
231 $this->colorCodeAdded = 1;
$resourceBrowserCodeAdded
renderControl($type, $enabled, $name, $value, $error, $attributes, $listMap, $inputType)
throwEx($message, $file='', $line='')
configure_filebrowser(&$view)
configure_linkbrowser(&$view)
DefaultControlRenderer is responsible for rendering html input controls. Each control is defined in a...
configure_fckeditor(&$view)
View is used by Controller to handle the view presentation in MVC pattern. View is a subclass of Smar...