/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
+
function applyFilters($q, $au)
{
if(!empty($q['!name'])){
$names = explode(',', $q['!name']);
-
- $this->whereAddIn('name', $names, 'string', 'NOT');
-
- //print_r(11);
+ foreach($names as $name){
+ $this->whereAdd("
+ core_enum.name NOT IN ('$name')
+ ");
+ }
+ }
+ }
+
+ function postListFilter($data, $authUser, $q) {
+
+ if(!empty($q['cmsTab'])){
+ $ret = array();
+ foreach($data as $k=>$v){
+ if($v['name'] == 'element'){
+ continue;
+ }
+ $ary = $v;
+ if($ary['name'] == 'page'){
+ $ary['display_name'] = $v['display_name'].' / Elements';
+ }
+ $ret[] = $ary;
+ }
+ $data = $ret;
}
+ return $data;
}
}
+ function fetchAllByType($etype, $fetchArg1=false, $fetchArg2=false, $fetchArg3=false)
+ {
+ $x = DB_DataObject::factory('core_enum');
+ $x->etype = $etype;
+ $x->active = 1;
+ return $x->fetchAll($fetchArg1, $fetchArg2, $fetchArg3);
+ }
+
function lookupObject($etype,$name, $create= false)
{
}
- function initEnums($data = false, $base = array())
+ function initEnums($data, $base = array())
{
- if ($data === false) {
- $this->initEnums($this->baseEnums());
- return;
- }
+
$seq_id = 0;
if (!empty($base['etype'])) {
$seq_id = 1;
$t->setFrom($row);
$t->setFrom($base);
+ unset($t->seqid); // these might have been changed
+ unset($t->display_name); // these might have been changed
+
+
+ if (!$t->find(true))
+ {
+ $t->setFrom($row);
+ $t->setFrom($base);
- if (!$t->find(true)) {
if (!empty($base['etype']) && empty($row['seqid'])) {
$t->seqid = $seq_id;
$seq_id++;