43 if (count($titles) == 0) {
46 if (array_key_exists($user_lang, $titles)) {
47 if ($titles[$user_lang][
'help_name'])
return $titles[$user_lang][
'help_name'];
49 $item = array_shift($titles);
50 if ($item[
'help_name'])
return $item[
'help_name'];
60 $oa->type =
'longtext';
65 $oa->setVisibility(
'S');
72 $this->
Affect(getTdoc($this->dbaccess,
$doc->id));
74 $this->setValue(
"help_family", getHttpVars(
"help_family"));
75 if ($this->
getValue(
"help_family")) $this->title = sprintf(_(
"help for %s") , $this->
getTitle($this->
getValue(
"help_family")));
79 redirect($action, getHttpVars(
"app") , getHttpVars(
"action") .
'&id=' . $this->
id);
94 foreach (
$rows as $row) {
95 $key = str_pad($row[
'help_sec_order'], 8,
'0', STR_PAD_LEFT) . $row[
'help_sec_key'];
96 $sections[$key][$row[
'help_sec_lang']] = $row;
110 $all_langs = array();
111 foreach ($all_lang_keys as $i => $key) {
112 $all_langs[$key] = $all_lang_texts[$i];
124 $user_lang = $action->getParam(
'CORE_LANG');
136 foreach (
$rows as $row) {
137 $helps[$row[
'help_lang']] = $row;
160 foreach ($help_values as
$lang => $help) {
161 if (
$lang == $user_lang) {
163 $helpname = $help[
'help_name'];
164 $helpdescription = $help[
'help_description'];
168 if (empty($lang_key)) {
170 foreach ($help_values as
$lang => $help) {
172 $helpname = $help[
'help_name'];
173 $helpdescription = $help[
'help_description'];
176 $this->lay->set(
'HELPID', $this->
id);
177 $this->lay->set(
'HELPNAME', $helpname);
178 $this->lay->set(
'HELPDESCRIPTION', $helpdescription);
182 $this->lay->set(
'HELPATTRIBUTESLIST',
false);
184 $this->lay->set(
'HELPATTRIBUTESLIST',
true);
186 $docattributes = $docfam->GetNormalAttributes();
187 $attributes = array();
189 $attributes[] = array(
190 'HELPATTRVALUE' => $attribute->id,
191 'HELPATTRNAME' => $attribute->getLabel() ,
194 $this->lay->SetBlockData(
'HELPATTRIBUTES', $attributes);
197 $this->lay->SetBlockData(
'HELPLANGS', $this->
getLangsFromItem($langs, $lang_key, $help_values));
198 $this->lay->set(
'JSONLANGS', json_encode($langs));
200 $n = count($langs) - 1;
201 $contentsection = array();
202 foreach ($sections as $section) {
207 foreach ($langs as $lang_key => $lang_name) {
208 if (array_key_exists($lang_key, $section)) {
209 $sec = $section[$lang_key];
212 'help_sec_key' => $sec_key,
213 'help_sec_name' =>
'',
214 'help_sec_lang' => $lang_key,
215 'help_sec_text' =>
'',
219 'SECNAME' => $sec[
'help_sec_name'],
220 'SECLANG' => $sec[
'help_sec_lang'],
221 'SECTEXT' => $sec[
'help_sec_text'],
222 'SECDISPLAY' => $lang_key == $first_lang ?
'block' :
'none',
226 $contentsection[] = array(
227 'SECKEY' => $sec_key,
228 'SECTIONLANGS' =>
'seclangs' . $sec_key,
229 'SECTIONITEMS' =>
'secitems' . $sec_key,
231 $this->lay->setBlockData(
'seclangs' . $sec_key, $this->
getLangsFromItem($langs, $first_lang, $section));
232 $this->lay->setBlockData(
'secitems' . $sec_key, $secitems);
234 $this->lay->setBlockData(
'CONTENTSECTIONS', $contentsection);
236 $langitems = array();
238 foreach ($langs as $lang_key => $lang_name) {
239 $langitems[] = array(
240 'LANGKEY' => $lang_key,
241 'LANGISO' => strtolower(substr($lang_key, -2)) ,
242 'LANGNAME' => $lang_name,
243 'LANGCLASS' => $first ?
'current' :
'inactive',
244 'LANGDISPLAY' => $first ?
'block' :
'none',
248 $this->lay->setBlockData(
'TEMPLATELANGS1', $langitems);
249 $this->lay->setBlockData(
'TEMPLATELANGS2', $langitems);
273 include_once (
"FDL/Class.SearchDoc.php");
275 $this->lay->set(
'HELPTITLE', $this->
getTitle());
276 $this->lay->set(
'DOCID', $this->
id);
278 if ($this->CanEdit() ==
'') {
279 $this->lay->set(
'HELPEDITABLE',
'1');
280 if ($action->getArgument(
'target') ==
'ext') {
281 $this->lay->set(
'HELPEDITURI',
'?app=FDL&action=EDITEXTDOC&viewext=yes&id=' . $this->
id);
283 $this->lay->set(
'HELPEDITURI',
'?app=GENERIC&action=GENERIC_EDIT&id=' . $this->
id);
286 $this->lay->set(
'HELPEDITABLE',
'0');
287 $this->lay->set(
'HELPEDITURI',
'');
294 $leftsection = array();
295 $contentsection = array();
297 foreach ($sections as $section) {
302 foreach ($langs as $lang_key => $lang_name) {
304 if (array_key_exists($lang_key, $section)) {
305 $sec = $section[$lang_key];
306 if ($lang_key == $first_lang) {
307 $leftsection[] = array(
308 'SECKEY' => $sec[
'help_sec_key'],
309 'SECNAME' => $sec[
'help_sec_name'],
310 'SECLANG' => $sec[
'help_sec_lang'],
316 $contentsection[] = array(
317 'SECKEY' => $sec[
'help_sec_key'],
318 'SECNAME' => $sec[
'help_sec_name'],
319 'SECLANG' => $sec[
'help_sec_lang'],
321 'SECDISPLAY' => $lang_key == $first_lang ?
'block' :
'none',
322 'SECLANGS' =>
'seclangs' . $i,
327 $this->lay->setBlockData(
'seclangs' . $i, $this->
getLangsFromItem($langs, $lang_key, $section));
331 if ($ifirst >= 0 && $ilast >= 0) {
332 $contentsection[$ifirst][
'SECHEADER'] =
'1';
333 $contentsection[$ilast][
'SECFOOTER'] =
'1';
337 $this->lay->setBlockData(
'LEFTSECTIONS', $leftsection);
339 $this->lay->setBlockData(
'CONTENTSECTIONS', $contentsection);
340 $this->lay->setBlockData(
'JSSECTIONS', $contentsection);
342 $all_langs = array();
343 foreach ($langs as $lang_key => $lang_name) {
344 $all_langs[] = array(
345 'LANGKEY' => $lang_key,
346 'LANGNAME' => $lang_name,
347 'LANGISO' => strtolower(substr($lang_key, -2)) ,
350 $this->lay->setBlockData(
'ALLLANGS', $all_langs);
352 $descriptions = $this->getAvalues(
"help_t_help");
354 foreach ($descriptions as & $v) {
355 $v[
"firstdesc"] = $first;
356 if ($v[
"help_description"]) {
360 $this->lay->setBlockData(
'DESCR', $descriptions);
363 foreach ($descriptions as & $v) {
364 $v[
"firsttitle"] = $first;
365 if ($v[
"help_name"]) {
369 $this->lay->setBlockData(
'TITLES', $descriptions);
373 $s->setObjectReturn();
374 $s->orderby =
'title';
376 while (
$doc =
$s->nextDoc()) {
381 $this->lay->setBlockData(
'LEFTHELPS', $aides);
395 foreach ($all_langs as $lang_key => $lang_name) {
396 if ($lang_key == $current_lang) {
397 $langclass =
'current';
398 } elseif (array_key_exists($lang_key, $item)) {
399 $langclass =
'active';
401 $langclass =
'inactive';
404 'LANGKEY' => $lang_key,
405 'LANGNAME' => $lang_name,
406 'LANGCLASS' => $langclass,
407 'LANGISO' => strtolower(substr($lang_key, -2)) ,
421 foreach ($section as
$lang => $sec) {
422 if (
$lang == $user_lang) {
427 foreach ($section as
$lang => $sec) {
438 foreach ($section as
$lang => $sec) {
439 return $sec[
'help_sec_key'];