26 if (count($titles) == 0) {
29 if (array_key_exists($user_lang, $titles)) {
30 if ($titles[$user_lang][
'help_name'])
return $titles[$user_lang][
'help_name'];
32 $item = array_shift($titles);
33 if ($item[
'help_name'])
return $item[
'help_name'];
43 $oa->type =
'longtext';
48 $oa->setVisibility(
'S');
55 $this->Affect(getTdoc($this->dbaccess,
$doc->id));
77 foreach (
$rows as $row) {
78 $key = str_pad($row[
'help_sec_order'], 8,
'0', STR_PAD_LEFT) . $row[
'help_sec_key'];
79 $sections[$key][$row[
'help_sec_lang']] = $row;
94 foreach ($all_lang_keys as $i => $key) {
95 $all_langs[$key] = $all_lang_texts[$i];
107 $user_lang = $action->getParam(
'CORE_LANG');
119 foreach (
$rows as $row) {
120 $helps[$row[
'help_lang']] = $row;
142 $helpdescription =
'';
144 foreach ($help_values as
$lang => $help) {
145 if (
$lang == $user_lang) {
147 $helpname = $help[
'help_name'];
148 $helpdescription = $help[
'help_description'];
152 if (empty($lang_key)) {
154 foreach ($help_values as
$lang => $help) {
156 $helpname = $help[
'help_name'];
157 $helpdescription = $help[
'help_description'];
160 $this->lay->set(
'HELPID', $this->
id);
161 $this->lay->set(
'HELPNAME', $helpname);
162 $this->lay->set(
'HELPDESCRIPTION', $helpdescription);
166 $this->lay->set(
'HELPATTRIBUTESLIST',
false);
168 $this->lay->set(
'HELPATTRIBUTESLIST',
true);
170 $docattributes = $docfam->GetNormalAttributes();
171 $docattributes = array_merge($docattributes, $docfam->getFieldAttributes());
174 $attributes[] = array(
175 'HELPATTRVALUE' => $attribute->id,
176 'HELPATTRNAME' => sprintf(
"%s (%s)", $attribute->getLabel() , $attribute->type)
180 $this->lay->SetBlockData(
'HELPATTRIBUTES', $attributes);
183 $this->lay->SetBlockData(
'HELPLANGS', $this->
getLangsFromItem($langs, $lang_key, $help_values));
184 $this->lay->set(
'JSONLANGS', json_encode($langs));
186 $n = count($langs) - 1;
187 $contentsection = array();
188 foreach ($sections as $section) {
193 foreach ($langs as $lang_key => $lang_name) {
194 if (array_key_exists($lang_key, $section)) {
195 $sec = $section[$lang_key];
198 'help_sec_key' => $sec_key,
199 'help_sec_name' =>
'',
200 'help_sec_lang' => $lang_key,
201 'help_sec_text' =>
'',
205 'SECNAME' => $sec[
'help_sec_name'],
206 'SECLANG' => $sec[
'help_sec_lang'],
207 'SECTEXT' => $sec[
'help_sec_text'],
208 'SECDISPLAY' => $lang_key == $first_lang ?
'block' :
'none',
212 $contentsection[] = array(
213 'SECKEY' => $sec_key,
214 'SECTIONLANGS' =>
'seclangs' . $sec_key,
215 'SECTIONITEMS' =>
'secitems' . $sec_key,
217 $this->lay->setBlockData(
'seclangs' . $sec_key, $this->
getLangsFromItem($langs, $first_lang, $section));
218 $this->lay->setBlockData(
'secitems' . $sec_key, $secitems);
220 $this->lay->setBlockData(
'CONTENTSECTIONS', $contentsection);
222 $langitems = array();
224 foreach ($langs as $lang_key => $lang_name) {
225 $langitems[] = array(
226 'LANGKEY' => $lang_key,
227 'LANGISO' => strtolower(substr($lang_key, -2)) ,
228 'LANGNAME' => $lang_name,
229 'LANGCLASS' => $first ?
'current' :
'inactive',
230 'LANGDISPLAY' => $first ?
'block' :
'none',
234 $this->lay->setBlockData(
'TEMPLATELANGS1', $langitems);
235 $this->lay->setBlockData(
'TEMPLATELANGS2', $langitems);
245 public function printhelppage($target =
"_self", $ulink =
true, $abstract =
false)
257 public function viewhelppage($target =
"_self", $ulink =
true, $abstract =
false)
261 include_once (
"FDL/Class.SearchDoc.php");
263 $this->lay->set(
'HELPTITLE', $this->
getTitle());
264 $this->lay->set(
'DOCID', $this->
id);
266 if ($this->CanEdit() ==
'') {
267 $this->lay->set(
'HELPEDITABLE',
'1');
268 if ($action->getArgument(
'target') ==
'ext') {
269 $this->lay->set(
'HELPEDITURI',
'?app=EXTUI&action=EUI_EDITDOC&id=' . $this->
id);
271 $this->lay->set(
'HELPEDITURI',
'?app=GENERIC&action=GENERIC_EDIT&id=' . $this->
id);
274 $this->lay->set(
'HELPEDITABLE',
'0');
275 $this->lay->set(
'HELPEDITURI',
'');
282 $leftsection = array();
283 $contentsection = array();
285 foreach ($sections as $section) {
290 foreach ($langs as $lang_key => $lang_name) {
292 if (array_key_exists($lang_key, $section)) {
293 $sec = $section[$lang_key];
294 if ($lang_key == $first_lang) {
295 $leftsection[] = array(
296 'SECKEY' => $sec[
'help_sec_key'],
297 'SECNAME' => $sec[
'help_sec_name'],
298 'SECLANG' => $sec[
'help_sec_lang'],
304 $contentsection[] = array(
305 'SECKEY' => $sec[
'help_sec_key'],
306 'SECNAME' => $sec[
'help_sec_name'],
307 'SECLANG' => $sec[
'help_sec_lang'],
309 'SECDISPLAY' => $lang_key == $first_lang ?
'block' :
'none',
310 'SECLANGS' =>
'seclangs' . $i,
315 $this->lay->setBlockData(
'seclangs' . $i, $this->
getLangsFromItem($langs, $lang_key, $section));
319 if ($ifirst >= 0 && $ilast >= 0) {
320 $contentsection[$ifirst][
'SECHEADER'] =
'1';
321 $contentsection[$ilast][
'SECFOOTER'] =
'1';
325 $this->lay->setBlockData(
'LEFTSECTIONS', $leftsection);
327 $this->lay->setBlockData(
'CONTENTSECTIONS', $contentsection);
328 $this->lay->setBlockData(
'JSSECTIONS', $contentsection);
330 $all_langs = array();
331 foreach ($langs as $lang_key => $lang_name) {
332 $all_langs[] = array(
333 'LANGKEY' => $lang_key,
334 'LANGNAME' => $lang_name,
335 'LANGISO' => strtolower(substr($lang_key, -2)) ,
338 $this->lay->setBlockData(
'ALLLANGS', $all_langs);
342 foreach ($descriptions as & $v) {
343 if (!$first && $v[
"help_lang"] === $user_lang) {
345 $v[
"firstdesc"] =
true;
346 $v[
"firsttitle"] =
true;
348 $v[
"firstdesc"] =
false;
349 $v[
"firsttitle"] =
false;
353 $descriptions[0][
"firstdesc"] =
true;
354 $descriptions[0][
"firsttitle"] =
true;
356 $this->lay->setBlockData(
'DESCR', $descriptions);
357 $this->lay->setBlockData(
'TITLES', $descriptions);
360 $s = new \SearchDoc($this->dbaccess,
'HELPPAGE');
361 $s->setObjectReturn();
362 $s->orderby =
'title';
364 while (
$doc =
$s->getNextDoc()) {
366 'AIDE' =>
$doc->getDocAnchor(
$doc->id, $target,
true,
$doc->getTitle() ,
false) ,
369 $this->lay->setBlockData(
'LEFTHELPS', $aides);
383 foreach ($all_langs as $lang_key => $lang_name) {
384 if ($lang_key == $current_lang) {
385 $langclass =
'current';
386 } elseif (array_key_exists($lang_key, $item)) {
387 $langclass =
'active';
389 $langclass =
'inactive';
392 'LANGKEY' => $lang_key,
393 'LANGNAME' => $lang_name,
394 'LANGCLASS' => $langclass,
395 'LANGISO' => strtolower(substr($lang_key, -2)) ,
409 foreach ($section as
$lang => $sec) {
410 if (
$lang == $user_lang) {
415 foreach ($section as
$lang => $sec) {
427 foreach ($section as
$lang => $sec) {
428 return $sec[
'help_sec_key'];
451 $attrId = strtolower($attrId);
453 return sprintf(
"?app=FDL&action=DOCHELP&id=%s", $this->
id);
457 if (!in_array($attrId, $helpAttrList)) {
461 return sprintf(
"?app=FDL&action=DOCHELP&id=%s&anchor=%s", $this->
id, $attrId);
& getAttribute($idAttr, &$oa=null, $useMask=true)
static rawValueToArray($v)
getArrayRawValues($idAttr, $index=-1)
getFamilyParameterValue($idp, $def="")
modify($nopost=false, $sfields="", $nopre=false)
setValue($attrid, $value, $index=-1, &$kvalue=null)
getMultipleRawValues($idAttr, $def="", $index=-1)
createDoc($dbaccess, $fromid, $control=true, $defaultvalues=true, $temporary=false)
getHttpVars($name, $def="", $scope="all")
getLangsFromItem($all_langs, $current_lang, $item)
getAttributeHelpUrl($attrId="")
getTitle($id="-1", $def="", $latest=false)
getHtmlValue($oattr, $value, $target="_self", $htmllink=true, $index=-1, $entities=true, $abstract=false)
if(is_numeric($parms['famid'])) $attrList
viewhelppage($target="_self", $ulink=true, $abstract=false)
getFirstSectionLang($section, $user_lang)
if($file) if($subject==""&&$file) if($subject=="") $err
printhelppage($target="_self", $ulink=true, $abstract=false)
getRawValue($idAttr, $def="")