示例#1
0
 $lobjConfig = new Config();
 $lobjConfig->setConfigPath('includes/config.php');
 $lobjConfig->setConfigOptions($lobjConfigOptions);
 //depending on step, display content
 switch ($lintStep) {
     case 0:
         //first setup config with site configurations
         $lobjConfig->displaySetupSiteConfigForm();
         break;
     case 1:
         //on POST and second step, write configuration and install
         if (isset($_POST['submit_setup_site_config'])) {
             $lobjConfig->setNewConfigValues();
             if (!$lobjConfig->writeConfigFile()) {
                 //error message
                 $lobjConfig->displayMessage(_("Something went wrong and could not save configurations."));
             } else {
                 //include again if config variables have changed
                 include_once 'includes/config.php';
                 //new installer instance and install and on success show complete page
                 $lobjInstaller = new Installer();
                 if ($lobjInstaller->install()) {
                     $administrator_email = $_POST['administrator_email'];
                     $db = new Querier();
                     $db->exec("UPDATE staff SET staff.email=" . $db->quote($administrator_email) . " WHERE staff.staff_id = 1");
                     $lobjInstaller->displayInstallationCompletePage();
                     $_SESSION['firstInstall'] = 1;
                 }
             }
         }
         break;
示例#2
0
  *  always is a select box [5] extra data : e.g. holds options for ticks and will only be used if
  *  array and ticks are specified or if additional data needed [6] tooltip that will display when
  *  hovering over '?' icon and if blank, no icon will appear
  */
 $lobjConfigOptions = array("omit_user_columns" => array(_("Columns To OMIT On User Form"), _("Tick the fields you would like to OMIT on the user form."), "array", "right", "ticks", array(_('fname'), _('lname'), _('title'), _('department'), _('position_number'), _('classification'), _('priority'), _('supervisor'), _('tel'), _('fax'), _('intercom'), _('room_number'), _('user_type'), _('personal_information'), _('emergency_contact')), _("The 'User Form' controls who may access SubjectsPlus and what permissions they have.  Some fields are necessary for SubjectsPlus to work; these may be safely turned off if you don't want to capture or display this information.")), "require_user_columns" => array(_("Columns To Require On User Form"), _("Tick the fields you would like to make required on the user form"), "array", "right", "ticks", array(_('title'), _('position_number'), _('classification'), _('priority'), _('tel'), _('fax'), _('intercom'), _('room_number'), _('address'), _('city'), _('state'), _('zip'), _('home_phone'), _('cell_phone'), _('lat_long'), _('emergency_contact')), _("These fields may be required, i.e., the form cannot be submitted until they are completed.")), "guide_types" => array(_("Guide Types"), _("These are the different ways you may organize your guides."), "array", "right", "large", "", _("You may add new types at any time.  If you change an existing type, you will need to update all items in subjects table by hand/SQL query.")), "all_ctags" => array(_("Record Tags"), _("These are the tags that a given record location can have associated with it."), "array", "right", "textarea", "", _("Record tags are a way of slicing and dicing the total set of records.  If you add a new tag, you will need to add new code to deal with items with this tag.  Adding a tag by itself will do nothing except make that tag show up in some places.")), "all_vtags" => array(_("Video Tags"), _("These are the tags that a given video can have associated with it. These are used for the videos module."), "array", "right", "large", "", ""), "all_tbtags" => array(_("Talkback Site Tag"), _("These are the tags associated with TalkBack entries. The default is to email all talkbacks to administrator email. Edit only if you want to change that or add a branch."), "aarray", "right", "large", "", _("e.g. To make a main branch sending to admin email and branch1 branch sent to specified email -> 'main=,branch1=example@branch1.edu'")), "all_cattags" => array(_("Talkback Topic Tags"), _("These are the tags that a given talkback can have associated with it."), "array", "right", "textarea", "", _("Talkback tags are a way of slicing and dicing the total set of talkbacks.  If you add a new tag, you will need to add new code to deal with items with this tag.  Adding a tag by itself will do nothing except make that tag show up in some places.")), "titlebar_styles" => array(_("Titlebar Styles"), _("These are the styles that can be issued to a pluslet titlebars."), "aarray", "right", "large", "", _("This allows titlebars to have custom styles with custom keys for subject guide creator to make.")), "pluslets_activated" => array(_("Pluslet Activated"), _("Which Pluslets are activated."), "array", "right", "textarea", "", _("")), "use_disciplines" => array(_("Use SerSol Provided Disciplines"), _("Include Serials Solutions disciplines integration."), "boolean", "right", "small", "", _("If you wish to include your SP guides in Serials Solutions' results--i.e., you have Summon--you need to use their disciplines.")), "api_enabled" => array(_("Enable the API service (your api key is '") . "{$api_key}')", _("If turned off, the API will return empty results"), "boolean", "right", "small", "", _("Go to ") . "<a href=\"../api/\" target=\"_blank\">" . _("this page") . "</a>" . _(" for an explanation of how the API works.")), "user_bio_update" => array(_("Enable Users to Edit Bio"), "", "boolean", "right", "small", "", ""), "user_photo_update" => array(_("Enable Users to Edit Headshot Photo"), "", "boolean", "right", "small", "", ""), "target_blank" => array(_("Have database links show in new tab"), _("Affects display on databases.php and within subject guides"), "boolean", "right", "small", "", ""), "guide_headers" => array(_("Header Switcher"), _("Have more than one header choice for a guide"), "array", "right", "large", "", _("Enter a comma separated list of headers.  The header name you put here will correspond to a header file on the server.  E.g., 'chc' would point to subjects/includes/header_chc.php")), "subjects_theme" => array(_("Use a theme"), _("Use a child theme to override the default theme.  Enter the directory name that you've created under subjects/themes/"), "string", "right", "small", "", ""), "mod_rewrite" => array(_("Use URL rewrites"), _("Make links prettier."), "boolean", "right", "small", "", ""), "BaseURL" => array(_("Base URL of your SubjectsPlus Installation"), _("e.g. 'http://www.yoursite.edu/library/sp/.' Make sure to include the trailing slash! <strong>If changed, you will need to log back in.</strong>"), "string", "left", "large", "", ""), "resource_name" => array(_("Name of this Resource"), _("e.g. SubjectsPlus, Research Guides"), "string", "left-bottom", "medium", "", ""), "institution_name" => array(_("Institution Name"), _("Name of your college/university/institution"), "string", "left-bottom", "medium", "", ""), "administrator" => array(_("Name of Library Administrator"), _("Name for SubjectsPlus administrator"), "string", "left-bottom", "medium", "", _("This will appear in the footer of SP pages.")), "administrator_email" => array(_("Library Administrator Email Address"), _("Email address for SubjectsPlus administrator"), "string", "left-bottom", "medium", "", _("This will appear in footer, and also be used as default email for TalkBack submissions.")), "email_key" => array(_("Email Key"), _("Ending of campus email addresses, including @ sign"), "string", "left-bottom", "medium", "", _("This allows for simpler login.")), "tel_prefix" => array(_("Telephone Prefix"), _("Prefix to prepend to telephone number for staff. Usually area code."), "string", "left-bottom", "small", "", _("Allows you to put short (non-prefixed) version of phone number on pages where space is limited.")), "hname" => array(_("MySQL Hostname"), _("This is the ip or url to your MySQL database."), "string", "left", "medium", "", _("host help?")), "db_port" => array(_("MySQL Port"), _("This is the port your MySQL database uses."), "string", "left", "medium", "", _("")), "uname" => array(_("MySQL Username"), _("This is the username to your MySQL database."), "string", "left", "medium", "", ""), "pword" => array(_("MySQL Password"), _("This is the password for your MySQL user."), "string", "left", "medium", "", ""), "dbName_SPlus" => array(_("MySQL SubjectsPlus Database"), _("Name of the SubjectsPlus database"), "string", "left", "", _("database help?")), "upload_whitelist" => array(_("List of accepted uploads' file extentions"), _("This option contains the coma-separated list of accepted file extensions for file uploads via CKEditor."), "array", "right", "large", "", _("If a file isn't in this list, it should not be uploaded.  File uploads only occur via the admin backend, using CKEditor, but this is to stop a user from doing something, uh, foolish.")), "proxyURL" => array(_("Proxy URL"), _("String which should be prepended if you use a proxy server"), "string", "right-bottom", "large", "", _("In the Records tab of SP, if you flag an item as 'restricted,' the proxy string will be prepended.")), "open_string" => array(_("Open String"), _("Used to create a link to an item in your Catalog. Your subject search term is sandwiched between these two strings"), "string", "right-bottom", "medium", "", ""), "close_string" => array(_("Close String"), _("If you don't need to close string, leave blank."), "string", "right-bottom", "medium", "", ""), "open_string_kw" => array(_("Open String Keyword"), _("As above, for Keyword search."), "string", "right-bottom", "medium", "", ""), "close_string_kw" => array(_("Close String Keyword"), _("If necessary."), "string", "right-bottom", "medium", "", ""), "open_string_cn" => array(_("Open String Call Number"), _("As above, for Call Number search."), "string", "right-bottom", "medium", "", ""), "close_string_cn" => array(_("Close String Call Number"), _("If necessary."), "string", "right-bottom", "medium", "", ""), "open_string_bib" => array(_("Open String Bib"), _("Used to create a link to an item in your Catalog. Your Bib search term is sandwiched between these two strings"), "string", "right-bottom", "medium", "", ""), "CKBasePath" => array(_("Base Path for CKEditor"), _("Path to CKEditor files appended to base URL"), "string", "left", "medium", "", _("CKEditor is used to generate the WYSIWYG data entry boxes.  It is bundled with SubjectsPlus under the sp/ root folder.  If you move CKEditor to another location, you will need to change this path.")));
 //set config options
 $lobjConfig->setConfigOptions($lobjConfigOptions);
 //if posted form
 if (isset($_POST['submit_edit_config'])) {
     //get POST variables based on options array
     $lobjConfig->setNewConfigValues();
     //check if new values are acceptable
     $lstrMessage = $lobjConfig->checkDBConnection();
     if ($lstrMessage != '') {
         //display error message on top of page
         $lobjConfig->displayMessage(_($lstrMessage));
         //display edit HTML form with new values
         $lobjConfig->displayEditConfigForm('new');
     } else {
         //if no error to connect to database, write to config file with new values
         $lobjReturn = $lobjConfig->writeConfigFile();
         //if error did not return
         if ($lobjReturn) {
             //if salt changed, log current person out and back in
             if ($lobjConfig->getChangeSalt()) {
                 $_SESSION['checkit'] = md5($_SESSION['email']) . $lobjReturn[1];
             }
             //display message
             $lobjConfig->displayMessage(_("Thy will be done."));
             //if the base URL of SubjectsPlus changes, log them out and relocate to new BaseURL
             if ($lobjConfig->isNewBaseURL()) {
示例#3
0
  *  always is a select box [5] extra data : e.g. holds options for ticks and will only be used if
  *  array and ticks are specified or if additional data needed [6] tooltip that will display when
  *  hovering over '?' icon and if blank, no icon will appear
  */
 $lobjConfigOptions = array("omit_user_columns" => array(_("Columns To OMIT On User Form"), _("Tick the fields you would like to OMIT on the user form."), "array", "right", "ticks", array(_('title'), _('department'), _('position_number'), _('classification'), _('priority'), _('supervisor'), _('tel'), _('fax'), _('intercom'), _('room_number'), _('user_type'), _('personal_information'), _('emergency_contact')), _("The 'User Form' controls who may access SubjectsPlus and what permissions they have.  Some fields are necessary for SubjectsPlus to work; these may be safely turned off if you don't want to capture or display this information.")), "require_user_columns" => array(_("Columns To Require On User Form"), _("Tick the fields you would like to make required on the user form"), "array", "right", "ticks", array(_('title'), _('position_number'), _('classification'), _('priority'), _('tel'), _('fax'), _('intercom'), _('room_number'), _('address'), _('city'), _('state'), _('zip'), _('home_phone'), _('cell_phone'), _('lat_long'), _('emergency_contact')), _("These fields may be required, i.e., the form cannot be submitted until they are completed.")), "guide_types" => array(_("Guide Types"), _("These are the different ways you may organize your guides."), "array", "right", "large", "", _("You may add new types at any time.  If you change an existing type, you will need to update all items in subjects table by hand/SQL query.")), "all_ctags" => array(_("Record Tags"), _("These are the tags that a given record location can have associated with it."), "array", "right", "textarea", "", _("Record tags are a way of slicing and dicing the total set of records.  If you add a new tag, you will need to add new code to deal with items with this tag.  Adding a tag by itself will do nothing except make that tag show up in some places.")), "all_vtags" => array(_("Video Tags"), _("These are the tags that a given video can have associated with it. These are used for the videos module."), "array", "right", "large", "", ""), "all_tbtags" => array(_("Talkback"), _("These are the tags associated with TalkBack entries. The default is to email all talkbacks to administrator email. Edit only if you want to change that or add a branch."), "aarray", "right", "large", "", _("e.g. To make a main branch sending to admin email and branch1 branch sent to specified email -> 'main=,branch1=example@branch1.edu'")), "use_disciplines" => array(_("Use SerSol Provided Disciplines"), _("Include Serials Solutions disciplines integration."), "boolean", "right", "small", "", _("If you wish to include your SP guides in Serials Solutions' results--i.e., you have Summon--you need to use their disciplines.")), "BaseURL" => array(_("Base URL of your SubjectsPlus Installation"), _("e.g. 'http://www.yoursite.edu/library/sp/.' Make sure to include the trailing slash! <strong>If changed, you will need to log back in.</strong>"), "string", "left", "large", "", ""), "resource_name" => array(_("Name of this Resource"), _("e.g. SubjectsPlus, Research Guides"), "string", "left-bottom", "medium", "", ""), "institution_name" => array(_("Institution Name"), _("Name of your college/university/institution"), "string", "left-bottom", "medium", "", ""), "administrator" => array(_("Name of Library Administrator"), _("Name for SubjectsPlus administrator"), "string", "left-bottom", "medium", "", _("This will appear in the footer of SP pages.")), "administrator_email" => array(_("Library Administrator Email Address"), _("Email address for SubjectsPlus administrator"), "string", "left-bottom", "medium", "", _("This will appear in footer, and also be used as default email for TalkBack submissions.")), "email_key" => array(_("Email Key"), _("Ending of campus email addresses, including @ sign"), "string", "left-bottom", "medium", "", _("This allows for simpler login.")), "tel_prefix" => array(_("Telephone Prefix"), _("Prefix to prepend to telephone number for staff. Usually area code."), "string", "left-bottom", "small", "", _("Allows you to put short (non-prefixed) version of phone number on pages where space is limited.")), "hname" => array(_("MySQL Hostname"), _("This is the ip or url to your MySQL database."), "string", "left", "medium", "", _("host help?")), "uname" => array(_("MySQL Username"), _("This is the username to your MySQL database."), "string", "left", "medium", "", ""), "pword" => array(_("MySQL Password"), _("This is the password for your MySQL user."), "string", "left", "medium", "", ""), "db_port" => array(_("MySQL Port"), _("This is the port your MySQL server uses. (Default: 3306)."), "string", "left", "medium", "", ""), "dbName_SPlus" => array(_("MySQL SubjectsPlus Database"), _("Name of the SubjectsPlus database"), "string", "left", "", _("database help?")), "upload_whitelist" => array(_("List of accepted uploads' file extentions"), _("This option contains the coma-separated list of accepted file extensions for file uploads via CKEditor."), "array", "right", "large", "", _("If a file isn't in this list, it should not be uploaded.  File uploads only occur via the admin backend, using CKEditor, but this is to stop a user from doing something, uh, foolish.")), "proxyURL" => array(_("Proxy URL"), _("String which should be prepended if you use a proxy server"), "string", "right", "large", "", _("In the Records tab of SP, if you flag an item as 'restricted,' the proxy string will be prepended.")), "CKBasePath" => array(_("Base Path for CKEditor"), _("Path to CKEditor files appended to base URL"), "string", "left", "medium", "", _("CKEditor is used to generate the WYSIWYG data entry boxes.  It is bundled with SubjectsPlus under the sp/ root folder.  If you move CKEditor to another location, you will need to change this path.")));
 //set config options
 $lobjConfig->setConfigOptions($lobjConfigOptions);
 //if posted form
 if (isset($_POST['submit_setup_db_config'])) {
     //get POST variables based on options array
     $lobjConfig->setNewConfigValues();
     //check whether new values are acceptable
     $lstrMessage = $lobjConfig->checkDBConnection();
     if ($lstrMessage != '') {
         //display error message on top of page
         $lobjConfig->displayMessage(_($lstrMessage));
         //display edit HTML form
         $lobjConfig->displaySetupDBConfigForm('new');
     } else {
         //if no error to connect to database, set path to new config
         //file and do not set the values again and then write the config
         //file
         $lobjConfig->setConfigPath($lstrConfigFilePath, FALSE);
         $lobjConfig->setChangeSalt(TRUE);
         $lobjConfig->setChangeAPIKey(TRUE);
         $lobjReturn = $lobjConfig->writeConfigFile();
         //if no error display complete. Otherwise, display error
         if ($lobjReturn) {
             $lobjConfig->displayMessage(_("Configuration Setup Complete."));
             if (!isInstalled()) {
                 ?>