function getExpressionTree($expr) { global $g_sqlSingleRecFuncs; $parser = new SqlParser($expr); $king_expr = new Expression(); $current_expr =& $king_expr; while (!is_empty_str($elem = $parser->parseNextElementRaw())) { // function or IN / NOT IN? if (in_array(strtoupper($elem), $g_sqlSingleRecFuncs) || strtoupper($elem) == "IN" || strtoupper($elem) == "NOT IN") { $current_expr->expr_str .= $elem . " "; $elem = $parser->parseNextElementRaw(); if ($elem != "(") { print_error_msg("( expected after " . $current_expr->expr_str); return null; } $current_expr->expr_str .= $elem; while (!is_empty_str($elem = $parser->parseNextElementRaw()) && $elem != ")") { $current_expr->expr_str .= $elem; } $current_expr->expr_str .= $elem . " "; continue; } if ($elem == "(") { $current_expr->expr_str .= " % "; unset($new_expr); $new_expr = new Expression(""); $current_expr->addChild($new_expr); $new_expr->setParent($current_expr); unset($current_expr); $current_expr =& $new_expr; } else { if ($elem == ")") { unset($tmp); $tmp =& $current_expr->getParent(); unset($current_expr); $current_expr =& $tmp; } else { // no spaces on .'s if ($elem == ".") { remove_last_char($current_expr->expr_str); $current_expr->expr_str .= $elem; } else { $current_expr->expr_str .= $elem . " "; } } } } return $king_expr; }
/** * Constructor * * Reads project's and default .ini file, sets project handler's * and initializes paths. * @param location config file */ public function __construct($plugin) { parent::__construct(); $this->plugin = $plugin; $this->setPagerKey('patt'); $this->importing = false; $this->template = array(); $this->templateFile = "calendarimage.tpl"; $this->basePath = realpath(dirname(__FILE__) . "/../") . "/"; $this->sqlParser->setSelect('select'); $this->sqlParser->setTable('calendar_image', 'a'); $this->sqlParser->addField(new SqlField('a', 'img_id', 'id', 'id', SqlParser::getTypeSelect() | SqlParser::PKEY, SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'img_cal_id', 'cal_id', 'Calendar', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('b', 'cal_tree_id', 'tree_id', 'Node', SqlParser::getTypeSelect(), SqlField::TYPE_INTEGER, false)); $this->sqlParser->addField(new SqlField('b', 'cal_tag', 'tag', 'Tag', SqlParser::getTypeSelect(), SqlField::TYPE_STRING, false)); $this->sqlParser->addField(new SqlField('b', 'cal_active', 'cal_active', 'Actieve status', SqlParser::getTypeSelect(), SqlField::TYPE_BOOLEAN)); $this->sqlParser->addField(new SqlField('a', 'img_weight', 'weight', 'Index', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'img_active', 'active', 'Actieve status', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_BOOLEAN)); $this->sqlParser->addField(new SqlField('a', 'img_name', 'name', 'Naam', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::NAME, SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'img_thumbnail', 'thumbnail', 'Afbeelding', SqlParser::getTypeSelect(), SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('a', 'img_image', 'image', 'Afbeelding', SqlParser::getTypeSelect(), SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('a', 'img_img_x', 'img_x', 'Offset x', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'img_img_y', 'img_y', 'Offset y', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'img_img_width', 'img_width', 'Offset width', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'img_img_height', 'img_height', 'Offset height', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'img_usr_id', 'usr_id', 'Gebruiker', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'img_own_id', 'own_id', 'Eigenaar', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'img_create', 'createdate', 'Creatie', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_DATE, true)); $this->sqlParser->addField(new SqlField('a', 'img_ts', 'ts', 'Gewijzigd', SqlParser::getTypeSelect(), SqlField::TYPE_DATE)); $this->sqlParser->addFrom("inner join calendar as b on b.cal_id = a.img_cal_id"); $this->orderStatement = array('order by a.img_weight asc, a.img_name asc'); }
/** * Constructor * * Reads project's and default .ini file, sets project handler's * and initializes paths. * @param location config file */ public function __construct($plugin) { parent::__construct(); $this->plugin = $plugin; $this->template = array(); $this->templateFile = "reservationoverview.tpl"; $this->basePath = realpath(dirname(__FILE__) . "/../") . "/"; $this->sqlParser->setSelect('select'); $this->sqlParser->setTable('reservation', 'a'); $this->sqlParser->addField(new SqlField('a', 'res_id', 'id', 'id', SqlParser::getTypeSelect() | SqlParser::PKEY, SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'res_tree_id', 'tree_id', 'Node', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'res_tag', 'tag', 'Tag', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'res_active', 'active', 'Actieve status', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_BOOLEAN)); $this->sqlParser->addField(new SqlField('b', 'usr_name', 'name', 'AchterNaam', SqlParser::getTypeSelect() | SqlParser::NAME, SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('b', 'usr_firstname', 'firstname', 'Voornaam', SqlParser::getTypeSelect() | SqlParser::NAME, SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('a', 'res_usr_id', 'usr_id', 'User', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'res_date', 'reservation_date', 'Date', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::NAME, SqlField::TYPE_DATE)); $this->sqlParser->addField(new SqlField('a', 'res_time', 'reservation_time', 'Time', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::NAME, SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('a', 'res_vip', 'vip', 'VIP reservation', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_BOOLEAN)); $this->sqlParser->addField(new SqlField('a', 'res_own_id', 'own_id', 'Owner', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'res_create', 'createdate', 'Created', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_DATE, true)); $this->sqlParser->addField(new SqlField('a', 'res_ts', 'ts', 'Modified', SqlParser::getTypeSelect(), SqlField::TYPE_DATE)); $this->sqlParser->addFrom('left join users as b on b.usr_id = a.res_usr_id'); $this->orderStatement = array(self::ORDER_TIME_ASC => 'order by a.res_date %s, a.res_time asc , b.usr_name asc', self::ORDER_TIME_DESC => 'order by a.res_date %s, a.res_time desc , b.usr_name asc'); }
/** * Constructor * * Reads project's and default .ini file, sets project handler's * and initializes paths. * @param location config file */ public function __construct($plugin) { parent::__construct(); $this->plugin = $plugin; $this->template = array(); $this->templateFile = "newslettertag.tpl"; $this->basePath = realpath(dirname(__FILE__) . "/../") . "/"; $this->sqlParser->setSelect('select'); $this->sqlParser->setTable('newsletter_tag', 'a'); $this->sqlParser->addField(new SqlField('b', 'nl_name', 'name', 'Newsletter title', SqlParser::getTypeSelect() | SqlParser::NAME, SqlField::TYPE_STRING, false)); $this->sqlParser->addField(new SqlField('a', 'tag_nl_id', 'nl_id', 'NewsLetter id', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::PKEY, SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'tag_parent_tag', 'parent_tag', 'Parent tag name', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::PKEY | SqlParser::NAME, SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('b', 'nl_tree_id', 'tree_id', 'Node', SqlParser::getTypeSelect(), SqlField::TYPE_INTEGER, false)); $this->sqlParser->addField(new SqlField('b', 'nl_tag', 'tag', 'Tag', SqlParser::getTypeSelect(), SqlField::TYPE_STRING, false)); $this->sqlParser->addField(new SqlField('a', 'tag_tags', 'tags', 'Replacement tags', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('a', 'tag_template', 'template', 'Template', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('a', 'tag_stylesheet', 'stylesheet', 'Stylesheet', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('a', 'tag_usr_id', 'usr_id', 'User', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'tag_own_id', 'own_id', 'Owner', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'tag_create', 'createdate', 'Create date', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_DATE, true)); $this->sqlParser->addField(new SqlField('a', 'tag_ts', 'ts', 'Modified', SqlParser::getTypeSelect(), SqlField::TYPE_DATE)); $this->sqlParser->addFrom("inner join newsletter as b on b.nl_id = a.tag_nl_id"); //$this->orderStatement = array('order by a.tag_tag %s'); $this->settings = array(); }
/** * Constructor * * Reads project's and default .ini file, sets project handler's * and initializes paths. * @param location config file */ public function __construct() { parent::__construct(); $this->configFile = strtolower(__CLASS__ . ".ini"); $this->template = array(); $this->templateFile = "links.tpl"; $this->basePath = realpath(dirname(__FILE__) . "/../") . "/"; $this->sqlParser->setSelect('select'); $this->sqlParser->setTable('links_settings', 'a'); $this->sqlParser->addField(new SqlField('a', 'lnk_id', 'id', 'id', SqlParser::getTypeSelect() | SqlParser::PKEY, SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'lnk_display', 'display', 'Display style', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'lnk_image_width', 'image_width', 'Breedte afbeelding', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'lnk_image_height', 'image_height', 'Hoogte afbeelding', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'lnk_image_max_width', 'image_max_width', 'maximale breedte afbeelding', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'lnk_rows', 'rows', 'Aantal items', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'lnk_usr_id', 'usr_id', 'Gebruiker', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'lnk_own_id', 'own_id', 'Eigenaar', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'lnk_create', 'createdate', 'Creatie', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_DATE, true)); $this->sqlParser->addField(new SqlField('a', 'lnk_ts', 'ts', 'Gewijzigd', SqlParser::getTypeSelect(), SqlField::TYPE_DATE)); //add new view types $view = ViewManager::getInstance(); $view->insert(self::VIEW_DETAIL, 'Details'); $view->insert(self::VIEW_IMPORT, 'Import images'); $view->insert(self::VIEW_RESIZE, 'Resize images'); $view->insert(self::VIEW_CONFIG, 'Configuration'); $view->insert(self::VIEW_MV_PREC, 'Move to previous element'); $view->insert(self::VIEW_MV_FOL, 'Move to next element'); }
/** * Constructor * * Reads project's and default .ini file, sets project handler's * and initializes paths. * @param location config file */ public function __construct($plugin) { parent::__construct(); $this->plugin = $plugin; $this->template = array(); $this->templateFile = "newsoverview.tpl"; $this->basePath = realpath(dirname(__FILE__) . "/../") . "/"; $this->sqlParser->setSelect('select'); $this->sqlParser->setTable('news', 'a'); $this->sqlParser->addField(new SqlField('a', 'news_id', 'id', 'id', SqlParser::getTypeSelect() | SqlParser::PKEY, SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'news_tree_id', 'tree_id', 'Node', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'news_tag', 'tag', 'Tag', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'news_active', 'active', 'Actieve status', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_BOOLEAN)); $this->sqlParser->addField(new SqlField('a', 'news_online', 'online', 'Online datum', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_DATE, true)); $this->sqlParser->addField(new SqlField('a', 'news_offline', 'offline', 'Offline datum', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_DATE)); $this->sqlParser->addField(new SqlField('a', 'news_date', 'date', 'Date', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_DATE)); $this->sqlParser->addField(new SqlField('a', 'news_name', 'name', 'Name', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::NAME, SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'news_intro', 'intro', 'Introduction', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('a', 'news_text', 'text', 'Content', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('a', 'news_thumbnail', 'thumbnail', 'Thumbnail', SqlParser::getTypeSelect(), SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('a', 'news_image', 'image', 'Afbeelding', SqlParser::getTypeSelect(), SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('a', 'news_img_x', 'img_x', 'Offset x', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'news_img_y', 'img_y', 'Offset y', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'news_img_width', 'img_width', 'Offset width', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'news_img_height', 'img_height', 'Offset height', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'news_count', 'count', 'Visits', SqlParser::getTypeSelect(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'news_usr_id', 'usr_id', 'User', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'news_own_id', 'own_id', 'Owner', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'news_create', 'createdate', 'Creatie', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_DATE, true)); $this->sqlParser->addField(new SqlField('a', 'news_ts', 'ts', 'Modified', SqlParser::getTypeSelect(), SqlField::TYPE_DATE)); $this->orderStatement = array('order by a.news_online desc, a.news_id desc'); }
function transaction($sql) { global $response, $apiKey, $data, $basePath; $parsedSQL = SqlParser::ParseString($sql)->getArray(); //$tokens = SqlParser::Tokenize($sql, true); if (strpos($sql, ';') !== false) { $response['success'] = false; $response['message'] = "You can't use ';'. Use the bulk transaction API instead"; } elseif (strpos($sql, '--') !== false) { $response['success'] = false; $response['message'] = "SQL comments '--' are not allowed"; } elseif ($parsedSQL['drop']) { $response['success'] = false; $response['message'] = "DROP is not allowed through the API"; } elseif ($parsedSQL['alter']) { $response['success'] = false; $response['message'] = "ALTER is not allowed through the API"; } elseif ($parsedSQL['create']) { $response['success'] = false; $response['message'] = "CREATE is not allowed through the API"; } elseif ($parsedSQL['update'] || $parsedSQL['insert'] || $parsedSQL['delete']) { if ($apiKey == $_REQUEST['key'] || $apiKey == false) { $api = new sqlapi(); $response = $api->transaction($_REQUEST['q']); } else { $response['success'] = false; $response['message'] = "Not the right key!"; } } elseif ($parsedSQL['select']) { parse_str(urldecode($_SERVER['QUERY_STRING']), $args); $id = $args['q']; if (!$args['lifetime']) { $args['lifetime'] = 0; } $options = array('cacheDir' => "{$basePath}/tmp/", 'lifeTime' => $args['lifetime']); $Cache_Lite = new Cache_Lite($options); if ($data = $Cache_Lite->get($id)) { //echo "cached"; } else { ob_start(); if ($_REQUEST['srs']) { $srs = $_REQUEST['srs']; } else { $srs = "900913"; } $api = new sqlapi($srs); $api->execQuery("set client_encoding='UTF8'", "PDO"); $response = $api->sql($_REQUEST['q']); echo json_encode($response); // Cache script $data = ob_get_contents(); $Cache_Lite->save($data, $id); ob_get_clean(); } } else { $response['success'] = false; $response['message'] = "Check your SQL. Could not recognise it as either SELECT, INSERT, UPDATE or DELETE"; } return $response; }
/** * Constructor * * Reads project's and default .ini file, sets project handler's * and initializes paths. * @param location config file */ public function __construct() { parent::__construct(); $this->template = array(); $this->templateFile = "loginmailer.tpl"; $this->templateEmail = "loginmailer_email.tpl"; //$this->configFile = strtolower(__CLASS__.".ini"); $this->basePath = realpath(dirname(__FILE__) . "/../") . "/"; $this->sqlParser->setSelect('select'); $this->sqlParser->setTable('login_mail', 'a'); $this->sqlParser->addField(new SqlField('a', 'login_tree_id', 'tree_id', 'Node', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::PKEY, SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'login_tag', 'tag', 'Tag', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::PKEY, SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'login_ref_tree_id', 'ref_tree_id', 'Reference Node', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'login_fin_tree_id', 'fin_tree_id', 'Reference Node success', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'login_intro', 'intro', 'Introductie', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('a', 'login_subject', 'subject', 'Email subject', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'login_content', 'content', 'Email content', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('a', 'login_cap_submit', 'submit', 'Submit button', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'login_cap_fin_submit', 'fin_submit', 'Submit button finish', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'login_usr_id', 'usr_id', 'Gebruiker', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'login_own_id', 'own_id', 'Eigenaar', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'login_create', 'createdate', 'Creatie', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_DATE, true)); $this->sqlParser->addField(new SqlField('a', 'login_ts', 'ts', 'Gewijzigd', SqlParser::getTypeSelect(), SqlField::TYPE_DATE)); //add new view types $view = ViewManager::getInstance(); $view->insert(self::VIEW_ACTIVATE, 'Activate'); }
/** * Constructor * * Reads project's and default .ini file, sets project handler's * and initializes paths. * @param location config file */ public function __construct() { parent::__construct(); $this->configFile = strtolower(__CLASS__ . ".ini"); $this->template = array(); $this->templateFile = "banner.tpl"; $this->basePath = realpath(dirname(__FILE__) . "/../") . "/"; $this->sqlParser->setSelect('select'); $this->sqlParser->setTable('banner_settings', 'a'); $this->sqlParser->addField(new SqlField('a', 'bnr_tree_id', 'tree_id', 'Node', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::PKEY, SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'bnr_tag', 'tag', 'Tag', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::PKEY, SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'bnr_display', 'display', 'Weergave', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'bnr_display_order', 'display_order', 'Volgorde', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'bnr_url', 'url', 'Weergave url', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_BOOLEAN)); $this->sqlParser->addField(new SqlField('a', 'bnr_transition_speed', 'transition_speed', 'Wissel snelheid', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'bnr_img_width', 'image_width', 'Breedte', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'bnr_img_height', 'image_height', 'Hoogte', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'bnr_img_max_width', 'image_max_width', 'Maximale breedte', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'bnr_image', 'image', 'Layer image', SqlParser::getTypeSelect(), SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('a', 'bnr_usr_id', 'usr_id', 'Gebruiker', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'bnr_own_id', 'own_id', 'Eigenaar', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'bnr_create', 'createdate', 'Creatie', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_DATE, true)); $this->sqlParser->addField(new SqlField('a', 'bnr_ts', 'ts', 'Gewijzigd', SqlParser::getTypeSelect(), SqlField::TYPE_DATE)); //add new view types $view = ViewManager::getInstance(); $view->insert(self::VIEW_SETTINGS, 'Instellingen'); }
/** * Constructor * * Reads project's and default .ini file, sets project handler's * and initializes paths. * @param location config file */ public function __construct($plugin) { parent::__construct(); $this->plugin = $plugin; $this->importing = false; $this->template = array(); $this->templateFile = "attachmentoverview.tpl"; $this->basePath = realpath(dirname(__FILE__) . "/../") . "/"; $this->sqlParser->setSelect('select'); $this->sqlParser->setTable('attachment', 'a'); $this->sqlParser->addField(new SqlField('a', 'att_id', 'id', 'id', SqlParser::getTypeSelect() | SqlParser::PKEY, SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'att_tree_id', 'tree_id', 'Node', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'att_tag', 'tag', 'Tag', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'att_ref_id', 'ref_id', 'Referentie', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, false)); $this->sqlParser->addField(new SqlField('a', 'att_weight', 'weight', 'Index', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'att_active', 'active', 'Actieve status', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_BOOLEAN)); $this->sqlParser->addField(new SqlField('a', 'att_online', 'online', 'Online datum', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_DATE, true)); $this->sqlParser->addField(new SqlField('a', 'att_offline', 'offline', 'Offline datum', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_DATE)); $this->sqlParser->addField(new SqlField('a', 'att_name', 'name', 'Naam', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::NAME, SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'att_intro', 'intro', 'Introductie', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('a', 'att_file', 'file', 'Bestand', SqlParser::getTypeSelect(), SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('a', 'att_usr_id', 'usr_id', 'Gebruiker', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'att_own_id', 'own_id', 'Eigenaar', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'att_create', 'createdate', 'Creatie', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_DATE, true)); $this->sqlParser->addField(new SqlField('a', 'att_ts', 'ts', 'Gewijzigd', SqlParser::getTypeSelect(), SqlField::TYPE_DATE)); $this->orderStatement = array(Attachment::ORDER_ASC => 'order by a.att_weight asc, a.att_name asc', Attachment::ORDER_DESC => 'order by a.att_weight desc, a.att_name asc', Attachment::ORDER_RAND => "order by rand()"); }
/** * Constructor * * Reads project's and default .ini file, sets project handler's * and initializes paths. * @param location config file */ public function __construct($plugin) { parent::__construct(); $this->plugin = $plugin; $this->pagerKey = 'nlusr'; $this->template = array(); $this->templateFile = "newsletteruser.tpl"; $this->basePath = realpath(dirname(__FILE__) . "/../") . "/"; $this->sqlParser->setSelect('select'); $this->sqlParser->setTable('newsletter_user', 'a'); $this->sqlParser->addField(new SqlField('a', 'usr_id', 'id', 'Id', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::PKEY, SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'usr_tree_id', 'tree_id', 'Node', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'usr_tag', 'tag', 'Tag', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'usr_active', 'active', 'Actieve status', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_BOOLEAN)); $this->sqlParser->addField(new SqlField('a', 'usr_gender', 'gender', 'Gender', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'usr_name', 'name', 'Name', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::NAME, SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'usr_email', 'email', 'Email', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::NAME, SqlField::TYPE_STRING, false)); $this->sqlParser->addField(new SqlField('a', 'usr_count', 'count', 'Newsletters sent', SqlParser::getTypeSelect(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'usr_bounce', 'bounce', 'Bounce count', SqlParser::getTypeSelect(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'usr_ip', 'ip', 'Ip adres', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'usr_host', 'host', 'Host', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'usr_client', 'client', 'Client', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'usr_optin', 'optin', 'Opt-in', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_STRING, false)); $this->sqlParser->addField(new SqlField('a', 'usr_unsubscribe', 'unsubscribe_date', 'Unsubscribe date', SqlParser::getTypeSelect() | SqlParser::MOD_DELETE, SqlField::TYPE_DATE)); $this->sqlParser->addField(new SqlField('a', 'usr_create', 'createdate', 'Created', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_DATE, true)); $this->sqlParser->addField(new SqlField('a', 'usr_ts', 'ts', 'Modified', SqlParser::getTypeSelect(), SqlField::TYPE_DATE)); $this->sqlParser->setGroupby('group by a.usr_id'); }
/** * Constructor * * Reads project's and default .ini file, sets project handler's * and initializes paths. * @param location config file */ public function __construct($plugin) { parent::__construct(); $this->plugin = $plugin; $this->template = array(); $this->templateFile = "formsettings.tpl"; $this->basePath = realpath(dirname(__FILE__) . "/../") . "/"; $this->sqlParser->setSelect('select'); $this->sqlParser->setTable('form_tree_settings', 'a'); $this->sqlParser->addField(new SqlField('a', 'form_tree_id', 'tree_id', 'Node', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::PKEY, SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'form_tag', 'tag', 'Tag', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::PKEY, SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'form_subject', 'subject', 'Onderwerp', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::NAME, SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'form_from', 'mailfrom', 'Van', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_EMAIL, true)); $this->sqlParser->addField(new SqlField('a', 'form_to', 'mailto', 'Naar', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_EMAIL)); $this->sqlParser->addField(new SqlField('a', 'form_caption', 'caption', 'Caption', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'form_action', 'action', 'Action', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'form_mail_text', 'mailtext', 'Mail intro', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('a', 'form_ref_tree_id', 'ref_tree_id', 'Referentie node', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'form_optin_tree_id', 'optin_tree_id', 'Referentie node opt-in', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'form_templatefield', 'templatefield', 'Template', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING, false)); $this->sqlParser->addField(new SqlField('a', 'form_mandatorysign', 'mandatorysign', 'Verplicht symbool', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING, false)); $this->sqlParser->addField(new SqlField('a', 'form_usr_id', 'usr_id', 'Gebruiker', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'form_own_id', 'own_id', 'Eigenaar', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'form_create', 'createdate', 'Creatie', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_DATE, true)); $this->sqlParser->addField(new SqlField('a', 'form_ts', 'ts', 'Gewijzigd', SqlParser::getTypeSelect(), SqlField::TYPE_DATE)); }
/** * Constructor * * Reads project's and default .ini file, sets project handler's * and initializes paths. * @param location config file */ public function __construct($plugin) { parent::__construct(); $this->plugin = $plugin; $this->template = array(); $this->templateFile = "calendaroverview.tpl"; $this->basePath = realpath(dirname(__FILE__) . "/../") . "/"; $this->sqlParser->setSelect('select'); $this->sqlParser->setTable('calendar', 'a'); $this->sqlParser->addField(new SqlField('a', 'cal_id', 'id', 'id', SqlParser::getTypeSelect() | SqlParser::PKEY, SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'cal_tree_id', 'tree_id', 'Node', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'cal_tag', 'tag', 'Tag', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'cal_active', 'active', 'Active state', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_BOOLEAN)); $this->sqlParser->addField(new SqlField('a', 'cal_start', 'start', 'Start date', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_DATE, true)); $this->sqlParser->addField(new SqlField('a', 'cal_stop', 'stop', 'End date', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_DATE, true)); $this->sqlParser->addField(new SqlField('a', 'cal_start_time', 'start_time', 'Start time', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('a', 'cal_stop_time', 'stop_time', 'End time', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('a', 'cal_name', 'name', 'Name', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::NAME, SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'cal_intro', 'intro', 'Introduction', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('a', 'cal_text', 'text', 'Content', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('a', 'cal_thumbnail', 'thumbnail', 'Thumbnail', SqlParser::getTypeSelect(), SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('a', 'cal_image', 'image', 'Image', SqlParser::getTypeSelect(), SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('a', 'cal_img_x', 'img_x', 'Offset x', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'cal_img_y', 'img_y', 'Offset y', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'cal_img_width', 'img_width', 'Offset width', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'cal_img_height', 'img_height', 'Offset height', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'cal_count', 'count', 'Visits', SqlParser::getTypeSelect(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'cal_usr_id', 'usr_id', 'User', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'cal_own_id', 'own_id', 'Owner', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'cal_create', 'createdate', 'Created', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_DATE, true)); $this->sqlParser->addField(new SqlField('a', 'cal_ts', 'ts', 'Modified', SqlParser::getTypeSelect(), SqlField::TYPE_DATE)); $this->orderStatement = array('order by a.cal_start %s, a.cal_start_time desc'); }
/** * Constructor * * Reads project's and default .ini file, sets project handler's * and initializes paths. * @param location config file */ public function __construct($plugin) { parent::__construct(); $this->plugin = $plugin; $this->reference = array(); $this->template = array(); $this->templateFile = "newsletterplugin.tpl"; $this->basePath = realpath(dirname(__FILE__) . "/../") . "/"; $this->sqlParser->setSelect('select'); $this->sqlParser->setTable('newsletter_plugin', 'a'); $this->sqlParser->addField(new SqlField('a', 'plug_nl_id', 'nl_id', 'NewsLetter id', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::PKEY, SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('b', 'nl_name', 'name', 'Name', SqlParser::getTypeSelect() | SqlParser::NAME, SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('a', 'plug_tag', 'nl_tag', 'Tag name', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::PKEY | SqlParser::NAME, SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('b', 'nl_tree_id', 'tree_id', 'Node', SqlParser::getTypeSelect(), SqlField::TYPE_INTEGER, false)); $this->sqlParser->addField(new SqlField('b', 'nl_tag', 'tag', 'Tag', SqlParser::getTypeSelect(), SqlField::TYPE_STRING, false)); $this->sqlParser->addField(new SqlField('b', 'nl_active', 'nl_active', 'Actieve status', SqlParser::getTypeSelect(), SqlField::TYPE_BOOLEAN)); $this->sqlParser->addField(new SqlField('a', 'plug_type', 'type', 'Type of tag', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'plug_text', 'text', 'Content', SqlParser::getTypeSelect(), SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('a', 'plug_plugin_id', 'plugin_id', 'Plugin identifier', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'plug_plugin_type', 'plugin_type', 'Plugin type', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'plug_plugin_keys', 'plugin_keys', 'Plugin keys', SqlParser::getTypeSelect(), SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('a', 'plug_usr_id', 'usr_id', 'User', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'plug_own_id', 'own_id', 'Owner', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'plug_create', 'createdate', 'Create date', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_DATE, true)); $this->sqlParser->addField(new SqlField('a', 'plug_ts', 'ts', 'Modified', SqlParser::getTypeSelect(), SqlField::TYPE_DATE)); $this->sqlParser->addFrom("inner join newsletter as b on b.nl_id = a.plug_nl_id"); $this->orderStatement = array('order by a.plug_tag %s'); $this->settings = array(); }
/** * Constructor * * Reads project's and default .ini file, sets project handler's * and initializes paths. * @param location config file */ public function __construct($plugin) { parent::__construct(); $this->plugin = $plugin; $this->template = array(); $this->templateFile = "newslettersettings.tpl"; $this->basePath = realpath(dirname(__FILE__) . "/../") . "/"; $this->sqlParser->setSelect('select'); $this->sqlParser->setTable('newsletter_overview_settings', 'a'); $this->sqlParser->addField(new SqlField('a', 'set_tree_id', 'tree_id', 'Node', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::PKEY, SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'set_tag', 'tag', 'Tag', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::PKEY, SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'set_display', 'display', 'Display', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'set_msg_subject', 'subject', 'Onderwerp', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::NAME, SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'set_msg_from', 'mailfrom', 'Van', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_EMAIL, true)); $this->sqlParser->addField(new SqlField('a', 'set_msg_action', 'action', 'Action', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'set_msg_text', 'mailtext', 'Mail intro', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('a', 'set_msg_ref_tree_id', 'ref_tree_id', 'Referentie node', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'set_del_tree_id', 'del_tree_id', 'Unsubscribe Referentie node', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'set_msg_optin_tree_id', 'optin_tree_id', 'Referentie node opt-in', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'set_cap_gender', 'cap_gender', 'Caption gender', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'set_cap_name', 'cap_name', 'Caption name', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'set_cap_email', 'cap_email', 'Caption email', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING, false)); $this->sqlParser->addField(new SqlField('a', 'set_cap_submit', 'cap_submit', 'Caption submit button', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('a', 'set_field_width', 'field_width', 'Field width', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'set_usr_id', 'usr_id', 'User', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'set_own_id', 'own_id', 'Owner', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'set_create', 'createdate', 'Created', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_DATE, true)); $this->sqlParser->addField(new SqlField('a', 'set_ts', 'ts', 'Modified', SqlParser::getTypeSelect(), SqlField::TYPE_DATE)); }
/** * @purpose : Parses SQL file * @params string $content Text containing sql instructions * @return array List of sql parsed from $content */ public static function parse($content) { $sqlList = array(); // Processing the SQL file content $lines = explode("\n", $content); $query = ""; // Parsing the SQL file content foreach ($lines as $sql_line) { $sql_line = trim($sql_line); if ($sql_line === "") { continue; } else { if (strpos($sql_line, "--") === 0) { continue; } else { if (strpos($sql_line, "#") === 0) { continue; } } } $query .= $sql_line; // Checking whether the line is a valid statement if (preg_match("/(.*);/", $sql_line)) { $query = trim($query); $query = substr($query, 0, strlen($query) - 1); $query = SqlParser::takeOffComments($query); //store this query $sqlList[] = $query; //reset the variable $query = ""; } } return $sqlList; }
/** * Constructor * * Reads project's and default .ini file, sets project handler's * and initializes paths. * @param location config file */ public function __construct($plugin) { parent::__construct(); $this->plugin = $plugin; $this->setPagerKey('pcom'); $this->template = array(); $this->templateFile = "calendarcomment.tpl"; $this->basePath = realpath(dirname(__FILE__) . "/../") . "/"; $this->sqlParser->setSelect('select'); $this->sqlParser->setTable('calendar_comment', 'a'); $this->sqlParser->addField(new SqlField('a', 'com_id', 'id', 'id', SqlParser::getTypeSelect() | SqlParser::PKEY, SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'com_cal_id', 'cal_id', 'Calendar id', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('b', 'cal_tree_id', 'tree_id', 'Node', SqlParser::getTypeSelect(), SqlField::TYPE_INTEGER, false)); $this->sqlParser->addField(new SqlField('b', 'cal_tag', 'tag', 'Tag', SqlParser::getTypeSelect(), SqlField::TYPE_STRING, false)); $this->sqlParser->addField(new SqlField('b', 'cal_active', 'cal_active', 'Actieve status', SqlParser::getTypeSelect(), SqlField::TYPE_BOOLEAN)); $this->sqlParser->addField(new SqlField('a', 'com_active', 'active', 'Active state', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_BOOLEAN)); $this->sqlParser->addField(new SqlField('a', 'com_name', 'name', 'Name', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::NAME, SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'com_email', 'email', 'Email', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING, false)); $this->sqlParser->addField(new SqlField('a', 'com_text', 'text', 'Content', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'com_ip', 'ip', 'Ip address', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('a', 'com_date', 'date', 'Date', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_DATE, true)); $this->sqlParser->addField(new SqlField('a', 'com_create', 'createdate', 'Create date', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_DATE, true)); $this->sqlParser->addField(new SqlField('a', 'com_ts', 'ts', 'Modified', SqlParser::getTypeSelect(), SqlField::TYPE_DATE)); $this->sqlParser->addFrom("inner join calendar as b on b.cal_id = a.com_cal_id"); $this->orderStatement = array('order by a.com_date %s'); $this->settings = array(); }
/** * Constructor * * Reads project's and default .ini file, sets project handler's * and initializes paths. * @param location config file */ public function __construct($plugin) { parent::__construct(); $this->plugin = $plugin; $this->setPagerKey('patt'); $this->importing = false; $this->template = array(); $this->templateFile = "newsletterattachment.tpl"; $this->basePath = realpath(dirname(__FILE__) . "/../") . "/"; $this->sqlParser->setSelect('select'); $this->sqlParser->setTable('newsletter_attachment', 'a'); $this->sqlParser->addField(new SqlField('a', 'att_id', 'id', 'id', SqlParser::getTypeSelect() | SqlParser::PKEY, SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'att_nl_id', 'nl_id', 'Nieuwsbericht', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('b', 'nl_tree_id', 'tree_id', 'Node', SqlParser::getTypeSelect(), SqlField::TYPE_INTEGER, false)); $this->sqlParser->addField(new SqlField('b', 'nl_tag', 'tag', 'Tag', SqlParser::getTypeSelect(), SqlField::TYPE_STRING, false)); $this->sqlParser->addField(new SqlField('b', 'nl_active', 'nl_active', 'Actieve status', SqlParser::getTypeSelect(), SqlField::TYPE_BOOLEAN)); $this->sqlParser->addField(new SqlField('a', 'att_weight', 'weight', 'Index', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'att_active', 'active', 'Actieve status', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_BOOLEAN)); $this->sqlParser->addField(new SqlField('a', 'att_name', 'name', 'Naam', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::NAME, SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'att_file', 'file', 'Bestand', SqlParser::getTypeSelect(), SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('a', 'att_usr_id', 'usr_id', 'Gebruiker', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'att_own_id', 'own_id', 'Eigenaar', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'att_create', 'createdate', 'Creatie', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_DATE, true)); $this->sqlParser->addField(new SqlField('a', 'att_ts', 'ts', 'Gewijzigd', SqlParser::getTypeSelect(), SqlField::TYPE_DATE)); $this->sqlParser->addFrom("inner join newsletter as b on b.nl_id = a.att_nl_id"); $this->orderStatement = array('order by a.att_weight asc, a.att_name asc'); }
/** * Constructor * * Reads project's and default .ini file, sets project handler's * and initializes paths. * @param location config file */ public function __construct() { parent::__construct(); $this->configFile = strtolower(__CLASS__ . ".ini"); $this->template = array(); $this->templateFile = "poll.tpl"; $this->basePath = realpath(dirname(__FILE__) . "/../") . "/"; $this->sqlParser->setSelect('select'); $this->sqlParser->setTable('poll_settings', 'a'); $this->sqlParser->addField(new SqlField('a', 'poll_id', 'id', 'id', SqlParser::getTypeSelect() | SqlParser::PKEY, SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'poll_display', 'display', 'Weergave', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'poll_rows', 'rows', 'Aantal items', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'poll_usr_id', 'usr_id', 'Gebruiker', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'poll_own_id', 'own_id', 'Eigenaar', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'poll_create', 'createdate', 'Creatie', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_DATE, true)); $this->sqlParser->addField(new SqlField('a', 'poll_ts', 'ts', 'Gewijzigd', SqlParser::getTypeSelect(), SqlField::TYPE_DATE)); //add new view types $view = ViewManager::getInstance(); $view->insert(self::VIEW_DETAIL, 'Details'); $view->insert(self::VIEW_ITEM_OVERVIEW, 'Items overview'); $view->insert(self::VIEW_ITEM_NEW, 'New item'); $view->insert(self::VIEW_ITEM_EDIT, 'Edit items'); $view->insert(self::VIEW_ITEM_DELETE, 'Items delete'); $view->insert(self::VIEW_CONFIG, 'Configuration'); }
/** * Constructor * * Reads project's and default .ini file, sets project handler's * and initializes paths. * @param location config file */ public function __construct() { parent::__construct(); $this->sqlParser->setSelect('select'); $this->sqlParser->setTable('reservation_userlink', 'a'); $this->sqlParser->addField(new SqlField('a', 'lnk_usr_id', 'usr_id', 'User id', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::PKEY, SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'lnk_grp_id', 'grp_id', 'Group id', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::PKEY, SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'lnk_ts', 'ts', 'Gewijzigd', SqlParser::getTypeSelect(), SqlField::TYPE_DATE)); }
public function __construct() { parent::__construct(); $this->sqlParser->setSelect('select'); $this->sqlParser->setTable('groups', 'a'); $this->sqlParser->addField(new SqlField('a', 'grp_id', 'id', 'Identifier', SqlParser::getTypeSelect() | SqlParser::PKEY, SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'grp_name', 'name', 'AchterNaam', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::NAME, SqlField::TYPE_STRING, true)); $this->orderStatement = array('order by a.grp_name asc'); }
/** * Constructor * * Reads project's and default .ini file, sets project handler's * and initializes paths. * @param location config file */ public function __construct() { parent::__construct(); $this->sqlParser->setSelect('select'); $this->sqlParser->setTable('login_request', 'a'); $this->sqlParser->addField(new SqlField('a', 'login_key', 'request_key', 'Request key', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::PKEY, SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'login_usr_id', 'usr_id', 'User', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'login_ts', 'ts', 'Modified', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_DATE, true)); }
/** * Constructor * * Reads project's and default .ini file, sets project handler's * and initializes paths. * @param location config file */ public function __construct() { parent::__construct(); $this->sqlParser->setSelect('select'); $this->sqlParser->setTable('news_tree_ref', 'a'); $this->sqlParser->addField(new SqlField('a', 'news_tree_id', 'tree_id', 'Node', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::PKEY, SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'news_tag', 'tag', 'Tag', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::PKEY, SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'news_ref_tree_id', 'ref_tree_id', 'Node', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::PKEY, SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'news_usr_id', 'usr_id', 'Gebruiker', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'news_ts', 'ts', 'Gewijzigd', SqlParser::getTypeSelect(), SqlField::TYPE_DATE)); }
public function __construct() { parent::__construct(); $this->sqlParser->setSelect('select'); $this->sqlParser->setTable('sitetag', 'a'); $this->sqlParser->addField(new SqlField('a', 'tree_id', 'tree_id', 'Node', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::PKEY, SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'parent_tag', 'parent_tag', 'Parent tag', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::PKEY | SqlParser::NAME, SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'tags', 'tags', 'Tags', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'remove_container', 'remove_container', 'Remove parent', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_BOOLEAN)); $this->sqlParser->addField(new SqlField('a', 'template', 'template', 'Template', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'stylesheet', 'stylesheet', 'Stylesheet', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING)); }
/** * Main method builds all the targets for a typical propel project. */ public function main() { $manager = new MigrationManager(); $manager->setConnections($this->getGeneratorConfig()->getBuildConnections()); $manager->setMigrationTable($this->getMigrationTable()); $manager->setMigrationDir($this->getOutputDirectory()); if (!($nextMigrationTimestamp = $manager->getFirstUpMigrationTimestamp())) { $this->log('All migrations were already executed - nothing to migrate.'); return false; } $timestamps = $manager->getValidMigrationTimestamps(); if (count($timestamps) > 1) { $this->log(sprintf('%d migrations to execute', count($timestamps))); } foreach ($timestamps as $timestamp) { $this->log(sprintf('Executing migration %s up', $manager->getMigrationClassName($timestamp))); $migration = $manager->getMigrationObject($timestamp); if (false === $migration->preUp($manager)) { $this->log('preUp() returned false. Aborting migration.', Project::MSG_ERR); return false; } foreach ($migration->getUpSQL() as $datasource => $sql) { $connection = $manager->getConnection($datasource); $this->log(sprintf('Connecting to database "%s" using DSN "%s"', $datasource, $connection['dsn']), Project::MSG_VERBOSE); $pdo = $manager->getPdoConnection($datasource); $res = 0; $statements = SqlParser::parseString($sql); foreach ($statements as $statement) { try { $this->log(sprintf('Executing statement "%s"', $statement), Project::MSG_VERBOSE); $stmt = $pdo->prepare($statement); $stmt->execute(); $res++; } catch (PDOException $e) { $this->log(sprintf('Failed to execute SQL "%s"', $statement), Project::MSG_ERR); // continue } } if (!$res) { $this->log('No statement was executed. The version was not updated.'); $this->log(sprintf('Please review the code in "%s"', $manager->getMigrationDir() . DIRECTORY_SEPARATOR . $manager->getMigrationClassName($timestamp))); $this->log('Migration aborted', Project::MSG_ERR); return false; } $this->log(sprintf('%d of %d SQL statements executed successfully on datasource "%s"', $res, count($statements), $datasource)); $manager->updateLatestMigrationTimestamp($datasource, $timestamp); $this->log(sprintf('Updated latest migration date to %d for datasource "%s"', $timestamp, $datasource), Project::MSG_VERBOSE); } $migration->postUp($manager); } $this->log('Migration complete. No further migration to execute.'); }
/** * Constructor * * Reads project's and default .ini file, sets project handler's * and initializes paths. * @param location config file */ public function __construct() { parent::__construct(); $this->sqlParser->setSelect('select'); $this->sqlParser->setTable('form_record_item', 'a'); $this->sqlParser->addField(new SqlField('a', 'item_id', 'id', 'Id', SqlParser::getTypeSelect() | SqlParser::PKEY, SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'item_rcd_id', 'rcd_id', 'Record id', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'item_elm_id', 'elm_id', 'Element id', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'item_classname', 'classname', 'Class name', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'item_weight', 'weight', 'Index', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'item_name', 'name', 'Name', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::NAME, SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'item_value', 'value', 'Waarde', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING, false)); $this->sqlParser->addFrom("inner join form_record as b on b.rcd_id = a.item_rcd_id"); }
public function __construct() { parent::__construct(); $this->sqlParser->setSelect('select'); $this->sqlParser->setTable('sitetheme', 'a'); $this->sqlParser->addField(new SqlField('a', 'tree_id', 'tree_id', 'Node', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::PKEY, SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'theme_id', 'theme_id', 'Thema', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'ts', 'ts', 'Gewijzigd', SqlParser::getTypeSelect(), SqlField::TYPE_DATE)); $this->sqlParser->addField(new SqlField('b', 'theme_name', 'name', 'Thema', SqlParser::getTypeSelect(), SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('b', 'theme_classname', 'classname', 'Klasse', SqlParser::getTypeSelect(), SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('b', 'theme_active', 'active', 'Active state', SqlParser::getTypeSelect(), SqlField::TYPE_BOOLEAN)); $this->sqlParser->addField(new SqlField('b', 'theme_dif_version', 'dif_version', 'DIF Version', SqlParser::getTypeSelect(), SqlField::TYPE_STRING)); $this->sqlParser->addFrom("left join theme as b on b.theme_id = a.theme_id"); }
public function __construct() { parent::__construct(); $this->sqlParser->setSelect('select'); $this->sqlParser->setTable('acl', 'a'); $this->sqlParser->addField(new SqlField('a', 'acl_tree_id', 'tree_id', 'Tree id', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::PKEY, SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'acl_grp_id', 'grp_id', 'Group id', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::PKEY, SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'acl_rights', 'rights', 'Rights', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); //$this->sqlParser->addField(new SqlField('b', 'tree_sitegrp_id', 'sitegroup_id', 'Site group', SqlParser::getTypeSelect(), SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('c', 'grp_name', 'name', 'Group name', SqlParser::getTypeSelect(), SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('a', 'acl_create', 'createdate', 'Created', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_DATE)); $this->sqlParser->addField(new SqlField('a', 'acl_ts', 'ts', 'Modified', SqlParser::getTypeSelect(), SqlField::TYPE_DATE)); $this->sqlParser->addFrom("inner join groups as c on c.grp_id = a.acl_grp_id"); $this->orderStatement = array('order by a.acl_tree_id asc'); }
/** * Constructor * * Reads project's and default .ini file, sets project handler's * and initializes paths. * @param location config file */ public function __construct() { parent::__construct(); $this->configFile = strtolower(__CLASS__ . ".ini"); $this->template = array(); $this->templateFile = "source.tpl"; $this->basePath = realpath(dirname(__FILE__) . "/../") . "/"; $this->sqlParser->setSelect('select'); $this->sqlParser->setTable('source', 'a'); $this->sqlParser->addField(new SqlField('a', 'src_tree_id', 'tree_id', 'Node', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::PKEY, SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'src_tag', 'tag', 'Tag', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::PKEY, SqlField::TYPE_STRING, true)); //$this->sqlParser->addField(new SqlField('a', 'src_version', 'version', 'Versie', SqlParser::getTypeSelect()|SqlParser::MOD_INSERT|SqlParser::PKEY, SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'src_text', 'text', 'Inhoud', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('a', 'src_usr_id', 'usr_id', 'Gebruiker', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'src_create', 'createdate', 'Creatie', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_DATE, true)); $this->sqlParser->addField(new SqlField('a', 'src_ts', 'ts', 'Gewijzigd', SqlParser::getTypeSelect(), SqlField::TYPE_DATE)); }
public function __construct() { parent::__construct(); $this->extensions = array(); $this->sqlParser->setSelect('select'); $this->sqlParser->setTable('extension', 'a'); $this->sqlParser->addField(new SqlField('a', 'ext_id', 'id', 'Identifier', SqlParser::getTypeSelect() | SqlParser::PKEY, SqlField::TYPE_INTEGER)); $this->sqlParser->addField(new SqlField('a', 'ext_name', 'name', 'Naam', SqlParser::getTypeSelect() | SqlParser::getTypeModify() | SqlParser::NAME, SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'ext_description', 'description', 'Description', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING, false)); $this->sqlParser->addField(new SqlField('a', 'ext_active', 'active', 'Actieve status', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_BOOLEAN)); $this->sqlParser->addField(new SqlField('a', 'ext_classname', 'classname', 'Naam klasse', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING, true)); $this->sqlParser->addField(new SqlField('a', 'ext_version', 'version', 'Versie', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('a', 'ext_dif_version', 'dif_version', 'DIF Versie', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_STRING)); $this->sqlParser->addField(new SqlField('a', 'ext_usr_id', 'usr_id', 'Gebruiker', SqlParser::getTypeSelect() | SqlParser::getTypeModify(), SqlField::TYPE_INTEGER, true)); $this->sqlParser->addField(new SqlField('a', 'ext_create', 'createdate', 'Creatie', SqlParser::getTypeSelect() | SqlParser::MOD_INSERT, SqlField::TYPE_DATE, true)); $this->sqlParser->addField(new SqlField('a', 'ext_ts', 'ts', 'Gewijzigd', SqlParser::getTypeSelect(), SqlField::TYPE_DATE)); $this->orderStatement = array('order by a.ext_name asc'); }