CMSModule(); } function GetName(){ return 'SimpleFeedback'; } function GetFriendlyName() { return 'Manage Simple Feedback'; } function SetParameters(){ $this->RegisterRoute('/simplefeedback\/sendfeed$/', array('action'=>'sendfeed')); } function Install() { global $gCms; //Get a reference to the database $db = $this->cms->db; // mysql-specific, but ignored by other database $taboptarray = array('mysql' => 'TYPE=MyISAM'); //Make a new "dictionary" (ADODB-speak for a table) $dict = NewDataDictionary($db); //Add the fields as a comma-separated string. $flds = "id I DEFAULT 0, name C(100), email C(100) "; //Note the naming scheme that should be followed when adding tables to the database, // so as to make it easy to recognize who the table belongs to, and to avoid conflict with other modules. $sqlarray = $dict->CreateTableSQL(cms_db_prefix().'module_simplefeedback_settings', $flds, $taboptarray); $dict->ExecuteSQLArray($sqlarray); $fields=array(); $fields['name']=""; $fields['email']=""; $sql=$this->GenerateInsertSQL(cms_db_prefix().'module_simplefeedback_settings', $fields); $db->Execute($sql); if($this->debug){ //echo $sql; echo $db->ErrorMsg(); } //Add the fields as a comma-separated string. $flds = "catid I AUTO KEY, name C(100) "; //Note the naming scheme that should be followed when adding tables to the database, // so as to make it easy to recognize who the table belongs to, and to avoid conflict with other modules. $sqlarray = $dict->CreateTableSQL(cms_db_prefix().'module_simplefeedback_cats', $flds, $taboptarray); $dict->ExecuteSQLArray($sqlarray); $db->CreateSequence(cms_db_prefix().'module_simplefeedback_cats_seq'); $fields=array(); $fields['name']="Sales"; $fields['catid']=$db->GenID(cms_db_prefix()."module_simplefeedback_cats_seq"); $sql=$this->GenerateInsertSQL(cms_db_prefix().'module_simplefeedback_cats', $fields); $db->Execute($sql); if($this->debug){ //echo $sql; echo $db->ErrorMsg(); } $fields=array(); $fields['name']="Technical"; $fields['catid']=$db->GenID(cms_db_prefix()."module_simplefeedback_cats_seq"); $sql=$this->GenerateInsertSQL(cms_db_prefix().'module_simplefeedback_cats', $fields); $db->Execute($sql); if($this->debug){ //echo $sql; echo $db->ErrorMsg(); } $fields=array(); $fields['name']="Enquiry"; $fields['catid']=$db->GenID(cms_db_prefix()."module_simplefeedback_cats_seq"); $sql=$this->GenerateInsertSQL(cms_db_prefix().'module_simplefeedback_cats', $fields); $db->Execute($sql); if($this->debug){ //echo $sql; echo $db->ErrorMsg(); } $fields=array(); $fields['name']="Business"; $fields['catid']=$db->GenID(cms_db_prefix()."module_simplefeedback_cats_seq"); $sql=$this->GenerateInsertSQL(cms_db_prefix().'module_simplefeedback_cats', $fields); $db->Execute($sql); if($this->debug){ //echo $sql; echo $db->ErrorMsg(); } $fields=array(); $fields['name']="Others"; $fields['catid']=$db->GenID(cms_db_prefix()."module_simplefeedback_cats_seq"); $sql=$this->GenerateInsertSQL(cms_db_prefix().'module_simplefeedback_cats', $fields); $db->Execute($sql); if($this->debug){ //echo $sql; echo $db->ErrorMsg(); } $this->CreatePermission('SimpleFeedback Admin', 'SimpleFeedback Admin'); $this->setPreference('email', ''); $this->setPreference('name', ''); $this->setPreference('success', ''); $this->setPreference('captcha', 'false'); $this->setPreference('after', ''); $this->setPreference('before', ''); $this->setPreference('showcontact', 'true'); $this->setPreference('showname', 'true'); $this->setPreference('showemail', 'true'); $this->setPreference('showcompany', 'true'); } function Upgrade($oldversion, $newversion){ $db = $this->cms->db; //Remove the database table $dict = NewDataDictionary( $db ); switch($oldversion){ case '0.2': break; case '0.1': case '0.1.2': $sqlarray = $dict->DropTableSQL( cms_db_prefix().'module_simplefeedback_settings' ); $dict->ExecuteSQLArray($sqlarray); break; } } function Uninstall() { $db = $this->cms->db; $dict = NewDataDictionary( $db ); $sqlarray = $dict->DropTableSQL( cms_db_prefix().'module_simplefeedback_cats' ); $dict->ExecuteSQLArray($sqlarray); //Remove the sequence $db->DropSequence( cms_db_prefix().'module_simplefeedback_cats_seq' ); $this->RemovePermission('SimpleFeedback Admin'); $this->RemovePreference(); } function GetVersion() { return '0.2.1'; } function GetHelp() { return '

Developed by AGA IT Solutions.

Simply put {cms_module module=\'SimpleFeedback\'} anywhere you would like to have the feedback form.

The response will be emailed to the address set in the control panel under Extensions. You can also change the categories using the control panel.

'; } function IsPluginModule() { return true; } function HasAdmin() { return true; } function GetAdminSection() { return 'extensions'; } function GetAdminDescription() { return 'Manage Simple Feedback'; } function displaySelectArray($selectlist, $id=0){ foreach($selectlist as $key => $val){ ?> Bart van Haaster - Training Coaching Advies Mediation - Home
Foto's Bart van Haaster  
Ons hoofd is rond zodat het denken van richting kan veranderen.