17 require_once (
'WHAT/autoload.php');
18 include_once (
'WHAT/Lib.Http.php');
19 include_once (
'WHAT/Lib.Common.php');
23 return (!((isset($var[
"global"]) && ($var[
"global"] ==
'Y'))));
93 create table application ( id int not null,
109 create index application_idx1 on application(id);
110 create index application_idx2 on application(name);
111 create sequence SEQ_ID_APPLICATION start 10;
204 $this->log->debug(
"Entering : Set application to $name");
208 $query->criteria =
"name";
210 $query->string =
"'" . pg_escape_string(
$name) .
"'";
214 $this->log->debug(
"Set application to $name");
216 $this->log->debug(
"Parent not set");
221 $this->InitApp(
$name);
224 if ($this->
name ==
"") {
225 printf(
"Application name %s not found",
$name);
227 } elseif (!empty(
$_SERVER[
'HTTP_HOST'])) {
232 if (!empty($_SERVER[
'HTTP_HOST'])) Header(
"Location: " . $_SERVER[
'HTTP_REFERER']);
236 $e->addHttpHeader(
'HTTP/1.0 404 Application not found');
242 if (is_object($this->parent) && isset($this->parent->session)) {
243 $this->
session = $this->parent->session;
244 if (isset($this->parent->user) && is_object($this->parent->user)) {
245 $this->
user = $this->parent->user;
250 $this->param =
new Param($this->dbaccess);
255 $this->InitStyle(
false,
$style);
262 $this->
session->register(
"userCoreStyle", $pStyle);
266 $this->param->SetKey($this->
id, isset($this->
user->id) ? $this->user->id :
false, $this->style->name);
267 if ($verifyAvailable && $this->available ===
"N") {
270 $e->addHttpHeader(
'HTTP/1.0 503 Application unavailable');
273 $this->permission = null;
285 if (is_object($this->
session)) {
286 if ($this->
session->userid != 0) {
287 $this->log->debug(
"Get user on " . $this->dbaccess);
290 $this->log->debug(
"User not set ");
297 if ($this->Exists($this->
name))
return "Ce nom d'application existe deja...";
298 if ($this->
name ==
"CORE") {
301 $this->
exec_query(
"select nextval ('seq_id_application')");
303 $this->
id = $arr[
"nextval"];
310 if ($this->dbid == - 1)
return false;
311 if ($this->Exists($this->
name, $this->
id))
return "Ce nom d'application existe deja...";
320 public function exists($app_name, $id_application = 0)
322 $this->log->debug(
"Exists $app_name ?");
327 if ($id_application !=
'') {
328 $query->basic_elem->sup_where = array(
330 "id!=$id_application"
333 $query->criteria =
"name";
335 $query->string =
"'" . $app_name .
"'";
340 return (
$query->nb > 0) ?
$r[0][
"id"] :
false;
347 private function stripRootDir($pathname)
349 if (substr($pathname, 0, strlen($this->rootdir)) === $this->rootdir) {
350 $pathname = substr($pathname, strlen($this->rootdir) + 1);
360 private function resolveResourceLocation($ref)
362 if (strstr($ref,
'../') !==
false) {
371 if (preg_match(
'/^(?P<appname>[a-z][a-z0-9_-]*):(?P<filename>.*)$/i', $ref, $m)) {
372 $location = sprintf(
'%s/%s/Layout/%s', $this->rootdir, $m[
'appname'], $m[
'filename']);
374 return sprintf(
'%s/Layout/%s', $m[
'appname'], $m[
'filename']);
380 sprintf(
"%s/Layout/%s", $this->
name, $ref)
382 if (is_file(sprintf(
"%s/%s", $this->rootdir, $filename))) {
387 $pUrl = parse_url($ref);
388 if (isset($pUrl[
'scheme']) || isset($pUrl[
'query'])) {
392 if (is_file($ref))
return $ref;
394 $this->log->error(__METHOD__ .
" Unable to identify the ref $ref");
418 $resourceLocation = $this->getResourceLocation(
$type, $ref, $needparse,
$packName,
true);
419 if (!$resourceLocation) {
420 $wng = sprintf(_(
"Cannot find %s resource file") , $ref);
422 $this->log->warning($wng);
425 $this->jsref[$resourceLocation] = $resourceLocation;
426 } elseif (
$type ==
'css') {
427 $this->cssref[$resourceLocation] = $resourceLocation;
432 return $resourceLocation;
445 private function getResourceLocation(
$type, $ref, $needparse,
$packName, $fromAdd =
false)
447 static $firstPack = array();
448 $resourceLocation =
'';
453 $resourcePackParseLocation = sprintf(
"?app=CORE&action=CORE_CSS&type=%s&ukey=%s&pack=%s",
$type, $key,
$packName);
454 $resourcePackNoParseLocation = sprintf(
"pack.php?type=%s&pack=%s&wv=%s",
$type,
$packName,
getParam(
"WVERSION"));
457 $packSession = array();
460 $packSession = ($this->
session ? $this->
session->Read(
"RSPACK_" . $packName) : array());
462 $packSession = array();
465 $packSession[$ref] = array(
467 "needparse" => $needparse
470 $this->
session->Register(
"RSPACK_" . $packName, $packSession);
476 unset($this->jsref[$resourcePackNoParseLocation]);
477 } elseif (
$type ==
"css") {
478 unset($this->cssref[$resourcePackNoParseLocation]);
481 $resourceLocation = $resourcePackParseLocation;
483 $hasParseBefore = ((
$type ===
"js") && isset($this->jsref[$resourcePackParseLocation]));
484 if (!$hasParseBefore) {
485 $hasParseBefore = ((
$type ===
"css") && isset($this->cssref[$resourcePackParseLocation]));
487 if (!$hasParseBefore) {
488 $resourceLocation = $resourcePackNoParseLocation;
491 } elseif ($needparse) {
492 $resourceLocation =
"?app=CORE&action=CORE_CSS&ukey=" . $key .
"&layout=" . $ref .
"&type=" .
$type;
494 $location = $this->resolveResourceLocation($ref);
500 return $resourceLocation;
513 public function getCssLink($ref, $needparse = null, $packName =
'')
515 if (substr($ref, 0, 2) ==
'./') {
516 $ref = substr($ref, 2);
518 $styleParseRule = $this->detectCssParse($ref, $needparse);
519 $rl = $this->getResourceLocation(
'css', $ref, $styleParseRule, $packName);
521 $msg = sprintf(_(
"Cannot find %s resource file") , $ref);
523 $this->log->warning($msg);
538 public function getJsLink($ref, $needparse =
false, $packName =
'')
540 if (substr($ref, 0, 2) ==
'./') {
541 $ref = substr($ref, 2);
543 $rl = $this->getResourceLocation(
'js', $ref, $needparse, $packName);
545 $msg = sprintf(_(
"Cannot find %s resource file") , $ref);
547 $this->log->warning($msg);
565 public function addCssRef($ref, $needparse = null, $packName =
'')
567 $styleParseRule = $this->detectCssParse($ref, $needparse);
569 if (substr($ref, 0, 2) ==
'./') $ref = substr($ref, 2);
570 return $this->AddRessourceRef(
'css', $ref, $styleParseRule, $packName);
573 private function detectCssParse($ref, $askParse)
575 $needparse = $askParse;
576 $currentFileRule = $this->style->getRule(
'css', $ref);
577 if (is_array($currentFileRule)) {
579 if (isset($currentFileRule[
'runtime_parser']) && is_array($currentFileRule[
'runtime_parser']) && isset($currentFileRule[
'runtime_parser'][
'className']) && null !== $currentFileRule[
'parse_on_runtime'][
'className']) {
580 throw new \Dcp\Style\Exception(
"STY0007",
'custom parse_on_runtime class is not supported yet');
583 if ((null !== $needparse) && ($parseOnLoad !== $needparse)) {
584 $this->log->warning(sprintf(
"%s was added with needParse to %s but style has a rule saying %s", $ref, var_export($needparse,
true) , var_export($parseOnLoad,
true)));
586 $needparse = $parseOnLoad;
589 $needparse = $needparse ?
true :
false;
601 return ($this->parent->GetCssRef());
603 return ($this->cssref);
619 public function addJsRef($ref, $needparse =
false, $packName =
'')
621 if (substr($ref, 0, 2) ==
'./') $ref = substr($ref, 2);
622 return $this->AddRessourceRef(
'js', $ref, $needparse, $packName);
632 return ($this->parent->GetJsRef());
634 return ($this->jsref);
652 $this->parent->AddJsCode($code);
654 $this->jscode[] = $code;
665 return ($this->parent->GetJsCode());
667 return ($this->jscode);
684 $this->parent->AddCssCode($code);
686 $this->csscode[] = $code;
697 return ($this->parent->GetCssCode());
699 return ($this->csscode);
711 if ($code ==
"")
return;
714 $this->parent->AddLogMsg($code, $cut);
718 if (is_array($code)) {
720 $logmsg[] = json_encode($code);
722 $logmsg[] = strftime(
"%H:%M - ") . str_replace(
"\n",
"\\n", (($cut > 0) ? mb_substr($code, 0, $cut) : $code));
725 $suser = sprintf(
"%s %s [%d] - ", $this->
user->firstname, $this->user->lastname, $this->user->id);
726 if (is_array($code)) $code = print_r($code,
true);
727 $this->log->info($suser . $code);
741 if (($code ==
"") || ($code ==
"-"))
return;
744 $this->parent->addWarningMsg($code);
751 error_log(
"dcp warning: $code");
761 return ($this->
session ? ($this->
session->read(
"logmsg", array())) : array());
767 $this->
session->unregister(
"logmsg");
776 return ($this->
session ? ($this->
session->read(
"warningmsg", array())) : array());
782 $this->
session->unregister(
"warningmsg");
793 $this->parent->setAdminMode($enable);
795 $this->adminMode = ($enable ?
true :
false);
804 return $this->parent->isInAdminMode();
806 return $this->adminMode ===
true;
821 if (!isset($this->
user) || !is_object($this->
user)) {
822 $this->log->warning(
"Action {$this->parent->name}:{$this->name} requires authentification");
825 if ($this->
user->id == 1)
return true;
826 if ($app_name ==
"") {
828 $acl =
new Acl($this->dbaccess);
829 if (!$acl->Set($acl_name, $this->id)) {
830 $this->log->warning(
"Acl $acl_name not available for App $this->name");
833 if (!$this->permission) {
840 "id_user" => $this->
user->id,
841 "id_application" => $this->id
847 return ($this->permission->HasPrivilege($acl->id,
$strict));
850 if (!is_numeric($app_name))
$appid = $this->GetIdFromName($app_name);
853 $wperm =
new Permission($this->dbaccess, array(
857 if ($wperm->isAffected()) {
858 $acl =
new Acl($this->dbaccess);
859 if (!$acl->Set($acl_name,
$appid)) {
860 $this->log->warning(
"Acl $acl_name not available for App $this->name");
863 return ($wperm->HasPrivilege($acl->id,
$strict));
877 if (isset($this->
user)) $pstyle =
new Param($this->dbaccess, array(
882 else $pstyle =
new Param($this->dbaccess, array(
887 if (!$pstyle->isAffected()) $pstyle =
new Param($this->dbaccess, array(
896 $this->style->Set($this);
901 $this->style->Set($this);
913 $this->parent->SetLayoutVars($lay);
919 if ($this->parent ==
"") {
922 return ($this->parent->GetRootApp());
929 return $this->rootdir .
"/" . $this->
getImageLink($img);
944 static $cacheImgUrl = array();
946 $cacheIndex = $img .
$size;
947 if (isset($cacheImgUrl[$cacheIndex]))
return $cacheImgUrl[$cacheIndex];
951 $url = $this->style->GetImageUrl($img,
"");
953 if (
$size !== null) $url =
'resizeimg.php?img=' . urlencode($url) .
'&size=' .
$size;
954 $cacheImgUrl[$cacheIndex] = $url;
959 if (file_exists($this->rootdir .
"/" . $this->
name .
"/Images/" . $img)) {
960 $url = $this->
name .
"/Images/" . $img;
961 if (
$size !== null) $url =
'resizeimg.php?img=' . urlencode($url) .
'&size=' .
$size;
962 $cacheImgUrl[$cacheIndex] = $url;
965 if (($this->childof !=
"") && (file_exists($this->rootdir .
"/" . $this->childof .
"/Images/" . $img))) {
966 $url = $this->childof .
"/Images/" . $img;
967 if (
$size !== null) $url =
'resizeimg.php?img=' . urlencode($url) .
'&size=' .
$size;
968 $cacheImgUrl[$cacheIndex] = $url;
970 }
else if (file_exists($this->rootdir .
"/Images/" . $img)) {
971 $url =
"Images/" . $img;
972 if (
$size !== null) $url =
'resizeimg.php?img=' . urlencode($url) .
'&size=' .
$size;
973 $cacheImgUrl[$cacheIndex] = $url;
978 if ($this->parent !=
"") {
979 $url = $this->parent->getImageLink($img);
980 if (
$size !== null) $url =
'resizeimg.php?img=' . urlencode($url) .
'&size=' .
$size;
981 $cacheImgUrl[$cacheIndex] = $url;
985 if (
$size !== null)
return 'resizeimg.php?img=' . urlencode($this->noimage) .
'&size=' .
$size;
1009 if (
$out === null) {
1012 $im = imagecreatefromgif($image);
1013 $idx = imagecolorexact($im, $fcol[0], $fcol[1], $fcol[2]);
1014 imagecolorset($im, $idx, $newcol[0], $newcol[1], $newcol[2]);
1015 imagegif($im,
$out);
1022 $ttf = explode(
":", $imgf);
1027 if ($url == $this->noimage)
return $url;
1030 if (count($tf) != 2)
return $url;
1032 $fcol = explode(
",", $tf[0]);
1033 if (count($fcol) != 3)
return $url;
1035 if (substr($tf[1], 0, 1) ==
'#') $col = $tf[1];
1036 else $col = $this->
getParam($tf[1]);
1037 $ncol[0] = hexdec(substr($col, 1, 2));
1038 $ncol[1] = hexdec(substr($col, 3, 2));
1039 $ncol[2] = hexdec(substr($col, 5, 2));
1041 $cdir =
'var/cache/image/';
1042 $rcdir = $this->rootdir .
'/' . $cdir;
1043 if (!is_dir($rcdir)) mkdir($rcdir);
1045 $uimg = $cdir . $this->
name .
'-' . $fcol[0] .
'.' . $fcol[1] .
'.' . $fcol[2] .
'_' .
$ncol[0] .
'.' .
$ncol[1] .
'.' .
$ncol[2] .
'.' . $img;
1046 $cimg = $this->rootdir .
'/' . $uimg;
1047 if (file_exists($cimg))
return $uimg;
1049 $this->ImageFilterColor($this->rootdir .
'/' . $url, $fcol,
$ncol, $cimg);
1059 if (strstr($layname,
'..')) {
1063 $file = $this->style->GetLayoutFile($layname,
"");
1066 $laydir = $this->rootdir .
"/" . $this->
name .
"/Layout/";
1067 $file = $laydir . $layname;
1068 if (file_exists(
$file)) {
1072 $file = $this->rootdir .
"/" . $this->childof .
"/Layout/$layname";
1075 if ($this->parent !=
"")
return ($this->parent->GetLayoutFile($layname));
1080 $file = $this->rootdir .
"/" . $this->
name .
"/Layout/" . $layname;
1081 if (file_exists(
$file)) {
1082 $file = $this->style->GetLayoutFile($layname,
$file);
1085 if ($this->parent !=
"")
return ($this->parent->GetLayoutFile($layname));
1096 if (is_array($val)) {
1099 $this->param->Set($key, $val[
"val"],
$type, $this->
id);
1126 $oldValues = array();
1128 $pdef =
new ParamDef($this->dbaccess);
1130 $pdef->isuser =
"N";
1131 $pdef->isstyle =
"N";
1132 $pdef->isglob =
"N";
1135 $pdef->kind =
"text";
1137 $oldValues = $pdef->getValues();
1140 if (is_array($val)) {
1141 if (isset($val[
"kind"])) $pdef->kind = $val[
"kind"];
1142 if (isset($val[
"user"]) && $val[
"user"] ==
"Y") $pdef->isuser =
"Y";
1143 else $pdef->isuser =
"N";
1144 if (isset($val[
"style"]) && $val[
"style"] ==
"Y") $pdef->isstyle =
"Y";
1145 else $pdef->isstyle =
"N";
1146 if (isset($val[
"descr"])) $pdef->descr = $val[
"descr"];
1147 if (isset($val[
"global"]) && $val[
"global"] ==
"Y") $pdef->isglob =
"Y";
1148 else $pdef->isglob =
"N";
1151 if ($pdef->appid == $this->id) {
1152 if ($pdef->isAffected()) {
1155 $newValues = $pdef->getValues();
1156 if ($oldValues[
'isglob'] != $newValues[
'isglob']) {
1159 $pv =
new Param($this->dbaccess, array(
1164 if ($pv->isAffected()) {
1165 $pv->set($pv->name, $pv->val, $ptypeNew, $pv->appid);
1182 if ($this->
hasParent()) $this->parent->setVolatileParam($key, $val);
1183 else $this->param->SetVolatile($key, $val);
1193 if (!isset($this->param))
return ($default);
1194 $z = $this->param->Get($key,
"z");
1197 if ($this->
hasParent())
return $this->parent->GetParam($key, $default);
1210 if (is_array($tparam)) {
1212 foreach ($tparam as $k => $v) {
1213 $this->SetParamDef($k, $v);
1216 if ($this->param && $this->param->Get($k, null) === null) {
1218 $this->SetParam($k, $v);
1221 $this->SetParam($k, $v);
1232 $list = $this->param->buffer;
1234 $list2 = $this->parent->GetAllParam();
1235 $list = array_merge($this->param->buffer, $list2);
1250 $this->log->info(
"Init : $name");
1251 if (file_exists($this->rootdir .
"/{$name}/{$name}.app")) {
1252 global $app_desc, $app_acl, $action_desc;
1255 $app_desc = array();
1256 $action_desc = array();
1257 include (
"{$name}/{$name}.app");
1258 $action_desc_ini = $action_desc;
1259 if (
sizeof($app_desc) > 0) {
1261 $this->log->debug(
"InitApp : new application ");
1264 foreach ($app_desc as $k => $v) {
1276 $this->available =
"Y";
1277 foreach ($app_desc as $k => $v) {
1285 $this->param =
new Param();
1289 $this->log->info(
"can't init $name");
1293 $action_desc = $action_desc_ini;
1295 $acl =
new Acl($this->dbaccess);
1296 $acl->Init($this, $app_acl, $update);
1299 $action->Init($this, $action_desc, $update);
1301 if ($this->childof !=
"") {
1304 simpleQuery($this->dbaccess, sprintf(
"INSERT INTO acl (id,id_application,name,grant_level,description, group_default) SELECT nextval('seq_id_acl') as id, %d as id_application, acl.name, acl.grant_level, acl.description, acl.group_default from acl as acl,application as app where acl.id_application=app.id and app.name='%s' and acl.name NOT IN (SELECT acl.name from acl as acl, application as app where id_application=app.id and app.name='%s')", $this->
id, pg_escape_string($this->childof) , pg_escape_string($this->
name)));
1306 simpleQuery($this->dbaccess, sprintf(
"INSERT INTO action (id, id_application, name, short_name, long_name,script,function,layout,available,acl,grant_level,openaccess,root,icon,toc,father,toc_order) SELECT nextval('seq_id_action') as id, %d as id_application, action.name, action.short_name, action.long_name, action.script, action.function, action.layout, action.available, action.acl, action.grant_level, action.openaccess, action.root, action.icon, action.toc, action.father, action.toc_order from action as action,application as app where action.id_application=app.id and app.name='%s' and action.name NOT IN (SELECT action.name from action as action, application as app where action.id_application=app.id and app.name='%s')", $this->
id, pg_escape_string($this->childof) , pg_escape_string($this->
name)));
1307 $this->log->info(sprintf(
"Update Actions from %s parent", $this->childof));
1308 $err = $this->_initACLWithGroupDefault();
1315 if (file_exists($this->rootdir .
"/{$name}/{$name}_init.php")) {
1316 include (
"{$name}/{$name}_init.php");
1320 $nextVersion = isset($app_const[
'VERSION']) ? $app_const[
'VERSION'] :
'';
1321 if ($nextVersion !=
'') {
1322 $currentVersion = $this->
getParam(
'VERSION',
'');
1323 if ($currentVersion !=
'' && $nextVersion != $currentVersion) {
1324 $this->
setParam(
'PREVIOUS_VERSION', array(
1325 'val' => $currentVersion,
1333 if ($update) $this->param->DelStatic($this->
id);
1335 if (isset($app_const)) $this->InitAllParam($app_const, $update);
1340 if (file_exists($this->rootdir .
"/{$this->childof}/{$this->childof}_init.php")) {
1341 include (
"{$this->childof}/{$this->childof}_init.php");
1343 $this->InitAllParam(array_filter($app_const,
"f_paramglog") ,
true);
1346 if ($this->
id > 1) {
1347 $this->SetParamDef(
"APPNAME", array(
1348 "descr" =>
"$name application",
1352 $this->SetParam(
"APPNAME", array(
1358 $this->updateChildApplications();
1360 $this->log->info(
"No {$name}/{$name}.app available");
1369 private function updateChildApplications()
1371 $sql = sprintf(
"select id, name from application where childof ='%s'", pg_escape_string($this->
name));
1374 foreach ($childIds as $childApp) {
1375 $childId = $childApp[
"id"];
1376 $childName = $childApp[
"name"];
1379 if (
$a->isAffected()) {
1381 $a->set($childName, $noParent);
1382 $a->initApp($childName,
true);
1384 catch(\Dcp\Exception $e) {
1385 if ($e->getDcpCode() !=
"CORE0007") {
1399 $this->InitApp(
$name,
true);
1409 $query->AddQuery(
"available = 'Y'");
1410 $allapp =
$query->Query();
1412 foreach ($allapp as
$app) {
1413 $application =
new Application($this->dbaccess, $app->id);
1415 $application->Set($app->name, $this->parent);
1416 $application->UpdateApp();
1427 $acl =
new Acl($this->dbaccess);
1428 $acl->DelAppAcl($this->
id);
1430 $this->log->debug(
"Delete {$this->name}");
1432 $query->basic_elem->sup_where = array(
1433 "id_application = {$this->id}"
1441 foreach (
$list as $v) {
1442 $this->log->debug(
" Delete action {$v->name} ");
1443 $err = $v->Delete();
1454 $param->DelAll($this->
id);
1456 $err = $this->Delete();
1468 if ($code ==
"")
return "";
1481 $query->AddQuery(
"available = 'Y'");
1482 $allapp =
$query->Query();
1483 $acl =
new Acl($this->dbaccess);
1485 foreach ($allapp as $v) {
1490 $privileges = $acl->getDefaultAcls($v->id);
1492 foreach ($privileges as $aclid) {
1508 $query->AddQuery(
"name = '" . pg_escape_string(trim(
$name)) .
"'");
1510 if (is_array(
$app) && isset(
$app[0]) && isset(
$app[0][
"id"]))
return $app[0][
"id"];
1519 return (is_object($this->parent) && ($this->parent !== $this));
1524 private function _initACLWithGroupDefault()
1528 simpleQuery($this->dbaccess, sprintf(
"SELECT * FROM acl WHERE id_application = %s AND group_default = 'Y'", $this->
id) ,
$res,
false,
false,
true);
1530 catch(Exception $e) {
1531 return $e->getMessage();
1533 foreach (
$res as $acl) {
1540 'id_application' => $this->
id,
1541 'id_acl' => $acl[
'id']
initAllParam($tparam, $update=false)
set($name, &$parent, $session="", $autoinit=false, $verifyAvailable=true)
imageFilterColor($image, $fcol, $newcol, $out=null)
initApp($name, $update=false)
getParam($key, $default="")
print< H1 > Check Database< i > $dbaccess</i ></H1 > $a
exec_query($sql, $lvl=0, $prepare=false)
print $fam getTitle() $fam name
Add($nopost=false, $nopre=false)
hasPermission($acl_name, $app_name="", $strict=false)
setVolatileParam($key, $val)
getCssLink($ref, $needparse=null, $packName= '')
addRessourceRef($type, $ref, $needparse, $packName)
Redirect($action, $appname, $actionname, $otherurl="", $httpparamredirect=false)
getFilteredImageUrl($imgf)
static getParamDef($name, $appid=null)
fetch_array($c, $type=PGSQL_ASSOC)
exists($app_name, $id_application=0)
modify($nopost=false, $sfields="", $nopre=false)
__construct($dbaccess= '', $id= '', $res= '', $dbid=0)
addCssRef($ref, $needparse=null, $packName= '')
const RULE_FLAG_PARSE_ON_RUNTIME
deprecatedFunction($msg= '')
setAdminMode($enable=true)
if(($docid!==0)&&(!is_numeric($docid))) $query
simpleQuery($dbaccess, $query, &$result=array(), $singlecolumn=false, $singleresult=false, $useStrict=null)
getImageUrl($img, $detectstyle=true, $size=null)
if($file) if($subject==""&&$file) if($subject=="") $err
getImageLink($img, $detectstyle=true, $size=null)
getJsLink($ref, $needparse=false, $packName= '')
affect($array, $more=false, $reset=true)
OldGetLayoutFile($layname)
initStyle($init=true, $useStyle= '')
addJsRef($ref, $needparse=false, $packName= '')