57 $this->jquery=$controller->jquery;
67 public function getForm($identifier, $instance) {
68 $type=($instance->_new) ?
"new" :
"edit";
69 $messageInfos=[
"new" => [
"icon" => HtmlIconGroups::corner(
"table",
"plus",
"big"),
"message" =>
"New object creation" ],
"edit" => [
"icon" => HtmlIconGroups::corner(
"table",
"edit",
"big"),
"message" =>
"Editing an existing object" ] ];
70 $message=$messageInfos[$type];
71 $form=$this->jquery->semantic()->dataForm($identifier, $instance);
72 $className=\get_class($instance);
73 $fields=$this->controller->_getAdminData()->getFormFieldNames($className);
74 $form->setFields($fields);
75 $form->insertField(0,
"_message");
76 $form->fieldAsMessage(
"_message", [
"icon" => $message[
"icon"] ]);
77 $instance->_message=$className;
79 foreach ( $fieldTypes as $property => $type ) {
82 $form->fieldAsCheckbox($property);
86 $form->fieldAsInput($property, [
"inputType" =>
"number" ]);
89 $form->fieldAsInput($property, [
"inputType" =>
"date" ]);
92 $form->fieldAsInput($property, [
"inputType" =>
"datetime-local" ]);
97 $form->setCaptions($this->
getFormCaptions($form->getInstanceViewer()->getVisibleProperties(), $className, $instance));
98 $form->setCaption(
"_message", $message[
"message"]);
99 $form->setSubmitParams($this->controller->_getAdminFiles()->getAdminBaseRoute() .
"/update",
"#frm-add-update");
110 $adminRoute=$this->controller->_getAdminFiles()->getAdminBaseRoute();
111 $semantic=$this->jquery->semantic();
113 $modal=($this->
isModal($instances, $model) ?
"modal" :
"no");
114 $lv=$semantic->dataTable(
"lv", $model, $instances);
115 $attributes=$this->controller->getFieldNames($model);
117 $lv->setCaptions($this->
getCaptions($attributes, $model));
118 $lv->setFields($attributes);
119 $lv->onPreCompile(
function () use ($attributes, &$lv) {
120 $lv->getHtmlComponent()->colRight(\count($attributes));
123 $lv->setIdentifierFunction($this->controller->getIdentifierFunction($model));
124 $lv->getOnRow(
"click", $adminRoute .
"/showDetail",
"#table-details", [
"attr" =>
"data-ajax" ]);
125 $lv->setUrls([
"delete" => $adminRoute .
"/delete",
"edit" => $adminRoute .
"/edit/" . $modal ]);
126 $lv->setTargetSelector([
"delete" =>
"#table-messages",
"edit" =>
"#frm-add-update" ]);
127 $lv->addClass(
"small very compact");
128 $lv->addEditDeleteButtons(
false, [
"ajaxTransition" =>
"random" ],
function ($bt) {
129 $bt->addClass(
"circular");
131 $bt->addClass(
"circular");
133 $lv->setActiveRowSelector(
"error");
134 $this->jquery->getOnClick(
"#btAddNew", $adminRoute .
"/newModel/" . $modal,
"#frm-add-update");
135 $this->jquery->click(
"_.edit",
"console.log($(this).closest('.ui.button'));");
146 return \count($objects) > 5;
155 return array_map(
"ucfirst", $captions);
164 return array_map(
"ucfirst", $captions);
168 return new HtmlHeader(
"", 4, $member,
"content");
172 return new HtmlHeader(
"", 4, $member .
" (" . \count($list) .
")",
"content");
183 return $this->jquery->semantic()->htmlLabel(
"element-" . $className .
"." . $member, $object .
"");
194 $element=$this->jquery->semantic()->htmlList(
"list-" . $className .
"." . $member);
195 return $element->addClass(
"animated divided celled");
202 return [
"models" => [
"Models",
"sticky note",
"Used to perform CRUD operations on data." ],
"routes" => [
"Routes",
"car",
"Displays defined routes with annotations" ],
"controllers" => [
"Controllers",
"heartbeat",
"Displays controllers and actions" ],
"cache" => [
"Cache",
"lightning",
"Annotations, models, router and controller cache" ],
"rest" => [
"Rest",
"server",
"Restfull web service" ],
"config" => [
"Config",
"settings",
"Configuration variables" ],
"seo" => [
"Seo",
"google",
"Search Engine Optimization" ],
"logs" => [
"Logs",
"bug",
"Log files" ] ];
208 foreach ( $routes as $route ) {
209 $errors=\array_merge($errors, $route->getMessages());
211 if (\
sizeof($errors) > 0) {
212 $messages=$this->controller->showSimpleMessage($errors,
"error",
"warning");
214 $dt=$this->jquery->semantic()->dataTable($dtName,
"Ubiquity\controllers\admin\popo\Route", $routes);
215 $dt->setIdentifierFunction(
function ($i, $instance) {
216 return $instance->getId();
218 $dt->setFields([
"path",
"methods",
"controller",
"action",
"cache",
"expired",
"name" ]);
219 $dt->setCaptions([
"Path",
"Methods",
"Controller",
"Action & parameters",
"Cache",
"Expired",
"Name",
"" ]);
220 $dt->fieldAsLabel(
"path",
"car");
225 $dt->onRowClick(
'$("#filter-routes").val($(this).find(".ui.label").text());');
226 $dt->onPreCompile(
function ($dTable) {
227 $dTable->setColAlignment(7, TextAlignment::RIGHT);
228 $dTable->setColAlignment(5, TextAlignment::CENTER);
231 $dt->setActiveRowSelector(
"warning");
232 $dt->wrap($messages);
233 $dt->setEdition()->addClass(
"compact");
238 $dt=$this->jquery->semantic()->dataTable(
"dtControllers",
"Ubiquity\controllers\admin\popo\ControllerAction", $controllers);
239 $dt->setFields([
"controller",
"action",
"dValues" ]);
240 $dt->setIdentifierFunction(
function ($i, $instance) {
241 return \urlencode($instance->getController());
243 $dt->setCaptions([
"Controller",
"Action [routes]",
"Default values",
"" ]);
245 $dt->setValueFunction(
"controller",
function ($v, $instance, $index) {
246 $bts=
new HtmlButtonGroups(
"bt-" . \urlencode($v), [ $v ]);
247 $bts->addClass(
"basic");
248 $bt=$bts->getItem(0);
249 $bt->addClass(
"_clickFirst")->setIdentifier(
"bt-0-" . $v);
250 $bt->addIcon(
"heartbeat",
true,
true);
252 $dd=$bts->addDropdown([
"Add new action in <b>{$v}</b>..." ]);
253 $dd->setIcon(
"plus");
254 $item=$dd->getItem(0);
255 $item->addClass(
"_add-new-action")->setProperty(
"data-controller", $instance->getController());
256 $bt->onClick(
"$(\"tr[data-ajax='" . \urlencode($instance->getController()) .
"'] td:not([rowspan])\").toggle(!$(this).hasClass('active'));");
259 $dt->setValueFunction(
"action",
function ($v, $instance, $index) {
262 $r=new \ReflectionMethod($instance->getController(), $action);
263 $lines=file($r->getFileName());
264 $params=$instance->getParameters();
265 \array_walk($params,
function (&$item) {
268 $params=
" (" . \implode(
" , ", $params) .
")";
269 $v=
new HtmlSemDoubleElement(
"",
"span",
"",
"<b>" . $v .
"</b>");
270 $v->setProperty(
"style",
"color: #3B83C0;");
271 $v->addIcon(
"lightning");
272 $v.=
new HtmlSemDoubleElement(
"",
"span",
"", $params);
273 $annots=$instance->getAnnots();
274 foreach ( $annots as $path => $annotDetail ) {
275 $lbl=
new HtmlLabel(
"", $path,
"car");
276 $lbl->setProperty(
"data-ajax", \htmlspecialchars(($path)));
277 $lbl->addClass(
"_route");
280 $v=\array_merge([ $v,
"<span class='_views-container'>" ], $this->
getActionViews($instance->getController(),
$controller, $action, $r, $lines));
284 $dt->onPreCompile(
function ($dt) {
285 $dt->setColAlignment(3, TextAlignment::RIGHT);
286 $dt->getHtmlComponent()->mergeIdentiqualValues(0);
288 $dt->setEdition(
true);
289 $dt->addClass(
"compact");
296 foreach ( $loadedViews as $view ) {
297 if (\file_exists(ROOT . DS .
"views" . DS . $view)) {
298 $lbl=
new HtmlLabel(
"lbl-view-" .
$controller . $action . $view, $view,
"browser",
"span");
299 $lbl->addClass(
"violet");
300 $lbl->addPopupHtml(
"<i class='icon info circle green'></i> <b>" . $view .
"</b> is ok.");
302 $lbl=
new HtmlLabel(
"lbl-view-" .
$controller . $action . $view, $view,
"warning",
"span");
303 $lbl->addClass(
"orange");
304 $lbl->addPopupHtml(
"<i class='icon warning circle'></i> <b>" . $view .
"</b> file is missing.");
309 if (!\file_exists(ROOT . DS .
"views" . DS . $viewname)) {
310 $bt=
new HtmlButton(
"",
"Create view " . $viewname);
311 $bt->setProperty(
"data-action", $action);
313 $bt->setProperty(
"data-controllerFullname", $controllerFullname);
314 $bt->addClass(
"_create-view visibleover basic violet mini")->setProperty(
"style",
"visibility: hidden;")->addIcon(
"plus");
316 } elseif (\array_search($viewname, $loadedViews) ===
false) {
317 $lbl=
new HtmlLabel(
"lbl-view-" .
$controller . $action . $viewname, $viewname,
"browser",
"span");
318 $lbl->addPopupHtml(
"<i class='icon warning circle'></i> <b>" . $viewname .
"</b> exists but is never loaded in action <b>" . $action .
"</b>.");
325 $dt->addFieldButtons([
"GET",
"POST" ],
true,
function (HtmlButtonGroups $bts, $instance, $index) {
326 $path=$instance->getPath();
327 $path=\str_replace(
"(.*?)",
"", $path);
328 $path=\str_replace(
"(index/)?",
"", $path);
329 $bts->setIdentifier(
"bts-" . $instance->getId() .
"-" . $index);
330 $bts->getItem(0)->addClass(
"_get")->setProperty(
"data-url", $path);
331 $bts->getItem(1)->addClass(
"_post")->setProperty(
"data-url", $path);
332 $item=$bts->addDropdown([
"Post with parameters..." ])->getItem(0);
333 $item->addClass(
"_postWithParams")->setProperty(
"data-url", $path);
338 $dt=$this->jquery->semantic()->dataTable(
"dtCacheFiles",
"Ubiquity\controllers\admin\popo\CacheFile", $cacheFiles);
339 $dt->setFields([
"type",
"name",
"timestamp",
"size" ]);
340 $dt->setCaptions([
"Type",
"Name",
"Timestamp",
"Size",
"" ]);
341 $dt->setValueFunction(
"type",
function ($v, $instance, $index) {
342 $item=$this->jquery->semantic()->htmlDropdown(
"dd-type-" . $v, $v);
343 $item->addItems([
"Delete all",
"(Re-)Init cache" ]);
344 $item->setPropertyValues(
"data-ajax", $v);
345 $item->getItem(0)->addClass(
"_delete-all");
346 if ($instance->getFile() ===
"")
347 $item->getItem(0)->setDisabled();
348 $item->getItem(1)->addClass(
"_init");
349 if ($instance->getType() !==
"Models" && $instance->getType() !==
"Controllers")
350 $item->getItem(1)->setDisabled();
351 $item->asButton()->addIcon(
"folder",
true,
true);
354 $dt->addDeleteButton(
true, [ ],
function ($o, $instance) {
355 if ($instance->getFile() ==
"")
357 $type=$instance->getType();
358 $o->setProperty(
"data-type", $type);
359 $type=\strtolower($type);
360 if ($type ==
'models' || $type ==
'controllers') {
361 $o->setProperty(
"data-key", $instance->getName());
363 $o->setProperty(
"data-key", $instance->getFile());
366 $dt->setIdentifierFunction(
"getFile");
367 $dt->setValueFunction(
"timestamp",
function ($v) {
369 return date(DATE_RFC2822, $v);
371 $dt->setValueFunction(
"size",
function ($v) {
373 return self::formatBytes($v);
375 $dt->setValueFunction(
"name",
function ($name, $instance, $i) {
376 if (JString::isNotNull($name)) {
377 $link=
new HtmlLink(
"lnl-" . $i);
378 $link->setContent($name);
379 $link->addIcon(
"edit");
380 $link->addClass(
"_lnk");
381 $link->setProperty(
"data-type", $instance->getType());
382 $link->setProperty(
"data-ajax", $instance->getFile());
383 $link->setProperty(
"data-key", $instance->getName());
387 $dt->onPreCompile(
function ($dt) {
388 $dt->getHtmlComponent()->mergeIdentiqualValues(0);
390 $this->jquery->postOnClick(
"._lnk", $this->controller->_getAdminFiles()->getAdminBaseRoute() .
"/_showFileContent",
"{key:$(this).attr('data-key'),type:$(this).attr('data-type'),filename:$(this).attr('data-ajax')}",
"#modal", [
"hasLoader" => false ]);
391 $this->jquery->postFormOnClick(
"._delete", $this->controller->_getAdminFiles()->getAdminBaseRoute() .
"/deleteCacheFile",
"frmCache",
"#dtCacheFiles tbody", [
"jqueryDone" =>
"replaceWith",
"params" =>
"{type:$(this).attr('data-type'),toDelete:$(this).attr('data-key')}" ]);
392 $this->jquery->postFormOnClick(
"._delete-all", $this->controller->_getAdminFiles()->getAdminBaseRoute() .
"/deleteAllCacheFiles",
"frmCache",
"#dtCacheFiles tbody", [
"jqueryDone" =>
"replaceWith",
"params" =>
"{type:$(this).attr('data-ajax')}" ]);
393 $this->jquery->postFormOnClick(
"._init", $this->controller->_getAdminFiles()->getAdminBaseRoute() .
"/initCacheType",
"frmCache",
"#dtCacheFiles tbody", [
"jqueryDone" =>
"replaceWith",
"params" =>
"{type:$(this).attr('data-ajax')}" ]);
398 $de=$this->jquery->semantic()->dataElement(
"dtStructure", $datas);
399 $fields=\array_keys($datas);
400 $de->setFields($fields);
401 $de->setCaptions($fields);
402 foreach ( $fields as $key ) {
403 $de->setValueFunction($key,
function ($value) {
404 if ($value instanceof \stdClass) {
405 $value=( array ) $value;
407 return \print_r($value,
true);
414 $tabs=$this->jquery->semantic()->htmlTab(
"tabsRest");
416 foreach ( $datas as
$controller => $restAttributes ) {
418 $list=
new HtmlList(
"attributes", [ [
"heartbeat",
"Controller",
$controller ],[
"car",
"Route",$restAttributes[
"restAttributes"][
"route"] ] ]);
419 $list->setHorizontal();
422 $desc=$parser->getDescriptionAsHtml();
424 $doc=
new HtmlMessage(
"msg-doc-controller-" .
$controller, $desc);
425 $doc->setIcon(
"help blue circle")->setDismissable()->addClass(
"transition hidden");
430 foreach ( $routes as $route ) {
431 $errors=\array_merge($errors, $route->getMessages());
433 $resource=$restAttributes[
"restAttributes"][
"resource"];
434 $tab=$tabs->addTab($resource, [ $doc,$list,$this->
_getRestRoutesDataTable($routes,
"dtRest", $resource, $restAttributes[
"restAttributes"][
"authorizations"]) ]);
435 if (\
sizeof($errors) > 0) {
436 $tab->menuTab->addLabel(
"error")->setColor(
"red")->addIcon(
"warning sign");
437 $tab->addContent($this->controller->showSimpleMessage(\array_values($errors),
"error",
"warning"),
true);
440 $tab->menuTab->addIcon(
"help circle blue")->onClick(
"$('#" . $doc->getIdentifier() .
"').transition('horizontal flip');");
447 $dt=$this->jquery->semantic()->dataTable($dtName,
"Ubiquity\controllers\admin\popo\Route", $routes);
448 $dt->setIdentifierFunction(
function ($i, $instance) {
449 return $instance->getPath();
451 $dt->setFields([
"path",
"methods",
"action",
"cache",
"expired" ]);
452 $dt->setCaptions([
"Path",
"Methods",
"Action & Parameters",
"Cache",
"Exp?",
"" ]);
453 $dt->fieldAsLabel(
"path",
"car");
456 $dt->setValueFunction(
"action",
function ($v, $instance) use ($authorizations) {
458 if (\array_search($v, $authorizations) !==
false) {
459 $auth=
new HtmlIcon(
"lock-" . $instance->getController() . $v,
"lock alternate");
460 $auth->addPopup(
"Authorization",
"This route require a valid access token");
462 $result=[
"<span style=\"color: #3B83C0;\">" . $v .
"</span>" . $instance->getCompiledParams() .
"<i class='ui icon help circle blue hidden transition _showMsgHelp' id='" . JString::cleanIdentifier(
"help-" . $instance->getAction() . $instance->getController()) .
"' data-show='" . JString::cleanIdentifier(
"msg-help-" . $instance->getAction() . $instance->getController()) .
"'></i>",$auth ];
466 $dt->addFieldButton(
"Test",
true,
function ($bt, $instance) use ($resource) {
468 $bt->setProperty(
"data-action", $instance->getAction())->setProperty(
"data-controller", \urlencode($instance->getController()));
470 $dt->onPreCompile(
function ($dTable) {
471 $dTable->setColAlignment(5, TextAlignment::RIGHT);
472 $dTable->setColAlignment(4, TextAlignment::CENTER);
474 $dt->setEdition()->addClass(
"compact");
479 $dt->setValueFunction(
"methods",
function ($v) {
482 if (!\is_array($v)) {
485 $result=
new HtmlLabelGroups(
"lbls-method", $v, [
"color" =>
"grey" ]);
492 $dt->setValueFunction(
"cache",
function ($v, $instance) {
493 $ck=
new HtmlFormCheckbox(
"ck-" . $instance->getPath(), $instance->getDuration() .
"");
501 $dt->setValueFunction(
"expired",
function ($v, $instance, $index) {
504 if ($instance->getCache()) {
505 if (\
sizeof($instance->getParameters()) === 0 || $instance->getParameters() === null)
507 if ($expired ===
false) {
508 $icon=
"hourglass full";
509 } elseif ($expired ===
true) {
510 $icon=
"hourglass empty orange";
515 return new HtmlIcon(
"", $icon);
520 $dt->setValueFunction(
"action",
function ($v, $instance) {
521 $result=
"<span style=\"font-weight: bold;color: #3B83C0;\">" . $v .
"</span>";
522 $result.=$instance->getCompiledParams();
523 if (!\method_exists($instance->getController(), $v)) {
524 $errorLbl=
new HtmlIcon(
"error-" . $v,
"warning sign red");
525 $errorLbl->addPopup(
"",
"Missing method!");
526 return [ $result,$errorLbl ];
533 $de=$this->jquery->semantic()->dataElement(
"deConfig", $config);
534 $fields=\array_keys($config);
535 $de->setFields($fields);
536 $de->setCaptions($fields);
537 $de->setValueFunction(
"database",
function ($v, $instance, $index) {
538 $dbDe=
new DataElement(
"", $v);
539 $dbDe->setFields([
"type",
"dbName",
"serverName",
"port",
"user",
"password",
"cache" ]);
540 $dbDe->setCaptions([
"Type",
"dbName",
"serverName",
"port",
"user",
"password",
"cache" ]);
543 $de->setValueFunction(
"templateEngineOptions",
function ($v, $instance, $index) {
544 $teoDe=
new DataElement(
"", $v);
545 $teoDe->setFields([
"cache" ]);
546 $teoDe->setCaptions([
"cache" ]);
547 $teoDe->fieldAsCheckbox(
"cache", [
"class" =>
"ui checkbox slider" ]);
550 $de->setValueFunction(
"mvcNS",
function ($v, $instance, $index) {
551 $mvcDe=
new DataElement(
"", $v);
552 $mvcDe->setFields([
"models",
"controllers",
"rest" ]);
553 $mvcDe->setCaptions([
"Models",
"Controllers",
"Rest" ]);
556 $de->setValueFunction(
"di",
function ($v, $instance, $index) use ($config) {
557 $diDe=
new DataElement(
"", $v);
558 $keys=\array_keys($config[
"di"]);
559 $diDe->setFields($keys);
560 foreach ( $keys as $key ) {
561 $diDe->setValueFunction($key,
function ($value) use ($config, $key) {
562 $r=$config[
'di'][$key];
563 if (\is_callable($r))
570 $de->setValueFunction(
"isRest",
function ($v) use ($config) {
571 $r=$config[
"isRest"];
572 if (\is_callable($r))
576 $de->fieldAsCheckbox(
"test", [
"class" =>
"ui checkbox slider" ]);
577 $de->fieldAsCheckbox(
"debug", [
"class" =>
"ui checkbox slider" ]);
582 $base=log($size, 1024);
583 $suffixes=array (
'o',
'Ko',
'Mo',
'Go',
'To' );
584 return round(pow(1024, $base - floor($base)), $precision) .
' ' . $suffixes[floor($base)];
589 foreach ( $relations as $member ) {
592 } elseif ($this->controller->_getAdminData()->getUpdateOneToManyInForm() && ($annot=
OrmUtils::getAnnotationInfoMember($className,
"#oneToMany", $member)) !==
false) {
594 } elseif ($this->controller->_getAdminData()->getUpdateManyToManyInForm() && ($annot=
OrmUtils::getAnnotationInfoMember($className,
"#manyToMany", $member)) !==
false) {
604 $fkClass=$joinColumn[
"className"];
605 if ($fkObject === null) {
606 $fkObject=
new $fkClass();
609 $fkIdGetter=
"get" . \ucfirst($fkId);
610 if (\method_exists($fkObject,
"__toString") && \method_exists($fkObject, $fkIdGetter)) {
611 $fkField=$joinColumn[
"name"];
615 $form->addField($fkField);
617 $form->fieldAsDropDown($fkField, JArray::modelArray(
DAO::getAll($fkClass), $fkIdGetter,
"__toString"));
618 $form->setCaption($fkField, \ucfirst($member));
624 $newField=$member .
"Ids";
625 $fkClass=$annot[
"className"];
627 $fkIdGetter=
"get" . \ucfirst($fkId);
629 $form->addField($newField);
630 $ids=\array_map(
function ($elm) use ($fkIdGetter) {
631 return $elm->{$fkIdGetter}();
633 $instance->{$newField}=\implode(
",", $ids);
634 $form->fieldAsDropDown($newField, JArray::modelArray(
DAO::getAll($fkClass), $fkIdGetter,
"__toString"),
true);
635 $form->setCaption($newField, \ucfirst($member));
639 $newField=$member .
"Ids";
640 $fkClass=$annot[
"targetEntity"];
642 $fkIdGetter=
"get" . \ucfirst($fkId);
644 $form->addField($newField);
645 $ids=\array_map(
function ($elm) use ($fkIdGetter) {
646 return $elm->{$fkIdGetter}();
648 $instance->{$newField}=\implode(
",", $ids);
649 $form->fieldAsDropDown($newField, JArray::modelArray($this->controller->_getAdminData()->getManyToManyDatas($fkClass, $instance, $member), $fkIdGetter,
"__toString"),
true, [
"jsCallback" =>
function ($elm) {
650 $elm->getField()->asSearch();
652 $form->setCaption($newField, \ucfirst($member));
656 $items=$this->jquery->semantic()->htmlItems($identifier);
658 $items->fromDatabaseObjects($array,
function ($e) {
659 $item=
new HtmlItem(
"");
660 $item->addIcon($e[1] .
" bordered circular")->setSize(
"big");
661 $item->addItemHeaderContent($e[0], [ ], $e[2]);
662 $item->setProperty(
"data-ajax", \strtolower($e[0]));
665 $items->getOnClick($this->controller->_getAdminFiles()->getAdminBaseRoute(),
"#main-content", [
"attr" =>
"data-ajax" ]);
666 return $items->addClass(
"divided relaxed link");
static getFieldsInRelations($class)
getControllersDataTable($controllers)
oneToManyFormField(DataForm $form, $member, $instance, $annot)
getFkHeaderList($member, $className, $list)
relationMembersInForm($form, $instance, $className)
_getRestRoutesDataTable($routes, $dtName, $resource, $authorizations)
static formatBytes($size, $precision=2)
getRoutesDataTable($routes, $dtName="dtRoutes")
getFkElement($member, $className, $object)
static getAnnotationInfoMember($class, $keyAnnotation, $member)
static setMemberValue($instance, $member, $value)
getCacheDataTable($cacheFiles)
getConfigDataElement($config)
__construct(UbiquityMyAdminBaseController $controller)
static getFirstKey($class)
getModelDataTable($instances, $model)
Returns the dataTable responsible for displaying instances of the model.
static getFirstKeyValue($instance)
getFormCaptions($captions, $className, $instance)
Returns the captions for form fields.
addGetPostButtons(DataTable $dt)
static getManyToMany($instance, $member, $array=null, $useCache=NULL)
Assigns / loads the child records in the $member member of $instance.
getModelsStructureDataTable($datas)
static getAll($className, $condition='', $loadManyToOne=true, $loadOneToMany=false, $useCache=NULL)
Returns an array of $className objects from the database.
static docClassParser($classname)
_dtExpired(DataTable $dt)
isModal($objects, $model)
Condition to determine if the edit or add form is modal for $model objects.
static getMemberValue($instance, $member)
getFkList($member, $className, $list)
manyToOneFormField(DataForm $form, $member, $className, $instance)
static getFieldTypes($className)
_dtMethods(DataTable $dt)
static getOneToMany($instance, $member, $useCache=NULL, $annot=null)
Assign / load the child records in the $member member of $instance.
getCaptions($captions, $className)
Returns the captions for list fields in showTable action.
static isExpired($path, $duration)
static closure_dump(\Closure $c)
static cleanClassname($classname)
getMainIndexItems($identifier, $array)
getFkHeaderElement($member, $className, $object)
static getLoadedViews(\ReflectionMethod $r, $lines)
getActionViews($controllerFullname, $controller, $action, \ReflectionMethod $r, $lines)
manyToManyFormField(DataForm $form, $member, $instance, $annot)
displayFkElementList($element, $member, $className, $object)
static getClassSimpleName($classnameWithNamespace)
getForm($identifier, $instance)
Returns the form for adding or modifying an object.