public function change() { if (!isAdmin()) { $this->kickOut(); } if ($_POST) { $this->form_validation->set_rules('MethodDescription2', 'MethodDescription', 'trim|required'); $this->form_validation->set_rules('MethodLink2', 'MethodLink', 'trim'); $this->form_validation->set_rules('MethodID2', 'Method ID', 'trim|required'); if ($this->form_validation->run() == FALSE) { $errors = validation_errors(); if (!empty($errors)) { addError($errors); } } else { $result = $this->method->update($this->input->post('MethodID2'), $this->input->post('MethodDescription2'), $this->input->post('MethodLink2')); if ($result) { addSuccess(getTxt('MethodEdited')); } else { addError(getTxt('ProcessingError')); } } } //Get methods that can be edited. $methods = $this->method->getEditable(); $methodsArray = array(); foreach ($methods as $method) { $methodsArray[$method['MethodID']] = $method['MethodDescription']; } $methodOptions = genOptions($methodsArray); //List of CSS to pass to this view $data = $this->StyleData; $data['methodOptions'] = $methodOptions; $this->load->view('methods/changemethod', $data); }
public function change() { if (!isAdmin()) { $this->kickOut(); } if ($_POST) { $this->load->library('form_validation'); $this->form_validation->set_rules('Organization', 'Organization', 'trim|required|xss_clean'); $this->form_validation->set_rules('SourceDescription', 'Source Description', 'trim|required|xss_clean'); $this->form_validation->set_rules('ContactName', 'Contact Name', 'trim|required|xss_clean'); $this->form_validation->set_rules('Phone', 'Phone Number', 'trim|required|xss_clean'); $this->form_validation->set_rules('Email', 'Email Address', 'trim|required|xss_clean'); $this->form_validation->set_rules('Address', 'Address', 'trim|required|xss_clean'); $this->form_validation->set_rules('City', 'City', 'trim|required|xss_clean'); $this->form_validation->set_rules('State', 'State', 'trim|required|xss_clean'); $this->form_validation->set_rules('ZipCode', 'Zip Code', 'trim|required|xss_clean'); $this->form_validation->set_rules('TopicCategory', 'Topic Category', 'trim|required|xss_clean'); $this->form_validation->set_rules('Title', 'Title', 'trim|required|xss_clean'); $this->form_validation->set_rules('Abstract', 'Abstract', 'trim|required|xss_clean'); } if ($this->form_validation->run() == FALSE) { $errors = validation_errors(); if (!empty($errors)) { addError($errors); } } else { //Array for generating MetadatID $dataPoint = array('TopicCategory' => $this->input->post('TopicCategory'), 'Title' => $this->input->post('Title'), 'Abstract' => $this->input->post('Abstract'), 'ProfileVersion' => $this->cNull($this->config->item('ProfileVersion')), 'MetadataLink' => $this->input->post('MetadataLink')); $metaID = $this->sources->updateMD($dataPoint, $this->input->post('MetadataID')); $result = $this->sources->updateSource($this->input->post('Organization'), $this->input->post('SourceDescription'), $this->input->post('SourceLink'), $this->input->post('ContactName'), $this->input->post('Phone'), $this->input->post('Email'), $this->input->post('Address'), $this->input->post('City'), $this->input->post('State'), $this->input->post('ZipCode'), $this->input->post('Citation'), $this->input->post('MetadataID'), $this->input->post('SourceID')); if ($result) { addSuccess(getTxt('SourceEdited')); } else { addError(getTxt('ProcessingError')); } } $sources = $this->sources->getAll(); $sourceOptions = optionsSource($sources); //List of CSS to pass to this view $data = $this->StyleData; $data['sourceOptions'] = $sourceOptions; //Getting the states dropdown $states = getStates(); $states['NULL'] = getTxt('International'); $stateOptions = genOptions($states); $data['stateOptions'] = $stateOptions; //Gets the topicCategory dropdown //getTC was created in the model $topics = $this->sources->getTC(); $topicsArray = array(); foreach ($topics as $topic) { $topicsArray[$topic['Term']] = translateTerm($topic['Term']); } $topicOptions = genOptions($topicsArray); $data['topicOptions'] = $topicOptions; $this->load->view('sources/changesource', $data); }
public function installation() { //Check if any other installations exist? if No then the first one shall be called 'default' $files1 = @$this->file_list(APPPATH . 'config/installations', '.php'); $count = count($files1); $default = false; $encryptedtext = ""; if ($count == 0) { //No other Setup Exists $default = true; } if (!$default) { //The default database details need to be passed to the setup script. Using encryption here as it will he a hidden field in the form. $cipher = new Cipher('transferDB@321'); $databaseDetails = array("host" => $this->config->item('database_host'), "database_username" => $this->config->item('database_username'), "database_password" => $this->config->item('database_password')); $encryptedtext = $cipher->encrypt(serialize($databaseDetails)); //Check if multiple installations are allowed. if (!$this->config->item('multiInstall')) { $data['errorMsg'] = "Your Server administrator has disabled Multiple installations on this Server."; $this->load->view('templates/apierror', $data); return; } } //List of languages to be shown. $lang = array("English" => "English", "Spanish" => "Español", "Italian" => "Italiano", "Portuguese" => "Portugués", "German" => "Deutsch", "Dutch" => "Nederlands", "Bulgarian" => "български", "Croatian" => "Hrvatski", "French" => "Français", "Russian" => "Русский", "Tagalog" => "Tagalog", "Czech" => "Český", "Ukranian" => "Українська", "Chinese" => "中文"); $langOptions = genOptions($lang); //Check if any other installations exist? if No then the first one shall be called 'default' $files1 = @$this->file_list(APPPATH . 'config/installations', '.php'); $default = false; if ($count == 0) { //No other Setup Exists $default = true; } $_SESSION['setup'] = true; $data = $this->StyleData; $data['langOptions'] = $langOptions; $data['default'] = $default; $data['hiddenStuff'] = $encryptedtext; $this->load->view('edit_mainconfig', $data); }
public function change() { if ($_POST) { //Try uploading the site image. If no new image is set, it should be an error. $name = 'siteimg' . time(); //Processing the SiteImage. $config['upload_path'] = './uploads/'; $config['allowed_types'] = 'gif|jpg|png|jpeg'; $config['max_size'] = '1024'; $config['max_width'] = '0'; $config['max_height'] = '0'; $config['file_name'] = $name; $this->load->library('upload', $config); $name = ""; if ($this->upload->do_upload('picture')) { $uploaddata = $this->upload->data(); $name = $uploaddata['file_name']; } //Create the site. $site = $this->createSite(); $siteID = $this->input->post('SiteID'); if ($name != "") { //Add image to sitepic table. $this->site->addPic($name, $siteID); } $result = $this->site->update($site, $siteID); if (!$result) { addError(getTxt('ProcessingError') . " Error while adding sites. "); } else { //Update Series. $series = array('SiteCode' => $this->input->post('SiteCode'), 'SiteName' => $this->input->post('SiteName'), 'SiteType' => $this->input->post('SiteType')); $this->load->model('sc', '', TRUE); //Add to the series catalog $result = $this->sc->updateSite($series, $siteID); if ($result) { addSuccess(getTxt('SiteSuccessfullyEdited')); } else { addError(getTxt('ProcessingError') . " Error while updating Series. "); } } } $sources = $this->sources->getAll(); $sourceOptions = optionsSource($sources); $types = $this->site->getSiteTypes(); $typesArray = array(); foreach ($types as $type) { $typesArray[$type['Term']] = translateTerm($type['Term']); } $typeOptions = genOptions($typesArray); $vds = $this->site->getVD(); $verticalDatumArray = array(); foreach ($vds as $vd) { $verticalDatumArray[$vd['Term']] = translateTerm($vd['Term']); } $vdOptions = genOptions($verticalDatumArray); $srs = $this->site->getSR(); $srArray = array(); foreach ($srs as $sr) { $srArray[$sr['SpatialReferenceID']] = translateTerm($sr['SRSName']); } $srOptions = genOptions($srArray); //List of CSS to pass to this view $data = $this->StyleData; $data['sourceOptions'] = $sourceOptions; $data['typeOptions'] = $typeOptions; $data['vdOptions'] = $vdOptions; $data['srOptions'] = $srOptions; //Getting the states dropdown $states = getStates(); $states['NULL'] = getTxt('International'); $stateOptions = genOptions($states); $data['stateOptions'] = $stateOptions; $this->load->view('sites/editsite', $data); }
</strong> <input type="radio" name= "setuptype" value="Basic" checked="checked" >Basic</input> <input type="radio" name= "setuptype" value="Advanced" >Advanced</input><br /><br /> </p> </div> <div class="col-md-12"><span class="h4"><strong><?php echo getTxt('MySQLConfiguration'); ?> </strong></span><br/><br/></div> <p><?php echo getTxt('databaseInstructions'); ?> </p> <?php if (!$default) { $options = genOptions(array(1 => "Yes", 0 => "No")); genSelect('useExistingDB', "wwdb", "wwdb", $options, 'SelectEllipsis', true); } echo '<div id="dbsettings">'; genInputH('DatabaseHost', 'Database Host', 'databasehost', getTxt('DatabaseHostInfo'), true); genInput('DatabaseUsername', 'Database User Name', 'databaseusername'); genInput('DatabasePassword', 'Database Password', 'databasepassword'); genInputH('DatabaseName', 'Database Name', 'databasename', getTxt('DatabaseNameInfo'), true); echo '</div>'; ?> <div class="col-sm-12"><p class="h4"><strong><?php echo getTxt('ConfigurationSettingsLook'); ?> </strong></p></div> <?php $extraText = "";