From 46bab8dfc69d0a8572aa8de8b6a10ad6d43d752c Mon Sep 17 00:00:00 2001 From: dleffler Date: Thu, 11 Aug 2011 00:14:28 -0400 Subject: [PATCH] Completely deprecates old-school 1.0 language subsystem in favor of expLang. All $i18n & $_TR variables were replaced with tne newer gt() call. Adds shell for coding for setting the language during install. [#291 state:resolved] --- conf/extensions/antispam.structure.php | 31 +- conf/extensions/avatar.defaults.php | 1 - conf/extensions/comments.structure.php | 20 +- conf/extensions/database.structure.php | 36 +- conf/extensions/display.defaults.php | 4 +- conf/extensions/display.structure.php | 59 +- conf/extensions/htmltopdf.structure.php | 13 +- conf/extensions/ldap.structure.php | 24 +- conf/extensions/maint.structure.php | 18 +- conf/extensions/minify.structure.php | 21 +- conf/extensions/registration.structure.php | 36 +- conf/extensions/search.structure.php | 8 +- conf/extensions/sef.structure.php | 8 +- conf/extensions/simplenotes.structure.php | 20 +- conf/extensions/site.defaults.php | 6 +- conf/extensions/site.structure.php | 121 +++-- conf/extensions/smtp.structure.php | 38 +- conf/extensions/tracking.structure.php | 20 +- cron/send_reminders.php | 4 - exponent.php | 27 +- .../images}/default_preview.gif | Bin .../images}/default_preview_denied.gif | Bin .../images}/default_preview_notfound.gif | Bin .../images}/default_preview_unknown.gif | Bin framework/core/definitions/modstate.php | 5 +- framework/core/expFramework.php | 11 +- .../English - US.info.php} | 11 +- framework/core/models-1/calendar.php | 42 +- .../core/models-1/calendarmodule_config.php | 75 ++- framework/core/models-1/database_importer.php | 3 - framework/core/models-1/file.php | 19 +- framework/core/models-1/file_collection.php | 11 +- framework/core/models-1/formbuilder_form.php | 55 +- .../core/models-1/formbuilder_report.php | 31 +- framework/core/models-1/mimetype.php | 8 +- framework/core/models-1/poll_answer.php | 3 - framework/core/models-1/poll_question.php | 3 - framework/core/models-1/section.php | 85 +-- framework/core/models-1/section_template.php | 29 +- .../core/models-1/simplepollmodule_config.php | 3 - framework/core/models/expFile.php | 3 - framework/core/models/expRss.php | 2 - framework/core/models/keywords.php | 3 +- framework/core/subsystems-1/autoloader.php | 57 +- framework/core/subsystems-1/backup.php | 16 +- framework/core/subsystems-1/backup/0.95.php | 1 - .../core/subsystems-1/backup/normalize.php | 2 - framework/core/subsystems-1/config.php | 64 +-- framework/core/subsystems-1/core.php | 3 +- .../core/subsystems-1/database/mysql.php | 2 - .../core/subsystems-1/database/mysqli.php | 2 - .../core/subsystems-1/database/mysqlid.php | 2 - .../core/subsystems-1/database/postgres.php | 2 - framework/core/subsystems-1/files.php | 356 ------------- .../core/subsystems-1/files/iconselector.js | 12 - framework/core/subsystems-1/flow.php | 153 ------ framework/core/subsystems-1/forms.php | 8 +- .../forms/controls/antispamcontrol.php | 14 +- .../forms/controls/calendarcontrol.php | 16 +- .../forms/controls/checkboxcontrol.php | 19 +- .../forms/controls/configcontrol.php | 22 +- .../forms/controls/contactcontrol.php | 3 +- .../forms/controls/countryregioncontrol.php | 2 - .../forms/controls/datetimecontrol.php | 22 +- .../forms/controls/dropdowncontrol.php | 25 +- .../forms/controls/filemanagercontrol.php | 8 +- .../forms/controls/genericcontrol.php | 20 +- .../forms/controls/hiddenfieldcontrol.php | 21 +- .../forms/controls/htmlcontrol.php | 8 +- .../forms/controls/listbuildercontrol.php | 15 +- .../forms/controls/listcontrol.php | 8 +- .../forms/controls/popupdatetimecontrol.php | 17 +- .../forms/controls/quantitycontrol.php | 22 +- .../forms/controls/radiocontrol.php | 18 +- .../forms/controls/radiogroupcontrol.php | 27 +- .../forms/controls/textcontrol.php | 22 +- .../forms/controls/texteditorcontrol.php | 22 +- .../forms/controls/uploadcontrol.php | 17 +- .../forms/controls/yuicalendarcontrol.php | 17 +- .../forms/controls/yuidatetimecontrol.php | 21 +- .../forms/controls/yuieditorcontrol.php | 22 +- framework/core/subsystems-1/geo.php | 2 - framework/core/subsystems-1/image.php | 504 ------------------ framework/core/subsystems-1/info.php | 168 ------ framework/core/subsystems-1/lang.php | 10 +- .../modules/calendarmodule/views/Default.php | 2 +- framework/core/subsystems-1/modules.php | 4 +- framework/core/subsystems-1/permissions.php | 17 +- framework/core/subsystems-1/search.php | 155 ------ .../core/subsystems-1/search/exclude.en.list | 7 - framework/core/subsystems-1/security.php | 65 --- framework/core/subsystems-1/sessions.php | 426 --------------- framework/core/subsystems-1/sorting.php | 195 ------- framework/core/subsystems-1/template.php | 12 +- framework/core/subsystems-1/users.php | 38 +- .../profileextensions/addressextension.php | 21 +- .../users/profileextensions/bbextension.php | 56 +- .../profileextensions/inboxextension.php | 10 +- .../profileextensions/phoneextension.php | 25 +- .../profileextensions/settingsextension.php | 13 +- framework/core/subsystems-1/workflow.php | 2 - .../workflow/actions/Debugging.php | 38 -- .../workflow/actions/Redirect User.php | 24 - .../workflow/actions/Show Back Link.php | 28 - .../workflow/actions/Show Message.php | 25 - framework/core/subsystems/expLang.php | 59 +- framework/core/subsystems/expSession.php | 3 +- framework/core/views/_maintenance.tpl | 8 +- framework/core/views/orphaned_content.tpl | 12 +- .../core/views/popup_printerfriendly.tpl | 2 +- .../actions/config_activate.php | 1 - .../actions/config_configuresite.php | 3 - .../actions/config_delete.php | 1 - .../actions/config_save.php | 11 +- .../actions/configuresite.php | 9 +- .../actions/finish_install_extension.php | 2 - .../actions/gmgr_delete.php | 1 - .../actions/gmgr_editprofile.php | 3 - .../actions/gmgr_membership.php | 3 +- .../actions/gmgr_savegroup.php | 4 +- .../actions/groupaccounts.php | 3 +- .../actions/install_extension.php | 23 +- .../actions/managemodules.php | 3 - .../actions/managesubsystems.php | 2 - .../actions/modmgr_activate.php | 1 - .../actions/profileext_clear.php | 1 - .../actions/profileext_manage.php | 3 - .../actions/switchtheme.php | 1 - .../administrationmodule/actions/sysinfo.php | 3 - .../actions/sysinfo_download.php | 3 - .../actions/toggle_dev.php | 1 - .../actions/toggle_maintenance.php | 1 - .../actions/umgr_clearpass.php | 1 - .../actions/umgr_delete.php | 1 - .../actions/umgr_edit.php | 1 - .../actions/umgr_editprofile.php | 8 +- .../actions/umgr_lockuser.php | 1 - .../actions/umgr_membership.php | 3 +- .../actions/umgr_saveuser.php | 14 +- .../actions/upload_extension.php | 9 +- .../actions/useraccounts.php | 1 - .../actions/usersessions.php | 2 - .../actions/verify_extension.php | 2 - .../modules-1/administrationmodule/class.php | 8 +- .../js/_form_EditorControl_Toolbar.js | 2 +- .../administrationmodule/tasks/coretasks.php | 98 ++-- .../tasks/htmlarea_tasks.php | 7 +- .../tasks/search_tasks.php | 6 +- .../views/Quick Links.tpl | 18 +- .../views/_config_configuresite.tpl | 4 +- .../views/_config_results.tpl | 6 +- .../views/_configuresiteview.tpl | 20 +- .../views/_examplecontent.tpl | 2 +- .../views/_form_EditorControl_Toolbar.tpl | 12 +- .../views/_form_massmail.tpl | 4 +- .../views/_form_uploadExt.tpl | 4 +- .../views/_gmgr_editprofile.tpl | 4 +- .../views/_groupmanager.tpl | 8 +- .../views/_groupmembership.tpl | 14 +- .../views/_htmlareaconfigs.tpl | 20 +- .../views/_modulemanager.tpl | 10 +- .../views/_optimizedatabase.tpl | 10 +- .../views/_orphanedcontent.tpl | 8 +- .../views/_profileextManager.tpl | 31 +- .../views/_remove_css.tpl | 2 +- .../views/_sessionmanager.tpl | 18 +- .../views/_subsystemManager.tpl | 10 +- .../administrationmodule/views/_sysinfo.tpl | 30 +- .../views/_tableInstallSummary.tpl | 18 +- .../views/_tableTrimSummary.tpl | 12 +- .../views/_thememanager.tpl | 16 +- .../views/_trimdatabaseWhich.tpl | 12 +- .../views/_umgr_edit_which.tpl | 24 +- .../views/_umgr_editprofile.tpl | 6 +- .../views/_upload_filesList.tpl | 20 +- .../views/_upload_finalSummary.tpl | 12 +- .../views/_usermanager.tpl | 8 +- .../views/_usermembership.tpl | 18 +- .../modules-1/bots/views/_bot_manager.tpl | 2 +- .../actions/delete_all_past.php | 1 - .../calendarmodule/actions/delete_form.php | 2 - .../modules-1/calendarmodule/actions/edit.php | 14 +- .../modules-1/calendarmodule/actions/ical.php | 2 - .../modules-1/calendarmodule/actions/save.php | 4 - .../calendarmodule/actions/search.php | 1 - .../calendarmodule/actions/viewtag.php | 1 - .../calendarmodule/actions/viewweek.php | 1 - framework/modules-1/calendarmodule/class.php | 45 +- .../calendarmodule/views/Administration.tpl | 18 +- .../calendarmodule/views/Default.tpl | 26 +- .../calendarmodule/views/Featured Events.tpl | 4 +- .../modules-1/calendarmodule/views/List.tpl | 10 +- .../calendarmodule/views/Mini-Calendar.tpl | 20 +- .../calendarmodule/views/Monthly List.tpl | 10 +- .../calendarmodule/views/Monthly Summary.tpl | 18 +- .../calendarmodule/views/Past Events.tpl | 22 +- .../views/Upcoming Events - Headlines.tpl | 8 +- .../calendarmodule/views/Upcoming Events.tpl | 10 +- .../views/_feedback_submitted.tpl | 4 +- .../calendarmodule/views/_form_delete.tpl | 6 +- .../calendarmodule/views/_form_edit.tpl | 4 +- .../calendarmodule/views/_recur_dates.tpl | 4 +- .../calendarmodule/views/_reminder.tpl | 4 +- .../calendarmodule/views/_search.tpl | 16 +- .../modules-1/calendarmodule/views/_view.tpl | 12 +- .../calendarmodule/views/_viewday.tpl | 12 +- .../calendarmodule/views/_viewtag.tpl | 10 +- .../calendarmodule/views/_viewweek.tpl | 18 +- .../modules-1/common/actions/groupperms.php | 4 +- .../common/actions/savegroupperms.php | 3 +- .../common/actions/saveuserperms.php | 3 +- .../modules-1/common/actions/userperms.php | 3 +- .../modules-1/common/views/_configure.tpl | 6 +- .../common/views/_grouppermissions.tpl | 4 +- .../common/views/_permission_icons.tpl | 14 - .../common/views/_userpermissions.tpl | 4 +- .../containermodule/actions/edit.php | 2 - .../actions/orphans_content.php | 3 +- framework/modules-1/containermodule/class.php | 17 +- .../containermodule/views/_container.tpl | 2 +- .../containermodule/views/_contentPicker.tpl | 4 +- .../views/_lastreferencedelete.tpl | 2 +- .../containermodule/views/_linkPicker.tpl | 2 +- .../containermodule/views/_nocontent.tpl | 6 +- .../views/_orphans_modules.tpl | 2 +- .../containermodule/views/_sourcePicker.tpl | 2 +- .../modules-1/exporter/exporters/eql/info.php | 6 +- .../exporter/exporters/eql/savefile.php | 3 +- .../exporter/exporters/files/export.php | 3 +- .../exporters/files/info-disabled.php | 6 +- .../exporter/views/_eql_tableList.tpl | 16 +- .../modules-1/exporter/views/_exporters.tpl | 10 +- .../exporter/views/_files_modList.tpl | 14 +- .../formbuilder/actions/edit_control.php | 2 - .../formbuilder/actions/edit_record.php | 8 +- .../formbuilder/actions/export_csv.php | 13 +- .../formbuilder/actions/picked_source.php | 2 - .../formbuilder/actions/save_control.php | 8 +- .../formbuilder/actions/save_form.php | 8 +- .../formbuilder/actions/submit_form.php | 5 - .../formbuilder/actions/view_data.php | 19 +- .../formbuilder/actions/view_form.php | 12 +- .../formbuilder/actions/view_record.php | 13 +- .../formbuilder/views/_custom_report.tpl | 2 +- .../formbuilder/views/_data_view.tpl | 8 +- .../formbuilder/views/_default_report.tpl | 2 +- .../formbuilder/views/_edit_control.tpl | 4 +- .../formbuilder/views/_edit_form.tpl | 2 +- .../formbuilder/views/_edit_report.tpl | 2 +- .../formbuilder/views/_view_form.tpl | 10 +- .../formbuilder/views/_view_response.tpl | 2 +- framework/modules-1/formmodule/class.php | 55 +- .../modules-1/formmodule/views/Data_view.tpl | 8 +- .../modules-1/formmodule/views/Default.tpl | 8 +- .../modules-1/importer/importers/eql/info.php | 6 +- .../importer/importers/eql/process.php | 1 - .../importer/importers/eql/start.php | 8 +- .../importer/importers/files/extract.php | 2 - .../importer/importers/files/finish.php | 2 - .../importers/files/info-disabled.php | 6 +- .../importer/importers/files/process.php | 17 +- .../importer/importers/files/start.php | 8 +- .../importers/usercsv/displayusers.php | 5 +- .../importers/usercsv/info-disabled.php | 6 +- .../importer/importers/usercsv/mapper.php | 31 +- .../importer/importers/usercsv/process.php | 32 +- .../importer/importers/usercsv/start.php | 25 +- .../importer/views/_eql_restoreForm.tpl | 4 +- .../modules-1/importer/views/_eql_results.tpl | 4 +- .../modules-1/importer/views/_files_final.tpl | 2 +- .../importer/views/_files_selectModList.tpl | 4 +- .../importer/views/_files_uploadForm.tpl | 4 +- .../importer/views/_files_verifyFiles.tpl | 18 +- .../modules-1/importer/views/_importers.tpl | 10 +- .../importer/views/_usercsv_display_users.tpl | 24 +- .../importer/views/_usercsv_form_geninfo.tpl | 4 +- .../importer/views/_usercsv_form_mapping.tpl | 4 +- .../importer/views/_usercsv_form_start.tpl | 4 +- .../modules-1/loginmodule/actions/login.php | 5 +- .../loginmodule/actions/loginredirect.php | 3 +- .../modules-1/loginmodule/actions/logout.php | 1 - .../loginmodule/actions/mygroups.php | 1 - .../loginmodule/actions/showuserprofile.php | 3 - framework/modules-1/loginmodule/class.php | 4 +- .../modules-1/loginmodule/views/Expanded.tpl | 18 +- .../loginmodule/views/Logout Only.tpl | 2 +- .../actions/save_internalalias.php | 6 +- .../modules-1/navigationmodule/class.php | 21 +- .../navigationmodule/views/Directional.tpl | 14 +- .../navigationmodule/views/Full Hierarchy.tpl | 2 +- .../views/Marked Hierarchy.tpl | 4 +- .../navigationmodule/views/_add_whichtype.tpl | 26 +- .../views/_form_addPagesetPage.tpl | 6 +- .../views/_form_editContentPage.tpl | 4 +- .../views/_form_editExternalAlias.tpl | 4 +- .../views/_form_editInternalAlias.tpl | 4 +- .../views/_form_editProperties.tpl | 2 +- .../views/_form_editTemplate.tpl | 6 +- .../navigationmodule/views/_htmleditor.tpl | 2 +- .../navigationmodule/views/_linker.tpl | 4 +- .../views/_manager_hierarchy.tpl | 6 +- .../views/_manager_pagesets.tpl | 18 +- .../views/_manager_standalone.tpl | 22 +- .../views/_move_standalone.tpl | 4 +- .../navigationmodule/views/_view_template.tpl | 26 +- .../actions/manage_question.php | 2 - .../simplepollmodule/actions/results.php | 2 - .../modules-1/simplepollmodule/class.php | 2 - .../views/_manageQuestion.tpl | 12 +- .../views/_manageQuestions.tpl | 4 +- .../controllers/administrationController.php | 38 +- .../views/administration/install_tables.tpl | 2 +- .../administration/optimize_database.tpl | 2 +- .../quicklinks_Administration_Links.tpl | 18 +- .../blog/controllers/blogController.php | 2 +- .../ecommerce/billingcalculators/cash.php | 8 +- .../ecommerce/billingcalculators/passthru.php | 8 +- .../controllers/ecomconfigController.php | 4 +- .../ecommerce/controllers/storeController.php | 5 - .../ecommerce/products/datatypes/product.php | 3 - .../products/views/eventregistration/show.tpl | 4 +- .../views/eventregistration/storeListing.tpl | 4 +- .../products/views/giftcard/storeListing.tpl | 4 +- .../ecommerce/views/store/events_calendar.tpl | 18 +- .../migration/views/migration/configure.tpl | 3 +- .../views/migration/manage_content.tpl | 3 +- .../views/migration/manage_files.tpl | 3 +- .../views/migration/manage_pages.tpl | 3 +- .../views/migration/manage_users.tpl | 3 +- .../views/migration/migrate_content.tpl | 3 +- .../views/migration/migrate_files.tpl | 3 +- .../motd/controllers/motdController.php | 1 - framework/modules/news/views/news/showall.tpl | 4 +- .../users/controllers/usersController.php | 4 +- .../modules/users/extensions/user_avatar.php | 2 +- .../modules/users/models/profileextension.php | 43 ++ framework/modules/users/models/user.php | 100 +++- framework/plugins/block.paginate.php | 1 - framework/plugins/function.attribution.php | 1 - framework/plugins/function.control.php | 2 - .../function.exponent_sessions_get.php | 2 - framework/plugins/function.get_user.php | 2 - framework/plugins/function.img.php | 2 +- framework/plugins/function.object_to_js.php | 3 - .../plugins/function.popupdatetimecontrol.php | 2 - framework/plugins/function.scaffold.php | 2 - .../plugins/function.userlistcontrol.php | 3 - framework/plugins/function.yuilogger.php | 1 - framework/plugins/modifier.is_logged_in.php | 2 - index.php | 6 +- install/include/sanity.php | 60 +-- install/index.php | 8 +- install/pages/install-1.php | 4 +- install/pages/setlang.php | 18 +- install/pages/welcome.php | 24 + install/popups/db_create.php | 34 +- install/popups/db_existing.php | 12 +- install/popups/db_priv.php | 34 +- install/upgrades/clear_cache.php | 2 - login.php | 2 - popup.php | 1 - rss.php | 4 - selector.php | 1 - site_rss.php | 7 - 364 files changed, 1793 insertions(+), 4420 deletions(-) rename framework/core/{subsystems-1/image => assets/images}/default_preview.gif (100%) rename framework/core/{subsystems-1/image => assets/images}/default_preview_denied.gif (100%) rename framework/core/{subsystems-1/image => assets/images}/default_preview_notfound.gif (100%) rename framework/core/{subsystems-1/image => assets/images}/default_preview_unknown.gif (100%) rename framework/core/{subsystems-1/files/mimetypes.php => lang/English - US.info.php} (70%) delete mode 100644 framework/core/subsystems-1/files.php delete mode 100644 framework/core/subsystems-1/files/iconselector.js delete mode 100644 framework/core/subsystems-1/flow.php delete mode 100644 framework/core/subsystems-1/image.php delete mode 100644 framework/core/subsystems-1/info.php delete mode 100644 framework/core/subsystems-1/search.php delete mode 100644 framework/core/subsystems-1/search/exclude.en.list delete mode 100644 framework/core/subsystems-1/security.php delete mode 100644 framework/core/subsystems-1/sessions.php delete mode 100644 framework/core/subsystems-1/sorting.php delete mode 100644 framework/core/subsystems-1/workflow/actions/Debugging.php delete mode 100644 framework/core/subsystems-1/workflow/actions/Redirect User.php delete mode 100644 framework/core/subsystems-1/workflow/actions/Show Back Link.php delete mode 100644 framework/core/subsystems-1/workflow/actions/Show Message.php diff --git a/conf/extensions/antispam.structure.php b/conf/extensions/antispam.structure.php index e39a268af0..4342459beb 100755 --- a/conf/extensions/antispam.structure.php +++ b/conf/extensions/antispam.structure.php @@ -33,39 +33,37 @@ //"custom"=>'Custom' --> THIS MAY BE COOL TO ADD LATER... ); -$i18n = exponent_lang_loadFile('conf/extensions/antispam.structure.php'); - return array( - $i18n['title'], + gt('Anti-Spam Measures'), array( 'SITE_USE_ANTI_SPAM'=>array( - 'title'=>$i18n['use_captcha'], - 'description'=>$i18n['use_captcha_desc'], + 'title'=>gt('Use CAPTCHA Test?'), + 'description'=>gt('A CAPTCHA (Computer Automated Public Turing Test to Tell Computers and Humans Apart) is a means to prevent massive account registration. When registering a new user account, the visitor will be required to enter a series of letters and numbers appearing in an image. This prevents scripted bots from registering a large quantity of accounts.'), 'control'=>new checkboxcontrol() ), 'ANTI_SPAM_USERS_SKIP'=>array( - 'title'=>$i18n['antispam_users_skip'], - 'description'=>$i18n['antispam_users_skip_desc'], + 'title'=>gt('Skip using Anti-Spam measures for Logged-In Users?'), + 'description'=>gt('If a user is logged-in, do not display anti-spam control.
'), 'control'=>new checkboxcontrol() ), 'ANTI_SPAM_CONTROL'=>array( - 'title'=>$i18n['antispam_control'], - 'description'=>$i18n['antispam_control_desc'], + 'title'=>gt('Choose an Anti-Spam Control'), + 'description'=>gt('Spam on forms, like comments and contact forms can be a big issue for admins. If you would like to try to combat spam on your site, choose an anti-spam control to use.
'), 'control'=>new dropdowncontrol('',$as_types) ), 'RECAPTCHA_THEME'=>array( - 'title'=>$i18n['recaptcha_theme'], - 'description'=>$i18n['recaptcha_theme'], + 'title'=>gt('reCAPTCHA Theme.'), + 'description'=>gt('reCAPTCHA Theme.'), 'control'=>new dropdowncontrol('',$as_themes) ), 'RECAPTCHA_PUB_KEY'=>array( - 'title'=>$i18n['recaptcha_pub_key'], - 'description'=>$i18n['recaptcha_pub_key_desc'], + 'title'=>gt('reCAPTCHA Public Key.'), + 'description'=>gt('If you are using reCAPTCHA please enter the public key here.'), 'control'=>new textcontrol() ), 'RECAPTCHA_PRIVATE_KEY'=>array( - 'title'=>$i18n['recaptcha_private_key'], - 'description'=>$i18n['recaptcha_private_key_desc'], + 'title'=>gt('reCAPTCHA Private Key.'), + 'description'=>gt('If you are using reCAPTCHA please enter the private key here.'), 'control'=>new textcontrol() ), @@ -74,7 +72,8 @@ $info = gd_info(); if (!EXPONENT_HAS_GD) { - $stuff[1]['SITE_USE_ANTI_SPAM']['description'] = $i18n['use_captcha_desc'].'

'.$i18n['no_gd_support']; + $stuff[1]['SITE_USE_ANTI_SPAM']['description'] = gt('A CAPTCHA (Computer Automated Public Turing Test to Tell Computers and Humans Apart) is a means to prevent massive account registration. When registering a new user account, the visitor will be required to enter a series of letters and numbers appearing in an image. This prevents scripted bots from registering a large quantity of accounts.').'

'. + gt('
The server\'s version and/or configuration of PHP does not include GD support, so you will not be able to activate or use the CAPTCHA test.
'); $stuff[1]['SITE_USE_ANTI_SPAM']['control']->disabled = true; } diff --git a/conf/extensions/avatar.defaults.php b/conf/extensions/avatar.defaults.php index 8e1d9973a6..1a32cfee8c 100644 --- a/conf/extensions/avatar.defaults.php +++ b/conf/extensions/avatar.defaults.php @@ -17,7 +17,6 @@ # ################################################## -//if (!defined('DEFAULT_AVATAR')) define('DEFAULT_AVATAR', URL_FULL . "framework/modules/users/avatars/avatar_not_found.jpg"); if (!defined('DEFAULT_AVATAR')) define('DEFAULT_AVATAR', URL_FULL . "framework/modules/users/assets/images/avatar_not_found.jpg"); diff --git a/conf/extensions/comments.structure.php b/conf/extensions/comments.structure.php index e0d01928a3..1af1b2aa0f 100755 --- a/conf/extensions/comments.structure.php +++ b/conf/extensions/comments.structure.php @@ -19,29 +19,27 @@ if (!defined('EXPONENT')) exit(''); -$i18n = exponent_lang_loadFile('conf/extensions/comments.structure.php'); - return array( - $i18n['title'], + gt('User Comment Policies'), array( 'COMMENTS_REQUIRE_LOGIN'=>array( - 'title'=>$i18n['comments_require_login'], - 'description'=>$i18n['comments_require_login_desc'], + 'title'=>gt('Require Login to Post Comments'), + 'description'=>gt('Checking this option will force user to create an account and be logged in before they can post comments on your site.'), 'control'=>new checkboxcontrol() ), 'COMMENTS_REQUIRE_APPROVAL'=>array( - 'title'=>$i18n['comments_require_approval'], - 'description'=>$i18n['comments_require_approval_desc'], + 'title'=>gt('I Want to Approve All Comments'), + 'description'=>gt('If this option is selected, comments will not be published to your site until you approve them.'), 'control'=>new checkboxcontrol() ), 'COMMENTS_REQUIRE_NOTIFICATION'=>array( - 'title'=>$i18n['comments_require_notification'], - 'description'=>$i18n['comments_require_notification_desc'], + 'title'=>gt('Notify Me of New Comments'), + 'description'=>gt('An email notification will be sent to the email address specificed below to notify you of new comments on your site.'), 'control'=>new checkboxcontrol() ), 'COMMENTS_NOTIFICATION_EMAIL'=>array( - 'title'=>$i18n['comments_require_notification_email'], - 'description'=>$i18n['comments_require_notification_email_desc'], + 'title'=>gt('Notification Email Address(es) (Enter multiple addresses by using a comma to separate them)'), + 'description'=>gt('If you have indicated you would like to be notified of new comments on your site, please enter the email address of all the people you would like to get the notificaiton email addresses.'), 'control'=>new textcontrol() ), ) diff --git a/conf/extensions/database.structure.php b/conf/extensions/database.structure.php index c6c2336933..cbe542f755 100755 --- a/conf/extensions/database.structure.php +++ b/conf/extensions/database.structure.php @@ -19,49 +19,47 @@ if (!defined('EXPONENT')) exit(''); -$i18n = exponent_lang_loadFile('conf/extensions/database.structure.php'); - return array( - $i18n['title'], + gt('Database Options'), array( 'DB_ENGINE'=>array( - 'title'=>$i18n['db_engine'], - 'description'=>$i18n['db_engine_desc'], + 'title'=>gt('Backend Software'), + 'description'=>gt('The database server software package.'), 'control'=>new dropdowncontrol('',exponent_database_backends()) ), 'DB_NAME'=>array( - 'title'=>$i18n['db_name'], - 'description'=>$i18n['db_name_desc'], + 'title'=>gt('Database Name'), + 'description'=>gt('The name of the database to store the site tables in.'), 'control'=>new textcontrol() ), 'DB_USER'=>array( - 'title'=>$i18n['db_user'], - 'description'=>$i18n['db_user_desc'], + 'title'=>gt('Username'), + 'description'=>gt('The name of the user to connect to the database server as'), 'control'=>new textcontrol() ), 'DB_PASS'=>array( - 'title'=>$i18n['db_pass'], - 'description'=>$i18n['db_pass_desc'], + 'title'=>gt('Password'), + 'description'=>gt('Password of the user above.'), 'control'=>new passwordcontrol() ), 'DB_HOST'=>array( - 'title'=>$i18n['db_host'], - 'description'=>$i18n['db_host_desc'], + 'title'=>gt('Server Address'), + 'description'=>gt('The domain name or IP address of the database server. If this is a local server, use "localhost"'), 'control'=>new textcontrol() ), 'DB_PORT'=>array( - 'title'=>$i18n['db_port'], - 'description'=>$i18n['db_port_desc'], + 'title'=>gt('Server Port'), + 'description'=>gt('The port that the database server runs on. For MySQL, this is 3306.'), 'control'=>new textcontrol() ), 'DB_TABLE_PREFIX'=>array( - 'title'=>$i18n['db_table_prefix'], - 'description'=>$i18n['db_table_prefix_desc'], + 'title'=>gt('Table Prefix'), + 'description'=>gt('A prefix to prepend to all table names.'), 'control'=>new textcontrol() ), 'DB_ENCODING'=>array( - 'title'=>$i18n['db_encoding'], - 'description'=>$i18n['db_encoding_desc'], + 'title'=>gt('Database Connection Encoding'), + 'description'=>gt('Sets the encoding of a connection. Supported on mySQL higher 4.1.12.'), 'control'=>new dropdowncontrol('', exponent_config_dropdownData('DB_ENCODING')) ) ) diff --git a/conf/extensions/display.defaults.php b/conf/extensions/display.defaults.php index 94d4ff3d4b..07e3c1ff72 100755 --- a/conf/extensions/display.defaults.php +++ b/conf/extensions/display.defaults.php @@ -17,9 +17,9 @@ # ################################################## -if (!defined('DISPLAY_LANGUAGE')) define('DISPLAY_LANGUAGE','en'); -if (!defined('SLINGBAR_TOP')) define('SLINGBAR_TOP','1'); +//if (!defined('DISPLAY_LANGUAGE')) define('DISPLAY_LANGUAGE','en'); if (!defined('LANGUAGE')) define("LANGUAGE",'English - US'); +if (!defined('SLINGBAR_TOP')) define('SLINGBAR_TOP','1'); if (!defined('WRITE_LANG_TEMPLATE')) define('WRITE_LANG_TEMPLATE','0'); if (!defined('DISPLAY_THEME_REAL')) define('DISPLAY_THEME_REAL','retrotheme'); if (!defined('DISPLAY_ATTRIBUTION')) define('DISPLAY_ATTRIBUTION','username'); diff --git a/conf/extensions/display.structure.php b/conf/extensions/display.structure.php index 93c6257e17..8770f5ea51 100755 --- a/conf/extensions/display.structure.php +++ b/conf/extensions/display.structure.php @@ -39,73 +39,62 @@ } uasort($themes,'strnatcmp'); -/* -$languages = array(); -if (is_readable(BASE.'framework/core/subsystems-1/lang')) { - $lang_dir = opendir(BASE.'framework/core/subsystems-1/lang'); - while (($lang_file = readdir($lang_dir)) !== false) { - $lang_file = realpath(BASE.'framework/core/subsystems-1/lang/'.$lang_file); - if (is_readable($lang_file) && is_file($lang_file)) { - $thislang = include($lang_file); - $languages[$thislang['locale']] = $thislang['name']; - } - } -} +$languages = expLang::langList(); +ksort($langs); +/* echo ""; print_r($languages); print_r($themes); echo ""; */ -$i18n = exponent_lang_loadFile('conf/extensions/display.structure.php'); - return array( - $i18n['title'], + gt('Display Settings'), array( - /*'DISPLAY_LANGUAGE'=>array( - 'title'=>$i18n['language'], - 'description'=>$i18n['language_desc'], +// 'DISPLAY_LANGUAGE'=>array( + 'LANGUAGE'=>array( + 'title'=>gt('Language'), + 'description'=>gt('The language to use.'), 'control'=>new dropdowncontrol(null,$languages) ), - */ 'SLINGBAR_TOP'=>array( - 'title'=>$i18n['slingbar_top'], - 'description'=>$i18n['slingbar_top_desc'], + 'title'=>gt('Slingbar at Top'), + 'description'=>gt('Should the slingbar display at the top of the page? Unchecking will place the slingbar at the bottom of the page.'), 'control'=>new checkboxcontrol(false,true) ), 'DISPLAY_THEME_REAL'=>array( - 'title'=>$i18n['theme_real'], - 'description'=>$i18n['theme_real_desc'], + 'title'=>gt('Theme'), + 'description'=>gt('The current theme layout'), 'control'=>new dropdowncontrol(null,$themes) ), 'DISPLAY_ATTRIBUTION'=>array( - 'title'=>$i18n['attribution'], - 'description'=>$i18n['attribution_desc'], + 'title'=>gt('Attribution'), + 'description'=>gt('How credit is given to authors for their posts.'), 'control'=>new dropdowncontrol(null,array('firstlast'=>'John Doe','lastfirst'=>'Doe, John','first'=>'John','username'=>'jdoe')) ), 'DISPLAY_DATETIME_FORMAT'=>array( - 'title'=>$i18n['datetime_format'], - 'description'=>$i18n['datetime_format_desc'], + 'title'=>gt('Date and Time Format'), + 'description'=>gt('Default system-wide date format, displaying both date and time.'), 'control'=>new dropdowncontrol(null,exponent_config_dropdownData('datetime_format')) ), 'DISPLAY_DATE_FORMAT'=>array( - 'title'=>$i18n['date_format'], - 'description'=>$i18n['date_format_desc'], + 'title'=>gt('Date Format'), + 'description'=>gt('Default system-wide date format, displaying date only.'), 'control'=>new dropdowncontrol(null,exponent_config_dropdownData('date_format')) ), 'DISPLAY_TIME_FORMAT'=>array( - 'title'=>$i18n['time_format'], - 'description'=>$i18n['time_format_desc'], + 'title'=>gt('Time Format'), + 'description'=>gt('Default system-wide date format, displaying time only.'), 'control'=>new dropdowncontrol(null,exponent_config_dropdownData('time_format')) ), 'DISPLAY_START_OF_WEEK'=>array( - 'title'=>$i18n['start_of_week'], - 'description'=>$i18n['start_of_week_desc'], + 'title'=>gt('Start of Week'), + 'description'=>gt('Default day to start the week.'), 'control'=>new dropdowncontrol(null,exponent_config_dropdownData('start_of_week')) ), 'DISPLAY_DEFAULT_TIMEZONE'=>array( - 'title'=>$i18n['default_timezone'], - 'description'=>$i18n['default_timezone_desc'], + 'title'=>gt('Default timezone for this site.'), + 'description'=>gt('Select the default timezone for this site. CAUTION: This may break calendars and other features that use date functions if you change this after entering data. Must be in a format shown here: http://www.php.net/manual/en/timezones.php'), 'control'=>new textcontrol() ) ) diff --git a/conf/extensions/htmltopdf.structure.php b/conf/extensions/htmltopdf.structure.php index cfc0e57f28..ef4d18dc0c 100644 --- a/conf/extensions/htmltopdf.structure.php +++ b/conf/extensions/htmltopdf.structure.php @@ -19,20 +19,17 @@ if (!defined('EXPONENT')) exit(''); - -$i18n = exponent_lang_loadFile('conf/extensions/htmltopdf.structure.php'); - return array( - $i18n['title'], + gt('HtmlToPdf Paths'), array( 'HTMLTOPDF_PATH'=>array( - 'title'=>$i18n['htmltopdf_path'], - 'description'=>$i18n['htmltopdf_path_desc'], + 'title'=>gt('HTML to PDF Path'), + 'description'=>gt('The actual path of the binary html to pdf library'), 'control'=>new textcontrol() ), 'HTMLTOPDF_PATH_TMP'=>array( - 'title'=>$i18n['htmltopdf_tmp'], - 'description'=>$i18n['htmltopdf_tmp_desc'], + 'title'=>gt('Html to PDF Tmp Directory'), + 'description'=>gt('The tmp directory to be used by htmltopdf library'), 'control'=>new textcontrol() ) ) diff --git a/conf/extensions/ldap.structure.php b/conf/extensions/ldap.structure.php index f18c6cc349..2b82a3c6a9 100755 --- a/conf/extensions/ldap.structure.php +++ b/conf/extensions/ldap.structure.php @@ -19,34 +19,32 @@ if (!defined('EXPONENT')) exit(''); -$i18n = exponent_lang_loadFile('conf/extensions/ldap.structure.php'); - return array( - $i18n['title'], + gt('LDAP Authentication Options'), array( 'USE_LDAP'=>array( - 'title'=>$i18n['use_ldap'], - 'description'=>$i18n['use_ldap_desc'], + 'title'=>gt('Turn on LDAP Authentication'), + 'description'=>gt('Checking this option will cause Exponent to try to authenticate to the ldap server listed below.'), 'control'=>new checkboxcontrol() ), 'LDAP_SERVER'=>array( - 'title'=>$i18n['ldap_server'], - 'description'=>$i18n['ldap_server_desc'], + 'title'=>gt('LDAP Server'), + 'description'=>gt('Enter the hostname or IP of the LDAP server.'), 'control'=>new textcontrol() ), 'LDAP_BASE_DN'=>array( - 'title'=>$i18n['ldap_base_dn'], - 'description'=>$i18n['ldap_base_dn_desc'], + 'title'=>gt('Base DN'), + 'description'=>gt('Enter the Base context for this LDAP connection.'), 'control'=>new textcontrol() ), 'LDAP_BIND_USER'=>array( - 'title'=>$i18n['ldap_bind_user'], - 'description'=>$i18n['ldap_bind_user_desc'], + 'title'=>gt('LDAP Bind User'), + 'description'=>gt('The username or context for the binding to the LDAP Server to perform administration tasks(This currently doesn\'t do anything.)'), 'control'=>new textcontrol() ), 'LDAP_BIND_PASS'=>array( - 'title'=>$i18n['ldap_bind_pass'], - 'description'=>$i18n['ldap_bind_pass_desc'], + 'title'=>gt('LDAP Password'), + 'description'=>gt('Enter the password for the username/context listed above.'), 'control'=>new passwordcontrol() ) ) diff --git a/conf/extensions/maint.structure.php b/conf/extensions/maint.structure.php index b08f08e242..b242c9bea5 100755 --- a/conf/extensions/maint.structure.php +++ b/conf/extensions/maint.structure.php @@ -20,25 +20,23 @@ if (!defined('EXPONENT')) exit(''); -$i18n = exponent_lang_loadFile('conf/extensions/maint.structure.php'); - return array( - $i18n['title'], + gt('Site Maintenance Settings'), array( 'MAINTENANCE_MODE'=>array( - 'title'=>$i18n['maint_mode'], - 'description'=>$i18n['maint_mode_desc'], + 'title'=>gt('Maintenance Mode?'), + 'description'=>gt('Whether or not the site is in maintenance mode. While in maintenance mode, only administrators and acting administrators will be allowed to login.'), 'control'=>new checkboxcontrol(false,true) ), 'MAINTENANCE_MSG_HTML'=>array( - 'title'=>$i18n['maint_msg'], - 'description'=>$i18n['maint_msg_desc'], + 'title'=>gt('Maintenance Mode Message'), + 'description'=>gt('A message to display to all non-administrators visiting the site.'), 'control'=>new htmleditorcontrol() ), 'DEVELOPMENT'=>array( - 'title'=>exponent_lang_getText('Enable Error Reporting'), - 'description'=>exponent_lang_getText('This option enables error reporting. This is useful for developement, but should be turned off for a live site.'), - 'control'=>new checkboxcontrol(false,true) + 'title'=>gt('Enable Error Reporting'), + 'description'=>gt('This option enables error reporting. This is useful for developement, but should be turned off for a live site.'), + 'control'=>new checkboxcontrol(false,true) ), ) ); diff --git a/conf/extensions/minify.structure.php b/conf/extensions/minify.structure.php index 30c6cee89e..c659fd0f0e 100644 --- a/conf/extensions/minify.structure.php +++ b/conf/extensions/minify.structure.php @@ -19,30 +19,27 @@ if (!defined('EXPONENT')) exit(''); - -$i18n = exponent_lang_loadFile('conf/extensions/minify.structure.php'); - return array( - $i18n['title'], + gt('Minify Configuration'), array( 'MINIFY_MAXAGE'=>array( - 'title'=>$i18n['minify_maxage'], - 'description'=>$i18n['minify_maxage_desc'], + 'title'=>gt('Minify Max Age'), + 'description'=>gt('Maximum age of browser cache in seconds'), 'control'=>new textcontrol() ), 'MINIFY_MAX_FILES'=>array( - 'title'=>$i18n['minify_max_files'], - 'description'=>$i18n['minify_max_files_desc'], + 'title'=>gt('Minify Max Files'), + 'description'=>gt('Maximum # of files that can be specified in the "f" GET parameter'), 'control'=>new textcontrol() ), 'MINIFY_URL_LENGTH'=>array( - 'title'=>$i18n['minify_url_length'], - 'description'=>$i18n['minify_url_length_desc'], + 'title'=>gt('Minify URL Length'), + 'description'=>gt('The length of minification url'), 'control'=>new textcontrol() ), 'MINIFY_ERROR_LOGGER'=>array( - 'title'=>$i18n['minify_error_logger'], - 'description'=>$i18n['minify_error_logger_desc'], + 'title'=>gt('Minify Error Logger'), + 'description'=>gt('Set to true to log error messages to FirePHP'), 'control'=>new checkboxcontrol() ) diff --git a/conf/extensions/registration.structure.php b/conf/extensions/registration.structure.php index 9a912fecfb..b3097645c8 100755 --- a/conf/extensions/registration.structure.php +++ b/conf/extensions/registration.structure.php @@ -20,49 +20,47 @@ if (!defined('EXPONENT')) exit(''); -$i18n = exponent_lang_loadFile('conf/extensions/registration.structure.php'); - return array( - $i18n['title'], + gt('User Registration'), array( 'SITE_ALLOW_REGISTRATION'=>array( - 'title'=>$i18n['allow_registration'], - 'description'=>$i18n['allow_registration_desc'], + 'title'=>gt('Allow Registration?'), + 'description'=>gt('Whether or not new users should be allowed to create accounts for themselves.'), 'control'=>new checkboxcontrol() ), 'USER_REGISTRATION_USE_EMAIL'=>array( - 'title'=>exponent_lang_getText('Use Email Address as username'), - 'description'=>exponent_lang_getText('Selecting this will prompt the user for their email address instead of a username.'), + 'title'=>gt('Use Email Address as username'), + 'description'=>gt('Selecting this will prompt the user for their email address instead of a username.'), 'control'=>new checkboxcontrol() ), 'USER_REGISTRATION_SEND_NOTIF'=>array( - 'title'=>$i18n['user_registration_send_notif'], - 'description'=>$i18n['user_registration_send_notif_desc'], + 'title'=>gt('Notification of New User'), + 'description'=>gt('Select this option if you want to send an email to a site administrator/webmaster when a new user registers on your website.'), 'control'=>new checkboxcontrol() ), 'USER_REGISTRATION_NOTIF_SUBJECT'=>array( - 'title'=>$i18n['user_registration_notif_subject'], - 'description'=>$i18n['user_registration_notif_subject_desc'], + 'title'=>gt('Notification Subject'), + 'description'=>gt('This is the text to be put in the subject line of a new user notification email.'), 'control'=>new textcontrol('',50) ), 'USER_REGISTRATION_ADMIN_EMAIL'=>array( - 'title'=>$i18n['user_registration_admin_email'], - 'description'=>$i18n['user_registration_admin_email_desc'], + 'title'=>gt('Notification Email Address'), + 'description'=>gt('Enter the email address you would like new user notification to go to.'), 'control'=>new textcontrol('',50) ), 'USER_REGISTRATION_SEND_WELCOME'=>array( - 'title'=>$i18n['user_registration_send_welcome'], - 'description'=>$i18n['user_registration_send_welcome_desc'], + 'title'=>gt('Send Welcome Email to New Users'), + 'description'=>gt('Select this option if you want to send a welcome email to a new user when they create a new account on your website.'), 'control'=>new checkboxcontrol() ), 'USER_REGISTRATION_WELCOME_SUBJECT'=>array( - 'title'=>$i18n['user_registration_welcome_subject'], - 'description'=>$i18n['user_registration_welcome_subject_desc'], + 'title'=>gt('Welcome Subject'), + 'description'=>gt('This is the text to be put in the subject line of a welcome email sent to new users.'), 'control'=>new textcontrol('',50) ), 'USER_REGISTRATION_WELCOME_MSG'=>array( - 'title'=>$i18n['user_registration_welcome_msg'], - 'description'=>$i18n['user_registration_welcome_msg_desc'], + 'title'=>gt('Welcome Message'), + 'description'=>gt('This is the text to be put in the message body of a welcome email sent to new users.'), 'control'=>new htmleditorcontrol('',15,50) ), ) diff --git a/conf/extensions/search.structure.php b/conf/extensions/search.structure.php index 5225d142d1..e06bf0a535 100644 --- a/conf/extensions/search.structure.php +++ b/conf/extensions/search.structure.php @@ -22,14 +22,12 @@ $ctl = new checkboxcontrol(false,true); $ctl->disabled = 0; -$i18n = exponent_lang_loadFile('conf/extensions/search.structure.php'); - return array( - $i18n['title'], + gt('Track Search Queries'), array( 'SAVE_SEARCH_QUERIES'=>array( - 'title'=>$i18n['save_search_queries'], - 'description'=>$i18n['save_search_queries_desc'], + 'title'=>gt('Save Search Queries'), + 'description'=>gt('It can be advantageous to know what your users are looking for. Take note that there is no user interface to see this data yet, you will need to query the database directly to see what your users are searching for.'), 'control'=>$ctl ) ) diff --git a/conf/extensions/sef.structure.php b/conf/extensions/sef.structure.php index 57b54bef94..b7968a012b 100755 --- a/conf/extensions/sef.structure.php +++ b/conf/extensions/sef.structure.php @@ -22,14 +22,12 @@ $ctl = new checkboxcontrol(false,true); $ctl->disabled = 0; -$i18n = exponent_lang_loadFile('conf/extensions/sef.structure.php'); - return array( - $i18n['title'], + gt('Search Engine Friendly URLs'), array( 'SEF_URLS'=>array( - 'title'=>$i18n['sef_urls'], - 'description'=>$i18n['sef_urls_desc'], + 'title'=>gt('Enable SEF URLs'), + 'description'=>gt('Enabling SEF URLs will make your URL strings easier to read and more attractive to the search engines.
'), 'control'=>$ctl ) ) diff --git a/conf/extensions/simplenotes.structure.php b/conf/extensions/simplenotes.structure.php index 0e04a9d672..6b3628798b 100644 --- a/conf/extensions/simplenotes.structure.php +++ b/conf/extensions/simplenotes.structure.php @@ -19,29 +19,27 @@ if (!defined('EXPONENT')) exit(''); -$i18n = exponent_lang_loadFile('conf/extensions/simplenote.structure.php'); - return array( - $i18n['title'], + gt('Simple Admin notes'), array( 'SIMPLENOTE_REQUIRE_LOGIN'=>array( - 'title'=>$i18n['simplenote_require_login'], - 'description'=>$i18n['simplenote_require_login_desc'], + 'title'=>gt('Require Login to Add Notes'), + 'description'=>gt('Checking this option will force user to create an account and be logged in before they can addn notes. Theoreticall this will rarely be an issue as simple notes are generall added to edit forms (products for example) and thus the user would need to be logged in anyway.'), 'control'=>new checkboxcontrol() ), 'SIMPLENOTE_REQUIRE_APPROVAL'=>array( - 'title'=>$i18n['simplenote_require_approval'], - 'description'=>$i18n['simplenote_require_approval_desc'], + 'title'=>gt('I Want to Approve All Notes'), + 'description'=>gt('If this option is selected, notes will not be displayed until you approve them.'), 'control'=>new checkboxcontrol() ), 'SIMPLENOTE_REQUIRE_NOTIFICATION'=>array( - 'title'=>$i18n['simplenote_require_notification'], - 'description'=>$i18n['simplenote_require_notification_desc'], + 'title'=>gt('Notify Me of New Notes'), + 'description'=>gt('An email notification will be sent to the email address specificed below to notify you of new notes.'), 'control'=>new checkboxcontrol() ), 'SIMPLENOTE_NOTIFICATION_EMAIL'=>array( - 'title'=>$i18n['simplenote_require_notification_email'], - 'description'=>$i18n['simplenote_require_notification_email_desc'], + 'title'=>gt('Notification Email Address(es) (Enter multiple addresses by using a comma to separate them)'), + 'description'=>gt('If you have indicated you would like to be notified of new notes, please enter the email address of all the people you would like to get the notificaiton email addresses.'), 'control'=>new textcontrol() ), ) diff --git a/conf/extensions/site.defaults.php b/conf/extensions/site.defaults.php index 8c487c91bc..7e34f9b018 100755 --- a/conf/extensions/site.defaults.php +++ b/conf/extensions/site.defaults.php @@ -50,9 +50,9 @@ if (!defined('DIR_DEFAULT_MODE_STR')) define('DIR_DEFAULT_MODE_STR','0770'); if (!defined('DIR_DEFAULT_MODE')) define('DIR_DEFAULT_MODE',octdec(DIR_DEFAULT_MODE_STR+0)); -if (!defined('USE_LANG')) define('USE_LANG','eng_US'); -if (!defined('ENABLE_WORKFLOW')) define('ENABLE_WORKFLOW',0); -if (!defined('WORKFLOW_REVISION_LIMIT')) define('WORKFLOW_REVIOSION_LIMIT',0); +//if (!defined('USE_LANG')) define('USE_LANG','eng_US'); +//if (!defined('ENABLE_WORKFLOW')) define('ENABLE_WORKFLOW',0); +//if (!defined('WORKFLOW_REVISION_LIMIT')) define('WORKFLOW_REVIOSION_LIMIT',0); if (!defined('ORGANIZATION_NAME')) define('ORGANIZATION_NAME',URL_BASE); if (!defined('HELP_ACTIVE')) define('HELP_ACTIVE',1); if (!defined('HELP_URL')) define('HELP_URL','http://docs.exponentcms.org/'); diff --git a/conf/extensions/site.structure.php b/conf/extensions/site.structure.php index 53966e0644..df1af829d2 100755 --- a/conf/extensions/site.structure.php +++ b/conf/extensions/site.structure.php @@ -20,7 +20,6 @@ if (!defined('EXPONENT')) exit(''); -$i18n = exponent_lang_loadFile('conf/extensions/site.structure.php'); $installed_editors = array(); foreach (glob(BASE . "themes/common/editors/*.tpl") as $installed_glue_file) { @@ -32,126 +31,126 @@ } $stuff = array( - $i18n['title'], + gt('General Site Configuration'), array( 'ORGANIZATION_NAME'=>array( - 'title'=>$i18n['org_name'], - 'description'=>$i18n['org_name_desc'], + 'title'=>gt('Organization Name'), + 'description'=>gt('The name of your company or organization. This is used in several places in the system.'), 'control'=>new textcontrol() ), 'SITE_TITLE'=>array( - 'title'=>$i18n['site_title'], - 'description'=>$i18n['site_title_desc'], + 'title'=>gt('Site Title'), + 'description'=>gt('The title of the website.'), 'control'=>new textcontrol() ), 'SITE_HEADER'=>array( - 'title'=>$i18n['site_header'], - 'description'=>$i18n['site_header_desc'], + 'title'=>gt('Site Header'), + 'description'=>gt('The header of the website.'), 'control'=>new textcontrol() ), - 'USE_LANG'=>array( - 'title'=>$i18n['use_lang'], - 'description'=>$i18n['use_lang_desc'], - 'control'=>new dropdowncontrol(0,exponent_lang_list()) - ), +// 'USE_LANG'=>array( +// 'title'=>gt('Interface Language'), +// 'description'=>gt('What language should be used for the Exponent interface?'), +// 'control'=>new dropdowncontrol(0,exponent_lang_list()) +// ), /*'SITE_ALLOW_REGISTRATION'=>array( - 'title'=>$i18n['allow_registration'], - 'description'=>$i18n['allow_registration_desc'], + 'title'=>gt('Allow Registration?'), + 'description'=>gt('Whether or not new users should be allowed to create accounts for themselves.'), 'control'=>new checkboxcontrol() ), 'SITE_USE_ANTI_SPAM'=>array( - 'title'=>$i18n['use_captcha'], - 'description'=>$i18n['use_captcha_desc'], + 'title'=>gt('Use CAPTCHA Test?'), + 'description'=>gt('A CAPTCHA (Computer Automated Public Turing Test to Tell Computers and Humans Apart) is a means to prevent massive account registration. When registering a new user account, the visitor will be required to enter a series of letters and numbers appearing in an image. This prevents scripted bots from registering a large quantity of accounts.'), 'control'=>new checkboxcontrol() ),*/ 'SITE_KEYWORDS'=>array( - 'title'=>$i18n['site_keywords'], - 'description'=>$i18n['site_keywords_desc'], + 'title'=>gt('Keywords'), + 'description'=>gt('Search engine keywords for the site.'), 'control'=>new texteditorcontrol('',10,30) ), 'SITE_DESCRIPTION'=>array( - 'title'=>$i18n['site_description'], - 'description'=>$i18n['site_description_desc'], + 'title'=>gt('Description'), + 'description'=>gt('A description of what the site is about.'), 'control'=>new texteditorcontrol('',15,50) ), 'SITE_404_TITLE'=>array( - 'title'=>'Not Found Page Title', - 'description'=>'Page title for your 404 Not Found Page', + 'title'=>gt('Not Found Page Title'), + 'description'=>gt('Page title for your 404 Not Found Page'), 'control'=>new textcontrol() ), 'SITE_404_HTML'=>array( - 'title'=>$i18n['site_404'], - 'description'=>$i18n['site_404_desc'], + 'title'=>gt('"Not Found" Error Text'), + 'description'=>gt('HTML to show to a user when they try to request something that is not found (like a deleted post, section etc.)'), 'control'=>new htmleditorcontrol('',15,50) ), 'SITE_403_REAL_HTML'=>array( - 'title'=>$i18n['site_403'], - 'description'=>$i18n['site_403_desc'], + 'title'=>gt('"Access Denied" Error Text'), + 'description'=>gt('HTML to show to a user when they try to perform some action that their user account is not allowed to perform.'), 'control'=>new htmleditorcontrol('',15,50) ), 'SITE_DEFAULT_SECTION'=>array( - 'title'=>$i18n['default_section'], - 'description'=>$i18n['default_section_desc'], + 'title'=>gt('Default Section'), + 'description'=>gt('The default section.'), 'control'=>new dropdowncontrol('',navigationmodule::levelDropDownControlArray(0)) ), 'SITE_WYSIWYG_EDITOR'=>array( - 'title'=>$i18n['wysiwyg_editor'], - 'description'=>$i18n['wysiwyg_editor_desc'], + 'title'=>gt('HTML Editor'), + 'description'=>gt('Choose the HTML editor to use as the default editor for this site.'), 'control'=>new dropdowncontrol(null, $installed_editors) ), 'SESSION_TIMEOUT_ENABLE'=>array( - 'title'=>$i18n['enable_session_timeout'], - 'description'=>$i18n['enable_session_timeout_desc'], - 'control'=>new checkboxcontrol() - ), + 'title'=>gt('Enable Session Timeout'), + 'description'=>gt('This will turn on and off the timeout value for users.'), + 'control'=>new checkboxcontrol() + ), 'SESSION_TIMEOUT'=>array( - 'title'=>$i18n['session_timeout'], - 'description'=>$i18n['session_timeout_desc'], + 'title'=>gt('Session Timeout'), + 'description'=>gt('How long a user can be idle (in seconds) before they are automatically logged out.'), 'control'=>new textcontrol() ), 'SESSION_TIMEOUT_HTML'=>array( - 'title'=>$i18n['timeout_error'], - 'description'=>$i18n['timeout_error_desc'], + 'title'=>gt('"Session Expired" Error Text'), + 'description'=>gt('HTML to show to a user when their session expires and they are trying to perform some action that requires them to have certain permissions.'), 'control'=>new htmleditorcontrol('',15,50) ), 'FILE_DEFAULT_MODE_STR'=>array( - 'title'=>$i18n['fileperms'], - 'description'=>$i18n['fileperms_desc'], + 'title'=>gt('Default File Permissions'), + 'description'=>gt('The readability / writability of uploaded files, for users other than the web server user.'), 'control'=>new dropdowncontrol(null,exponent_config_dropdownData('file_permissions')) ), 'DIR_DEFAULT_MODE_STR'=>array( - 'title'=>$i18n['dirperms'], - 'description'=>$i18n['dirperms_desc'], + 'title'=>gt('Default Directory Permissions'), + 'description'=>gt('The readability / writability of created directories, for users other than the web server user.'), 'control'=>new dropdowncontrol(null,exponent_config_dropdownData('dir_permissions')) ), 'ENABLE_SSL'=>array( - 'title'=>$i18n['ssl'], - 'description'=>$i18n['ssl_desc'], + 'title'=>gt('Enable SSL Support'), + 'description'=>gt('Whether or not to turn on Secure Linking through SSL'), 'control'=>new checkboxcontrol() ), 'NONSSL_URL'=>array( - 'title'=>$i18n['nonssl_url'], - 'description'=>$i18n['nonssl_url_desc'], + 'title'=>gt('Non-SSL URL Base'), + 'description'=>gt('Full URL of the website without SSL support (usually starting with "http://")'), 'control'=>new textcontrol() ), 'SSL_URL'=>array( - 'title'=>$i18n['ssl_url'], - 'description'=>$i18n['ssl_url_desc'], - 'control'=>new textcontrol() - ), - 'ENABLE_WORKFLOW'=>array( - 'title'=>$i18n['enable_workflow'], - 'description'=>$i18n['enable_workflow_desc'], - 'control'=>new checkboxcontrol() - ), - 'WORKFLOW_REVISION_LIMIT'=>array( - 'title'=>$i18n['revision_limit'], - 'description'=>$i18n['revision_limit_desc'], + 'title'=>gt('SSL URL Base'), + 'description'=>gt('Full URL of the website with SSL support (usually starting with "https://")'), 'control'=>new textcontrol() ), +// 'ENABLE_WORKFLOW'=>array( +// 'title'=>gt('Enable Workflow'), +// 'description'=>gt('Turns workflow on and off. Leave off unless you are specifically using it, as workflow will effect system performance.'), +// 'control'=>new checkboxcontrol() +// ), +// 'WORKFLOW_REVISION_LIMIT'=>array( +// 'title'=>gt('Revision History Limit'), +// 'description'=>gt('The maximum number of major revisions (excluding the "current" revision) to keep per item of content. A limit of 0 (zero) means that all revisions will be kept.'), +// 'control'=>new textcontrol() +// ), 'HELP_URL'=>array( - 'title'=>$i18n['help_url'], - 'description'=>$i18n['help_url_desc'], + 'title'=>gt('URL For Help Documentation'), + 'description'=>gt('This is where Exponent will look for help docs. If unsure, leave the defaults unchanged.'), 'control'=>new textcontrol() ), ) diff --git a/conf/extensions/smtp.structure.php b/conf/extensions/smtp.structure.php index ac17190be0..2ebf47ff74 100755 --- a/conf/extensions/smtp.structure.php +++ b/conf/extensions/smtp.structure.php @@ -19,49 +19,47 @@ if (!defined('EXPONENT')) exit(''); -$i18n = exponent_lang_loadFile('conf/extensions/smtp.structure.php'); - return array( - $i18n['title'], + gt('SMTP Server Settings'), array( 'SMTP_FROMADDRESS'=>array( - 'title'=>$i18n['from_address'], - 'description'=>$i18n['from_address_desc'], + 'title'=>gt('From Address'), + 'description'=>gt('The from address to use when talking to the SMTP server. This is important for people using ISP SMTP servers, which may restrict access to certain email addresses.'), 'control'=>new textcontrol() ), 'SMTP_USE_PHP_MAIL'=>array( - 'title'=>$i18n['php_mail'], - 'description'=>$i18n['php_mail_desc'], + 'title'=>gt('Use PHP mail() Function?'), + 'description'=>gt('If the Exponent implementation of raw SMTP does not work for you, either because of server issues or hosting configurations, check this option to use the standard mail() function provided by PHP. NOTE: If you do so, you will not have to modify any other SMTP settings, as they will be ignored.'), 'control'=>new checkboxcontrol() ), 'SMTP_SERVER'=>array( - 'title'=>$i18n['server'], - 'description'=>$i18n['server_desc'], + 'title'=>gt('SMTP Server'), + 'description'=>gt('The IP address or host/domain name of the server to connect to for sending email through SMTP.'), 'control'=>new textcontrol() ), 'SMTP_PORT'=>array( - 'title'=>$i18n['port'], - 'description'=>$i18n['port_desc'], + 'title'=>gt('Port'), + 'description'=>gt('The port that the SMTP server is listening to for SMTP connections. If you do not know what this is, leave it as the default of 25.'), 'control'=>new textcontrol() ), 'SMTP_AUTHTYPE'=>array( - 'title'=>$i18n['auth'], - 'description'=>$i18n['auth_desc'], - 'control'=>new dropdowncontrol('',array('NONE'=>$i18n['auth_none'],'LOGIN'=>$i18n['auth_login'],'PLAIN'=>$i18n['auth_plain'])) + 'title'=>gt('Authentication Method'), + 'description'=>gt('Here, you can specify what type of authentication your SMTP server requires (if any). Please consult your mailserver administrator for this information.'), + 'control'=>new dropdowncontrol('',array('NONE'=>gt('No Authentication'),'LOGIN'=>gt('PLAIN'),'PLAIN'=>gt('LOGIN'))) ), 'SMTP_USERNAME'=>array( - 'title'=>$i18n['username'], - 'description'=>$i18n['username_desc'], + 'title'=>gt('SMTP Username'), + 'description'=>gt('The username to use when connecting to an SMTP server that requires some form of authentication'), 'control'=>new textcontrol() ), 'SMTP_PASSWORD'=>array( - 'title'=>$i18n['password'], - 'description'=>$i18n['password'], + 'title'=>gt('SMTP Password'), + 'description'=>gt('The password to use when connecting to an SMTP server that requires some form of authentication'), 'control'=>new passwordcontrol() ), 'SMTP_DEBUGGING'=>array( - 'title'=>$i18n['smtp_debug'], - 'description'=>$i18n['smtp_debug_desc'], + 'title'=>gt('Turn SMTP Debugging On?'), + 'description'=>gt('Turns on additional debugging output for all email system use.'), 'control'=>new checkboxcontrol() ), ) diff --git a/conf/extensions/tracking.structure.php b/conf/extensions/tracking.structure.php index 3fbf97a000..deabbe718e 100755 --- a/conf/extensions/tracking.structure.php +++ b/conf/extensions/tracking.structure.php @@ -22,29 +22,27 @@ $ctl = new checkboxcontrol(false,true); $ctl->disabled = 0; -$i18n = exponent_lang_loadFile('conf/extensions/tracking.structure.php'); - return array( - $i18n['title'], + gt('User Tracking'), array( 'ENABLE_TRACKING'=>array( - 'title'=>$i18n['enable_tracking'], - 'description'=>$i18n['tracking_desc'], + 'title'=>gt('Enable User Tracking'), + 'description'=>gt('Enabling user tracking will allow you to view detailed statistics about what users are doing on your site. Performance penalties may be incurred for enabling this. If you don\'t know what it is, or don\'t need it, don\'t enable it.'), 'control'=>$ctl ), 'TRACKING_COOKIE_EXPIRES'=>array( - 'title'=>$i18n['cookie_expires'], - 'description'=>$i18n['cookie_expires_desc'], + 'title'=>gt('How many days until the tracking cookie expires?'), + 'description'=>gt('This will affect how long the users\' browsers will retain the tracking data which will help detect returning users. It should NOT be set to a larger value than the archive retention time.'), 'control'=>new textcontrol() ), 'TRACKING_ARCHIVE_DELAY'=>array( - 'title'=>$i18n['tracking_archive'], - 'description'=>$i18n['tracking_archive_desc'], + 'title'=>gt('How often, in hours, should the raw tracking data be processed?'), + 'description'=>gt('The more often this updates, the smaller your database will be and the more up-to-date statistics you can view, however, running this too often wastes server resources.'), 'control'=>new textcontrol() ), 'TRACKING_ARCHIVE_TIME'=>array( - 'title'=>$i18n['tracking_save'], - 'description'=>$i18n['tracking_save_desc'], + 'title'=>gt('How long should archived data be retained, in days?'), + 'description'=>gt('The longer that data is retained, the more accurate the statistics are that can be produced and also the more storage space required to store them.'), 'control'=>new textcontrol() ) ) diff --git a/cron/send_reminders.php b/cron/send_reminders.php index 78d3993697..f480046976 100644 --- a/cron/send_reminders.php +++ b/cron/send_reminders.php @@ -77,10 +77,7 @@ // $viewparams = array("type"=>"byday", "range"=>"week"); // } -//if (!defined("SYS_DATETIME")) include_once(BASE . "framework/core/subsystems-1/datetime.php"); include_once(BASE . "framework/core/subsystems-1/datetime.php"); -//if (!defined('SYS_SORTING')) include_once(BASE . 'framework/core/subsystems-1/sorting.php'); -//include_once(BASE . 'framework/core/subsystems-1/sorting.php'); //if (!function_exists("exponent_sorting_byEventStartAscending")) { // function exponent_sorting_byEventStartAscending($a,$b) { // return ($a->eventstart < $b->eventstart ? -1 : 1); @@ -396,7 +393,6 @@ "From"=>$from = $config->email_from_reminder, "Reply-to"=>$reply = $config->email_reply_reminder ); -//if (!defined("SYS_USERS")) require_once(BASE . "framework/core/subsystems-1/users.php"); require_once(BASE . "framework/core/subsystems-1/users.php"); // set up the html message diff --git a/exponent.php b/exponent.php index 1ea76a0403..a6291384eb 100644 --- a/exponent.php +++ b/exponent.php @@ -40,7 +40,8 @@ * @global array $available_controllers * @name $available_controllers */ -$available_controllers = intializeControllers(); +$available_controllers = initializeControllers(); //original position +//$available_controllers = array(); // Initialize the Sessions Subsystem expSession::initialize(); @@ -50,9 +51,12 @@ $validateTheme = array("headerinfo"=>false,"footerinfo"=>false); // Initialize the language subsystem -require_once(BASE.'framework/core/subsystems-1/lang.php'); -exponent_lang_initialize(); -// Load 2.0 lang +//require_once(BASE.'framework/core/subsystems-1/lang.php'); +//exponent_lang_initialize(); +// Load 2.0 language +$cur_lang = array(); +$default_lang = array(); +$target_lang_file = ''; expLang::loadLang(); // Initialize the Core Subsystem @@ -67,10 +71,14 @@ * @name $db */ $db = exponent_database_connect(DB_USER,DB_PASS,DB_HOST.':'.DB_PORT,DB_NAME); +//$available_controllers = initializeControllers(); +//foreach ($db->selectObjects('modstate',1) as $mod) { +// if (!empty($mod->path)) $available_controllers[$mod->module] = $mod->path; //FIXME test location +//} // Initialize the old school Modules Subsystem. require_once(BASE.'framework/core/subsystems-1/modules.php'); -exponent_modules_initialize(); +exponent_modules_initialize(); // now in the autoloader, if used // Initialize the Template Subsystem. require_once(BASE.'framework/core/subsystems-1/template.php'); @@ -78,9 +86,7 @@ // Initialize the Permissions Subsystem. require_once(BASE.'framework/core/subsystems-1/permissions.php'); -// Initialize the Flow/History Subsystem. -//if (!defined('SYS_FLOW')) require_once(BASE.'framework/core/subsystems-1/flow.php'); -//require_once(BASE.'framework/core/subsystems-1/flow.php'); +// Initialize the History (Flow) Subsystem. /** * the browsing history object * @global expHistory $history @@ -93,13 +99,8 @@ require_once(BASE.'framework/core/subsystems-1/users.php'); // Initialize the javascript subsystem -//if (!defined('SYS_JAVASCRIPT')) require_once(BASE.'framework/core/subsystems-1/javascript.php'); require_once(BASE.'framework/core/subsystems-1/javascript.php'); -// Initialize the MVC framework -//require_once(BASE.'framework/core/expFramework.php'); -//$available_controllers = intializeControllers(); - if (expJavascript::inAjaxAction()) set_error_handler('handleErrors'); // Validate the session. This will populate the $user variable diff --git a/framework/core/subsystems-1/image/default_preview.gif b/framework/core/assets/images/default_preview.gif similarity index 100% rename from framework/core/subsystems-1/image/default_preview.gif rename to framework/core/assets/images/default_preview.gif diff --git a/framework/core/subsystems-1/image/default_preview_denied.gif b/framework/core/assets/images/default_preview_denied.gif similarity index 100% rename from framework/core/subsystems-1/image/default_preview_denied.gif rename to framework/core/assets/images/default_preview_denied.gif diff --git a/framework/core/subsystems-1/image/default_preview_notfound.gif b/framework/core/assets/images/default_preview_notfound.gif similarity index 100% rename from framework/core/subsystems-1/image/default_preview_notfound.gif rename to framework/core/assets/images/default_preview_notfound.gif diff --git a/framework/core/subsystems-1/image/default_preview_unknown.gif b/framework/core/assets/images/default_preview_unknown.gif similarity index 100% rename from framework/core/subsystems-1/image/default_preview_unknown.gif rename to framework/core/assets/images/default_preview_unknown.gif diff --git a/framework/core/definitions/modstate.php b/framework/core/definitions/modstate.php index 2823bde3e4..f60863b9cb 100644 --- a/framework/core/definitions/modstate.php +++ b/framework/core/definitions/modstate.php @@ -24,7 +24,10 @@ DB_FIELD_TYPE=>DB_DEF_STRING, DB_FIELD_LEN=>100), 'active'=>array( - DB_FIELD_TYPE=>DB_DEF_BOOLEAN) + DB_FIELD_TYPE=>DB_DEF_BOOLEAN), + 'path'=>array( + DB_FIELD_TYPE=>DB_DEF_STRING, + DB_FIELD_LEN=>250), ); ?> \ No newline at end of file diff --git a/framework/core/expFramework.php b/framework/core/expFramework.php index c0c08e3420..da91dae6e4 100755 --- a/framework/core/expFramework.php +++ b/framework/core/expFramework.php @@ -423,7 +423,7 @@ function get_filedisplay_views() { return $views; } -function intializeControllers() { +function initializeControllers() { $controllers = array(); loadModulesDir(BASE.'themes/'.DISPLAY_THEME_REAL.'/modules', $controllers); loadModulesDir(BASE.'framework/modules', $controllers); @@ -432,6 +432,7 @@ function intializeControllers() { // recursive function used for (auto?)loading 2.0 modules controllers & models function loadModulesDir($dir, &$controllers) { + global $db; if (is_readable($dir)) { $dh = opendir($dir); while (($file = readdir($dh)) !== false) { @@ -444,6 +445,10 @@ function loadModulesDir($dir, &$controllers) { if (empty($controllers[substr($ctl_file,0,-4)]) && substr($ctl_file,-4,4) == ".php") { include_once($dirpath.'/'.$ctl_file); $controllers[substr($ctl_file,0,-4)] = $dirpath.'/'.$ctl_file; +// $module->module = substr($ctl_file,0,-4); +// $module->active = 1; +// $module->path = $dirpath.'/'.$ctl_file; +// $db->insertObject($module,'modstate'); } } } @@ -455,6 +460,10 @@ function loadModulesDir($dir, &$controllers) { if (empty($controllers[substr($ctl_file,0,-4)]) && substr($ctl_file,-4,4) == ".php") { include_once($dirpath.'/'.$ctl_file); $controllers[substr($ctl_file,0,-4)] = $dirpath.'/'.$ctl_file; +// $module->module = substr($ctl_file,0,-4); +// $module->active = 1; +// $module->path = $dirpath.'/'.$ctl_file; +// $db->insertObject($module,'modstate'); } } } diff --git a/framework/core/subsystems-1/files/mimetypes.php b/framework/core/lang/English - US.info.php similarity index 70% rename from framework/core/subsystems-1/files/mimetypes.php rename to framework/core/lang/English - US.info.php index e2585a4a28..0e47ab397c 100644 --- a/framework/core/subsystems-1/files/mimetypes.php +++ b/framework/core/lang/English - US.info.php @@ -18,10 +18,11 @@ ################################################## return array( - 'text/plain'=>'Plain Text', - 'image/jpeg'=>'JPEG Image', - 'image/gif'=>'GIF Image', - 'image/png'=>'PNG (Portable Network Graphics) Image' + 'name'=>'English - US', + 'charset'=>'UTF-8', // Used in the META. Very important. + 'author'=>'OIC Group, Inc.', + 'locale'=>'en-us', // See RFC 1766 and ISO 639-2 + 'default_view'=>'Default' // For recursion in view resolution ); -?> \ No newline at end of file +?> diff --git a/framework/core/models-1/calendar.php b/framework/core/models-1/calendar.php index d280bc3174..b7262f489a 100644 --- a/framework/core/models-1/calendar.php +++ b/framework/core/models-1/calendar.php @@ -22,12 +22,7 @@ class calendar { static function form($object) { global $user; - $i18n = exponent_lang_loadFile('datatypes/calendar.php'); - -// if (!defined('SYS_FORMS')) require_once(BASE.'framework/core/subsystems-1/forms.php'); require_once(BASE.'framework/core/subsystems-1/forms.php'); -// exponent_forms_initialize(); - $form = new form(); if (!isset($object->id)) { $object->title = ''; @@ -44,36 +39,34 @@ static function form($object) { $form->meta('id',$object->id); } - $form->register('title',$i18n['title'],new textcontrol($object->title)); - $form->register('body',$i18n['body'],new htmleditorcontrol($object->body)); + $form->register('title',gt('Title'),new textcontrol($object->title)); + $form->register('body',gt('Body'),new htmleditorcontrol($object->body)); $form->register(null,'', new htmlcontrol('
')); if ($object->is_recurring == 1) { - $form->register(null,'',new htmlcontrol($i18n['remove_warning'],false)); + $form->register(null,'',new htmlcontrol(gt('Warning: If you change the date below, it will only affect this specific events. All other changes can be applied to this and other events.'),false)); } - //$form->register('eventdate',$i18n['eventdate'],new popupdatetimecontrol($object->eventdate->date,'',false)); - $form->register('eventdate',$i18n['eventdate'],new yuicalendarcontrol($object->eventdate->date,'',false)); + //$form->register('eventdate',gt('Event Date'),new popupdatetimecontrol($object->eventdate->date,'',false)); + $form->register('eventdate',gt('Event Date'),new yuicalendarcontrol($object->eventdate->date,'',false)); $cb = new checkboxcontrol($object->is_allday,false); $cb->jsHooks = array('onclick'=>'exponent_forms_disable_datetime(\'eventstart\',this.form,this.checked); exponent_forms_disable_datetime(\'eventend\',this.form,this.checked);'); - $form->register('is_allday',$i18n['is_allday'],$cb); - $form->register('eventstart',$i18n['eventstart'],new datetimecontrol($object->eventstart,false)); - $form->register('eventend',$i18n['eventend'],new datetimecontrol($object->eventend,false)); + $form->register('is_allday',gt('All Day Event'),$cb); + $form->register('eventstart',gt('Start Time'),new datetimecontrol($object->eventstart,false)); + $form->register('eventend',gt('End Time'),new datetimecontrol($object->eventend,false)); if (!isset($object->id)) { $customctl = file_get_contents(BASE.'framework/modules-1/calendarmodule/form.part'); //$datectl = new popupdatetimecontrol($object->eventstart+365*86400,'',false); $datectl = new yuicalendarcontrol($object->eventdate->date+365*86400,'',false); $customctl = str_replace('%%UNTILDATEPICKER%%',$datectl->controlToHTML('untildate'),$customctl); - $form->register('recur',$i18n['recurrence'],new customcontrol($customctl)); + $form->register('recur',gt('Recurrence'),new customcontrol($customctl)); } else if ($object->is_recurring == 1) { // Edit applies to one or more... $template = new template('calendarmodule','_recur_dates'); global $db; $eventdates = $db->selectObjects('eventdate','event_id='.$object->id); -// if (!defined('SYS_SORTING')) require_once(BASE.'framework/core/subsystems-1/sorting.php'); -// require_once(BASE.'framework/core/subsystems-1/sorting.php'); // if (!function_exists('exponent_sorting_byDateAscending')) { // function exponent_sorting_byDateAscending($a,$b) { // return ($a->date > $b->date ? 1 : -1); @@ -83,29 +76,26 @@ static function form($object) { $eventdates = expSorter::sort(array('array'=>$eventdates,'sortby'=>'date', 'order'=>'ASC')); if (isset($object->eventdate)) $template->assign('checked_date',$object->eventdate); $template->assign('dates',$eventdates); - $form->register(null,'',new htmlcontrol('
'.$i18n['recurrence_warning'])); + $form->register(null,'',new htmlcontrol('
'.gt('This event is a recurring event, and occurs on the dates below. Select which dates you wish to apply these edits to.'))); $form->register(null,'',new htmlcontrol(''.$template->render().'
')); $form->meta('date_id',$object->eventdate->id); // Will be 0 if we are creating. } - $form->register('featured_header','',new htmlcontrol('

'.$i18n['featured_event_info'].'


')); - $form->register('is_featured',$i18n['feature_this_event'],new checkboxcontrol($object->is_featured,false)); + $form->register('featured_header','',new htmlcontrol('

'.gt('Featured Event Info').'


')); + $form->register('is_featured',gt('Feature this event'),new checkboxcontrol($object->is_featured,false)); /* Why was this even here? No views have it. 6/23/09 Time to implement it - Maia*/ - // $form->register('image_header','',new htmlcontrol('

'.$i18n['upload_file'].'


')); - // $form->register('file',$i18n['upload_image'],new uploadcontrol()); + // $form->register('image_header','',new htmlcontrol('

'.gt('Upload Image File').'


')); + // $form->register('file',gt('Upload Image'),new uploadcontrol()); - // $form->register('tag_header','',new htmlcontrol('

'.$i18n['tags'].'


')); - $form->register('submit','',new buttongroupcontrol($i18n['save'],'',$i18n['cancel'])); + // $form->register('tag_header','',new htmlcontrol('

'.gt('Tags').'


')); + $form->register('submit','',new buttongroupcontrol(gt('Save'),'',gt('Cancel'))); return $form; } static function update($values,$object) { -// if (!defined('SYS_FORMS')) require_once(BASE.'framework/core/subsystems-1/forms.php'); require_once(BASE.'framework/core/subsystems-1/forms.php'); -// exponent_forms_initialize(); - $object->title = $values['title']; $object->body = preg_replace('/
$/','',trim($values['body'])); diff --git a/framework/core/models-1/calendarmodule_config.php b/framework/core/models-1/calendarmodule_config.php index d6d375c21e..c35f58a4df 100644 --- a/framework/core/models-1/calendarmodule_config.php +++ b/framework/core/models-1/calendarmodule_config.php @@ -20,12 +20,7 @@ class calendarmodule_config { function form($object) { - $i18n = exponent_lang_loadFile('datatypes/calendarmodule_config.php'); - -// if (!defined('SYS_FORMS')) require_once(BASE.'framework/core/subsystems-1/forms.php'); require_once(BASE.'framework/core/subsystems-1/forms.php'); -// exponent_forms_initialize(); - global $db; $tag_collections = $db->selectObjects("tag_collections"); foreach ($tag_collections as $tag_collections => $collection) { @@ -105,11 +100,11 @@ function form($object) { } // setup the config form - $form->register(null,'',new htmlcontrol('

'.$i18n['general_conf'].'


')); - // $form->register('enable_categories',$i18n['enable_categories'],new checkboxcontrol($object->enable_categories,true)); - $form->register('enable_feedback',$i18n['enable_feedback'],new checkboxcontrol($object->enable_feedback,true)); + $form->register(null,'',new htmlcontrol('

'.gt('General Configuration').'


')); + // $form->register('enable_categories',gt('Enable Categories'),new checkboxcontrol($object->enable_categories,true)); + $form->register('enable_feedback',gt('Enable Feedback'),new checkboxcontrol($object->enable_feedback,true)); - $form->register(null,'',new htmlcontrol('

'.$i18n['events_reminder'].'


')); + $form->register(null,'',new htmlcontrol('

'.gt('Events Reminder Email').'


')); // Get original style user lists // $selected_users = array(); @@ -117,18 +112,18 @@ function form($object) { // $selected_users[$i] = $db->selectValue('user', 'firstname', 'id='.$i) . ' ' . $db->selectValue('user', 'lastname', 'id='.$i) . ' (' . $db->selectValue('user', 'username', 'id='.$i) . ')'; // } // $userlist = array(); - // $list = exponent_users_getAllUsers(); + // $list = user::getAllUsers(); // foreach ($list as $i) { // if(!array_key_exists($i->id, $selected_users)) { // $userlist[$i->id] = $i->firstname . ' ' . $i->lastname . ' (' . $i->username . ')'; // } // } - // $form->register('reminder_notify',$i18n['reminder_notify'],new listbuildercontrol($selected_users, $userlist)); + // $form->register('reminder_notify',gt('Who should be reminded of events?'),new listbuildercontrol($selected_users, $userlist)); // Get User list $defaults = array(); $userlist = array(); - $users = exponent_users_getAllUsers(); + $users = user::getAllUsers(); foreach ($db->selectObjects('calendar_reminder_address','calendar_id='.$object->id.' and user_id != 0') as $address) { $locuser = exponent_users_getUserById($address->user_id); $defaults[$locuser->id] = $locuser->firstname . ' ' . $locuser->lastname . ' (' . $locuser->username . ')'; @@ -138,12 +133,12 @@ function form($object) { $userlist[$locuser->id] = $locuser->firstname . ' ' . $locuser->lastname . ' (' . $locuser->username . ')'; } } - $form->register('users',$i18n['users'],new listbuildercontrol($defaults,$userlist)); + $form->register('users',gt('Users'),new listbuildercontrol($defaults,$userlist)); // Get Group list $defaults = array(); $grouplist = array(); - $groups = exponent_users_getAllGroups(); + $groups = user::getAllGroups(); if ($groups != null) { foreach ($db->selectObjects('calendar_reminder_address','calendar_id='.$object->id.' and group_id != 0') as $address) { $group = exponent_users_getGroupById($address->group_id); @@ -154,7 +149,7 @@ function form($object) { $grouplist[$group->id] = $group->name; } } - $form->register('groups',$i18n['groups'],new listbuildercontrol($defaults,$grouplist)); + $form->register('groups',gt('Groups'),new listbuildercontrol($defaults,$grouplist)); } // Get Freeform list @@ -162,34 +157,34 @@ function form($object) { foreach ($db->selectObjects('calendar_reminder_address','calendar_id='.$object->id." and email != ''") as $address) { $defaults[$address->email] = $address->email; } - $form->register('addresses',$i18n['addresses'],new listbuildercontrol($defaults,null)); + $form->register('addresses',gt('Other Addresses'),new listbuildercontrol($defaults,null)); - $form->register('email_title_reminder',$i18n['message_subject_prefix'],new textcontrol($object->email_title_reminder,45)); - $form->register('email_from_reminder',$i18n['from_display'],new textcontrol($object->email_from_reminder,45)); - $form->register('email_address_reminder',$i18n['from_email'],new textcontrol($object->email_address_reminder,45)); - $form->register('email_reply_reminder',$i18n['reply_to'],new textcontrol($object->email_reply_reminder,45)); - $form->register('email_showdetail',$i18n['show_detail_in_message'],new checkboxcontrol($object->email_showdetail)); - $form->register('email_signature',$i18n['email_signature'],new texteditorcontrol($object->email_signature,5,30)); - - $form->register(null,'',new htmlcontrol('

'.$i18n['merge_calendars'].'


')); - $form->register('aggregate',$i18n['pull_events'],new listbuildercontrol($selected_calendars,$all_calendars)); - - $form->register(null,'',new htmlcontrol('

'.$i18n['rss_configuration'].'


')); - $form->register('enable_rss',$i18n['enable_rss'], new checkboxcontrol($object->enable_rss)); - $form->register('enable_ical',$i18n['enable_ical'], new checkboxcontrol($object->enable_ical)); - $form->register('feed_title',$i18n['feed_title'],new textcontrol($object->feed_title,35,false,75)); - $form->register('feed_desc',$i18n['feed_desc'],new texteditorcontrol($object->feed_desc)); - $form->register('rss_cachetime', $i18n['rss_cachetime'], new textcontrol($object->rss_cachetime)); - $form->register('rss_limit', $i18n['rss_limit'], new textcontrol($object->rss_limit)); - - // $form->register(null,'',new htmlcontrol('

'.$i18n['tagging'].'


')); - // $form->register('enable_tags',$i18n['enable_tags'], new checkboxcontrol($object->enable_tags)); - // $form->register('collections',$i18n['tag_collections'],new listbuildercontrol($object->collections,$tc_list)); - // $form->register('group_by_tags',$i18n['group_by_tags'], new checkboxcontrol($object->group_by_tags)); - // $form->register(null,'',new htmlcontrol($i18n['show_tags_desc'])); + $form->register('email_title_reminder',gt('Message Subject Prefix'),new textcontrol($object->email_title_reminder,45)); + $form->register('email_from_reminder',gt('From (Display)'),new textcontrol($object->email_from_reminder,45)); + $form->register('email_address_reminder',gt('From (Email)'),new textcontrol($object->email_address_reminder,45)); + $form->register('email_reply_reminder',gt('Reply-to'),new textcontrol($object->email_reply_reminder,45)); + $form->register('email_showdetail',gt('Show detail in message?'),new checkboxcontrol($object->email_showdetail)); + $form->register('email_signature',gt('Email Signature'),new texteditorcontrol($object->email_signature,5,30)); + + $form->register(null,'',new htmlcontrol('

'.gt('Merge Calendars').'


')); + $form->register('aggregate',gt('Pull Events from These Other Calendars'),new listbuildercontrol($selected_calendars,$all_calendars)); + + $form->register(null,'',new htmlcontrol('

'.gt('RSS/iCalendar Configuration').'


')); + $form->register('enable_rss',gt('Enable RSS'), new checkboxcontrol($object->enable_rss)); + $form->register('enable_ical',gt('Enable iCalendar'), new checkboxcontrol($object->enable_ical)); + $form->register('feed_title',gt('Title for this RSS feed'),new textcontrol($object->feed_title,35,false,75)); + $form->register('feed_desc',gt('Description for this RSS feed'),new texteditorcontrol($object->feed_desc)); + $form->register('rss_cachetime', gt('Recommended RSS/iCal feed update interval in minutes (1440 = 1 day)'), new textcontrol($object->rss_cachetime)); + $form->register('rss_limit', gt('Maximum days of RSS/iCal items to publish (0 = all)'), new textcontrol($object->rss_limit)); + + // $form->register(null,'',new htmlcontrol('

'.gt('Tagging').'


')); + // $form->register('enable_tags',gt('Enable Tags'), new checkboxcontrol($object->enable_tags)); + // $form->register('collections',gt('Tag Collections'),new listbuildercontrol($object->collections,$tc_list)); + // $form->register('group_by_tags',gt('Filter events by tags'), new checkboxcontrol($object->group_by_tags)); + // $form->register(null,'',new htmlcontrol(gt('Tags to show'))); // $form->register('show_tags','',new listbuildercontrol($object->show_tags,$available_tags)); - $form->register('submit','',new buttongroupcontrol($i18n['save'],'',$i18n['cancel'])); + $form->register('submit','',new buttongroupcontrol(gt('Save'),'',gt('Cancel'))); return $form; } diff --git a/framework/core/models-1/database_importer.php b/framework/core/models-1/database_importer.php index de06ebb79e..40496254f0 100644 --- a/framework/core/models-1/database_importer.php +++ b/framework/core/models-1/database_importer.php @@ -23,10 +23,7 @@ function form() { exponent_lang_loadDictionary('modules','database'); -// if (!defined('SYS_FORMS')) require_once(BASE.'framework/core/subsystems-1/forms.php'); require_once(BASE.'framework/core/subsystems-1/forms.php'); -// exponent_forms_initialize(); - $form = new form(); //Form is created to collect information from the user //Values set previously (defaults or user-entered) are displayed diff --git a/framework/core/models-1/file.php b/framework/core/models-1/file.php index b91ec9fb67..b3eebef662 100644 --- a/framework/core/models-1/file.php +++ b/framework/core/models-1/file.php @@ -20,11 +20,6 @@ class file { static function update($name,$dest,$object,$destname = null,$force=false) { - $i18n = exponent_lang_loadFile('datatypes/file.php'); - -// if (!defined('SYS_FILES')) include_once(BASE.'framework/core/subsystems-1/files.php'); -// include_once(BASE.'framework/core/subsystems-1/files.php'); - // Get the filename, if it was passed in the update() call. Otherwise, fallback if ($destname == null) { $object->filename = $_FILES[$name]['name']; @@ -32,7 +27,7 @@ static function update($name,$dest,$object,$destname = null,$force=false) { $object->filename = $destname; } // General error message. This will be made more explicit later on. - $err = sprintf($i18n['cant_upload'],$object->filename) .'
'; + $err = sprintf(gt('Unable to upload "%s" to the server'),$object->filename) .'
'; switch($_FILES[$name]['error']) { case UPLOAD_ERR_OK: @@ -42,13 +37,13 @@ static function update($name,$dest,$object,$destname = null,$force=false) { case UPLOAD_ERR_FORM_SIZE: // This is a tricky one to catch. If the file is too large for POST, then the script won't even run. // But if its between post_max_size and upload_file_max_size, we will get here. - return $err.$i18n['file_too_large']; + return $err.gt('The file you uploaded exceeded the size limits for the server.'); case UPLOAD_ERR_PARTIAL: - return $err.$i18n['partial_file']; + return $err.gt('The file you uploaded was only partially uploaded.'); case UPLOAD_ERR_NO_FILE: - return $err.$i18n['no_file_uploaded']; + return $err.gt('No file was uploaded.'); default: - return $err.$i18n['unknown']; + return $err.gt('An unknown error has occurred.'); break; } @@ -57,7 +52,7 @@ static function update($name,$dest,$object,$destname = null,$force=false) { if (file_exists(BASE.$dest.'/'.$object->filename) && $force == false) { - return $err.$i18n['file_exists']; + return $err.gt('The file already exists on the server'); } //Check to see if the directory exists. If not, create the directory structure. @@ -69,7 +64,7 @@ static function update($name,$dest,$object,$destname = null,$force=false) { expFile::moveUploadedFile($_FILES[$name]['tmp_name'],BASE.$dest.'/'.$object->filename); if (!file_exists(BASE.$dest.'/'.$object->filename)) { - return $err.$i18n['cant_move']; + return $err.gt('The destination file could not be created.'); } // At this point, we are good to go. diff --git a/framework/core/models-1/file_collection.php b/framework/core/models-1/file_collection.php index f23709b077..9bfac01e3a 100644 --- a/framework/core/models-1/file_collection.php +++ b/framework/core/models-1/file_collection.php @@ -20,12 +20,7 @@ class file_collection { function form($object) { - $i18n = exponent_lang_loadFile('datatypes/file_collection.php'); - -// if (!defined('SYS_FORMS')) require_once(BASE.'framework/core/subsystems-1/forms.php'); require_once(BASE.'framework/core/subsystems-1/forms.php'); -// exponent_forms_initialize(); - $form = new form(); if (!isset($object->id)) { $object->name = ''; @@ -34,9 +29,9 @@ function form($object) { $form->meta('id',$object->id); } - $form->register('name',$i18n['name'],new textcontrol($object->name)); - $form->register('description',$i18n['description'],new htmleditorcontrol($object->description)); - $form->register('submit','',new buttongroupcontrol($i18n['save'],'',$i18n['cancel'])); + $form->register('name',gt('Name'),new textcontrol($object->name)); + $form->register('description',gt('Description'),new htmleditorcontrol($object->description)); + $form->register('submit','',new buttongroupcontrol(gt('Save'),'',gt('Cancel'))); return $form; } diff --git a/framework/core/models-1/formbuilder_form.php b/framework/core/models-1/formbuilder_form.php index bf1eede43c..ee0f59a82d 100644 --- a/framework/core/models-1/formbuilder_form.php +++ b/framework/core/models-1/formbuilder_form.php @@ -20,44 +20,39 @@ class formbuilder_form { static function form($object) { - $i18n = exponent_lang_loadFile('datatypes/formbuilder_form.php'); - global $db; -// if (!defined('SYS_FORMS')) require_once(BASE.'framework/core/subsystems-1/forms.php'); -// if (!defined('SYS_USERS')) require_once(BASE.'framework/core/subsystems-1/users.php'); + //global $user; require_once(BASE.'framework/core/subsystems-1/forms.php'); require_once(BASE.'framework/core/subsystems-1/users.php'); - //global $user; -// exponent_forms_initialize(); - + $form = new form(); if (!isset($object->id)) { $object->name = ''; $object->description = ''; $object->is_email = 0; $object->is_saved = 1; - $object->response = $i18n['default_response']; - $object->resetbtn = $i18n['default_resetbtn']; - $object->submitbtn = $i18n['default_submitbtn']; - $object->subject = $i18n['default_subject']; + $object->response = gt('Your form has been submitted'); + $object->resetbtn = gt('Reset'); + $object->submitbtn = gt('Submit'); + $object->subject = gt('Submitted form from site'); } else { $form->meta('id',$object->id); } - $form->register('name',$i18n['name'],new textcontrol($object->name)); - $form->register('description',$i18n['description'],new texteditorcontrol($object->description)); - $form->register('response',$i18n['response'],new htmleditorcontrol($object->response)); + $form->register('name',gt('Name'),new textcontrol($object->name)); + $form->register('description',gt('Description'),new texteditorcontrol($object->description)); + $form->register('response',gt('Response'),new htmleditorcontrol($object->response)); - $form->register(null,'', new htmlcontrol('

'.$i18n['button_header'].'


')); - $form->register('submitbtn',$i18n['submitbtn'], new textcontrol($object->submitbtn)); - $form->register('resetbtn',$i18n['resetbtn'], new textcontrol($object->resetbtn)); - $form->register(null,'', new htmlcontrol('

'.$i18n['email_header'].'


')); - $form->register('is_email',$i18n['is_email'],new checkboxcontrol($object->is_email,false)); + $form->register(null,'', new htmlcontrol('

'.gt('Button Settings').'


')); + $form->register('submitbtn',gt('Submit Button Text'), new textcontrol($object->submitbtn)); + $form->register('resetbtn',gt('Reset Button Text'), new textcontrol($object->resetbtn)); + $form->register(null,'', new htmlcontrol('

'.gt('Email Settings').'


')); + $form->register('is_email',gt('Email Form'),new checkboxcontrol($object->is_email,false)); // Get User list $userlist = array(); $defaults = array(); - $users = exponent_users_getAllUsers(); + $users = user::getAllUsers(); foreach ($db->selectObjects('formbuilder_address','form_id='.$object->id.' and user_id != 0') as $address) { $locuser = exponent_users_getUserById($address->user_id); $defaults[$locuser->id] = $locuser->firstname . ' ' . $locuser->lastname . ' (' . $locuser->username . ')'; @@ -67,12 +62,12 @@ static function form($object) { $userlist[$locuser->id] = $locuser->firstname . ' ' . $locuser->lastname . ' (' . $locuser->username . ')'; } } - $form->register('users',$i18n['users'],new listbuildercontrol($defaults,$userlist)); + $form->register('users',gt('Users'),new listbuildercontrol($defaults,$userlist)); // Get Group list $grouplist = array(); $defaults = array(); - $groups = exponent_users_getAllGroups(); + $groups = user::getAllGroups(); if ($groups != null) { foreach ($db->selectObjects('formbuilder_address','form_id='.$object->id.' and group_id != 0') as $address) { $group = exponent_users_getGroupById($address->group_id); @@ -83,7 +78,7 @@ static function form($object) { $grouplist[$group->id] = $group->name; } } - $form->register('groups',$i18n['groups'],new listbuildercontrol($defaults,$grouplist)); + $form->register('groups',gt('Groups'),new listbuildercontrol($defaults,$grouplist)); } // Get free-form address list @@ -91,18 +86,18 @@ static function form($object) { foreach ($db->selectObjects('formbuilder_address','form_id='.$object->id." and email != ''") as $address) { $defaults[$address->email] = $address->email; } - $form->register('addresses',$i18n['addresses'],new listbuildercontrol($defaults,null)); + $form->register('addresses',gt('Other Addresses'),new listbuildercontrol($defaults,null)); - $form->register('subject',$i18n['subject'],new textcontrol($object->subject)); - $form->register(null,'', new htmlcontrol('

'.$i18n['database_header'].'



')); - $form->register('is_saved',$i18n['is_saved'],new checkboxcontrol($object->is_saved,false)); - $form->register(null,'', new htmlcontrol('     '.$i18n['warning_data_loss'].'
')); + $form->register('subject',gt('Email Subject'),new textcontrol($object->subject)); + $form->register(null,'', new htmlcontrol('

'.gt('Database Settings').'



')); + $form->register('is_saved',gt('Save Submissions to the Database'),new checkboxcontrol($object->is_saved,false)); + $form->register(null,'', new htmlcontrol('     '.gt('To help prevent data loss, you cannot remove a form\'s database table once it has been added.').'
')); if ($object->is_saved == 1) { $form->controls['is_saved']->disabled = true; $form->meta('is_saved','1'); } // $form->register(null,'', new htmlcontrol('


')); - $form->register('submit','',new buttongroupcontrol($i18n['save'],'',$i18n['cancel'])); + $form->register('submit','',new buttongroupcontrol(gt('Save'),'',gt('Cancel'))); return $form; } @@ -122,9 +117,7 @@ static function update($values,$object) { static function updateTable($object) { global $db; -// if (!defined('SYS_FORMS')) require_once(BASE.'framework/core/subsystems-1/forms.php'); require_once(BASE.'framework/core/subsystems-1/forms.php'); -// exponent_forms_initialize(); if ($object->is_saved == 1) { $datadef = array( 'id'=>array( diff --git a/framework/core/models-1/formbuilder_report.php b/framework/core/models-1/formbuilder_report.php index d77d202c85..271e3590db 100644 --- a/framework/core/models-1/formbuilder_report.php +++ b/framework/core/models-1/formbuilder_report.php @@ -20,13 +20,8 @@ class formbuilder_report { static function form($object) { - $i18n = exponent_lang_loadFile('datatypes/formbuilder_report.php'); - global $db; -// if (!defined('SYS_FORMS')) require_once(BASE.'framework/core/subsystems-1/forms.php'); require_once(BASE.'framework/core/subsystems-1/forms.php'); -// exponent_forms_initialize(); - $form = new form(); if (!isset($object->id)) { $object->name = ''; @@ -36,10 +31,10 @@ static function form($object) { } - $form->register('name',$i18n['name'],new textcontrol($object->name)); - $form->register('description',$i18n['description'],new texteditorcontrol($object->description)); - $form->register(null,'', new htmlcontrol($i18n['blank_report_message'])); - $form->register('text',$i18n['text'],new htmleditorcontrol($object->text)); + $form->register('name',gt('Name'),new textcontrol($object->name)); + $form->register('description',gt('Description'),new texteditorcontrol($object->description)); + $form->register(null,'', new htmlcontrol(gt('Leave the below custom definition blank to use the default "all fields" e-mail report and record view.'))); + $form->register('text',gt('Custom E-Mail Report and View Record Definition'),new htmleditorcontrol($object->text)); $fields = array(); $column_names = array(); @@ -59,28 +54,26 @@ static function form($object) { } } } - $fields['ip'] = $i18n['field_ip']; - if (in_array('ip',$cols)) $column_names['ip'] = $i18n['field_id']; + $fields['ip'] = gt('IP Address'); + if (in_array('ip',$cols)) $column_names['ip'] = gt('IP Address'); if (isset($field['field_user_id'])) $fields['user_id'] = $field['field_user_id']; - if (in_array('user_id',$cols)) $column_names['user_id'] = $i18n['field_user_id']; - $fields['timestamp'] = $i18n['field_timestamp']; - if (in_array('timestamp',$cols)) $column_names['timestamp'] = $i18n['field_timestamp']; + if (in_array('user_id',$cols)) $column_names['user_id'] = gt('Username'); + $fields['timestamp'] = gt('Timestamp'); + if (in_array('timestamp',$cols)) $column_names['timestamp'] = gt('Timestamp'); } - $form->register('column_names',$i18n['column_names'], new listbuildercontrol($column_names,$fields)); - $form->register(null,'', new htmlcontrol($i18n['note'])); + $form->register('column_names',gt('Columns shown in View Data/Export CSV'), new listbuildercontrol($column_names,$fields)); + $form->register(null,'', new htmlcontrol(gt('Selecting NO columns is equal to selecting all columns'))); // $form->register(null,'', new htmlcontrol('


')); - $form->register('submit','',new buttongroupcontrol($i18n['save'],'',$i18n['cancel'])); + $form->register('submit','',new buttongroupcontrol(gt('Save'),'',gt('Cancel'))); return $form; } static function update($values, $object) { -// if (!defined('SYS_FORMS')) require_once(BASE.'framework/core/subsystems-1/forms.php'); require_once(BASE.'framework/core/subsystems-1/forms.php'); -// exponent_forms_initialize(); $object->name = $values['name']; $object->description = $values['description']; $object->text = htmleditorcontrol::parseData('text',$values); diff --git a/framework/core/models-1/mimetype.php b/framework/core/models-1/mimetype.php index fd6df3155f..8ce90a1c24 100644 --- a/framework/core/models-1/mimetype.php +++ b/framework/core/models-1/mimetype.php @@ -20,8 +20,6 @@ //TODO: bring back icon selector, this time based on the filebrowser engine class mimetype { function form($object) { - $i18n = exponent_lang_loadFile('datatypes/mimetype.php'); - $form = new form(); if (!isset($object->mimetype)) { $object->mimetype = ''; @@ -31,14 +29,14 @@ function form($object) { $form->meta('oldmime',$object->mimetype); } - $form->register('mimetype',$i18n['mimetype'], new textcontrol($object->mimetype)); - $form->register('name',$i18n['name'],new textcontrol($object->name)); + $form->register('mimetype',gt('MIME Type'), new textcontrol($object->mimetype)); + $form->register('name',gt('Name'),new textcontrol($object->name)); $icodir = MIMEICON_RELATIVE; $htmlimg = ($object->icon == '' ? '' : ''); // Replace this with something a little better. - $form->register('submit','',new buttongroupcontrol($i18n['save'],'',$i18n['cancel'])); + $form->register('submit','',new buttongroupcontrol(gt('Save'),'',gt('Cancel'))); return $form; } diff --git a/framework/core/models-1/poll_answer.php b/framework/core/models-1/poll_answer.php index 0b4314c932..1840436ae3 100644 --- a/framework/core/models-1/poll_answer.php +++ b/framework/core/models-1/poll_answer.php @@ -34,10 +34,7 @@ class poll_answer { static function form($object) { -// if (!defined('SYS_FORMS')) require_once(BASE.'framework/core/subsystems-1/forms.php'); require_once(BASE.'framework/core/subsystems-1/forms.php'); -// exponent_forms_initialize(); - $form = new form(); if (!isset($object->id)) { $object->answer = ''; diff --git a/framework/core/models-1/poll_question.php b/framework/core/models-1/poll_question.php index 008ac1231c..adb0c17353 100644 --- a/framework/core/models-1/poll_question.php +++ b/framework/core/models-1/poll_question.php @@ -34,10 +34,7 @@ class poll_question { static function form($object) { -// if (!defined('SYS_FORMS')) require_once(BASE.'framework/core/subsystems-1/forms.php'); require_once(BASE.'framework/core/subsystems-1/forms.php'); -// exponent_forms_initialize(); - $form = new form(); if (!isset($object->id)) { $object->question = ''; diff --git a/framework/core/models-1/section.php b/framework/core/models-1/section.php index 42e3817171..a996a4f199 100644 --- a/framework/core/models-1/section.php +++ b/framework/core/models-1/section.php @@ -27,8 +27,6 @@ class section { * meta field (hidden input) or a rank dropdown. */ function _commonForm(&$object) { - $i18n = exponent_lang_loadFile('datatypes/section.php'); - // Create a new blank form. $form = new form(); @@ -61,8 +59,8 @@ function _commonForm(&$object) { } // The name of the section, as it will be linked in the section hierarchy. - $form->register('name',$i18n['name'],new textcontrol($object->name)); - $form->register('sef_name',$i18n['sef_name'].'

If you don\'t put in an SEF Name one will be generated based on the title provided. SEF names can only contain alpha-numeric characters, hyphens and underscores.

',new textcontrol($object->sef_name)); + $form->register('name',gt('name'),new textcontrol($object->name)); + $form->register('sef_name',gt('SEF Name').'

If you don\'t put in an SEF Name one will be generated based on the title provided. SEF names can only contain alpha-numeric characters, hyphens and underscores.

',new textcontrol($object->sef_name)); if (!isset($object->id)) { // This is a new section, so we can add the positional dropdown @@ -74,18 +72,16 @@ function _commonForm(&$object) { if (count($sections) && $object->parent >= 0) { // Initialize the sorting subsystem so that we can order the sections // by rank, ascending, and get the proper ordering. -// if (!defined('SYS_SORTING')) require_once(BASE.'framework/core/subsystems-1/sorting.php'); -// require_once(BASE.'framework/core/subsystems-1/sorting.php'); // usort($sections,'exponent_sorting_byRankAscending'); $sections = expSorter::sort(array('array'=>$sections,'sortby'=>'rank', 'order'=>'ASC')); // Generate the Position dropdown array. - $positions = array($i18n['position_top']); + $positions = array(gt('At the Top')); foreach ($sections as $section) { - $positions[] = sprintf($i18n['position_after'],$section->name); + $positions[] = sprintf(gt('After "%s"'),$section->name); } $form->meta('rank',count($positions)-1); - //$form->register('rank',$i18n['rank'],new dropdowncontrol(count($positions)-1,$positions)); + //$form->register('rank',gt('Rank'),new dropdowncontrol(count($positions)-1,$positions)); } else { // If there are no siblings, the new section gets the first // slot, with a rank of 0. @@ -96,9 +92,9 @@ function _commonForm(&$object) { $form->meta('parent',$object->parent); } else if ($object->parent >= 0) { // Allow them to change parents, but not if the section is outside of the hiearchy (parent > 0) - $form->register('parent',$i18n['parent'],new dropdowncontrol($object->parent,navigationmodule::levelDropdownControlArray(0,0,array($object->id),1))); + $form->register('parent',gt('Parent Page'),new dropdowncontrol($object->parent,navigationmodule::levelDropdownControlArray(0,0,array($object->id),1))); } - $form->register('new_window',$i18n['new_window'],new checkboxcontrol($object->new_window,false)); + $form->register('new_window',gt('Open in New Window'),new checkboxcontrol($object->new_window,false)); // Return the form to the calling scope, which should always be a // member method of this class. @@ -106,13 +102,8 @@ function _commonForm(&$object) { } static function moveStandaloneForm($object = null) { - $i18n = exponent_lang_loadFile('datatypes/section.php'); - // Initialize the forms subsystem for use. -// if (!defined('SYS_FORMS')) require_once(BASE.'framework/core/subsystems-1/forms.php'); require_once(BASE.'framework/core/subsystems-1/forms.php'); -// exponent_forms_initialize(); - $form = section::_commonForm($object); // the name and sef_name are already set in the stand-alone page $form->unregister('name'); @@ -124,10 +115,8 @@ static function moveStandaloneForm($object = null) { $standalones[$s->id] = $s->name; } -// if (!defined('SYS_SORTING')) include_once(BASE.'framework/core/subsystems-1/sorting.php'); -// include_once(BASE.'framework/core/subsystems-1/sorting.php'); - $form->register('page',$i18n['standalone_page'],new dropdowncontrol(0,$standalones)); - $form->register('submit','',new buttongroupcontrol($i18n['save'],'',$i18n['cancel'])); + $form->register('page',gt('Standalone Page'),new dropdowncontrol(0,$standalones)); + $form->register('submit','',new buttongroupcontrol(gt('Save'),'',gt('Cancel'))); return $form; } @@ -143,24 +132,20 @@ static function moveStandaloneForm($object = null) { * edit an existing one. */ static function form($object = null) { - $i18n = exponent_lang_loadFile('datatypes/section.php'); - // Initialize the forms subsystem for use. -// if (!defined('SYS_FORMS')) require_once(BASE.'framework/core/subsystems-1/forms.php'); require_once(BASE.'framework/core/subsystems-1/forms.php'); -// exponent_forms_initialize(); - + // Grab the basic form that all page types share // This has the name and positional dropdowns registered. // This call also initializes the section object, if it is not an existing section. $form = section::_commonForm($object); // Register the 'Active?' and 'Public?' checkboxes. - $form->register('active',$i18n['active'],new checkboxcontrol($object->active)); - $form->register('public',$i18n['public'],new checkboxcontrol($object->public)); + $form->register('active',gt('Active'),new checkboxcontrol($object->active)); + $form->register('public',gt('Public'),new checkboxcontrol($object->public)); // Register the sub themes dropdown. - $form->register('subtheme',$i18n['subtheme'],new dropdowncontrol($object->subtheme,expTheme::getSubThemes())); + $form->register('subtheme',gt('Theme Variation'),new dropdowncontrol($object->subtheme,expTheme::getSubThemes())); // Register the 'Secured?' checkboxes for SSL pages if(ENABLE_SSL) { @@ -170,12 +155,12 @@ static function form($object = null) { $form->register(null,'',new htmlcontrol('

SEO Information

')); // Register the Page Meta Data controls. - $form->register('page_title',$i18n['page_title'],new textcontrol($object->page_title)); - $form->register('keywords',$i18n['keywords'],new texteditorcontrol($object->keywords,5)); - $form->register('description',$i18n['description'],new texteditorcontrol($object->description,5)); + $form->register('page_title',gt('Page Title'),new textcontrol($object->page_title)); + $form->register('keywords',gt('Keywords'),new texteditorcontrol($object->keywords,5)); + $form->register('description',gt('Page Description'),new texteditorcontrol($object->description,5)); // Add a Submit / Cancel button. - $form->register('submit','',new buttongroupcontrol($i18n['save'],'',$i18n['cancel'])); + $form->register('submit','',new buttongroupcontrol(gt('Save'),'',gt('Cancel'))); // Return the form to the calling scope (usually an action in the navigation module). return $form; @@ -194,13 +179,9 @@ static function form($object = null) { * edit an existing one. */ static function externalAliasForm($object = null) { - $i18n = exponent_lang_loadFile('datatypes/section.php'); - // Initialize the forms subsystem for use. -// if (!defined('SYS_FORMS')) require_once(BASE.'framework/core/subsystems-1/forms.php'); require_once(BASE.'framework/core/subsystems-1/forms.php'); -// exponent_forms_initialize(); - + // Grab the basic form that all page types share // This has the name and positional dropdowns registered. // This call also initializes the section object, if it is not an existing section. @@ -210,13 +191,13 @@ static function externalAliasForm($object = null) { if (!isset($object->external_link)) $object->external_link = ''; // Add a textbox the user can enter the external website's URL into. - $form->register('external_link',$i18n['external_link'],new textcontrol($object->external_link)); + $form->register('external_link',gt('Page'),new textcontrol($object->external_link)); // Add the'Public?' checkbox. The 'Active?' checkbox is omitted, because it makes no sense. - $form->register('public',$i18n['public'],new checkboxcontrol($object->public)); + $form->register('public',gt('Public'),new checkboxcontrol($object->public)); // Add a Submit / Cancel button. - $form->register('submit','',new buttongroupcontrol($i18n['save'],'',$i18n['cancel'])); + $form->register('submit','',new buttongroupcontrol(gt('Save'),'',gt('Cancel'))); // Return the form to the calling scope (usually an action in the navigation module). return $form; @@ -235,13 +216,9 @@ static function externalAliasForm($object = null) { * edit an existing one. */ static function internalAliasForm($object = null) { - $i18n = exponent_lang_loadFile('datatypes/section.php'); - // Initialize the forms subsystem for use. -// if (!defined('SYS_FORMS')) require_once(BASE.'framework/core/subsystems-1/forms.php'); require_once(BASE.'framework/core/subsystems-1/forms.php'); -// exponent_forms_initialize(); - + // Initialization if (!isset($object->id)) { $object->internal_id = 0; @@ -255,13 +232,13 @@ static function internalAliasForm($object = null) { $form->unregister('sef_name'); // Add a dropdown to allow the user to choose an internal page. - $form->register('internal_id',$i18n['internal_link'],new dropdowncontrol($object->internal_id,navigationmodule::levelDropDownControlArray(0,0))); + $form->register('internal_id',gt('Page'),new dropdowncontrol($object->internal_id,navigationmodule::levelDropDownControlArray(0,0))); // Add the'Public?' checkbox. The 'Active?' checkbox is omitted, because it makes no sense. - $form->register('public',$i18n['public'],new checkboxcontrol($object->public)); + $form->register('public',gt('Public'),new checkboxcontrol($object->public)); // Add a Submit / Cancel button. - $form->register('submit','',new buttongroupcontrol($i18n['save'],'',$i18n['cancel'])); + $form->register('submit','',new buttongroupcontrol(gt('Save'),'',gt('Cancel'))); // Return the form to the calling scope (usually an action in the navigation module). return $form; @@ -279,13 +256,9 @@ static function internalAliasForm($object = null) { * edit an existing one. */ static function pagesetForm($object = null) { - $i18n = exponent_lang_loadFile('datatypes/section.php'); - // Initialize the forms subsystem for use. -// if (!defined('SYS_FORMS')) require_once(BASE.'framework/core/subsystems-1/forms.php'); require_once(BASE.'framework/core/subsystems-1/forms.php'); -// exponent_forms_initialize(); - + // Grab the basic form that all page types share // This has the name and positional dropdowns registered. // This call also initializes the section object, if it is not an existing section. @@ -300,13 +273,13 @@ static function pagesetForm($object = null) { // Grab each pageset and store its name and id. The id will be used when updating. $pagesets[$pageset->id] = $pageset->name; } - $form->register('pageset',$i18n['pageset'],new dropdowncontrol(0,$pagesets)); + $form->register('pageset',gt('Pageset'),new dropdowncontrol(0,$pagesets)); // Add the'Public?' checkbox. The 'Active?' checkbox is omitted, because it makes no sense. - $form->register('public',$i18n['public'],new checkboxcontrol($object->public)); + $form->register('public',gt('Public'),new checkboxcontrol($object->public)); // Add a Submit / Cancel button. - $form->register('submit','',new buttongroupcontrol($i18n['save'],'',$i18n['cancel'])); + $form->register('submit','',new buttongroupcontrol(gt('Save'),'',gt('Cancel'))); // Return the form to the calling scope (usually an action in the navigation module). return $form; diff --git a/framework/core/models-1/section_template.php b/framework/core/models-1/section_template.php index 77cf77f2b7..1e1c95d73c 100644 --- a/framework/core/models-1/section_template.php +++ b/framework/core/models-1/section_template.php @@ -20,12 +20,7 @@ class section_template { static function form($object = null) { - $i18n = exponent_lang_loadFile('datatypes/section_template.php'); - -// if (!defined('SYS_FORMS')) require_once(BASE.'framework/core/subsystems-1/forms.php'); require_once(BASE.'framework/core/subsystems-1/forms.php'); -// exponent_forms_initialize(); - $form = new form(); if (!isset($object->id)) { $object->name = ''; @@ -43,37 +38,35 @@ static function form($object = null) { $form->meta('id',$object->id); } $form->meta('parent',$object->parent); - $form->register('name',$i18n['name'],new textcontrol($object->name)); + $form->register('name',gt('Name'),new textcontrol($object->name)); if (!isset($object->id) && $object->parent != 0) { // Add the 'Add' drop down if not a top level global $db; $sections = $db->selectObjects('section_template','parent='.$object->parent); if (count($sections)) { -// if (!defined('SYS_SORTING')) require_once(BASE.'framework/core/subsystems-1/sorting.php'); -// require_once(BASE.'framework/core/subsystems-1/sorting.php'); // usort($sections,'exponent_sorting_byRankAscending'); $sections = expSorter::sort(array('array'=>$sections,'sortby'=>'rank', 'order'=>'ASC')); - $dd = array($i18n['position_top']); - foreach ($sections as $s) $dd[] = sprintf($i18n['position_after'],$s->name); + $dd = array(gt('At the Top')); + foreach ($sections as $s) $dd[] = sprintf(gt('After "%s"'),$s->name); - $form->register('rank',$i18n['rank'],new dropdowncontrol(count($dd)-1,$dd)); + $form->register('rank',gt('Position'),new dropdowncontrol(count($dd)-1,$dd)); } else $form->meta('rank',0); } else $form->meta('rank',0); if (is_readable(THEME_ABSOLUTE.'subthemes')) { // grab sub themes - $form->register('subtheme',$i18n['subtheme'],new dropdowncontrol($object->subtheme,expTheme::getSubThemes())); + $form->register('subtheme',gt('Theme Variation'),new dropdowncontrol($object->subtheme,expTheme::getSubThemes())); } - $form->register('active',$i18n['active'],new checkboxcontrol($object->active)); - $form->register('public',$i18n['public'],new checkboxcontrol($object->public)); + $form->register('active',gt('Active'),new checkboxcontrol($object->active)); + $form->register('public',gt('Public'),new checkboxcontrol($object->public)); // Register the Page Meta Data controls. - $form->register('page_title',$i18n['page_title'],new textcontrol($object->page_title)); - $form->register('keywords',$i18n['keywords'],new texteditorcontrol($object->keywords,5,25)); - $form->register('description',$i18n['description'],new texteditorcontrol($object->keywords,5,25)); + $form->register('page_title',gt('Page Title'),new textcontrol($object->page_title)); + $form->register('keywords',gt('keywords'),new texteditorcontrol($object->keywords,5,25)); + $form->register('description',gt('Page Description'),new texteditorcontrol($object->keywords,5,25)); - $form->register('submit','',new buttongroupcontrol($i18n['save'],'',$i18n['cancel'])); + $form->register('submit','',new buttongroupcontrol(gt('Save'),'',gt('Cancel'))); return $form; } diff --git a/framework/core/models-1/simplepollmodule_config.php b/framework/core/models-1/simplepollmodule_config.php index 4cc4786167..21cc1a19b8 100644 --- a/framework/core/models-1/simplepollmodule_config.php +++ b/framework/core/models-1/simplepollmodule_config.php @@ -34,10 +34,7 @@ class simplepollmodule_config { function form($object) { -// if (!defined('SYS_FORMS')) require_once(BASE.'framework/core/subsystems-1/forms.php'); require_once(BASE.'framework/core/subsystems-1/forms.php'); -// exponent_forms_initialize(); - $form = new form(); if (!isset($object->id)) { $object->thank_you_message = 'Thank you for voting.'; diff --git a/framework/core/models/expFile.php b/framework/core/models/expFile.php index 3ec98639c4..277232fe3b 100644 --- a/framework/core/models/expFile.php +++ b/framework/core/models/expFile.php @@ -344,9 +344,6 @@ public static function fileUpload( $_postName = null, $_destDir = null ) { -// if (!defined('SYS_FILES')) include_once(BASE.'framework/core/subsystems-1/files.php'); -// include_once(BASE.'framework/core/subsystems-1/files.php'); - // Make sure something was sent first off... if ( ( !isset($_SERVER['CONTENT_TYPE'] )) || ( strpos($_SERVER['CONTENT_TYPE'], 'multipart/form-data') !== 0) ) diff --git a/framework/core/models/expRss.php b/framework/core/models/expRss.php index ab5af66172..12907948dc 100644 --- a/framework/core/models/expRss.php +++ b/framework/core/models/expRss.php @@ -62,8 +62,6 @@ public function beforeSave() { } public function getFeedItems() { -// if (!defined('SYS_RSS')) include_once('core_rss.php'); -// if (!defined('SYS_RSS')) require_once(BASE.'external/feedcreator.class.php'); require_once(BASE.'external/feedcreator.class.php'); // get all the feeds available to this expRss object diff --git a/framework/core/models/keywords.php b/framework/core/models/keywords.php index 8f2b37261a..35eb4e8075 100644 --- a/framework/core/models/keywords.php +++ b/framework/core/models/keywords.php @@ -42,8 +42,7 @@ public static function getExcludedWords() { public function getTextBySection($section) { global $db; -// if (!defined('SYS_SEARCH')) include_once(BASE.'framework/core/subsystems-1/search.php'); - + $id = is_object($section) ? $section->id : $section; $refs = $db->selectObjects('sectionref', 'section='.$id); diff --git a/framework/core/subsystems-1/autoloader.php b/framework/core/subsystems-1/autoloader.php index da83c5f7f0..69b029a5d3 100644 --- a/framework/core/subsystems-1/autoloader.php +++ b/framework/core/subsystems-1/autoloader.php @@ -42,7 +42,12 @@ BASE.'framework/modules/ecommerce/products/controllers', //FIXME does NOT exist BASE.'framework/modules/ecommerce/products/datatypes', // models ); - + + $auto_dirs2 = array( + BASE.'themes/'.DISPLAY_THEME_REAL.'/modules', + BASE.'framework/modules' + ); + /* exdoc * This function overrides the default PHP5 autoloader, * and instead looks at the $auto_dirs global to look @@ -53,9 +58,8 @@ * @node Subsystems:Autoloader */ function __autoload($class) { -// global $auto_dirs1, $auto_dirs2, $controllers; - global $auto_dirs; - + global $auto_dirs, $auto_dirs2; +// // check the directories for class files. foreach ($auto_dirs as $auto_dir) { if (is_readable($auto_dir.'/'.$class.'.php')) { @@ -63,6 +67,51 @@ function __autoload($class) { return; } } + +// // recursive function used for (auto?)loading 2.0 modules controllers & models instead of using initializeControllers() +// foreach ($auto_dirs2 as $dir) { +// if (is_readable($dir)) { +// $dh = opendir($dir); +// while (($file = readdir($dh)) !== false) { +// if (is_dir($dir.'/'.$file) && ($file != '..' && $file != '.')) { +// // load controllers +// $dirpath = $dir.'/'.$file.'/controllers'; +// if (file_exists($dirpath)) { +// $controller_dir = opendir($dirpath); +// while (($ctl_file = readdir($controller_dir)) !== false) { +// if (substr($ctl_file,0,-4) == $class && substr($ctl_file,-4,4) == ".php") { +// include_once($dirpath.'/'.$ctl_file); +// return; +// } +// } +// } +// // load models +// $dirpath = $dir.'/'.$file.'/models'; +// if (file_exists($dirpath)) { +// $controller_dir = opendir($dirpath); +// while (($ctl_file = readdir($controller_dir)) !== false) { +// if (substr($ctl_file,0,-4) == $class && substr($ctl_file,-4,4) == ".php") { +// include_once($dirpath.'/'.$ctl_file); +// return; +// } +// } +// } +// } +// } +// } +// } +// +// // autoload the old school modules instead of using exponent_modules_initialize() +// if (is_readable(BASE.'framework/modules-1')) { +// $dh = opendir(BASE.'framework/modules-1'); +// while (($file = readdir($dh)) !== false) { +// if ($file == $class && is_dir(BASE.'framework/modules-1/'.$file) && is_readable(BASE.'framework/modules-1/'.$file.'/class.php')) { +// include_once(BASE.'framework/modules-1/'.$file.'/class.php'); +// return; +// } +// } +// } + } ?> diff --git a/framework/core/subsystems-1/backup.php b/framework/core/subsystems-1/backup.php index 6417b9f642..1fc801595b 100644 --- a/framework/core/subsystems-1/backup.php +++ b/framework/core/subsystems-1/backup.php @@ -94,14 +94,12 @@ function tmp_removePrefix($tbl) { function exponent_backup_restoreDatabase($db,$file,&$errors,$force_version = null) { $errors = array(); - $i18n = exponent_lang_loadFile('subsystems/backup.php'); - if (is_readable($file)) { $lines = @file($file); // Sanity check if (count($lines) < 2 || trim($lines[0]) != EQL_HEADER) { - $errors[] = $i18n['bad_eql']; + $errors[] = gt('Not a valid EQL file'); return false; } @@ -118,7 +116,7 @@ function exponent_backup_restoreDatabase($db,$file,&$errors,$force_version = nul // Check version and include necessary converters //FIXME We reject v1.0 eql files if ($eql_version != $current_version) { - $errors[] = $i18n['wrong_ver']; + $errors[] = gt('EQL file was Not a valid EQL version'); return false; include_once(BASE.'framework/core/subsystems-1/backup/'.$eql_version.'.php'); $fprefix = 'exponent_backup_'.implode('',explode('.',$eql_version)).'_'; @@ -220,9 +218,9 @@ function exponent_backup_restoreDatabase($db,$file,&$errors,$force_version = nul } } else { // if (!file_exists(BASE.'framework/core/definitions/'.$table.'.php')) { - $errors[] = sprintf($i18n['no_definition'],$table,$line_number); + $errors[] = sprintf(gt('Table "%s" not found in the system (line %d)'),$table,$line_number); // } else if (!is_readable(BASE.'framework/core/definitions/'.$table.'.php')) { -// $errors[] = sprintf($i18n['unreadable_definition'],$table,'framework/core/definitions/'.$table.'.php',$line_number); +// $errors[] = sprintf(gt('Data definition file for %s (%s) is not readable (line %d)'),$table,'framework/core/definitions/'.$table.'.php',$line_number); // } else { // $dd = include(BASE.'framework/core/definitions/'.$table.'.php'); // $info = (is_readable(BASE.'framework/core/definitions/'.$table.'.info.php') ? include(BASE.'framework/core/definitions/'.$table.'.info.php') : array()); @@ -239,18 +237,18 @@ function exponent_backup_restoreDatabase($db,$file,&$errors,$force_version = nul $db->insertObject($object,$table); } } else { - $errors[] = sprintf($i18n['invalid_type'],$pair[0],$line_number); + $errors[] = sprintf(gt('Invalid specifier type "%s" (line %d)'),$pair[0],$line_number); } } } if ($eql_version != $current_version) { - $errors[] = $i18n['wrong_ver']; + $errors[] = gt('EQL file was Not a valid EQL version'); return false; include_once(BASE.'framework/core/subsystems-1/backup/normalize.php'); } return true; } else { - $errors[] = $i18n['eql_not_r']; + $errors[] = gt('Unable to read EQL file'); return false; } } diff --git a/framework/core/subsystems-1/backup/0.95.php b/framework/core/subsystems-1/backup/0.95.php index d4b2a7252d..f698db5120 100644 --- a/framework/core/subsystems-1/backup/0.95.php +++ b/framework/core/subsystems-1/backup/0.95.php @@ -42,7 +42,6 @@ function exponent_backup_095_addressbook_contact($db,$object) { // Field 'feedback_form' was added to 'calendar' in 0.96 // Field 'feedback_email' was added to 'calendar' in 0.96 function exponent_backup_095_calendar($db,$object) { -// if (!defined('SYS_DATETIME')) include(BASE.'framework/core/subsystems-1/datetime.php'); include(BASE.'framework/core/subsystems-1/datetime.php'); // Pull edited / editor from posted / poster diff --git a/framework/core/subsystems-1/backup/normalize.php b/framework/core/subsystems-1/backup/normalize.php index 229585d998..546cff28bf 100644 --- a/framework/core/subsystems-1/backup/normalize.php +++ b/framework/core/subsystems-1/backup/normalize.php @@ -26,8 +26,6 @@ // Normalize Section Rankings function exponent_backup_normalize_sections($db,$parent = 0) { $sections = $db->selectObjects('section','parent='.$parent); -// if (!defined('SYS_SORTING')) require_once(BASE.'framework/core/subsystems-1/sorting.php'); -// require_once(BASE.'framework/core/subsystems-1/sorting.php'); // usort($sections,'exponent_sorting_byRankAscending'); $sections = expSorter::sort(array('array'=>$sections,'sortby'=>'rank', 'order'=>'ASC')); diff --git a/framework/core/subsystems-1/config.php b/framework/core/subsystems-1/config.php index 1d8af8bec0..739f3650bf 100644 --- a/framework/core/subsystems-1/config.php +++ b/framework/core/subsystems-1/config.php @@ -40,9 +40,7 @@ function exponent_config_parse($configname,$site_root = null) { // Last argument added in 0.96, for shared core. Default it to the old hard-coded value if ($site_root == null) $site_root = BASE; -// if (!defined('SYS_FORMS')) require_once(BASE.'framework/core/subsystems-1/forms.php'); require_once(BASE.'framework/core/subsystems-1/forms.php'); -// exponent_forms_initialize(); // We don't actually use the forms subsystem, but the .structure.php files do. if ($configname == '') $file = $site_root.'conf/config.php'; @@ -119,22 +117,17 @@ function exponent_config_parseFile($file) { */ function exponent_config_configurationForm($configname,$database=false) { // $configname = "" for active config - - $this_i18n = exponent_lang_loadFile('subsystems/config.php'); - if (is_readable(BASE."conf/extensions")) { global $user; $options = exponent_config_parse($configname); -// if (!defined('SYS_FORMS')) require_once(BASE.'framework/core/subsystems-1/forms.php'); require_once(BASE.'framework/core/subsystems-1/forms.php'); -// exponent_forms_initialize(); - + $form = new form(); - $form->register(null,'',new htmlcontrol('

'.$this_i18n['form_title'].'

')); - $form->register('configname',$this_i18n['profile'],new textcontrol($configname)); - $form->register('activate',$this_i18n['activate'],new checkboxcontrol((!defined('CURRENTCONFIGNAME') || CURRENTCONFIGNAME==$configname))); + $form->register(null,'',new htmlcontrol('

'.gt('Configuration Options').'

')); + $form->register('configname',gt('Profile Name'),new textcontrol($configname)); + $form->register('activate',gt('Activate'),new checkboxcontrol((!defined('CURRENTCONFIGNAME') || CURRENTCONFIGNAME==$configname))); $sections = array(); @@ -161,14 +154,12 @@ function exponent_config_configurationForm($configname,$database=false) { $form->register("c[$directive]",''.$info['title'].'',$info['control'],$info['description']); } } - //$form->register(null,'',new buttongroupcontrol($this_i18n['save'],'',$this_i18n['cancel'])); + //$form->register(null,'',new buttongroupcontrol(gt('Save'),'',gt('Cancel'))); } } } $form->registerAfter('activate',null,'',new htmlcontrol('
'.implode('  |  ',$sections))); - $form->register('submit','',new buttongroupcontrol($this_i18n['save'],'',$this_i18n['cancel'])); - -// exponent_forms_cleanup(); + $form->register('submit','',new buttongroupcontrol(gt('Save'),'',gt('Cancel'))); return $form; } @@ -213,26 +204,26 @@ function exponent_config_change($var, $val) { function exponent_config_writeFile($str, $configname="") { // if ($configname != "") { - // // Wishing to save - // if ((file_exists(BASE."conf/profiles/$configname.php") && expUtil::isReallyWritable(BASE."conf/profiles/$configname.php")) || - // expUtil::isReallyWritable($BASE."conf/profiles")) { - // - // $fh = fopen(BASE."conf/profiles/$configname.php","w"); - // fwrite($fh,$str); - // fclose($fh); - // } else { - // echo $i18n['profile_not_writable'].'
'; - // } - // } +// // Wishing to save +// if ((file_exists(BASE."conf/profiles/$configname.php") && expUtil::isReallyWritable(BASE."conf/profiles/$configname.php")) || +// expUtil::isReallyWritable($BASE."conf/profiles")) { +// +// $fh = fopen(BASE."conf/profiles/$configname.php","w"); +// fwrite($fh,$str); +// fclose($fh); +// } else { +// echo gt('Unable to write profile configuration').'
'; +// } +// } //if (isset($values['activate']) || $configname == "") { if ((file_exists(BASE."conf/config.php") && expUtil::isReallyWritable(BASE."conf/config.php")) || expUtil::isReallyWritable(BASE."conf")) { - $fh = fopen(BASE."conf/config.php","w"); - fwrite($fh,$str); - /*fwrite($fh,"\n\n");*/ - fclose($fh); + $fh = fopen(BASE."conf/config.php","w"); + fwrite($fh,$str); + /*fwrite($fh,"\n\n");*/ + fclose($fh); } else { - echo $i18n['active_not_writable'].'
'; + echo gt('Unable to write active configuration').'
'; } //} } @@ -250,8 +241,6 @@ function exponent_config_saveConfiguration($values,$site_root=null) { $site_root = BASE; } - $i18n = exponent_lang_loadFile('subsystems/config.php'); - $configname = str_replace(" ","_",$values['configname']); $original_config = exponent_config_parse($configname,$site_root); @@ -315,7 +304,7 @@ function exponent_config_saveConfiguration($values,$site_root=null) { // fwrite($fh,$str); // fclose($fh); // } else { - // echo $i18n['profile_not_writable'].'
'; + // echo gt('Unable to write profile configuration').'
'; // } // } @@ -332,7 +321,7 @@ function exponent_config_saveConfiguration($values,$site_root=null) { /*fwrite($fh,"\n\n");*/ fclose($fh); } else { - echo $i18n['active_not_writable'].'
'; + echo gt('Unable to write profile configuration').'
'; } } } @@ -347,9 +336,6 @@ function exponent_config_saveConfiguration($values,$site_root=null) { * @node Subsystems:Config */ function exponent_config_outputConfigurationTemplate($template,$configname) { - // $i18n variable gets overwritten by included files. - $this_i18n = exponent_lang_loadFile('subsystems/config.php'); - if (is_readable(BASE."conf/extensions")) { $categorized = array(); $options = exponent_config_parse($configname); @@ -361,7 +347,7 @@ function exponent_config_outputConfigurationTemplate($template,$configname) { $categorized[$arr[0]] = array(); foreach ($arr[1] as $directive=>$info) { if (is_a($info["control"],"passwordcontrol")) { - $info["value"] = '<'.$this_i18n['hidden'].'>'; + $info["value"] = '<'.gt('hidden').'>'; } else if (is_a($info["control"],"checkboxcontrol")) { $info["value"] = (isset($options[$directive]) ? ($options[$directive]?"yes":"no") : "no"); } else if (is_a($info["control"],"dropdowncontrol") && isset($options[$directive])) { diff --git a/framework/core/subsystems-1/core.php b/framework/core/subsystems-1/core.php index cb06f0bdf4..4131831e08 100644 --- a/framework/core/subsystems-1/core.php +++ b/framework/core/subsystems-1/core.php @@ -371,8 +371,7 @@ function exponent_core_maxUploadSizeMessage() { $size_msg = $size . " bytes"; } } - $i18n = exponent_lang_loadFile('subsystems/core.php'); - return sprintf($i18n['max_upload'],$size_msg); + return sprintf(gt('The maximum size of uploaded files is %s. Uploading files larger than that may result in erratic behavior.'),$size_msg); } /* exdoc diff --git a/framework/core/subsystems-1/database/mysql.php b/framework/core/subsystems-1/database/mysql.php index a4b87d3c33..0cba7b7320 100644 --- a/framework/core/subsystems-1/database/mysql.php +++ b/framework/core/subsystems-1/database/mysql.php @@ -165,7 +165,6 @@ function createTable($tablename,$datadef,$info) { // if (isset($info[DB_TABLE_WORKFLOW]) && $info[DB_TABLE_WORKFLOW]) { // // Initialize workflow tables: -// if (!defined("SYS_WORKFLOW")) require_once(BASE."framework/core/subsystems-1/workflow.php"); // $wf = exponent_workflow_installWorkflowTables($tablename,$datadef); // foreach ($wf as $key=>$status) { // $return[$key] = $status; @@ -430,7 +429,6 @@ function alterTable($tablename,$newdatadef,$info,$aggressive = false) { // if (isset($info[DB_TABLE_WORKFLOW]) && $info[DB_TABLE_WORKFLOW]) { // // Initialize workflow tables: -// if (!defined("SYS_WORKFLOW")) require_once(BASE."framework/core/subsystems-1/workflow.php"); // $wf = exponent_workflow_alterWorkflowTables($tablename,$newdatadef,$aggressive); // foreach ($wf as $key=>$status) { // $return[$key] = $status; diff --git a/framework/core/subsystems-1/database/mysqli.php b/framework/core/subsystems-1/database/mysqli.php index 9c761527a7..3c50ca421a 100644 --- a/framework/core/subsystems-1/database/mysqli.php +++ b/framework/core/subsystems-1/database/mysqli.php @@ -154,7 +154,6 @@ function createTable($tablename,$datadef,$info) { // if (isset($info[DB_TABLE_WORKFLOW]) && $info[DB_TABLE_WORKFLOW]) { // // Initialize workflow tables: -// if (!defined("SYS_WORKFLOW")) // require_once(BASE . "framework/core/subsystems-1/workflow.php"); // $wf = exponent_workflow_installWorkflowTables($tablename, $datadef); // foreach ($wf as $key => $status) { @@ -446,7 +445,6 @@ function alterTable($tablename, $newdatadef, $info, $aggressive = false) { // if (isset($info[DB_TABLE_WORKFLOW]) && $info[DB_TABLE_WORKFLOW]) { // // Initialize workflow tables: -// if (!defined("SYS_WORKFLOW")) // require_once(BASE . "framework/core/subsystems-1/workflow.php"); // $wf = exponent_workflow_alterWorkflowTables($tablename, $newdatadef, $aggressive); // foreach ($wf as $key => $status) { diff --git a/framework/core/subsystems-1/database/mysqlid.php b/framework/core/subsystems-1/database/mysqlid.php index 76a181581b..a2da954533 100644 --- a/framework/core/subsystems-1/database/mysqlid.php +++ b/framework/core/subsystems-1/database/mysqlid.php @@ -208,7 +208,6 @@ function createTable($tablename,$datadef,$info) { // if (isset($info[DB_TABLE_WORKFLOW]) && $info[DB_TABLE_WORKFLOW]) { // // Initialize workflow tables: -// if (!defined("SYS_WORKFLOW")) require_once(BASE."framework/core/subsystems-1/workflow.php"); // $wf = exponent_workflow_installWorkflowTables($tablename,$datadef); // foreach ($wf as $key=>$status) { // $return[$key] = $status; @@ -482,7 +481,6 @@ function alterTable($tablename,$newdatadef,$info,$aggressive = false) { // if (isset($info[DB_TABLE_WORKFLOW]) && $info[DB_TABLE_WORKFLOW]) { // // Initialize workflow tables: -// if (!defined("SYS_WORKFLOW")) require_once(BASE."framework/core/subsystems-1/workflow.php"); // $wf = exponent_workflow_alterWorkflowTables($tablename,$newdatadef,$aggressive); // foreach ($wf as $key=>$status) { // $return[$key] = $status; diff --git a/framework/core/subsystems-1/database/postgres.php b/framework/core/subsystems-1/database/postgres.php index 341055d439..7db381df90 100644 --- a/framework/core/subsystems-1/database/postgres.php +++ b/framework/core/subsystems-1/database/postgres.php @@ -145,7 +145,6 @@ function createTable($tablename,$datadef,$info) { // if (isset($info[DB_TABLE_WORKFLOW]) && $info[DB_TABLE_WORKFLOW]) { // // Initialize workflow tables: -// if (!defined("SYS_WORKFLOW")) require_once(BASE."framework/core/subsystems-1/workflow.php"); // exponent_workflow_installWorkflowTables($tablename,$datadef); // } } @@ -208,7 +207,6 @@ function alterTable($tablename,$newdatadef,$info,$aggressive = false) { // if (isset($info[DB_TABLE_WORKFLOW]) && $info[DB_TABLE_WORKFLOW]) { // // Initialize workflow tables: -// if (!defined("SYS_WORKFLOW")) require_once(BASE."framework/core/subsystems-1/workflow.php"); // exponent_workflow_alterWorkflowTables($tablename,$newdatadef); // } diff --git a/framework/core/subsystems-1/files.php b/framework/core/subsystems-1/files.php deleted file mode 100644 index 1220be77b8..0000000000 --- a/framework/core/subsystems-1/files.php +++ /dev/null @@ -1,356 +0,0 @@ -"; - echo "--------Don't know what to do with $dir/$file
"; - echo ""; - print_r(stat("$dir/$file")); - echo filetype("$dir/$file"); - echo ""; - } - } - } - rmdir($dir); -} - -function exponent_files_fixName($name) { - return preg_replace('/[^A-Za-z0-9\.]/','_',$name); -} - -/* exdoc - * Checks to see if the upload destination file exists. This is to prevent - * accidentally uploading over the top of another file. - * Returns true if the file already exists, and false if it does not. - * - * @param string $dir The directory to contain the existing directory. - * @param string $name The name of the file control used to upload the - * file. The files subsystem will look to the $_FILES array - * to get the filename of the uploaded file. - * @node Subsystems:Files - */ -function exponent_files_uploadDestinationFileExists($dir,$name) { - return (file_exists(BASE.$dir."/".exponent_files_fixName($_FILES[$name]['name']))); -} - -/* exdoc -* Move an uploaded temporary file to a more permanent home inside of the Exponent files/ directory. -* This function takes into account the default file modes specified in the site configuration. - * @param string $tmp_name The temporary path of the uploaded file. - * @param string $dest The full path to the destination file (including the destination filename). - * @node Subsystems:Files - */ -function exponent_files_moveUploadedFile($tmp_name,$dest) { - move_uploaded_file($tmp_name,$dest); - if (file_exists($dest)) { - $__oldumask = umask(0); - chmod($dest,FILE_DEFAULT_MODE); - umask($__oldumask); - } -} - -/* exdoc - * Lists files and directories under a given parent directory, returning a - * revursive array. The key is the file or directory name. In the case of files, - * the value if the file name. In the case of directories, the value if an array - * of the files / directories in that directory. - * - * @param string $dir The path of the directory to look at. - * @param boolean $recurse A boolean dictating whether to descend into subdirectories - * recursviely, and list files and subdirectories. - * @param string $ext An optional file extension. If specified, only files ending with - * that file extension will show up in the list. Directories are not affected. - * @param array $exclude_dirs An array of directory names to exclude. These names are - * path-independent. Specifying "dir" will ignore all directories and - * sub-directories named "dir", regardless of their parent. - * @node Subsystems:Files - */ -function exponent_files_list($dir, $recurse = false, $ext=null, $exclude_dirs = array()) { - $files = array(); - if (is_readable($dir)) { - $dh = opendir($dir); - while (($file = readdir($dh)) !== false) { - if (is_dir("$dir/$file") && !in_array($file,$exclude_dirs) && $recurse && $file != "." && $file != ".." && $file != "CVS") { - $files[$file] = exponent_files_list("$dir/$file",$recurse,$ext,$exclude_dirs); - } - if (is_file("$dir/$file") && ($ext == null || substr($file,-1*strlen($ext),strlen($ext)) == $ext)) { - $files[$file] = $file; - } - } - } - return $files; -} - -/* exdoc - * Lists files and directories under a given parent directory. Returns an - * associative, flat array of files and directories. The key is the full file - * or directory name, and the value is the file or directory name. - * - * @param string $dir The path of the directory to look at. - * @param boolean $recurse A boolean dictating whether to descend into subdirectories - * recursviely, and list files and subdirectories. - * @param string $ext An optional file extension. If specified, only files ending with - * that file extension will show up in the list. Directories are not affected. - * @param array $exclude_dirs An array of directory names to exclude. These names are - * path-independent. Specifying "dir" will ignore all directories and - * sub-directories named "dir", regardless of their parent. - * @node Subsystems:Files - */ -function exponent_files_listFlat($dir, $recurse = false, $ext=null, $exclude_dirs = array(), $relative = "") { - $files = array(); - if (is_readable($dir)) { - $dh = opendir($dir); - while (($file = readdir($dh)) !== false) { - if (is_dir("$dir/$file") && !in_array($file,$exclude_dirs) && $recurse && $file != "." && $file != ".." && $file != "CVS") { - $files = array_merge($files,exponent_files_listFlat("$dir/$file",$recurse,$ext,$exclude_dirs,$relative)); - } - if (is_file("$dir/$file") && ($ext == null || substr($file,-1*strlen($ext),strlen($ext)) == $ext)) { - $files[str_replace($relative,"","$dir/$file")] = $file; - } - } - } - return $files; -} - -/* exdoc - * Copies just the directory structure (including subdirectories) of a given directory. - * Any files in the source directory are ignore, and duplicate copies are made (no symlinks). - * - * @param string $src The directory to copy structure from. This must be a full path. - * @param string $dest The directory to create duplicate structure in. If this directory is not empty, - * you may run into some problems, because of file/directory conflicts. - * @param $exclude_dirs An array of directory names to exclude. These names are - * path-independent. Specifying "dir" will ignore all directories and - * sub-directories named "dir", regardless of their parent. - * @node Subsystems:Files - */ -function exponent_files_copyDirectoryStructure($src,$dest,$exclude_dirs = array()) { - $__oldumask = umask(0); - if (!file_exists($dest)) mkdir($dest,fileperms($src)); - $dh = opendir($src); - while (($file = readdir($dh)) !== false) { - if (is_dir("$src/$file") && !in_array($file,$exclude_dirs) && substr($file,0,1) != "." && $file != "CVS") { - if (!file_exists("$dest/$file")) mkdir("$dest/$file",fileperms("$src/$file")); - if (is_dir("$dest/$file")) { - exponent_files_copyDirectoryStructure("$src/$file","$dest/$file"); - } - } - } - umask($__oldumask); -} - -/* exdoc - * Looks at the filesystem strucutre surrounding the destination - * and determines if the web server can create a new file there. - * Returns one of the following: - *
SYS_FILES_NOTWRITABLE - unable to create files in destination - *
SYS_FILES_SUCCESS - A file or directory can be created in destination - *
SYS_FILES_FOUNDFILE - Found destination to be a file, not a directory - * - * @param string $dest Path to the directory to check - * @node Subsystems:Files - */ -function exponent_files_canCreate($dest) { - if (substr($dest,0,1) == '/') $dest = str_replace(BASE,'',$dest); - $parts = explode('/',$dest); - $working = BASE; - for ($i = 0; $i < count($parts); $i++) { - if ($parts[$i] != '') { - if (!file_exists($working.$parts[$i])) { - return (expUtil::isReallyWritable($working) ? SYS_FILES_SUCCESS : SYS_FILES_NOTWRITABLE); - } - $working .= $parts[$i].'/'; - } - } - // If we got this far, then the file we are asking about already exists. - // Check to see if we can overrwrite this file. - // First however, we need to strip off the '/' that was added a few lines up as the last part of the for loop. - $working = substr($working,0,-1); - - if (!expUtil::isReallyWritable($working)) { - return SYS_FILES_NOTWRITABLE; - } else { - if (is_file($working)) { - return SYS_FILES_FOUNDFILE; - } else { - return SYS_FILES_FOUNDDIR; - } - } -} - -/** - * Recursively removes all files in a given directory, and all - * the files and directories underneath it. - * Optionally can skip dotfiles - * - * @param string $dir directory to work with - * @param bool $dot_files should dotfiles be removed? - * @return array - */ -function exponent_files_remove_files_in_directory($dir, $dot_files = false) { - $results['removed'] = array(); - $results['not_removed'] = array(); - - $files = scandir($dir); - array_shift($files); // remove '.' from array - array_shift($files); // remove '..' from array - foreach ($files as $file) { - if ($dot_files || substr($file, 0, 1) != '.') { // don't remove dot files - $file = $dir . '/' . $file; - if (is_dir($file)) { - exponent_files_remove_files_in_directory($file); - rmdir($file); - } else { - if (is_writeable($file) && !is_dir($file)) { - unlink($file); - $results['removed'][] = $file; - } else { - $results['not_removed'][] = $file; - } - } - } - } - -/* odl routine - if (is_readable($dir)) { - $dh = opendir($dir); - while (($file = readdir($dh)) !== false) { - $filepath = $dir.'/'.$file; - if (substr($file,0,1) != '.') { - if (is_writeable($filepath) && !is_dir($filepath)) { - unlink($filepath); - $results['removed'][] = $filepath; - } else { - $results['not_removed'][] = $filepath; - } - } - } - }*/ - - return $results; -} - -function exponent_files_bytesToHumanReadable($size) { - if ($size >= 1024*1024*1024) { // Gigs - $size_msg = round(($size / (1024*1024*1024)),2) . " GB"; - } else if ($size >= 1024*1024) { // Megs - $size_msg = round(($size / (1024*1024)),2) . " MB"; - } else if ($size >= 1024) { // Kilo - $size_msg = round(($size / 1024),2) . " kB"; - } else { - $size_msg = $size . " bytes"; - } - - return $size_msg; -} - -?> diff --git a/framework/core/subsystems-1/files/iconselector.js b/framework/core/subsystems-1/files/iconselector.js deleted file mode 100644 index b7ea2d14d9..0000000000 --- a/framework/core/subsystems-1/files/iconselector.js +++ /dev/null @@ -1,12 +0,0 @@ -var g_span = document.getElementById("iconSPAN"); -var g_hidden = document.getElementById("iconHIDDEN"); - -function setIcon(src) { - if (g_span.childNodes.length) { - g_span.removeChild(g_span.childNodes[0]) - } - var img = g_span.appendChild(document.createElement("img")); - img.setAttribute("src",src); - - g_hidden.setAttribute("value",src); -} \ No newline at end of file diff --git a/framework/core/subsystems-1/flow.php b/framework/core/subsystems-1/flow.php deleted file mode 100644 index 5116d414c8..0000000000 --- a/framework/core/subsystems-1/flow.php +++ /dev/null @@ -1,153 +0,0 @@ -setting flow'.$router->current_url; - if ($access_level == SYS_FLOW_PUBLIC) { - expSession::set($SYS_FLOW_REDIRECTIONPATH.'_flow_' . SYS_FLOW_PROTECTED . '_' . $url_type, $router->current_url); - expSession::set($SYS_FLOW_REDIRECTIONPATH.'_flow_last_' . SYS_FLOW_PROTECTED, $router->current_url); - } - expSession::set($SYS_FLOW_REDIRECTIONPATH.'_flow_' . $access_level . '_' . $url_type, $router->current_url); - expSession::set($SYS_FLOW_REDIRECTIONPATH.'_flow_last_' . $access_level, $router->current_url); - - //FIXME: Glue code to try to get new history and old flow to play nicely together. - expHistory::set('viewable', $router->params); -} - -/* exdoc - * Looks through persistent session data and returns the last URL set - * for a specific type. If the type is set to SYS_FLOW_NONE, then either - * SYS_FLOW_ACTION or SYS_FLOW_SECTIONAL will be retrieved. - * - * @param integer $url_type The type of URL to retrieve, Either - * SYS_FLOW_SECTIONAL or SYS_FLOW_ACTION - * @node Subsystems:Flow - */ -function exponent_flow_get($url_type = SYS_FLOW_NONE) { -# global $SYS_FLOW_REDIRECTIONPATH; -# $access_level = (expSession::loggedIn() ? SYS_FLOW_PROTECTED : SYS_FLOW_PUBLIC); -# if (!expSession::is_set($SYS_FLOW_REDIRECTIONPATH.'_flow_last_'.$access_level)) return URL_FULL; -# switch ($url_type) { -# case SYS_FLOW_NONE: -# return expSession::get($SYS_FLOW_REDIRECTIONPATH.'_flow_last_' . $access_level); -# case SYS_FLOW_SECTIONAL: -# case SYS_FLOW_ACTION: -# return expSession::get($SYS_FLOW_REDIRECTIONPATH.'_flow_' . $access_level . '_' . $url_type); -# } - - return expHistory::getLastNotEditable(); -} - -/* exdoc - * Looks at the persistent session data to figure out what the last 'valid' URL visited - * was, and then redirects. If the optional $url_type parameter is specified as anything - * other than SYS_FLOW_NONE, then only that type of URL will be used for the redirection. - * - * @param integer $url_type The type of URL to retrieve, Either - * SYS_FLOW_SECTIONAL or SYS_FLOW_ACTION - * @node Subsystems:Flow - */ -function exponent_flow_redirect($url_type = SYS_FLOW_NONE) { -# global $SYS_FLOW_REDIRECTIONPATH; -# $access_level = (expSession::loggedIn() ? SYS_FLOW_PROTECTED : SYS_FLOW_PUBLIC); -# // Fallback to the default redirection path in strange edge cases. -# if (!expSession::is_set($SYS_FLOW_REDIRECTIONPATH.'_flow_last_'.$access_level)) $SYS_FLOW_REDIRECTIONPATH='exponent_default'; -# $url = ''; -# //die(eDebug($_SESSION)); -# switch ($url_type) { -# case SYS_FLOW_NONE: -# $url = expSession::get($SYS_FLOW_REDIRECTIONPATH . '_flow_last_' . $access_level); -# break; -# case SYS_FLOW_SECTIONAL: -# case SYS_FLOW_ACTION: -# $url = expSession::get($SYS_FLOW_REDIRECTIONPATH . '_flow_' . $access_level . '_' . $url_type); -# break; -# } - -# if ($url == '') { -# $url = URL_FULL.'index.php?section='.SITE_DEFAULT_SECTION; -# } -# if (DEVELOPMENT >= 2) { -# echo ''.$url.''; -# } else { -# header("Location: $url"); -# } -# exit('Redirecting...'); - - expHistory::back(); -} - -function exponent_flow_redirecto_login($redirecturl) { - $redirecturl = empty($redirecturl) ? exponent_flow_get() : $redirecturl; - expSession::set('redirecturl',$redirecturl); - redirect_to(array('module'=>'loginmodule', 'action'=>'loginredirect')); -} - -?> diff --git a/framework/core/subsystems-1/forms.php b/framework/core/subsystems-1/forms.php index e7ec36815b..fc86211740 100644 --- a/framework/core/subsystems-1/forms.php +++ b/framework/core/subsystems-1/forms.php @@ -44,8 +44,6 @@ */ function exponent_forms_initialize() { } -// $i18n = exponent_lang_loadFile('subsystems/forms.php'); -// // $forms_dir = BASE."framework/core/subsystems-1/forms"; // $controls_dir = BASE."framework/core/subsystems-1/forms/controls"; // if (phpversion() < 5) { @@ -57,7 +55,7 @@ function exponent_forms_initialize() { // } // } // } else { -// echo $i18n['forms_dir_unreadable']; +// echo gt('The framework/core/subsystems-1/forms/ directory is not readable.'); // } // if (is_readable($controls_dir)) { // $dh = opendir($controls_dir); @@ -67,7 +65,7 @@ function exponent_forms_initialize() { // } // } // } else { -// echo $i18n['controls_dir_unreadable']; +// echo gt('The framework/core/subsystems-1/forms/controls directory is not readable.'); // } // } else { // if (is_readable($controls_dir)) { @@ -75,7 +73,7 @@ function exponent_forms_initialize() { // $auto_dirs["forms_forms"] = $forms_dir; // $auto_dirs["forms_controls"] = $controls_dir; // } else { -// echo $i18n['controls_dir_unreadable']; +// echo gt('The framework/core/subsystems-1/forms/controls directory is not readable.'); // } // } //} diff --git a/framework/core/subsystems-1/forms/controls/antispamcontrol.php b/framework/core/subsystems-1/forms/controls/antispamcontrol.php index 6fe3d11206..972bca12ea 100644 --- a/framework/core/subsystems-1/forms/controls/antispamcontrol.php +++ b/framework/core/subsystems-1/forms/controls/antispamcontrol.php @@ -50,10 +50,7 @@ function controlToHTML($name) { } function form($object) { -// if (!defined("SYS_FORMS")) require_once(BASE."framework/core/subsystems-1/forms.php"); require_once(BASE."framework/core/subsystems-1/forms.php"); -// exponent_forms_initialize(); - $form = new form(); if (!isset($object->identifier)) { $object->identifier = ""; @@ -63,22 +60,19 @@ function form($object) { $object->maxlength = 0; $object->required = false; } - $i18n = exponent_lang_loadFile('subsystems/forms/controls/textcontrol.php'); - - $form->register("identifier",$i18n['identifier'],new textcontrol($object->identifier)); - $form->register("caption",$i18n['caption'], new textcontrol($object->caption)); + $form->register("identifier",gt('Iidentifier'),new textcontrol($object->identifier)); + $form->register("caption",gt('Caption'), new textcontrol($object->caption)); $form->register(null, null, new htmlcontrol('
')); $form->register(null, null, new htmlcontrol('
')); - $form->register("submit","",new buttongroupcontrol($i18n['save'],'',$i18n['cancel'])); + $form->register("submit","",new buttongroupcontrol(gt('Save'),'',gt('Cancel'))); return $form; } function update($values, $object) { if ($object == null) $object = new antispamcontrol(); if ($values['identifier'] == "") { - $i18n = exponent_lang_loadFile('subsystems/forms/controls/textcontrol.php'); $post = $_POST; - $post['_formError'] = $i18n['id_req']; + $post['_formError'] = gt('Identifier is required.'); expSession::set("last_POST",$post); return null; } diff --git a/framework/core/subsystems-1/forms/controls/calendarcontrol.php b/framework/core/subsystems-1/forms/controls/calendarcontrol.php index 1088e40579..4a581fb529 100644 --- a/framework/core/subsystems-1/forms/controls/calendarcontrol.php +++ b/framework/core/subsystems-1/forms/controls/calendarcontrol.php @@ -274,9 +274,6 @@ function templateFormat($db_data, $ctl) { // function form($object) { - // if (!defined("SYS_FORMS")) require_once(BASE."framework/core/subsystems-1/forms.php"); - // exponent_forms_initialize(); - // // $form = new form(); // if (!isset($object->identifier)) { // $object->identifier = ""; @@ -284,13 +281,11 @@ function templateFormat($db_data, $ctl) { // $object->showtime = true; // } // - // $i18n = exponent_lang_loadFile('subsystems/forms/controls/popupdatetimecontrol.php'); - // - // $form->register("identifier",$i18n['identifier'],new textcontrol($object->identifier)); - // $form->register("caption",$i18n['caption'], new textcontrol($object->caption)); - // $form->register("showtime",$i18n['showtime'], new checkboxcontrol($object->showtime,false)); + // $form->register("identifier",gt('Identifier'),new textcontrol($object->identifier)); + // $form->register("caption",gt('Caption'), new textcontrol($object->caption)); + // $form->register("showtime",gt('Show Time'), new checkboxcontrol($object->showtime,false)); // - // $form->register("submit","",new buttongroupcontrol($i18n['save'],"",$i18n['cancel'])); + // $form->register("submit","",new buttongroupcontrol(gt('Save'),"",bt'Cancel'))); // return $form; // } @@ -300,9 +295,8 @@ function update($values, $object) { $object->default = 0; } if ($values['identifier'] == "") { - $i18n = exponent_lang_loadFile('subsystems/forms/controls/popupdatetimecontrol.php'); $post = $_POST; - $post['_formError'] = $i18n['id_req']; + $post['_formError'] = gt('Identifier is required.'); expSession::set("last_POST",$post); return null; } diff --git a/framework/core/subsystems-1/forms/controls/checkboxcontrol.php b/framework/core/subsystems-1/forms/controls/checkboxcontrol.php index 2597d1f497..5324514b1d 100644 --- a/framework/core/subsystems-1/forms/controls/checkboxcontrol.php +++ b/framework/core/subsystems-1/forms/controls/checkboxcontrol.php @@ -165,12 +165,7 @@ function templateFormat($db_data, $ctl) { } function form($object) { - $i18n = exponent_lang_loadFile('subsystems/forms/controls/checkboxcontrol.php'); - -// if (!defined("SYS_FORMS")) require_once(BASE."framework/core/subsystems-1/forms.php"); require_once(BASE."framework/core/subsystems-1/forms.php"); -// exponent_forms_initialize(); - $form = new form(); if (!isset($object->identifier)) { $object->identifier = ""; @@ -180,12 +175,12 @@ function form($object) { $object->required = false; } - $form->register("identifier",$i18n['identifier'],new textcontrol($object->identifier)); - $form->register("caption",$i18n['caption'], new textcontrol($object->caption)); - $form->register("default",$i18n['default'], new checkboxcontrol($object->default,false)); + $form->register("identifier",gt('Identifier'),new textcontrol($object->identifier)); + $form->register("caption",gt('Caption'), new textcontrol($object->caption)); + $form->register("default",gt('Default'), new checkboxcontrol($object->default,false)); $form->register("flip","Caption on Left", new checkboxcontrol($object->flip,false)); - $form->register("required", $i18n['required'], new checkboxcontrol($object->required,false)); - $form->register("submit","",new buttongroupcontrol($i18n['save'],'',$i18n['cancel'])); + $form->register("required", gt('Required'), new checkboxcontrol($object->required,false)); + $form->register("submit","",new buttongroupcontrol(gt('Save'),'',gt('Cancel'))); return $form; } @@ -193,10 +188,8 @@ function form($object) { function update($values, $object) { if ($object == null) $object = new checkboxcontrol(); if ($values['identifier'] == "") { - $i18n = exponent_lang_loadFile('subsystems/forms/controls/checkboxcontrol.php'); - $post = $_POST; - $post['_formError'] = $i18n['id_required']; + $post['_formError'] = gt('Identifier is required.'); expSession::set("last_POST",$post); return null; } diff --git a/framework/core/subsystems-1/forms/controls/configcontrol.php b/framework/core/subsystems-1/forms/controls/configcontrol.php index bd8d1c5ee1..0e883343c2 100644 --- a/framework/core/subsystems-1/forms/controls/configcontrol.php +++ b/framework/core/subsystems-1/forms/controls/configcontrol.php @@ -70,12 +70,8 @@ function controlToHTML($name, $label) { } function form($object) { -// if (!defined("SYS_FORMS")) require_once(BASE."framework/core/subsystems-1/forms.php"); require_once(BASE."framework/core/subsystems-1/forms.php"); -// exponent_forms_initialize(); - $form = new form(); - if (!isset($object->identifier)) { $object->identifier = ""; $object->caption = ""; @@ -84,24 +80,20 @@ function form($object) { $object->cols = 60; $object->maxchars = 0; } - - $i18n = exponent_lang_loadFile('subsystems/forms/controls/texteditorcontrol.php'); - - $form->register("identifier",$i18n['identifier'],new textcontrol($object->identifier)); - $form->register("caption",$i18n['caption'], new textcontrol($object->caption)); - $form->register("default",$i18n['default'], new texteditorcontrol($object->default)); - $form->register("rows",$i18n['rows'], new textcontrol($object->rows,4,false,3,"integer")); - $form->register("cols",$i18n['cols'], new textcontrol($object->cols,4, false,3,"integer")); - $form->register("submit","",new buttongroupcontrol($i18n['save'],'',$i18n['cancel'])); + $form->register("identifier",gt('Identifier'),new textcontrol($object->identifier)); + $form->register("caption",gt('Caption'), new textcontrol($object->caption)); + $form->register("default",gt('Default'), new texteditorcontrol($object->default)); + $form->register("rows",gt('Rows'), new textcontrol($object->rows,4,false,3,"integer")); + $form->register("cols",gt('Columns'), new textcontrol($object->cols,4, false,3,"integer")); + $form->register("submit","",new buttongroupcontrol(gt('Save'),'',gt('Cancel'))); return $form; } function update($values, $object) { if ($object == null) $object = new texteditorcontrol(); if ($values['identifier'] == "") { - $i18n = exponent_lang_loadFile('subsystems/forms/controls/texteditorcontrol.php'); $post = $_POST; - $post['_formError'] = $i18n['id_req']; + $post['_formError'] = gt('Identifier is required.'); expSession::set("last_POST",$post); return null; } diff --git a/framework/core/subsystems-1/forms/controls/contactcontrol.php b/framework/core/subsystems-1/forms/controls/contactcontrol.php index 84b3a3c7bf..43e6bb02f6 100644 --- a/framework/core/subsystems-1/forms/controls/contactcontrol.php +++ b/framework/core/subsystems-1/forms/controls/contactcontrol.php @@ -39,11 +39,10 @@ function __construct($default = "",$type = 0) { function controlToHTML($name) { // First, grab the data for the users -// if (!defined("SYS_USERS")) require_once(BASE."framework/core/subsystems-1/users.php"); require_once(BASE."framework/core/subsystems-1/users.php"); $users = array(); - foreach (exponent_users_getAllUsers() as $u) { + foreach (user::getAllUsers() as $u) { $users[$u->id] = $u->firstname." ".$u->lastname.' ('.$u->username.')'; } diff --git a/framework/core/subsystems-1/forms/controls/countryregioncontrol.php b/framework/core/subsystems-1/forms/controls/countryregioncontrol.php index d82dbe39df..4e02247cdc 100644 --- a/framework/core/subsystems-1/forms/controls/countryregioncontrol.php +++ b/framework/core/subsystems-1/forms/controls/countryregioncontrol.php @@ -43,7 +43,6 @@ function __construct($country_default = "", $region_default = "", $allow_entire_ function controlToHTML($name) { $html = ""; -// if (!defined("SYS_GEO")) require_once(BASE."framework/core/subsystems-1/geo.php"); require_once(BASE."framework/core/subsystems-1/geo.php"); $countries = exponent_geo_listCountriesOnly(); $c_dd = new dropdowncontrol($this->country_default,$countries); @@ -81,7 +80,6 @@ function controlToHTML($name) { $html .= " r_select.appendChild(o);"; $html .= " }"; $html .= "}"; -// if (!defined("SYS_JAVACSRIPT")) require_once(BASE."framework/core/subsystems-1/javascript.php"); require_once(BASE."framework/core/subsystems-1/javascript.php"); $region = null; $region->parent_id = 0; diff --git a/framework/core/subsystems-1/forms/controls/datetimecontrol.php b/framework/core/subsystems-1/forms/controls/datetimecontrol.php index 2531823d21..5c8df1c928 100644 --- a/framework/core/subsystems-1/forms/controls/datetimecontrol.php +++ b/framework/core/subsystems-1/forms/controls/datetimecontrol.php @@ -39,7 +39,6 @@ function getFieldDefinition() { } function __construct($default = 0, $showdate = true, $showtime = true) { -// if (!defined("SYS_DATETIME")) include_once(BASE."framework/core/subsystems-1/datetime.php"); include_once(BASE."framework/core/subsystems-1/datetime.php"); if ($default == 0) $default = time(); $this->default = $default; @@ -76,7 +75,6 @@ function controlToHTML($name) { if ($minute < 10) $minute = "0".$minute; $html = ""; if ($this->showdate) { -// if (!defined("SYS_DATETIME")) require_once(BASE."framework/core/subsystems-1/datetime.php"); require_once(BASE."framework/core/subsystems-1/datetime.php"); $html .= '
'; $html .= exponent_datetime_monthsDropdown($name . "_month",$default_date['mon']); @@ -134,10 +132,7 @@ function templateFormat($db_data, $ctl) { } function form($object) { -// if (!defined("SYS_FORMS")) require_once(BASE."framework/core/subsystems-1/forms.php"); require_once(BASE."framework/core/subsystems-1/forms.php"); -// exponent_forms_initialize(); - $form = new form(); if (!isset($object->identifier)) { $object->identifier = ""; @@ -145,15 +140,12 @@ function form($object) { $object->showdate = true; $object->showtime = true; } + $form->register("identifier",gt('Identifier'),new textcontrol($object->identifier)); + $form->register("caption",gt('Caption'), new textcontrol($object->caption)); + $form->register("showdate",gt('Show Date'), new checkboxcontrol($object->showdate,false)); + $form->register("showtime",gt('Show Time'), new checkboxcontrol($object->showtime,false)); - $i18n = exponent_lang_loadFile('subsystems/forms/controls/datetimecontrol.php'); - - $form->register("identifier",$i18n['identifier'],new textcontrol($object->identifier)); - $form->register("caption",$i18n['caption'], new textcontrol($object->caption)); - $form->register("showdate",$i18n['showdate'], new checkboxcontrol($object->showdate,false)); - $form->register("showtime",$i18n['showtime'], new checkboxcontrol($object->showtime,false)); - - $form->register("submit","",new buttongroupcontrol($i18n['save'],"",$i18n['cancel'])); + $form->register("submit","",new buttongroupcontrol(gt('Save'),"",gt('Cancel'))); return $form; } @@ -163,10 +155,8 @@ function update($values, $object) { $object->default = 0; //This will force the control to always show the current time as default } if ($values['identifier'] == "") { - $i18n = exponent_lang_loadFile('subsystems/forms/controls/datetimecontrol.php'); - $post = $_POST; - $post['_formError'] = $i18n['id_req']; + $post['_formError'] = gt('Identifier is required.'); expSession::set("last_POST",$post); return null; } diff --git a/framework/core/subsystems-1/forms/controls/dropdowncontrol.php b/framework/core/subsystems-1/forms/controls/dropdowncontrol.php index 05ff08045c..777358bd8d 100644 --- a/framework/core/subsystems-1/forms/controls/dropdowncontrol.php +++ b/framework/core/subsystems-1/forms/controls/dropdowncontrol.php @@ -90,10 +90,7 @@ function controlToHTML($name) { } function form($object) { -// if (!defined("SYS_FORMS")) require_once(BASE."framework/core/subsystems-1/forms.php"); require_once(BASE."framework/core/subsystems-1/forms.php"); -// exponent_forms_initialize(); - $form = new form(); if (!isset($object->identifier)) { $object->identifier = ""; @@ -103,32 +100,26 @@ function form($object) { $object->items = array(); $object->required = false; } - - $i18n = exponent_lang_loadFile('subsystems/forms/controls/dropdowncontrol.php'); - - $form->register("identifier",$i18n['identifier'],new textcontrol($object->identifier)); - $form->register("caption",$i18n['caption'], new textcontrol($object->caption)); - $form->register("items",$i18n['items'], new listbuildercontrol($object->items,null)); - $form->register("default",$i18n['default'], new textcontrol($object->default)); - $form->register("size",$i18n['size'], new textcontrol($object->size,3,false,2,"integer")); + $form->register("identifier",gt('Identifier'),new textcontrol($object->identifier)); + $form->register("caption",gt('Caption'), new textcontrol($object->caption)); + $form->register("items",gt('Items'), new listbuildercontrol($object->items,null)); + $form->register("default",gt('Default'), new textcontrol($object->default)); + $form->register("size",gt('Size'), new textcontrol($object->size,3,false,2,"integer")); $form->register(null, null, new htmlcontrol('
')); - $form->register("required", $i18n['required'], new checkboxcontrol($object->required,true)); + $form->register("required", gt('Make this a required field.'), new checkboxcontrol($object->required,true)); $form->register(null, null, new htmlcontrol('
')); - $form->register("submit","",new buttongroupcontrol($i18n['save'],'',$i18n['cancel'])); + $form->register("submit","",new buttongroupcontrol(gt('Save'),'',gt('Cancel'))); return $form; } function update($values, $object) { if ($values['identifier'] == "") { - $i18n = exponent_lang_loadFile('subsystems/forms/controls/dropdowncontrol.php'); $post = $_POST; - $post['_formError'] = $i18n['id_req']; + $post['_formError'] = gt('Identifier is required.'); expSession::set("last_POST",$post); return null; } -// if (!defined("SYS_FORMS")) require_once(BASE."framework/core/subsystems-1/forms.php"); require_once(BASE."framework/core/subsystems-1/forms.php"); -// exponent_forms_initialize(); if ($object == null) $object = new dropdowncontrol(); $object->identifier = $values['identifier']; $object->caption = $values['caption']; diff --git a/framework/core/subsystems-1/forms/controls/filemanagercontrol.php b/framework/core/subsystems-1/forms/controls/filemanagercontrol.php index f3cdfaf723..7a507edad7 100644 --- a/framework/core/subsystems-1/forms/controls/filemanagercontrol.php +++ b/framework/core/subsystems-1/forms/controls/filemanagercontrol.php @@ -342,19 +342,13 @@ function controlToHTML($name) { } function form($object) { -// if (!defined("SYS_FORMS")) require_once(BASE."framework/core/subsystems-1/forms.php"); require_once(BASE."framework/core/subsystems-1/forms.php"); -// exponent_forms_initialize(); - $form = new form(); if (!isset($object->html)) { $object->html = ""; } - - $i18n = exponent_lang_loadFile('subsystems/forms/controls/htmlcontrol.php'); - $form->register("html",'',new htmleditorcontrol($object->html)); - $form->register("submit","",new buttongroupcontrol($i18n['save'],'',$i18n['cancel'])); + $form->register("submit","",new buttongroupcontrol(gt('Save'),'',gt('Cancel'))); return $form; } diff --git a/framework/core/subsystems-1/forms/controls/genericcontrol.php b/framework/core/subsystems-1/forms/controls/genericcontrol.php index 8e54b45985..ebe2a579ac 100644 --- a/framework/core/subsystems-1/forms/controls/genericcontrol.php +++ b/framework/core/subsystems-1/forms/controls/genericcontrol.php @@ -121,12 +121,7 @@ function templateFormat($db_data, $ctl) { } function form($object) { - $i18n = exponent_lang_loadFile('subsystems/forms/controls/checkboxcontrol.php'); - -// if (!defined("SYS_FORMS")) require_once(BASE."framework/core/subsystems-1/forms.php"); require_once(BASE."framework/core/subsystems-1/forms.php"); -// exponent_forms_initialize(); - $form = new form(); if (!isset($object->identifier)) { $object->identifier = ""; @@ -136,14 +131,14 @@ function form($object) { $object->required = false; } - $form->register("identifier",$i18n['identifier'],new textcontrol($object->identifier)); - $form->register("caption",$i18n['caption'], new textcontrol($object->caption)); - $form->register("default",$i18n['default'], new checkboxcontrol($object->default,false)); - $form->register("flip",$i18n['caption_right'], new checkboxcontrol($object->flip,false)); + $form->register("identifier",gt('Identifier'),new textcontrol($object->identifier)); + $form->register("caption",gt('Caption'), new textcontrol($object->caption)); + $form->register("default",gt('Default'), new checkboxcontrol($object->default,false)); + $form->register("flip",gt('Caption on Right'), new checkboxcontrol($object->flip,false)); $form->register(null, null, new htmlcontrol('
')); - $form->register("required", $i18n['required'], new checkboxcontrol($object->required,true)); + $form->register("required", gt('Required'), new checkboxcontrol($object->required,true)); $form->register(null, null, new htmlcontrol('
')); - $form->register("submit","",new buttongroupcontrol($i18n['save'],'',$i18n['cancel'])); + $form->register("submit","",new buttongroupcontrol(gt('Save'),'',gt('Cancel'))); return $form; } @@ -151,9 +146,8 @@ function form($object) { function update($values, $object) { if ($object == null) $object = new genericcontrol();; if ($values['identifier'] == "") { - $i18n = exponent_lang_loadFile('subsystems/forms/controls/checkboxcontrol.php'); $post = $_POST; - $post['_formError'] = $i18n['id_required']; + $post['_formError'] = gt('Identifier is required.'); expSession::set("last_POST",$post); return null; } diff --git a/framework/core/subsystems-1/forms/controls/hiddenfieldcontrol.php b/framework/core/subsystems-1/forms/controls/hiddenfieldcontrol.php index 3ea166e0f6..406afe0add 100644 --- a/framework/core/subsystems-1/forms/controls/hiddenfieldcontrol.php +++ b/framework/core/subsystems-1/forms/controls/hiddenfieldcontrol.php @@ -60,12 +60,7 @@ function templateFormat($db_data, $ctl) { } function form($object) { - $i18n = exponent_lang_loadFile('subsystems/forms/controls/checkboxcontrol.php'); - -// if (!defined("SYS_FORMS")) require_once(BASE."framework/core/subsystems-1/forms.php"); require_once(BASE."framework/core/subsystems-1/forms.php"); -// exponent_forms_initialize(); - $form = new form(); if (!isset($object->identifier)) { $object->identifier = ""; @@ -75,14 +70,14 @@ function form($object) { $object->required = false; } - $form->register("identifier",$i18n['identifier'],new textcontrol($object->identifier)); - $form->register("caption",$i18n['caption'], new textcontrol($object->caption)); - $form->register("default",$i18n['default'], new checkboxcontrol($object->default,false)); - $form->register("flip",$i18n['caption_right'], new checkboxcontrol($object->flip,false)); + $form->register("identifier",gt('Identifier'),new textcontrol($object->identifier)); + $form->register("caption",gt('Caption'), new textcontrol($object->caption)); + $form->register("default",gt('Default'), new checkboxcontrol($object->default,false)); + $form->register("flip",gt('Caption on Right'), new checkboxcontrol($object->flip,false)); $form->register(null, null, new htmlcontrol('
')); - $form->register("required", $i18n['required'], new checkboxcontrol($object->required,true)); + $form->register("required", gt('Make this a required field.'), new checkboxcontrol($object->required,true)); $form->register(null, null, new htmlcontrol('
')); - $form->register("submit","",new buttongroupcontrol($i18n['save'],'',$i18n['cancel'])); + $form->register("submit","",new buttongroupcontrol(gt('Save'),'',gt('Cancel'))); return $form; } @@ -90,10 +85,8 @@ function form($object) { function update($values, $object) { if ($object == null) $object = new checkboxcontrol(); if ($values['identifier'] == "") { - $i18n = exponent_lang_loadFile('subsystems/forms/controls/checkboxcontrol.php'); - $post = $_POST; - $post['_formError'] = $i18n['id_required']; + $post['_formError'] = gt('Identifier is required.'); expSession::set("last_POST",$post); return null; } diff --git a/framework/core/subsystems-1/forms/controls/htmlcontrol.php b/framework/core/subsystems-1/forms/controls/htmlcontrol.php index 013aa08c10..e144036c68 100644 --- a/framework/core/subsystems-1/forms/controls/htmlcontrol.php +++ b/framework/core/subsystems-1/forms/controls/htmlcontrol.php @@ -51,19 +51,13 @@ function controlToHTML($name) { } function form($object) { -// if (!defined("SYS_FORMS")) require_once(BASE."framework/core/subsystems-1/forms.php"); require_once(BASE."framework/core/subsystems-1/forms.php"); -// exponent_forms_initialize(); - $form = new form(); if (!isset($object->html)) { $object->html = ""; } - - $i18n = exponent_lang_loadFile('subsystems/forms/controls/htmlcontrol.php'); - $form->register("html",'',new htmleditorcontrol($object->html)); - $form->register("submit","",new buttongroupcontrol($i18n['save'],'',$i18n['cancel'])); + $form->register("submit","",new buttongroupcontrol(gt('Save'),'',gt('Cancel'))); return $form; } diff --git a/framework/core/subsystems-1/forms/controls/listbuildercontrol.php b/framework/core/subsystems-1/forms/controls/listbuildercontrol.php index 6b51592dfa..fc6e620f65 100644 --- a/framework/core/subsystems-1/forms/controls/listbuildercontrol.php +++ b/framework/core/subsystems-1/forms/controls/listbuildercontrol.php @@ -121,30 +121,23 @@ static function parseData($formvalues, $name, $forceindex = false) { } function form($object) { -// if (!defined("SYS_FORMS")) require_once(BASE."framework/core/subsystems-1/forms.php"); require_once(BASE."framework/core/subsystems-1/forms.php"); -// exponent_forms_initialize(); - $form = new form(); if (!isset($object->identifier)) { $object->identifier = ""; $object->caption = ""; } + $form->register("identifier",gt('Identifer'),new textcontrol($object->identifier)); + $form->register("caption",gt('Caption'), new textcontrol($object->caption)); - $i18n = exponent_lang_loadFile('subsystems/forms/controls/listbuildercontrol.php'); - - $form->register("identifier",$i18n['identifer'],new textcontrol($object->identifier)); - $form->register("caption",$i18n['caption'], new textcontrol($object->caption)); - - $form->register("submit","",new buttongroupcontrol($i18n['save'],'',$i18n['cancel'])); + $form->register("submit","",new buttongroupcontrol(gt('Save'),'',gt('Cancel'))); return $form; } function update($values, $object) { if ($values['identifier'] == "") { - $i18n = exponent_lang_loadFile('subsystems/forms/controls/listbuildercontrol.php'); $post = $_POST; - $post['_formError'] = $i18n['id_req']; + $post['_formError'] = gt('Identifier is required.'); expSession::set("last_POST",$post); return null; } diff --git a/framework/core/subsystems-1/forms/controls/listcontrol.php b/framework/core/subsystems-1/forms/controls/listcontrol.php index f17baa5b38..44ef3cc244 100644 --- a/framework/core/subsystems-1/forms/controls/listcontrol.php +++ b/framework/core/subsystems-1/forms/controls/listcontrol.php @@ -135,19 +135,13 @@ function controlToHTML($name) { } function form($object) { -// if (!defined("SYS_FORMS")) require_once(BASE."framework/core/subsystems-1/forms.php"); require_once(BASE."framework/core/subsystems-1/forms.php"); -// exponent_forms_initialize(); - $form = new form(); if (!isset($object->html)) { $object->html = ""; } - - $i18n = exponent_lang_loadFile('subsystems/forms/controls/htmlcontrol.php'); - $form->register("html",'',new htmleditorcontrol($object->html)); - $form->register("submit","",new buttongroupcontrol($i18n['save'],'',$i18n['cancel'])); + $form->register("submit","",new buttongroupcontrol(gt('Save'),'',gt('Cancel'))); return $form; } diff --git a/framework/core/subsystems-1/forms/controls/popupdatetimecontrol.php b/framework/core/subsystems-1/forms/controls/popupdatetimecontrol.php index 5d8e59f3c4..1aafb6710e 100644 --- a/framework/core/subsystems-1/forms/controls/popupdatetimecontrol.php +++ b/framework/core/subsystems-1/forms/controls/popupdatetimecontrol.php @@ -173,24 +173,18 @@ function templateFormat($db_data, $ctl) { } function form($object) { -// if (!defined("SYS_FORMS")) require_once(BASE."framework/core/subsystems-1/forms.php"); require_once(BASE."framework/core/subsystems-1/forms.php"); -// exponent_forms_initialize(); - $form = new form(); if (!isset($object->identifier)) { $object->identifier = ""; $object->caption = ""; $object->showtime = true; } + $form->register("identifier",gt('Identifier'),new textcontrol($object->identifier)); + $form->register("caption",gt('Caption'), new textcontrol($object->caption)); + $form->register("showtime",gt('Show Time'), new checkboxcontrol($object->showtime,false)); - $i18n = exponent_lang_loadFile('subsystems/forms/controls/popupdatetimecontrol.php'); - - $form->register("identifier",$i18n['identifier'],new textcontrol($object->identifier)); - $form->register("caption",$i18n['caption'], new textcontrol($object->caption)); - $form->register("showtime",$i18n['showtime'], new checkboxcontrol($object->showtime,false)); - - $form->register("submit","",new buttongroupcontrol($i18n['save'],"",$i18n['cancel'])); + $form->register("submit","",new buttongroupcontrol(gt('Save'),"",gt('Cancel'))); return $form; } @@ -200,9 +194,8 @@ function update($values, $object) { $object->default = 0; } if ($values['identifier'] == "") { - $i18n = exponent_lang_loadFile('subsystems/forms/controls/popupdatetimecontrol.php'); $post = $_POST; - $post['_formError'] = $i18n['id_req']; + $post['_formError'] = gt('Identifier is required.'); expSession::set("last_POST",$post); return null; } diff --git a/framework/core/subsystems-1/forms/controls/quantitycontrol.php b/framework/core/subsystems-1/forms/controls/quantitycontrol.php index c5131a2773..5fd7722d9b 100644 --- a/framework/core/subsystems-1/forms/controls/quantitycontrol.php +++ b/framework/core/subsystems-1/forms/controls/quantitycontrol.php @@ -161,12 +161,8 @@ function callAjaxAction(id, value) { } function form($object) { -// if (!defined("SYS_FORMS")) require_once(BASE."framework/core/subsystems-1/forms.php"); require_once(BASE."framework/core/subsystems-1/forms.php"); -// exponent_forms_initialize(); - $form = new form(); - if (!isset($object->identifier)) { $object->identifier = ""; $object->caption = ""; @@ -175,24 +171,20 @@ function form($object) { $object->cols = 60; $object->maxchars = 0; } - - $i18n = exponent_lang_loadFile('subsystems/forms/controls/texteditorcontrol.php'); - - $form->register("identifier",$i18n['identifier'],new textcontrol($object->identifier)); - $form->register("caption",$i18n['caption'], new textcontrol($object->caption)); - $form->register("default",$i18n['default'], new texteditorcontrol($object->default)); - $form->register("rows",$i18n['rows'], new textcontrol($object->rows,4,false,3,"integer")); - $form->register("cols",$i18n['cols'], new textcontrol($object->cols,4, false,3,"integer")); - $form->register("submit","",new buttongroupcontrol($i18n['save'],'',$i18n['cancel'])); + $form->register("identifier",gt('Identifier'),new textcontrol($object->identifier)); + $form->register("caption",gt('Caption'), new textcontrol($object->caption)); + $form->register("default",gt('default'), new texteditorcontrol($object->default)); + $form->register("rows",gt('Rows'), new textcontrol($object->rows,4,false,3,"integer")); + $form->register("cols",gt('Columns'), new textcontrol($object->cols,4, false,3,"integer")); + $form->register("submit","",new buttongroupcontrol(gt('Save'),'',gt('Cancel'))); return $form; } function update($values, $object) { if ($object == null) $object = new texteditorcontrol(); if ($values['identifier'] == "") { - $i18n = exponent_lang_loadFile('subsystems/forms/controls/texteditorcontrol.php'); $post = $_POST; - $post['_formError'] = $i18n['id_req']; + $post['_formError'] = gt('Identifier is required.'); expSession::set("last_POST",$post); return null; } diff --git a/framework/core/subsystems-1/forms/controls/radiocontrol.php b/framework/core/subsystems-1/forms/controls/radiocontrol.php index 7be90b7bc5..104330936c 100644 --- a/framework/core/subsystems-1/forms/controls/radiocontrol.php +++ b/framework/core/subsystems-1/forms/controls/radiocontrol.php @@ -114,10 +114,7 @@ function controlToHTML_newschool($name, $label) { } function form($object) { -// if (!defined("SYS_FORMS")) require_once(BASE."framework/core/subsystems-1/forms.php"); require_once(BASE."framework/core/subsystems-1/forms.php"); -// exponent_forms_initialize(); - $form = new form(); if (!isset($object->identifier)) { $object->identifier = ""; @@ -126,14 +123,12 @@ function form($object) { $object->default = false; $object->flip = false; } - $i18n = exponent_lang_loadFile('subsystems/forms/controls/radiocontrol.php'); - - $form->register("groupname",$i18n['groupname'],new textcontrol($object->groupname)); - $form->register("caption",$i18n['caption'], new textcontrol($object->caption)); - $form->register("default",$i18n['default'], new checkboxcontrol($object->default,false)); - $form->register("flip",$i18n['flip'], new checkboxcontrol($object->flip,false)); + $form->register("groupname",gt('Group Name'),new textcontrol($object->groupname)); + $form->register("caption",gt('Caption'), new textcontrol($object->caption)); + $form->register("default",gt('Default'), new checkboxcontrol($object->default,false)); + $form->register("flip",gt('Caption on Right'), new checkboxcontrol($object->flip,false)); - $form->register("submit","",new buttongroupcontrol($i18n['save'],'',$i18n['cancel'])); + $form->register("submit","",new buttongroupcontrol(gt('Save'),'',gt('Cancel'))); return $form; } @@ -141,9 +136,8 @@ function form($object) { function update($values, $object) { if ($object == null) $object = new radiocontrol(); if ($values['groupname'] == "") { - $i18n = exponent_lang_loadFile('subsystems/forms/controls/radiocontrol.php'); $post = $_POST; - $post['_formError'] = $i18n['groupname_req']; + $post['_formError'] = gt('Group name is required.'); expSession::set("last_POST",$post); return null; } diff --git a/framework/core/subsystems-1/forms/controls/radiogroupcontrol.php b/framework/core/subsystems-1/forms/controls/radiogroupcontrol.php index 620929bb83..d168b5d614 100644 --- a/framework/core/subsystems-1/forms/controls/radiogroupcontrol.php +++ b/framework/core/subsystems-1/forms/controls/radiogroupcontrol.php @@ -97,10 +97,7 @@ function controlToHTML($name, $label) { } function form($object) { -// if (!defined("SYS_FORMS")) require_once(BASE."framework/core/subsystems-1/forms.php"); require_once(BASE."framework/core/subsystems-1/forms.php"); -// exponent_forms_initialize(); - $form = new form(); if (!isset($object->identifier)) { $object->identifier = ""; @@ -111,18 +108,15 @@ function form($object) { $object->cols = 1; $object->items = array(); } - - $i18n = exponent_lang_loadFile('subsystems/forms/controls/radiogroupcontrol.php'); - - $form->register("identifier",$i18n['identifier'],new textcontrol($object->identifier)); - $form->register("caption",$i18n['caption'], new textcontrol($object->caption)); - $form->register("items",$i18n['items'], new listbuildercontrol($object->items,null)); - $form->register("default",$i18n['default'], new textcontrol($object->default)); + $form->register("identifier",gt('Identifier'),new textcontrol($object->identifier)); + $form->register("caption",gt('Caption'), new textcontrol($object->caption)); + $form->register("items",gt('Items'), new listbuildercontrol($object->items,null)); + $form->register("default",gt('Default'), new textcontrol($object->default)); $form->register("flip","Caption on Left", new checkboxcontrol($object->flip,false)); - $form->register("cols",$i18n['cols'], new textcontrol($object->cols,4,false,2,"integer")); - $form->register(null,"", new htmlcontrol($i18n['spacing_msg'])); - $form->register("spacing",$i18n['spacing'], new textcontrol($object->spacing,5,false,4,"integer")); - $form->register("submit","",new buttongroupcontrol($i18n['save'],'',$i18n['cancel'])); + $form->register("cols",gt('Columns'), new textcontrol($object->cols,4,false,2,"integer")); + $form->register(null,"", new htmlcontrol(gt('Setting Number of Columns to zero will put all items on one row.'))); + $form->register("spacing",gt('Column Spacing'), new textcontrol($object->spacing,5,false,4,"integer")); + $form->register("submit","",new buttongroupcontrol(gt('Save'),'',gt('Cancel'))); return $form; } @@ -130,15 +124,12 @@ function form($object) { function update($values, $object) { if ($object == null) $object = new radiogroupcontrol(); if ($values['identifier'] == "") { - $i18n = exponent_lang_loadFile('subsystems/forms/controls/radiogroupcontrol.php'); $post = $_POST; - $post['_formError'] = $i18n['id_req']; + $post['_formError'] = gt('Identifier is required.'); expSession::set("last_POST",$post); return null; } -// if (!defined("SYS_FORMS")) require_once(BASE."framework/core/subsystems-1/forms.php"); require_once(BASE."framework/core/subsystems-1/forms.php"); -// exponent_forms_initialize(); $object->identifier = $values['identifier']; $object->caption = $values['caption']; $object->default = $values['default']; diff --git a/framework/core/subsystems-1/forms/controls/textcontrol.php b/framework/core/subsystems-1/forms/controls/textcontrol.php index b9dd2e32de..7041d71661 100644 --- a/framework/core/subsystems-1/forms/controls/textcontrol.php +++ b/framework/core/subsystems-1/forms/controls/textcontrol.php @@ -75,10 +75,7 @@ function controlToHTML($name, $label) { } function form($object) { -// if (!defined("SYS_FORMS")) require_once(BASE."framework/core/subsystems-1/forms.php"); require_once(BASE."framework/core/subsystems-1/forms.php"); -// exponent_forms_initialize(); - $form = new form(); if (!isset($object->identifier)) { $object->identifier = ""; @@ -88,24 +85,21 @@ function form($object) { $object->maxlength = 0; $object->required = false; } - $i18n = exponent_lang_loadFile('subsystems/forms/controls/textcontrol.php'); - - $form->register("identifier",$i18n['identifier'],new textcontrol($object->identifier)); - $form->register("caption",$i18n['caption'], new textcontrol($object->caption)); - $form->register("default",$i18n['default'], new textcontrol($object->default)); - $form->register("size",$i18n['size'], new textcontrol((($object->size==0)?"":$object->size),4,false,3,"integer")); - $form->register("maxlength",$i18n['maxlength'], new textcontrol((($object->maxlength==0)?"":$object->maxlength),4,false,3,"integer")); - $form->register("required", $i18n['required'], new checkboxcontrol($object->required,false)); - $form->register("submit","",new buttongroupcontrol($i18n['save'],'',$i18n['cancel'])); + $form->register("identifier",gt('Identifier'),new textcontrol($object->identifier)); + $form->register("caption",gt('Caption'), new textcontrol($object->caption)); + $form->register("default",gt('Default'), new textcontrol($object->default)); + $form->register("size",gt('Size'), new textcontrol((($object->size==0)?"":$object->size),4,false,3,"integer")); + $form->register("maxlength",gt('Maximum Length'), new textcontrol((($object->maxlength==0)?"":$object->maxlength),4,false,3,"integer")); + $form->register("required", gt('Make this a required field.'), new checkboxcontrol($object->required,false)); + $form->register("submit","",new buttongroupcontrol(gt('Save'),'',gt('Cancel'))); return $form; } function update($values, $object) { if ($object == null) $object = new textcontrol(); if ($values['identifier'] == "") { - $i18n = exponent_lang_loadFile('subsystems/forms/controls/textcontrol.php'); $post = $_POST; - $post['_formError'] = $i18n['id_req']; + $post['_formError'] = gt('Identifier is required.'); expSession::set("last_POST",$post); return null; } diff --git a/framework/core/subsystems-1/forms/controls/texteditorcontrol.php b/framework/core/subsystems-1/forms/controls/texteditorcontrol.php index 3e2643065b..5920929f8f 100644 --- a/framework/core/subsystems-1/forms/controls/texteditorcontrol.php +++ b/framework/core/subsystems-1/forms/controls/texteditorcontrol.php @@ -68,12 +68,8 @@ function controlToHTML($name) { } function form($object) { -// if (!defined("SYS_FORMS")) require_once(BASE."framework/core/subsystems-1/forms.php"); require_once(BASE."framework/core/subsystems-1/forms.php"); -// exponent_forms_initialize(); - $form = new form(); - if (!isset($object->identifier)) { $object->identifier = ""; $object->caption = ""; @@ -82,24 +78,20 @@ function form($object) { $object->cols = 60; $object->maxchars = 0; } - - $i18n = exponent_lang_loadFile('subsystems/forms/controls/texteditorcontrol.php'); - - $form->register("identifier",$i18n['identifier'],new textcontrol($object->identifier)); - $form->register("caption",$i18n['caption'], new textcontrol($object->caption)); - $form->register("default",$i18n['default'], new texteditorcontrol($object->default)); - $form->register("rows",$i18n['rows'], new textcontrol($object->rows,4,false,3,"integer")); - $form->register("cols",$i18n['cols'], new textcontrol($object->cols,4, false,3,"integer")); - $form->register("submit","",new buttongroupcontrol($i18n['save'],'',$i18n['cancel'])); + $form->register("identifier",gt('Identifier'),new textcontrol($object->identifier)); + $form->register("caption",gt('Caption'), new textcontrol($object->caption)); + $form->register("default",gt('Default'), new texteditorcontrol($object->default)); + $form->register("rows",gt('Rows'), new textcontrol($object->rows,4,false,3,"integer")); + $form->register("cols",gt('Columns'), new textcontrol($object->cols,4, false,3,"integer")); + $form->register("submit","",new buttongroupcontrol(gt('Save'),'',gt('Cancel'))); return $form; } function update($values, $object) { if ($object == null) $object = new texteditorcontrol(); if ($values['identifier'] == "") { - $i18n = exponent_lang_loadFile('subsystems/forms/controls/texteditorcontrol.php'); $post = $_POST; - $post['_formError'] = $i18n['id_req']; + $post['_formError'] = gt('Identifier is required.'); expSession::set("last_POST",$post); return null; } diff --git a/framework/core/subsystems-1/forms/controls/uploadcontrol.php b/framework/core/subsystems-1/forms/controls/uploadcontrol.php index a54d9c63c9..ecb96871a7 100644 --- a/framework/core/subsystems-1/forms/controls/uploadcontrol.php +++ b/framework/core/subsystems-1/forms/controls/uploadcontrol.php @@ -55,9 +55,7 @@ function controlToHTML($name) { } function form($object) { -// if (!defined("SYS_FORMS")) require_once(BASE."framework/core/subsystems-1/forms.php"); require_once(BASE."framework/core/subsystems-1/forms.php"); -// exponent_forms_initialize(); $form = new form(); if (!isset($object->identifier)) { @@ -65,21 +63,18 @@ function form($object) { $object->caption = ""; $object->default = ""; } - $i18n = exponent_lang_loadFile('subsystems/forms/controls/textcontrol.php'); - - $form->register("identifier",$i18n['identifier'],new textcontrol($object->identifier)); - $form->register("caption",$i18n['caption'], new textcontrol($object->caption)); - $form->register("default",$i18n['default'], new textcontrol($object->default)); - $form->register("submit","",new buttongroupcontrol($i18n['save'],'',$i18n['cancel'])); + $form->register("identifier",gt('Identifier'),new textcontrol($object->identifier)); + $form->register("caption",gt('Caption'), new textcontrol($object->caption)); + $form->register("default",gt('Default'), new textcontrol($object->default)); + $form->register("submit","",new buttongroupcontrol(gt('Save'),'',gt('Cancel'))); return $form; } function update($values, $object) { if ($object == null) $object = new uploadcontrol(); if ($values['identifier'] == "") { - $i18n = exponent_lang_loadFile('subsystems/forms/controls/textcontrol.php'); $post = $_POST; - $post['_formError'] = $i18n['id_req']; + $post['_formError'] = gt('Identifier is required.'); expSession::set("last_POST",$post); return null; } @@ -90,8 +85,6 @@ function update($values, $object) { } function moveFile($original_name,$formvalues) { -// if (!defined('SYS_FILES')) include_once(BASE.'framework/core/subsystems-1/files.php'); -// include_once(BASE.'framework/core/subsystems-1/files.php'); $dir = 'files/uploads'; $filename = expFile::fixName(time().'_'.$formvalues[$original_name]['name']); $dest = $dir.'/'.$filename; diff --git a/framework/core/subsystems-1/forms/controls/yuicalendarcontrol.php b/framework/core/subsystems-1/forms/controls/yuicalendarcontrol.php index 697e194082..1f6a481609 100644 --- a/framework/core/subsystems-1/forms/controls/yuicalendarcontrol.php +++ b/framework/core/subsystems-1/forms/controls/yuicalendarcontrol.php @@ -142,23 +142,17 @@ function templateFormat($db_data, $ctl) { // function form($object) { - // if (!defined("SYS_FORMS")) require_once(BASE."framework/core/subsystems-1/forms.php"); - // exponent_forms_initialize(); - // // $form = new form(); // if (!isset($object->identifier)) { // $object->identifier = ""; // $object->caption = ""; // $object->showtime = true; // } + // $form->register("identifier",gt('Identifier'),new textcontrol($object->identifier)); + // $form->register("caption",gt('Caption'), new textcontrol($object->caption)); + // $form->register("showtime",gt('Show Time'), new checkboxcontrol($object->showtime,false)); // - // $i18n = exponent_lang_loadFile('subsystems/forms/controls/popupdatetimecontrol.php'); - // - // $form->register("identifier",$i18n['identifier'],new textcontrol($object->identifier)); - // $form->register("caption",$i18n['caption'], new textcontrol($object->caption)); - // $form->register("showtime",$i18n['showtime'], new checkboxcontrol($object->showtime,false)); - // - // $form->register("submit","",new buttongroupcontrol($i18n['save'],"",$i18n['cancel'])); + // $form->register("submit","",new buttongroupcontrol(gt('Save'),"",gt('Cancel'))); // return $form; // } @@ -168,9 +162,8 @@ function update($values, $object) { $object->default = 0; } if ($values['identifier'] == "") { - $i18n = exponent_lang_loadFile('subsystems/forms/controls/popupdatetimecontrol.php'); $post = $_POST; - $post['_formError'] = $i18n['id_req']; + $post['_formError'] = gt('Identifier is required.'); expSession::set("last_POST",$post); return null; } diff --git a/framework/core/subsystems-1/forms/controls/yuidatetimecontrol.php b/framework/core/subsystems-1/forms/controls/yuidatetimecontrol.php index 7eaf3fb70b..2ca236c73c 100644 --- a/framework/core/subsystems-1/forms/controls/yuidatetimecontrol.php +++ b/framework/core/subsystems-1/forms/controls/yuidatetimecontrol.php @@ -38,7 +38,6 @@ function getFieldDefinition() { } function __construct($default = 0, $edit_text = "", $showdate = true, $showtime = true, $display_only=false, $checked=false) { -// if (!defined("SYS_DATETIME")) include_once(BASE."framework/core/subsystems-1/datetime.php"); include_once(BASE."framework/core/subsystems-1/datetime.php"); $this->default = ($default == 0) ? time() : $default; $this->edit_text = $edit_text; @@ -144,9 +143,6 @@ function templateFormat($db_data, $ctl) { function form($object) { /* - if (!defined("SYS_FORMS")) require_once(BASE."framework/core/subsystems-1/forms.php"); - exponent_forms_initialize(); - $form = new form(); if (!isset($object->identifier)) { $object->identifier = ""; @@ -154,15 +150,12 @@ function form($object) { $object->showdate = true; $object->showtime = true; } + $form->register("identifier",gt('Identifier'),new textcontrol($object->identifier)); + $form->register("caption",gt('Caption'), new textcontrol($object->caption)); + $form->register("showdate",gt('Show Date'), new checkboxcontrol($object->showdate,false)); + $form->register("showtime",gt('Show tTme'), new checkboxcontrol($object->showtime,false)); - $i18n = exponent_lang_loadFile('subsystems/forms/controls/datetimecontrol.php'); - - $form->register("identifier",$i18n['identifier'],new textcontrol($object->identifier)); - $form->register("caption",$i18n['caption'], new textcontrol($object->caption)); - $form->register("showdate",$i18n['showdate'], new checkboxcontrol($object->showdate,false)); - $form->register("showtime",$i18n['showtime'], new checkboxcontrol($object->showtime,false)); - - $form->register("submit","",new buttongroupcontrol($i18n['save'],"",$i18n['cancel'])); + $form->register("submit","",new buttongroupcontrol(gt('Save'),"",gt('Cancel'))); return $form; */ } @@ -174,10 +167,8 @@ function update($values, $object) { $object->default = 0; //This will force the control to always show the current time as default } if ($values['identifier'] == "") { - $i18n = exponent_lang_loadFile('subsystems/forms/controls/datetimecontrol.php'); - $post = $_POST; - $post['_formError'] = $i18n['id_req']; + $post['_formError'] = gt('Identifier is required.'); expSession::set("last_POST",$post); return null; } diff --git a/framework/core/subsystems-1/forms/controls/yuieditorcontrol.php b/framework/core/subsystems-1/forms/controls/yuieditorcontrol.php index 9bbc2ceff1..055e67da7f 100644 --- a/framework/core/subsystems-1/forms/controls/yuieditorcontrol.php +++ b/framework/core/subsystems-1/forms/controls/yuieditorcontrol.php @@ -92,10 +92,8 @@ function controlToHTML($name) { } function form($object) { -// if (!defined("SYS_FORMS")) require_once(BASE."framework/core/subsystems-1/forms.php"); require_once(BASE."framework/core/subsystems-1/forms.php"); -// exponent_forms_initialize(); - + $form = new form(); if (!isset($object->identifier)) { @@ -106,24 +104,20 @@ function form($object) { $object->cols = 60; $object->maxchars = 0; } - - $i18n = exponent_lang_loadFile('subsystems/forms/controls/texteditorcontrol.php'); - - $form->register("identifier",$i18n['identifier'],new textcontrol($object->identifier)); - $form->register("caption",$i18n['caption'], new textcontrol($object->caption)); - $form->register("default",$i18n['default'], new texteditorcontrol($object->default)); - $form->register("rows",$i18n['rows'], new textcontrol($object->rows,4,false,3,"integer")); - $form->register("cols",$i18n['cols'], new textcontrol($object->cols,4, false,3,"integer")); - $form->register("submit","",new buttongroupcontrol($i18n['save'],'',$i18n['cancel'])); + $form->register("identifier",gt('Identifier'),new textcontrol($object->identifier)); + $form->register("caption",gt('Caption'), new textcontrol($object->caption)); + $form->register("default",gt('Default'), new texteditorcontrol($object->default)); + $form->register("rows",gt('Rows'), new textcontrol($object->rows,4,false,3,"integer")); + $form->register("cols",gt('Columns'), new textcontrol($object->cols,4, false,3,"integer")); + $form->register("submit","",new buttongroupcontrol(gt('Save'),'',gt('Cancel'))); return $form; } function update($values, $object) { if ($object == null) $object = new texteditorcontrol(); if ($values['identifier'] == "") { - $i18n = exponent_lang_loadFile('subsystems/forms/controls/texteditorcontrol.php'); $post = $_POST; - $post['_formError'] = $i18n['id_req']; + $post['_formError'] = gt('Identifier is required.'); expSession::set("last_POST",$post); return null; } diff --git a/framework/core/subsystems-1/geo.php b/framework/core/subsystems-1/geo.php index 2f2e4818d3..9d0e3fcb4e 100644 --- a/framework/core/subsystems-1/geo.php +++ b/framework/core/subsystems-1/geo.php @@ -57,8 +57,6 @@ function exponent_geo_listCountriesAndRegions() { } uasort($countries[$c->id]->regions,"strnatcasecmp"); } -// if (!defined("SYS_SORTING")) require_once(BASE."framework/core/subsystems-1/sorting.php"); -// require_once(BASE."framework/core/subsystems-1/sorting.php"); // uasort($countries,"exponent_sorting_byNameAscending"); $countries = expSorter::sort(array('array'=>$countries,'sortby'=>'name', 'order'=>'ASC', 'ignore_case'=>true, 'type'=>'a')); return $countries; diff --git a/framework/core/subsystems-1/image.php b/framework/core/subsystems-1/image.php deleted file mode 100644 index 804995cb0f..0000000000 --- a/framework/core/subsystems-1/image.php +++ /dev/null @@ -1,504 +0,0 @@ -'image/jpeg', - 'jpeg'=>'image/jpeg', - 'gif'=>'image/gif', - 'png'=>'image/png' - ); - $lowerfile = strtolower($filename); - foreach ($types as $type=>$mime) { - if (substr($lowerfile,-1*strlen($type),strlen($type)) == $type) $sizeinfo['mime'] = $mime; - } - } - - return $sizeinfo; -} - -/* exdoc - * Create an image resource handle (from GD) for a given filename. - * This is a wrapper around various GD functions, to provide Exponent - * programmers a single point of entry. It also handles situations where - * there is no GD support compiled into the server. (In this case, null is returned). - * - * At this point, the user should have called exponent_image_sizeInfo on the filename - * and verified that the file does indeed exist, and is readable. A safeguard check - * is in place, however. - * - * @param string $filename The path/filename of the image. - * @param Array $sizeinfo Size information (as returned by exponent_image_sizeInfo - * @node Subsystems:Image - */ -function exponent_image_createFromFile($filename,$sizeinfo) { - if (!EXPONENT_HAS_GD) { - return null; - } - - $info = gd_info(); - - if ($sizeinfo['mime'] == 'image/jpeg' && $info['JPG Support'] == true) { - $img = imagecreatefromjpeg($filename); - } else if ($sizeinfo['mime'] == 'image/png' && $info['PNG Support'] == true) { - $img = imagecreatefrompng($filename); - } else if ($sizeinfo['mime'] == 'image/gif' && $info['GIF Read Support'] == true) { - $img = imagecreatefromgif($filename); - } else { - // Either we have an unknown image type, or an unsupported image type. - return IMAGE_ERR_NOTSUPPORTED; - } - - if (function_exists('imagesavealpha')) { - imagealphablending($img, false); - imagesavealpha($img, true); - } - return $img; -} - -/* exdoc - * Create a new blank image resource, with the specified width and height. - * This is a wrapper around various GD functions, to provide Exponent - * programmers a single point of entry. It also handles situations where - * there is no GD support compiled into the server. (In this case, null is returned). - * - * @param integer $w Width of the image resource to create (in pixels) - * @param integer $h Height of the image resource to create (in pixels) - * @node Subsystems:Image - */ -function exponent_image_create($w,$h) { - if (!EXPONENT_HAS_GD) { - return null; - } - $info = gd_info(); - if (strpos($info['GD Version'],'2.0') !== false) { - $img = imagecreatetruecolor($w,$h); - - if (function_exists('imagesavealpha')) { - imagealphablending($img, false); - imagesavealpha($img, true); - } - - return $img; - } else { - return imagecreate($w,$h); - } -} - -function exponent_image_copyresized($dest,$src,$dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) { - if (!EXPONENT_HAS_GD) { - return null; - } - $info = gd_info(); - if (strpos($info['GD Version'],'2.0') !== false) { - return imagecopyresampled($dest,$src,$dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); - } else { - return imagecopyresized($dest,$src,$dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); - } -} - -/* exdoc - * Proportionally scale an image by a specific percentage - * This is a wrapper around various GD functions, to provide Exponent - * programmers a single point of entry. It also handles situations where - * there is no GD support compiled into the server. (In this case, null is returned). - * - * @param string $filename The path/filename of the image to scale. - * @param decimal $scale The scaling factor, as a decimal (i.e. 0.5 for 50%) - * @node Subsystems:Image - */ -function exponent_image_scaleByPercent($filename,$scale) { - $sizeinfo = exponent_image_sizeinfo($filename); - if (!is_array($sizeinfo)) { - return $sizeinfo; - } - - $original = exponent_image_createFromFile($filename,$sizeinfo); - if (!is_resource($original)) { - return $original; - } - - if ($scale == 1) { - return $original; - } - - $w = $scale * $sizeinfo[0]; - $h = $scale * $sizeinfo[1]; - - $thumb = exponent_image_create($w,$h); - if (!$thumb) return null; - exponent_image_copyresized($thumb,$original,0,0,0,0,$w,$h,$sizeinfo[0],$sizeinfo[1]); - - return $thumb; -} - -/* exdoc - * Proportionally scale an image to a given width. Height adjusts accordingly. - * This is a wrapper around various GD functions, to provide Exponent - * programmers a single point of entry. It also handles situations where - * there is no GD support compiled into the server. (In this case, null is returned). - * - * @param string $filename The path/filename of the image to scale. - * @param integer $width The desired width of the scaled image, in pixels. - * @node Subsystems:Image - */ -function exponent_image_scaleToWidth($filename,$width) { - $sizeinfo = exponent_image_sizeinfo($filename); - if (!is_array($sizeinfo)) { - return $sizeinfo; - } - $original = exponent_image_createFromFile($filename,$sizeinfo); - if (!is_resource($original)) { - return $sizeinfo; - } - - if ($width == $sizeinfo[0]) { - return $original; - } - - $w = $width; - $h = ($width / $sizeinfo[0]) * $sizeinfo[1]; - - $thumb = exponent_image_create($w,$h); - if (!$thumb) return null; - exponent_image_copyresized($thumb,$original,0,0,0,0,$w,$h,$sizeinfo[0],$sizeinfo[1]); - - return $thumb; -} - -/* exdoc - * Proportionally scale an image to a given height. Width adjusts accordingly. - * This is a wrapper around various GD functions, to provide Exponent - * programmers a single point of entry. It also handles situations where - * there is no GD support compiled into the server. (In this case, null is returned). - * - * @param string $filename The path/filename of the image to scale. - * @param integer $height The desired height of the scaled image, in pixels. - * @node Subsystems:Image - */function exponent_image_scaleToHeight($filename,$height) { - $sizeinfo = exponent_image_sizeinfo($filename); - if (!is_array($sizeinfo)) { - return $sizeinfo; - } - - $original = exponent_image_createFromFile($filename,$sizeinfo); - if (!is_resource($original)) { - return $original; - } - - if ($height == $sizeinfo[1]) { - return $original; - } - - $w = ($height / $sizeinfo[1]) * $sizeinfo[0]; - $h = $height; - - $thumb = exponent_image_create($w,$h); - if (!$thumb) return null; - exponent_image_copyresized($thumb,$original,0,0,0,0,$w,$h,$sizeinfo[0],$sizeinfo[1]); - - return $thumb; -} - -/* exdoc - * Proportionally scale an image to fit within the given width / height. - * This is a wrapper around various GD functions, to provide Exponent - * programmers a single point of entry. It also handles situations where - * there is no GD support compiled into the server. (In this case, null is returned). - * - * @param string $filename The path/filename of the image to scale. - * @param integer $width The maximum width of the scaled image, in pixels. - * @param integer $height The maximum height of the scaled image, in pixels. - * @node Subsystems:Image - */ -function exponent_image_scaleToConstraint($filename,$width,$height) { - $sizeinfo = exponent_image_sizeinfo($filename); - if (!is_array($sizeinfo)) { - return $sizeinfo; - } - - $original = exponent_image_createFromFile($filename,$sizeinfo); - if (!is_resource($original)) { - return $original; - } - - if ($width >= $sizeinfo[0] && $height >= $sizeinfo[1]) { - return $original; - } - - $w = $width; - $h = ($width / $sizeinfo[0]) * $sizeinfo[1]; - - if ($h > $height) { // height is outside - $w = ($height / $sizeinfo[1]) * $sizeinfo[0]; - $h = $height; - } - - $thumb = exponent_image_create($w,$h); - if (!$thumb) return null; - exponent_image_copyresized($thumb,$original,0,0,0,0,$w,$h,$sizeinfo[0],$sizeinfo[1]); - - return $thumb; -} -/* exdoc - * Scale an image to a square keeping the image aspect ratio. - * If the image is smaller in either dimension than request square side original is returned. - * Image is first cropped to a square of length smaller of width or height and then resized. - * This is a wrapper around various GD functions, to provide Exponent - * programmers a single point of entry. It also handles situations where - * there is no GD support compiled into the server. (In this case, null is returned). - * - * @param string $filename The path/filename of the image to scale. - * @param integer $size The desired side length of the scaled image, in pixels. - * @node Subsystems:Image - */ -function exponent_image_scaleToSquare($filename,$side) { - $sizeinfo = exponent_image_sizeinfo($filename); - if (!is_array($sizeinfo)) { - return $sizeinfo; - } - - $original = exponent_image_createFromFile($filename,$sizeinfo); - if (!is_resource($original)) { - return $original; - } - - if ($side >= $sizeinfo[0] || $side >= $sizeinfo[1]) { - return $original; - } - - /* The defaults will serve in case the image is a square */ - $src_x = 0; - $src_y = 0; - $width = $sizeinfo[0]; - $height = $sizeinfo[1]; - - /*if width greater than height, we crop the image left and right */ - if ($sizeinfo[0] > $sizeinfo[1]) { - $width=$sizeinfo[1]; - $height=$sizeinfo[1]; - $src_x=round(($sizeinfo[0]-$width)/2,0); - } - else - { - /*if height greater than width, we crop the image top and bottom */ - $height=$sizeinfo[0]; - $width=$sizeinfo[0]; - $src_y=round(($sizeinfo[1]-$height)/2,0); - } - - $w = $side; - $h = $side; - - $thumb = exponent_image_create($w,$h); - if (!$thumb) return null; - exponent_image_copyresized($thumb,$original,0,0,$src_x,$src_y,$w,$h,$width,$height); - - return $thumb; -} - -/* exdoc - * Scale an image to a given width and height, without regard to aspect ratio. - * This is a wrapper around various GD functions, to provide Exponent - * programmers a single point of entry. It also handles situations where - * there is no GD support compiled into the server. (In this case, null is returned). - * - * @param string $filename The path/filename of the image to scale. - * @param integer $width The desired width of the scaled image, in pixels. - * @param integer $height The desired height of the scaled image, in pixels. - * @node Subsystems:Image - */ -function exponent_image_scaleManually($filename,$width,$height) { - $sizeinfo = exponent_image_sizeinfo($filename); - if (!is_array($sizeinfo)) { - return $sizeinfo; - } - - $original = exponent_image_createFromFile($filename,$sizeinfo); - if (!is_resource($original)) { - return $original; - } - - if ($width == $sizeinfo[0] && $height == $sizeinfo[1]) { - return $original; - } - - $thumb = exponent_image_create($width,$height); - if (!$thumb) return null; - exponent_image_copyresized($thumb,$original,0,0,0,0,$width,$height,$sizeinfo[0],$sizeinfo[1]); - - return $thumb; -} - -function exponent_image_rotate($filename,$degrees) { - $sizeinfo = exponent_image_sizeinfo($filename); - if (!is_array($sizeinfo)) { - return $sizeinfo; - } - - $original = exponent_image_createFromFile($filename,$sizeinfo); - if (!is_resource($original)) { - return $original; - } - - $color = imagecolorclosesthwb($original,255,255,255); - - return imagerotate($original,$degrees,$color); -} - -function exponent_image_flip($filename,$is_horizontal) { - $sizeinfo = exponent_image_sizeinfo($filename); - if (!is_array($sizeinfo)) { - return $sizeinfo; - } - - $original = exponent_image_createFromFile($filename,$sizeinfo); - if (!is_resource($original)) { - return $original; - } - - // Horizontal - invert y coords - // Vertical - invert x coords - - $w = $sizeinfo[0]; - $h = $sizeinfo[1]; - $new = exponent_image_create($w,$h); - - if ($is_horizontal) { - // Copy column by column - //$dest,$src,$dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) { - for ($i = 0; $i < $w; $i++) { - imagecopy($new,$original, // DESTINATION, SOURCE - $i,0, // dst_X, dst_Y - $w-$i-1,0, // src_X,src_Y - 1,$h); //src_W, src_H - } - } else { - // Copy row by row. - //$dest,$src,$dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) { - for ($i = 0; $i < $h; $i++) { - imagecopy($new,$original, // DESTINATION, SOURCE - 0,$i, // dst_X, dst_Y - 0,$h-$i-1, // src_X,src_Y - #$w,1, // dst_W, dst_H - $w,1); //src_W, src_H - } - } - return $new; -} - -/* exdoc - * @state UNDOCUMENTED - * @node Undocumented - */ -function exponent_image_output($img, $sizeinfo, $filename=null, $quality=75) { - header('Content-type: ' . $sizeinfo['mime']); - if ($sizeinfo['mime'] == 'image/jpeg') { - ($filename != null) ? imagejpeg($img, $filename, $quality) : imagejpeg($img, null, $quality); - } else if ($sizeinfo['mime'] == 'image/png') { - ($filename != null) ? imagepng($img,$filename) : imagepng($img); - } else if ($sizeinfo['mime'] == 'image/gif') { - ($filename != null) ? imagepng($img,$filename) : imagepng($img); - } -} - -/* exdoc - * @state UNDOCUMENTED - * @node Undocumented - */ -function exponent_image_captcha($w,$h,$string) { - $img = exponent_image_create($w,$h); - if ($img) { - // We were able to create an image. - $bg = imagecolorallocate($img,250,255,225); - imagefill($img,0,0,$bg); - #echo $bg; - $colors = array(); - for ($i = 0; $i < strlen($string) && $i < 10; $i++) { - $colors[$i] = imagecolorallocate($img,rand(50,150),rand(50,150),rand(50,150)); - } - $px_per_char = floor($w / (strlen($string)+1)); - for ($i = 0; $i < strlen($string); $i++) { - imagestring($img,rand(4,6),$px_per_char * ($i+1) + rand(-5,5),rand(0,$h / 2),$string{$i},$colors[($i % 10)]); - } - - // Need this to be 'configurable' - for ($i = 0; $i < strlen($string) / 2 && $i < 10; $i++) { - $c = imagecolorallocate($img,rand(150,250),rand(150,250),rand(150,250)); - imageline($img,rand(0,$w / 4),rand(5, $h-5),rand(3*$w / 4,$w),rand(0,$h),$c); - } - - //imagestring($img,6,0,0,$string,$color); - return $img; - } else { - return null; - } -} - -?> \ No newline at end of file diff --git a/framework/core/subsystems-1/info.php b/framework/core/subsystems-1/info.php deleted file mode 100644 index c19d63cb26..0000000000 --- a/framework/core/subsystems-1/info.php +++ /dev/null @@ -1,168 +0,0 @@ - - * @node Subsystems:Info - */ -function exponent_info_highlightPHP($data, $return = true) -{ - // Init - ob_start(); - highlight_string($data); // for better compat with PHP < 4 . 20 - $contents = ob_get_contents(); - ob_end_clean(); - - $data = explode ('
', $contents); - $start = ''; - $end = ''; - $i = 1; - $text = ''; - - // Loop - foreach ($data as $line) { - $spacer = str_replace(" "," ",str_pad("",5-strlen($i.""))); - $text .= $start . $i . $spacer . $end . str_replace("\n", '', $line) . "
\n"; - ++$i; - } - - // Return mode - if ($return === false) { - echo $text; - } else { - return $text; - } -} - -?> diff --git a/framework/core/subsystems-1/lang.php b/framework/core/subsystems-1/lang.php index 2bb14901ad..ebc5a54bcd 100644 --- a/framework/core/subsystems-1/lang.php +++ b/framework/core/subsystems-1/lang.php @@ -42,7 +42,7 @@ function exponent_lang_list() { return $langs; } -function exponent_lang_initialize() { +function exponent_lang_initialize() { //FIXME same as expLang::loadLang? if (!defined('LANG')) { if ((is_readable(BASE . 'framework/core/subsystems-1/lang/' . USE_LANG . '.php')) && (USE_LANG != 'en')) { define('LANG', USE_LANG); // Lang file exists. @@ -59,7 +59,7 @@ function exponent_lang_initialize() { define('LANG_CHARSET', $info['charset']); } -function exponent_lang_loadLangs() { +function exponent_lang_loadLangs() { //FIXME moved to expLang::loadLang $ret = array(); if (is_readable(BASE.'framework/core/subsystems-1/lang')) { while (($lang_file = readfile(BASE . 'framework/core/subsystems-1/lang/*.php')) !== false) { @@ -147,7 +147,7 @@ function loadStrings(&$tr_array, $filepath) { * * @return Array The language set found, or an empty array if no set file was found. */ -function exponent_lang_loadKey($filename, $key) { +function exponent_lang_loadKey($filename, $key) { //FIXME deprecated by using expFramework gt // First we load the full set. $keys = exponent_lang_loadFile($filename); @@ -175,7 +175,7 @@ function exponent_lang_loadKey($filename, $key) { * * @return string the short version of the lang code */ -function exponent_lang_convertLangCode($long_code, $target = "iso639-1") { +function exponent_lang_convertLangCode($long_code, $target = "iso639-1") { //FIXME deprecate? //TODO: auto-guess the incoming type of lang code from the input format //TODO: breakout the data into a xml file in subsystems/lang/ @@ -207,7 +207,7 @@ function exponent_lang_convertLangCode($long_code, $target = "iso639-1") { return $converted_code; } -function exponent_lang_getText($text) { +function exponent_lang_getText($text) { //FIXME moved to expFramework gt return $text; } ?> diff --git a/framework/core/subsystems-1/lang/eng_US/modules/calendarmodule/views/Default.php b/framework/core/subsystems-1/lang/eng_US/modules/calendarmodule/views/Default.php index 58a3ae167f..40c5f869fd 100644 --- a/framework/core/subsystems-1/lang/eng_US/modules/calendarmodule/views/Default.php +++ b/framework/core/subsystems-1/lang/eng_US/modules/calendarmodule/views/Default.php @@ -44,7 +44,7 @@ 'sunday'=>'Sunday', 'monday'=>'Monday', 'tuesday'=>'Tuesday', - 'wednesday'=>'Wednesday', + 'wednesday'=>'Tuesday', 'thursday'=>'Thursday', 'friday'=>'Friday', 'saturday'=>'Saturday', diff --git a/framework/core/subsystems-1/modules.php b/framework/core/subsystems-1/modules.php index 9684f2e770..1db9235367 100644 --- a/framework/core/subsystems-1/modules.php +++ b/framework/core/subsystems-1/modules.php @@ -47,7 +47,7 @@ function exponent_modules_initialize() { * Returns the list of module class names. * @node Subsystems:Modules */ -function exponent_modules_list() { +function exponent_modules_list() { //FIXME already in expModules $mods = array(); if (is_readable(BASE."framework/modules-1")) { $dh = opendir(BASE."framework/modules-1"); @@ -116,8 +116,6 @@ function exponent_modules_moduleManagerFormTemplate($template) { $moduleInfo[$module]->active = ($modstate != null ? $modstate->active : 0); } } -// if (!defined('SYS_SORTING')) include_once(BASE.'framework/core/subsystems-1/sorting.php'); -// include_once(BASE.'framework/core/subsystems-1/sorting.php'); // uasort($moduleInfo,"exponent_sorting_byNameAscending"); $moduleInfo = expSorter::sort(array('array'=>$moduleInfo,'sortby'=>'name', 'order'=>'ASC', 'ignore_case'=>true, 'type'=>'a')); diff --git a/framework/core/subsystems-1/permissions.php b/framework/core/subsystems-1/permissions.php index 6dc0c7e126..b33b1f0c3c 100644 --- a/framework/core/subsystems-1/permissions.php +++ b/framework/core/subsystems-1/permissions.php @@ -115,27 +115,26 @@ function exponent_permissions_load($user) { // Check perm stats for UI levels $ui_levels = array(); - $i18n = exponent_lang_loadFile('subsystems/permissions.php'); if ($user->is_acting_admin == 1) { $ui_levels = array( - $i18n['preview'], - $i18n['normal'], - $i18n['perms'], - $i18n['structure'] + gt('Preview'), + gt('Normal'), + gt('Permission Management'), + gt('Structure Management') ); } else { if (count($exponent_permissions_r)) { $ui_levels = array( - $i18n['preview'], - $i18n['normal'] + gt('Preview'), + gt('Normal') ); } if ($has_admin) { - $ui_levels[] = $i18n['perms']; + $ui_levels[] = gt('Permission Management'); } if (isset($exponent_permissions_r['containermodule']) && count($exponent_permissions_r['containermodule'])) { - $ui_levels[] = $i18n['structure']; + $ui_levels[] = gt('Structure Management'); } } expSession::set('uilevels',$ui_levels); diff --git a/framework/core/subsystems-1/search.php b/framework/core/subsystems-1/search.php deleted file mode 100644 index 83e1b75f44..0000000000 --- a/framework/core/subsystems-1/search.php +++ /dev/null @@ -1,155 +0,0 @@ -UNDOCUMENTED - * @node Undocumented - */ -//define("SYS_SEARCH",1); - -/* exdoc - * @state UNDOCUMENTED - * @node Undocumented - */ -define("SEARCH_TYPE_ANY",1); -/* exdoc - * @state UNDOCUMENTED - * @node Undocumented - */ -define("SEARCH_TYPE_ALL",2); -/* exdoc - * @state UNDOCUMENTED - * @node Undocumented - */ -define("SEARCH_TYPE_PHRASE",3); - -/* exdoc - * @state UNDOCUMENTED - * @node Undocumented - */ -function exponent_search_whereClause($fields,$terms,$modules,$type = SEARCH_TYPE_ANY) { - $where = "("; - - $first_time = true; - foreach ($fields as $field) { - if ($first_time == false) { - $where .= " OR "; - } else { - $first_time = false; - } - - switch ($type) { - case SEARCH_TYPE_ALL: - $where .= "(" . $field . " LIKE '%" . implode("% ' AND $field LIKE ' %",$terms) . " %') "; - break; - case SEARCH_TYPE_PHRASE: - $where .= $field . " LIKE '% " . implode(" ",$terms) . " %' "; - break; - default: - $where .= $field . " LIKE '%" . implode("%' OR $field LIKE '%",$terms) . "%' "; - break; - } - } - - $first_time = true; - $where .= ') AND ('; - foreach ($modules as $mod) { - if ($first_time == false) { - $where .= " OR "; - } else { - $first_time = false; - } - - $where .= 'ref_module="'.$mod.'"'; - } - - $where .= ')'; - - return $where; - //return substr($where,0,-4); -} - -/* exdoc - * @state UNDOCUMENTED - * @node Undocumented - */ -function exponent_search_saveSearchKey($search) { - $search->title = " " . $search->title . " "; - $search->body = " " . $search->body . " "; - - global $db; - if (isset($search->id)) { - $db->updateObject($search,"search"); - } else { - $db->insertObject($search,"search"); - } -} - -/* exdoc - * @state UNDOCUMENTED - * @node Undocumented - */ -function exponent_search_removeHTML($str) { - $str = str_replace(array("\r\n","\n")," ",$str); - return strip_tags(str_replace(array("
","
","
","
"),"\n",$str)); -} - -/* exdoc - * @state UNDOCUMENTED - * @node Undocumented - */ -function exponent_search_cleanSearchQuery($query) { - $exclude = array_map("trim",file(BASE."framework/core/subsystems-1/search/exclude.en.list")); - $newquery = array('valid'=>array(),'excluded'=>array()); - foreach ($query as $q_tok) { - if (!in_array($q_tok,$exclude)) { - $newquery['valid'][] = $q_tok; - } else { - $newquery['excluded'][] = $q_tok; - } - } - return $newquery; -} - -function getModuleNames($mods) { - $mod_list = array(); - - if(!isset($mods) || $mods == null) { - $mods = expModules::exponent_modules_list(); - } - - foreach ($mods as $mod) { - $name = null; - if (class_exists($mod) && is_callable(array($mod,'searchName'))) { - $name = call_user_func(array($mod,'searchName')); - } elseif (class_exists($mod) && is_callable(array($mod,'spiderContent'))) { - if (call_user_func(array($mod,'spiderContent'))) { - $name = $mod; - } - } - - if ($name != null) { - $mod_list[$mod] = $name; - } - } - - return $mod_list; -} - -?> diff --git a/framework/core/subsystems-1/search/exclude.en.list b/framework/core/subsystems-1/search/exclude.en.list deleted file mode 100644 index f5a090c851..0000000000 --- a/framework/core/subsystems-1/search/exclude.en.list +++ /dev/null @@ -1,7 +0,0 @@ -a -of -is -the -it -it\'s -its \ No newline at end of file diff --git a/framework/core/subsystems-1/security.php b/framework/core/subsystems-1/security.php deleted file mode 100644 index 0d1bf597d5..0000000000 --- a/framework/core/subsystems-1/security.php +++ /dev/null @@ -1,65 +0,0 @@ -UNDOCUMENTED - * @node Undocumented - */ -//define('SYS_SECURITY',1); - -/* exdoc - * @state UNDOCUMENTED - * @node Undocumented - */ -function exponent_security_checkPasswordStrength($username,$password) { - - $i18n = exponent_lang_loadFile('subsystems/security.php'); -// Return blank string on success, error message on failure. -// The error message should let the user know why their password is wrong. - if (strcasecmp($username,$password) == 0) { - return $i18n['not_username']; - } - # For example purposes, the next line forces passwords to be over 8 characters long. - if (strlen($password) < 8) { - return $i18n['pass_len']; - } - - return ""; // by default, accept any passwords -} - -function exponent_security_checkUsername($username) { - - $i18n = exponent_lang_loadFile('subsystems/security.php'); -// Return blank string on success, error message on failure. -// The error message should let the user know why their username is wrong. - if (strlen($username) < 3) { - return $i18n['username_length']; - } - //echo ""; - //print_r(preg_match("/^[a-zA-Z0-9]/",$username)); - //echo ""; - //exit; - - //if (!preg_match("/[a-zA-Z0-9]/",$username)){ - // return $i18n['username_illegal']; - //} - return ""; // by default, accept any passwords -} - -?> diff --git a/framework/core/subsystems-1/sessions.php b/framework/core/subsystems-1/sessions.php deleted file mode 100644 index 8a206f71f2..0000000000 --- a/framework/core/subsystems-1/sessions.php +++ /dev/null @@ -1,426 +0,0 @@ -UNDOCUMENTED - * @node Undocumented - */ - define('SYS_SESSION_KEY',PATH_RELATIVE); -} - -// Name of session cookie may also be overridden -if (!defined('SYS_SESSION_COOKIE')) { - define('SYS_SESSION_COOKIE','PHPSESSID'); -} - -/* exdoc - * Runs necessary code to initialize sessions for use. - * This sends the session cookie header (via the session_start - * PHP function) and sets up session variables needed by the - * rest of the system and this subsystem. - * @node Subsystems:Sessions - */ -function exponent_sessions_initialize() { - $sessid = ''; - if (isset($_GET['expid'])) - { - $sessid = $_GET['expid']; - } - else if (isset($_POST['expid'])) - { - $sessid = $_POST['expid']; - } - else if (!isset($_COOKIE[SYS_SESSION_COOKIE])) - { - $sessid = md5(uniqid(rand(), true)); - } - else - { - $sessid = $_COOKIE[SYS_SESSION_COOKIE]; - } - session_name(SYS_SESSION_COOKIE); - session_id($sessid); - $_COOKIE['PHPSESSID'] = $sessid; - session_set_cookie_params(60*60*24*100); // This sets the cookie to expire in 100 days - ||seconds*minutes*hours*days|| - - session_start(); - if (!isset($_SESSION[SYS_SESSION_KEY])) - { - $_SESSION[SYS_SESSION_KEY] = array(); - } - if (!isset($_SESSION[SYS_SESSION_KEY]['vars'])) - { - $_SESSION[SYS_SESSION_KEY]['vars'] = array(); - } - if (isset($_SESSION[SYS_SESSION_KEY]['vars']['display_theme'])) - { - define('DISPLAY_THEME',$_SESSION[SYS_SESSION_KEY]['vars']['display_theme']); - } - -} - -/* exdoc - * Validates the stored session ticket against the database. This is used - * to force refreshes and force logouts. It also updates activity time. - * @node Subsystems:Sessions - */ -function exponent_sessions_validate() { - global $db, $user; - //FJD - create a ticket for every session instead of just logged in users - if (!isset($_SESSION[SYS_SESSION_KEY]['ticket'])) { - $ticket = exponent_sessions_createTicket(); - }else{ - $ticket = $db->selectObject('sessionticket',"ticket='".$_SESSION[SYS_SESSION_KEY]['ticket']."'"); - } - - //if we don't have a ticket here, that means the browser passed the cookie, the session is still - // active, but the DATABASE tickets table was cleared. - - if(SESSION_TIMEOUT_ENABLE == true){ - $timeoutval = SESSION_TIMEOUT; - if ($timeoutval < 300) $timeoutval = 300; - if ($ticket == null || $ticket->last_active < time() - $timeoutval) { - exponent_sessions_logout(); - define('SITE_403_HTML',SESSION_TIMEOUT_HTML); - return; - } - } - - if (isset($_SESSION[SYS_SESSION_KEY]['user'])) { - $user = ($_SESSION[SYS_SESSION_KEY]['user']); - } else { - $user = new user(); - $user->id = 0; - } - - if (isset($ticket->refresh) && $ticket->refresh == 1) { - if (isset($user)) exponent_permissions_load($user); - exponent_sessions_clearCurrentUserSessionCache(); - $ticket->refresh = 0; - } - - exponent_sessions_updateTicket($ticket, $user); - // Clean out old sessions from the sessionticket table. - $db->delete('sessionticket','last_active < ' . (time() - SESSION_TIMEOUT)); - - define('SITE_403_HTML', SITE_403_REAL_HTML); -} - -/* exdoc - * Creates and stores a session ticket for the given user, - * so that sessions can be tracked and permissions can be - * refreshed as needed. - * - * @param User $user The user object of the newly logged-in user. - * @node Subsystems:Sessions - */ -function exponent_sessions_login($user) { - $ticket = exponent_sessions_getTicketString(); - if (!isset($ticket)) $ticket = exponent_sessions_createTicket($user); - $_SESSION[SYS_SESSION_KEY]['user'] = $user; - exponent_sessions_updateTicket($ticket, $user); - exponent_permissions_load($user); -} - -/* exdoc - * Creates user ticket in sessionticket table and session - * - * @param User $user The user object of the newly logged-in user. Uses id of 0 if not supplied. - * @node Subsystems:Sessions - */ -function exponent_sessions_createTicket($user = null){ - $ticket = null; - if (!isset($user->id)) $user = new user(0); - $ticket->uid = $user->id; - $ticket->ticket = uniqid("",true); - $ticket->last_active = time(); - $ticket->start_time = time(); - $ticket->browser = $_SERVER['HTTP_USER_AGENT']; - $ticket->ip_address = $_SERVER['REMOTE_ADDR']; - if (!empty($_SERVER['HTTP_REFERER'])) { - $ticket->referrer = $_SERVER['HTTP_REFERER']; - } - $_SESSION[SYS_SESSION_KEY]['ticket'] = $ticket->ticket; - - global $db; - $db->insertObject($ticket,'sessionticket'); - return $ticket; -} - -/* exdoc - * Creates user ticket in sessionticket table and session - * - * @param User $user The user object of the newly logged-in user. Uses id of 0 if not supplied. - * @node Subsystems:Sessions - */ -function exponent_sessions_updateTicket($ticket, $user){ - global $db; - if (isset($ticket->ticket)){ - $ticket->uid = isset($user->id) ? $user->id : 0; - $ticket->last_active = time(); - $db->updateObject($ticket,'sessionticket',"ticket='" . $ticket->ticket . "'"); - } - return $ticket; -} - - -/* exdoc - * Clears the session of all user data, used when a user logs out. - * This gets rid of stale session tickets, and resets the session - * to a blank state. - * @node Subsystems:Sessions - */ -function exponent_sessions_logout() { - global $db, $user; - $ticket = $db->delete('sessionticket', "ticket='" . $_SESSION[SYS_SESSION_KEY]['ticket'] . "'"); - unset($_SESSION[SYS_SESSION_KEY]['user']); - unset($_SESSION[SYS_SESSION_KEY]['ticket']); - //unset($_SESSION[SYS_SESSION_KEY]['vars']); - exponent_permissions_clear(); - //redirect_to(array('section'=>SITE_DEFAULT_SECTION)); -} - -/* exdoc - * Looks at the session data to see if the current session is - * that of a logged in user. Returns true if the viewer is logged - * in, and false if it is not - * @node Subsystems:Sessions - */ -function exponent_sessions_loggedIn() { - //if ($anon){ - return (isset($_SESSION[SYS_SESSION_KEY]['ticket']) && isset($_SESSION[SYS_SESSION_KEY]['user'])); - //} - //else{ - // return (isset($_SESSION[SYS_SESSION_KEY]['ticket'])); - //} -} - -//Clears entire user session data and truncates the sessionticket table -function exponent_sessions_clearAllSessionData(){ - global $db; - $db->delete('sessionticket',"1"); - unset($_SESSION[SYS_SESSION_KEY]); -} - - -function exponent_sessions_getTicketString() { - //if (isset($_SESSION[SYS_SESSION_KEY]['ticket'])) { - // return $_SESSION[SYS_SESSION_KEY]['ticket']; - //} else return null; - global $db; - if (isset($_SESSION[SYS_SESSION_KEY]['ticket'])) { - if($db->selectObject('sessionticket',"ticket='".$_SESSION[SYS_SESSION_KEY]['ticket']."'") != null ) { - return $_SESSION[SYS_SESSION_KEY]['ticket']; - }else return null; - } -} - -function exponent_sessions_getOrigReferrer($ticket=null) { - global $db; - - // if they didn't pass in a specific ticket - if (empty($ticket)) { - // see if there is a ticket in the session to use - if (isset($_SESSION[SYS_SESSION_KEY]['ticket'])) { - $ticket = $_SESSION[SYS_SESSION_KEY]['ticket']; - } else { - return null; - } - } - - return $db->selectValue('sessionticker', 'referrer', "ticket='".$ticket."'" ); -} - -/* exdoc - * Checks to see if the session holds a set variable of the given name. - * - * Note that some session variables (like the user object and the ticket) - * cannot be changed using this call (for security / sanity reason) - * @node Subsystems:Sessions - */ -function exponent_sessions_isset($var) { - return isset($_SESSION[SYS_SESSION_KEY]['vars'][$var]); -} - -/* - * Sets a variable in the session data, for use on subsequent page calls. - * - * Note that some session variables (like the user object and the ticket) - * cannot be changed using this call (for security / sanity reason) - * - * @param string $var The name of the variable, for later reference - * @param mixed $val The value to store - * @node Subsystems:Sessions - */ -function exponent_sessions_set($var, $val) { - $_SESSION[SYS_SESSION_KEY]['vars'][$var] = $val; -} - -/* exdoc - * Removes a variable from the session. - * - * Note that some session variables (like the user object and the ticket) - * cannot be changed using this call (for security / sanity reason) - * - * @param string $var The name of the variable to unset. - * @node Subsystems:Sessions - */ -function exponent_sessions_unset($var) { - unset($_SESSION[SYS_SESSION_KEY]['vars'][$var]); -} - -/* exdoc - * This retrieves the value of a persistent session variable. Returns - * null if the variable is not set in the session, or the value of the stored variable. - * - * Note that some session variables (like the user object and the ticket) - * cannot be changed using this call (for security / sanity reason) - * - * @param string $var The name of the variable to retrieve. - * @node Subsystems:Sessions - */ -function exponent_sessions_get($var) { - if (isset($_SESSION[SYS_SESSION_KEY]['vars'][$var])) { - return $_SESSION[SYS_SESSION_KEY]['vars'][$var]; - } else return null; -} - -/* exdoc - * Clears current users session cache - * - * @param Modules $modules Array or string. If not set, applies to all modules. If set, will only clear cache for that module - * @param User $user if not set,applies to all users. If set, will only clear for that user - * @node Subsystems:Sessions - */ -function exponent_sessions_clearCurrentUserSessionCache($modules = null) { - - if (isset($modules)){ - if (is_array($modules)){ - foreach ($modules as $mod){ - if (isset($_SESSION[SYS_SESSION_KEY]['cache'][$mod])) unset($_SESSION[SYS_SESSION_KEY]['cache'][$mod]); - } - }else{ - if (isset($_SESSION[SYS_SESSION_KEY]['cache'][$modules])) unset($_SESSION[SYS_SESSION_KEY]['cache'][$modules]); - } - }else{ - if (isset($_SESSION[SYS_SESSION_KEY]['cache'])) unset($_SESSION[SYS_SESSION_KEY]['cache']); - } -} - -function exponent_sessions_getCacheValue($module){ - //returns array or null - if (isset($_SESSION[SYS_SESSION_KEY]['cache'][$module])) return($_SESSION[SYS_SESSION_KEY]['cache'][$module]); - else return null; -} - -function exponent_sessions_setCacheValue($module, $val){ - //should always be an array, even if single index - $_SESSION[SYS_SESSION_KEY]['cache'][$module] = $val; -} - -/* exdoc - * Clears global users session cache - * - * @param Modules $modules If not set, applies to all modules. If set, will only clear cache for that module - * @param User $user if not set,applies to all users. If set, will only clear for that user - * @node Subsystems:Sessions - */ -function exponent_sessions_clearAllUsersSessionCache($modules = null, $user = null) { - //ignoring module for now, as we can only easily clear entire cache - //by just flagging the refresh field in the session ticket. - //Maybe we'll enhance this later to store the session cache in the db - //and we can then use this to only clear certain modules' cache. - //We can easily clear for just an individual user or all users though, - //but I don't see why we need to clear just one other specified user's cache - //at this point either. This just updates all sessionticket records to refresh=1 - - global $db; - $sessionticket->refresh = 1; - $db->updateObject($sessionticket, 'sessionticket', '1'); - - /* Possible future code - if (isset($user)){ - $where = " uid='" . $user->id . "'"; - }else { - $where = ''; - } - - if (isset($modules)){ - if (is_array($modules)){ - foreach ($modules as $mod){ - - } - }else{ - - } - }else{ - - } - */ -} - - -// Database-stored session handling -// -// Read function must return string value always to make -// save handler work as expected. Return empty string if -// there is no data to read. Return values from other handlers -// are converted to boolean expression. TRUE for success, -// FALSE for failure. - -// Opens the session -function exponent_sessions_db_open($save_path,$sess_name) { - global $SYS_SESSIONS_SESSIONNAME; - $SYS_SESSIONS_SESSIONNAME = $sess_name; - // Put locking in database - -} - -function exponent_sessions_db_close() { - -} - -function exponent_sessions_db_read($id) { - -} - -function exponent_sessions_db_write($id, $sess_data) { - -} - -function exponent_sessions_db_destroy($id) { - -} - -function exponent_sessions_db_gc($maxlifetime) { - -} - -?> diff --git a/framework/core/subsystems-1/sorting.php b/framework/core/subsystems-1/sorting.php deleted file mode 100644 index f079c994d7..0000000000 --- a/framework/core/subsystems-1/sorting.php +++ /dev/null @@ -1,195 +0,0 @@ -rank < $b->rank ? -1 : 1); -} - -/* exdoc - * Object sorting comparison function -- sorts by rank in descending order. - * @node Subsystems:Sorting - */ -function exponent_sorting_byRankDescending($a,$b) { - return ($a->rank > $b->rank ? -1 : 1); -} - -/* exdoc - * Object sorting comparison function -- sorts by name in ascending order. - * Uses a natural order, case-insensitive comparison algorithm (strnatcasecmp) - * @node Subsystems:Sorting - */ -function exponent_sorting_byNameAscending($a,$b) { - return strnatcasecmp($a->name,$b->name); -} - -/* exdoc - * Object sorting comparison function -- sorts by name in descending order. - * Uses a natural order, case-insensitive comparison algorithm (strnatcasecmp) - * @node Subsystems:Sorting - */ -function exponent_sorting_byNameDescending($a,$b) { - return (strnatcasecmp($a->name,$b->name) == -1 ? 1 : -1); -} - -/* exdoc - * Object sorting comparison function -- sorts by title in ascending order. - * Uses a natural order, case-insensitive comparison algorithm (strnatcasecmp) - * @node Subsystems:Sorting - */ -function exponent_sorting_byTitleAscending($a,$b) { - return strnatcasecmp($a->title,$b->title); -} - -/* exdoc - * Object sorting comparison function -- sorts by title in descending order. - * Uses a natural order, case-insensitive comparison algorithm (strnatcasecmp) - * @node Subsystems:Sorting - */ -function exponent_sorting_byTitleDescending($a,$b) { - return (strnatcasecmp($a->title,$b->title) == -1 ? 1 : -1); -} - -function exponent_sorting_byLastNameAscending($a,$b) { - return strnatcasecmp($a->lastname,$b->lastname); -} - -function exponent_sorting_byFirstNameAscending($a,$b) { - return strnatcasecmp($a->firstname,$b->firstname); -} -/* exdoc - * Object sorting comparison function -- sorts by username attribute in ascending order. - * Uses a natural order, case-insensitive comparison algorithm (strnatcasecmp) - * @node Subsystems:Sorting - */ -function exponent_sorting_byUserNameAscending($a,$b) { - return strnatcasecmp($a->username,$b->username); -} - -/* exdoc - * Object sorting comparison function -- sorts by username attribute in descending order. - * Uses a natural order, case-insensitive comparison algorithm (strnatcasecmp) - * @node Subsystems:Sorting - */ -function exponent_sorting_byUserNameDescending($a,$b) { - return (strnatcasecmp($a->username,$b->username) == -1 ? 1 : -1); -} - -/* exdoc - * Object sorting comparison function -- sorts by posted attribute in ascending order. - * @node Subsystems:Sorting - */ -function exponent_sorting_byPostedAscending($a,$b) { - return ($a->posted < $b->posted ? -1 : 1); -} - -/* exdoc - * Object sorting comparison function -- sorts by posted attribute in descending order. - * @node Subsystems:Sorting - */ -function exponent_sorting_byPostedDescending($a,$b) { - return ($a->posted > $b->posted ? -1 : 1); -} - -function exponent_sorting_byEditedAscending($a,$b) { - return ($a->edited < $b->edited ? -1 : 1); -} -function exponent_sorting_byEditedDescending($a,$b) { - return ($a->edited > $b->edited ? -1 : 1); -} -/* exdoc - * Object sorting comparison function -- sorts by updated attribute in ascending order. - * @node Subsystems:Sorting - */ -function exponent_sorting_byUpdatedAscending($a,$b) { - return ($a->updated < $b->updated ? -1 : 1); -} - -/* exdoc - * Object sorting comparison function -- sorts by updated attribute in descending order. - * @node Subsystems:Sorting - */ -function exponent_sorting_byUpdatedDescending($a,$b) { - return ($a->updated > $b->updated ? -1 : 1); -} - -/* exdoc - * Object sorting comparison function -- sorts by name method return value in ascending order. - * Uses a natural order, case-insensitive comparison algorithm (strnatcasecmp) - * @node Subsystems:Sorting - */ -function exponent_sorting_moduleByNameAscending($a,$b) { - return strnatcasecmp($a->name(),$b->name()); -} - -/* exdoc - * Object sorting comparison function -- sorts by name method return value in descending order. - * Uses a natural order, case-insensitive comparison algorithm (strnatcasecmp) - * @node Subsystems:Sorting - */ -function exponent_sorting_moduleByNameDescending($a,$b) { - return (strnatcasecmp($a->name(),$b->name()) == -1 ? 1 : -1); -} - -/* exdoc - * Class name sorting comparison function -- sorts by name method return value in ascending order. - * Uses a natural order, case-insensitive comparison algorithm (strnatcasecmp) - * @node Subsystems:Sorting - */ -function exponent_sorting_moduleClassByNameAscending($a,$b) { - return strnatcasecmp(call_user_func(array($a,"name")),call_user_func(array($b,"name"))); -} - -/* exdoc - * Class name sorting comparison function -- sorts by name method return value in descending order. - * Uses a natural order, case-insensitive comparison algorithm (strnatcasecmp) - * @node Subsystems:Sorting - */ -function exponent_sorting_moduleClassByNameDescending($a,$b) { - return (strnatcasecmp(call_user_func(array($a,"name")),call_user_func(array($b,"name"))) == -1 ? 1 : -1); -} - -/* exdoc - * Workflow revision sorting comparison function -- sorts by major and minor in ascending order. - * @node Subsystems:Sorting - */ -function exponent_sorting_workflowRevisionAscending($a,$b) { - return strnatcmp($a->wf_major.".".$a->wf_minor,$b->wf_major.".".$b->wf_minor); -} - -/* exdoc - * Workflow revision sorting comparison function -- sorts by major and minor in descending order. - * @node Subsystems:Sorting - */ -function exponent_sorting_workflowRevisionDescending($a,$b) { - return (strnatcmp($a->wf_major.".".$a->wf_minor,$b->wf_major.".".$b->wf_minor) == -1 ? 1 : -1); -} - -?> diff --git a/framework/core/subsystems-1/template.php b/framework/core/subsystems-1/template.php index fc903bf021..bd4c921e71 100644 --- a/framework/core/subsystems-1/template.php +++ b/framework/core/subsystems-1/template.php @@ -106,7 +106,7 @@ function __construct($item_type, $item_dir, $view = "Default") { $this->tpl->assign("__redirect", expHistory::getLastNotEditable()); // Load language constants - $this->tpl->assign('_TR',exponent_lang_loadFile($this->langdir . $this->view . '.php')); + //$this->tpl->assign('_TR',exponent_lang_loadFile($this->langdir . $this->view . '.php')); } @@ -126,7 +126,7 @@ function assign($var, $val) { function output() { // javascript registration - $this->tpl->assign('_TR',exponent_lang_loadFile($this->langdir."".$this->view.'.php')); //fix lamp issue + //$this->tpl->assign('_TR',exponent_lang_loadFile($this->langdir."".$this->view.'.php')); //fix lamp issue $this->tpl->display($this->view.'.tpl'); } @@ -148,7 +148,7 @@ function register_permissions($perms, $locs) { function render() { // Caching support? // Load language constants //$this->tpl->assign('_TR',exponent_lang_loadFile($this->viewdir.'/'.$this->view.'.php')); - $this->tpl->assign('_TR', exponent_lang_loadFile($this->langdir . $this->view . '.php')); //fix lamp issue + //$this->tpl->assign('_TR', exponent_lang_loadFile($this->langdir . $this->view . '.php')); //fix lamp issue return $this->tpl->fetch($this->view.'.tpl'); } } @@ -236,7 +236,7 @@ function __construct($controller, $viewfile) { $this->tpl->assign("__redirect", expHistory::getLastNotEditable()); // Load language constants - $this->tpl->assign('_TR',exponent_lang_loadFile($this->langdir . $this->view . '.php')); + //$this->tpl->assign('_TR',exponent_lang_loadFile($this->langdir . $this->view . '.php')); $this->tpl->assign("__loc",$controller->loc); $this->tpl->assign("__name", $controller->baseclassname); @@ -354,10 +354,7 @@ function exponent_template_getViewConfigForm($module,$view,$form,$values) { $form_file = $filepath; } -// if (!defined("SYS_FORMS")) require_once(BASE."framework/core/subsystems-1/forms.php"); require_once(BASE."framework/core/subsystems-1/forms.php"); -// exponent_forms_initialize(); - if ($form == null) $form = new form(); if ($form_file == "") return $form; @@ -450,7 +447,6 @@ function exponent_template_listFormTemplates($type) { */ function exponent_template_listModuleViews($module, $lang = LANG) { return exponent_core_buildNameList("modules", $module, "tpl", "[!_]*"); - } function exponent_template_getViewParams($viewfile) { diff --git a/framework/core/subsystems-1/users.php b/framework/core/subsystems-1/users.php index f29a92ea15..9b187bdfc1 100644 --- a/framework/core/subsystems-1/users.php +++ b/framework/core/subsystems-1/users.php @@ -53,11 +53,11 @@ function exponent_users_getFullProfile($user) { return $user; } -function exponent_users_listExtensions() { +function exponent_users_listExtensions() { //FIXME moved into profileextension model w/ code from 1.0 return profileextension::listExtensions(); } -function exponent_users_authenticate($user, $password) { +function exponent_users_authenticate($user, $password) { //FIXME moved into user model if (MAINTENANCE_MODE && $user->is_acting_admin == 0 ) return false; // if MAINTENANCE_MODE only allow admins if (empty($user)) return false; // if the user object is null then fail the login // check password, if account is locked, or is admin(account locking doesn't to administrators) @@ -76,7 +76,7 @@ function exponent_users_authenticate($user, $password) { * @param string $password The password that the visitor has supplied as credentials * @node Subsystems:Users */ -function exponent_users_login($username, $password) { +function exponent_users_login($username, $password) { //FIXME moved into user model & expSession global $db; // Retrieve the user object from the database. This may be null, if the username is non-existent. @@ -125,7 +125,7 @@ function exponent_users_login($username, $password) { * can be cleaned up for the next user. * @node Subsystems:Users */ -function exponent_users_logout() { +function exponent_users_logout() { //FIXME moved into expSession expSession::logout(); } @@ -185,7 +185,6 @@ function exponent_users_groupUpdate($formvalues, $group = null) { */ function exponent_users_checkUsername($formvalues) { global $db; - $i18n = exponent_lang_loadFile('subsystems/users.php'); $username = ''; if (USER_REGISTRATION_USE_EMAIL == 1) { expValidator::validate(array('valid_email'=>'email'), $formvalues); @@ -198,7 +197,7 @@ function exponent_users_checkUsername($formvalues) { // check to make sure this username/email is unique. If this is an update we make sure the id isn't // the same as the user trying to update their own account. - $unametaken = (USER_REGISTRATION_USE_EMAIL == 1) ? $i18n['email_taken'] : $i18n['username_taken']; + $unametaken = (USER_REGISTRATION_USE_EMAIL == 1) ? gt('That email address is already in use.') : gt('That username is already taken.'); $where = "username = '".$username."'"; if (!empty($formvalues['id'])) $where .= ' AND id != '.$formvalues['id']; if (count($db->selectObjects('user', $where)) > 0) expValidator::failAndReturnToForm($unametaken, $formvalues); @@ -308,8 +307,6 @@ function exponent_users_userManagerFormTemplate($template) { global $user; $users = $db->selectObjects('user'); -// if (!defined('SYS_SORTING')) require_once(BASE.'framework/core/subsystems-1/sorting.php'); -// require_once(BASE.'framework/core/subsystems-1/sorting.php'); if (!function_exists('exponent_sorting_byLastFirstAscending')) { function exponent_sorting_byLastFirstAscending($a,$b) { return strnatcmp($a->lastname . ', '. $a->firstname,$b->lastname . ', '. $b->firstname); @@ -342,8 +339,6 @@ function exponent_users_groupManagerFormTemplate($template) { global $db; $groups = $db->selectObjects('group'); -// if (!defined('SYS_SORTING')) require_once(BASE.'framework/core/subsystems-1/sorting.php'); -// require_once(BASE.'framework/core/subsystems-1/sorting.php'); // usort($groups,'exponent_sorting_byNameAscending'); $groups = expSorter::sort(array('array'=>$groups,'sortby'=>'name', 'order'=>'ASC')); @@ -452,7 +447,7 @@ function exponent_users_getUsersByEmail($email) { return $tmpus; } -function exponent_users_getEmailById($id) { +function exponent_users_getEmailById($id) { //FIXME moved to user model global $db; return $db->selectValue('user','email','id='.$id); } @@ -466,7 +461,7 @@ function exponent_users_getEmailById($id) { * @param bool $allow_normal Whether or not to include normal accounts in the returned list. * @node Subsystems:Users */ -function exponent_users_getAllUsers($allow_admin=1,$allow_normal=1) { +function exponent_users_getAllUsers($allow_admin=1,$allow_normal=1) { //FIXME moved to user model global $db; if ($allow_admin && $allow_normal) return $db->selectObjects('user'); else if ($allow_admin) return $db->selectObjects('user','is_admin=1 OR is_acting_admin = 1'); @@ -490,12 +485,11 @@ function exponent_users_getAllUsers($allow_admin=1,$allow_normal=1) { function exponent_users_getGroupById($gid) { //anonymous group -- NOT YET IMPLEMENTED /* global $db; - $i18n = exponent_lang_loadFile('subsystems/users.php'); if ($gid == 0){ //anonymous group $g->id = 0; - $g->name = $i18n['anonymous_group_name']; - $g->description = $i18n['anonymous_group_description']; + $g->name = gt('Anonymous Users - NOT YET WORKING'); + $g->description = gt('This is a default system group for all non-logged in users. NOT YET WORKING'); $g->inclusive = 1; return $g; } else { @@ -519,7 +513,7 @@ function exponent_users_getGroupById($gid) { * @param string $name The username of the user account to retrieve. * @node Subsystems:Users */ -function exponent_users_getUserByName($name) { +function exponent_users_getUserByName($name) { //FIXME moved to user model global $db; $tmpu = $db->selectObject('user',"username='$name'"); if ($tmpu && $tmpu->is_admin == 1) { @@ -531,7 +525,7 @@ function exponent_users_getUserByName($name) { } /* exdoc - * This funciton pulls a group object from the subsystem's storage mechanism, + * This function pulls a group object from the subsystem's storage mechanism, * according to the group name. For the default implementation, this is equivalent * to a $db->selectObject() call, but it may not be the same for other implementations. * Returns a group object, and null if no group was found. @@ -558,7 +552,7 @@ function exponent_users_getGroupByName($name) { * @param bool $allow_inclusive Whether or not to include inclusive groups in the returned list. * @node Subsystems:Users */ -function exponent_users_getAllGroups($allow_exclusive=1,$allow_inclusive=1) { +function exponent_users_getAllGroups($allow_exclusive=1,$allow_inclusive=1) { //FIXME moved to user model global $db; if ($allow_exclusive && $allow_inclusive) { // For both, just do a straight selectObjects call, with no WHERE criteria. @@ -600,9 +594,9 @@ function exponent_users_getGroupsForUser($u, $allow_exclusive=1, $allow_inclusiv $groups = array(); if ( (!empty($u->is_admin) && $u->is_admin == 1) || (!empty($u->is_acting_admin) && $u->is_acting_admin == 1) ) { // For administrators, we synthesize group memberships - they effectively - // belong to all groups. So, we call exponent_users_getAllGroups, and pass the + // belong to all groups. So, we call user::getAllGroups, and pass the // filtration criteria arguments (2 and 3) to it. - return exponent_users_getAllGroups($allow_exclusive,$allow_inclusive); + return user::getAllGroups($allow_exclusive,$allow_inclusive); } foreach ($db->selectObjects('groupmembership','member_id='.$u->id) as $m) { // Loop over the membership records for this user, and select the full @@ -769,7 +763,7 @@ function exponent_users_changepass($pass, $user = null) { $db->updateObject($u,'user'); } -function exponent_users_isLoggedIn() { +function exponent_users_isLoggedIn() { //FIXME moved to user model global $user; if (!empty($user) && !empty($user->id) && $user->id != 0) { return true; @@ -778,7 +772,7 @@ function exponent_users_isLoggedIn() { } } -function exponent_users_isAdmin() { +function exponent_users_isAdmin() { //FIXME moved to user model global $user; return (!empty($user->is_acting_admin) || !empty($user->is_admin)) ? true : false; } diff --git a/framework/core/subsystems-1/users/profileextensions/addressextension.php b/framework/core/subsystems-1/users/profileextensions/addressextension.php index e37b8c0091..926d5b6dc0 100644 --- a/framework/core/subsystems-1/users/profileextensions/addressextension.php +++ b/framework/core/subsystems-1/users/profileextensions/addressextension.php @@ -18,24 +18,21 @@ ################################################## class addressextension { - function name() { return exponent_lang_loadKey('subsystems/users/profileextensions/addressextension.php','extension_name'); } + function name() { return 'Address Extension'; } function author() { return "James Hunt"; } - function description() { return exponent_lang_loadKey('subsystems/users/profileextensions/addressextension.php','extension_description'); } + function description() { return 'Stores an address for the user.'; } function modifyForm($form,$user) { // new if !isset($user->id) - - $i18n = exponent_lang_loadFile('subsystems/users/profileextensions/addressextension.php'); - if (!isset($user->user_address) || $user->user_address == null) { $user->user_address = addressextension::_blankAddress(); } - $form->register(null,"",new htmlcontrol('
'.$i18n['header'].'')); - $form->register("address1",$i18n['address1'], new textcontrol($user->user_address->address1)); - $form->register("address2",$i18n['address2'], new textcontrol($user->user_address->address2)); - $form->register("city",$i18n['city'], new textcontrol($user->user_address->city)); - $form->register("state",$i18n['state'], new textcontrol($user->user_address->state)); - $form->register("zip",$i18n['zip'], new textcontrol($user->user_address->zip)); - $form->register("country",$i18n['country'], new textcontrol($user->user_address->country)); + $form->register(null,"",new htmlcontrol('
'.gt('Address Information').'')); + $form->register("address1",gt('Address'), new textcontrol($user->user_address->address1)); + $form->register("address2",gt(''), new textcontrol($user->user_address->address2)); + $form->register("city",gt('City'), new textcontrol($user->user_address->city)); + $form->register("state",gt('State'), new textcontrol($user->user_address->state)); + $form->register("zip",gt('Zip Code'), new textcontrol($user->user_address->zip)); + $form->register("country",gt('Country'), new textcontrol($user->user_address->country)); return $form; } diff --git a/framework/core/subsystems-1/users/profileextensions/bbextension.php b/framework/core/subsystems-1/users/profileextensions/bbextension.php index d4db13fb61..312d6b091b 100644 --- a/framework/core/subsystems-1/users/profileextensions/bbextension.php +++ b/framework/core/subsystems-1/users/profileextensions/bbextension.php @@ -21,49 +21,46 @@ // GREP:HARDCODEDTEXT - 3am-6am is not i18n! class bbextension { - function name() { return exponent_lang_loadKey('subsystems/users/profileextensions/bbextension.php','extension_name'); } + function name() { return 'Bulletin Board Module Extension'; } function author() { return 'Adam Kessler'; } - function description() { return exponent_lang_loadKey('subsystems/users/profileextensions/bbextension.php','extension_description'); } + function description() { return 'User profile extension for the Bulletin Board Module. Include things like avatars files, number of post, etc.'; } function modifyForm($form,$user) { // new if !isset($user->id) - - $i18n = exponent_lang_loadFile('subsystems/users/profileextensions/bbextension.php'); - if (!isset($user->bb_user) || $user->bb_user == null) { $user->bb_user = bbextension::_blankBBUser(); } - if (!isset($user->bb_user->website) || $user->bb_user->website == "" ) { - $user->bb_user->website = 'http://'; - } - $yesno = array(1=>$i18n['Yes'], 0=>$i18n['No']); - $form->register(null,"",new htmlcontrol('
'.$i18n['header'].'')); - $form->register("icq_num",$i18n['icq_num'], new textcontrol($user->bb_user->icq_num,16,false,15)); - $form->register("aim_addy",$i18n['aim_addy'], new textcontrol($user->bb_user->aim_addy,26,false,25)); - $form->register("msn_addy",$i18n['msn_addy'], new textcontrol($user->bb_user->msn_addy,26,false,25)); - $form->register("yahoo_addy",$i18n['yahoo_addy'], new textcontrol($user->bb_user->yahoo_addy,26,false,25)); - $form->register("skype_addy",$i18n['skype_addy'], new textcontrol($user->bb_user->skype_addy,26,false,25)); - $form->register("gtalk_addy",$i18n['gtalk_addy'], new textcontrol($user->bb_user->gtalk_addy,26,false,25)); - $form->register("website",$i18n['website'], new textcontrol($user->bb_user->website,46,false,55)); - $form->register("location",$i18n['location'], new textcontrol($user->bb_user->location,46,false,55)); - $form->register("occupation",$i18n['occupation'], new textcontrol($user->bb_user->occupation,46,false,55)); - $form->register("interests",$i18n['interests'], new texteditorcontrol($user->bb_user->interests,7,45)); - $form->register("signature",$i18n['signature'], new texteditorcontrol($user->bb_user->signature,7,45)); - $form->register("show_email_addy",$i18n['show_email_addy'], new radiogroupcontrol($user->bb_user->show_email_addy,$yesno,false,100,3)); - $form->register("hide_online_status",$i18n['hide_online_status'], new radiogroupcontrol($user->bb_user->hide_online_status,$yesno,false,100,3)); - $form->register("notify_of_replies",$i18n['notify_of_replies'], new radiogroupcontrol($user->bb_user->notify_of_replies,$yesno,false,100,3)); - $form->register("notify_of_pvt_msg",$i18n['notify_of_pvt_msg'], new radiogroupcontrol($user->bb_user->notify_of_pvt_msg,$yesno,false,100,3)); - $form->register("attach_signature",$i18n['attach_signature'], new radiogroupcontrol($user->bb_user->attach_signature,$yesno,false,100,3)); + if (!isset($user->bb_user->website) || $user->bb_user->website == "" ) { + $user->bb_user->website = 'http://'; + } + $yesno = array(1=>gt('Yes'), 0=>gt('No')); + $form->register(null,"",new htmlcontrol('
'.gt('Bulletin Board Info').'')); + $form->register("icq_num",gt('ICQ Number: '), new textcontrol($user->bb_user->icq_num,16,false,15)); + $form->register("aim_addy",gt('AIM Address: '), new textcontrol($user->bb_user->aim_addy,26,false,25)); + $form->register("msn_addy",gt('MSN Messenger: '), new textcontrol($user->bb_user->msn_addy,26,false,25)); + $form->register("yahoo_addy",gt('Yahoo Messenger: '), new textcontrol($user->bb_user->yahoo_addy,26,false,25)); + $form->register("skype_addy",gt('Skype Username: '), new textcontrol($user->bb_user->skype_addy,26,false,25)); + $form->register("gtalk_addy",gt('Google Talk: '), new textcontrol($user->bb_user->gtalk_addy,26,false,25)); + $form->register("website",gt('Website: '), new textcontrol($user->bb_user->website,46,false,55)); + $form->register("location",gt('Location: '), new textcontrol($user->bb_user->location,46,false,55)); + $form->register("occupation",gt('Occupation: '), new textcontrol($user->bb_user->occupation,46,false,55)); + $form->register("interests",gt('Interests: '), new texteditorcontrol($user->bb_user->interests,7,45)); + $form->register("signature",gt('Signature: '), new texteditorcontrol($user->bb_user->signature,7,45)); + $form->register("show_email_addy",gt('Always show my email address: '), new radiogroupcontrol($user->bb_user->show_email_addy,$yesno,false,100,3)); + $form->register("hide_online_status",gt('Hide online status: '), new radiogroupcontrol($user->bb_user->hide_online_status,$yesno,false,100,3)); + $form->register("notify_of_replies",gt('Notify me of replies: '), new radiogroupcontrol($user->bb_user->notify_of_replies,$yesno,false,100,3)); + $form->register("notify_of_pvt_msg",gt('Notify me of private messages: '), new radiogroupcontrol($user->bb_user->notify_of_pvt_msg,$yesno,false,100,3)); + $form->register("attach_signature",gt('Always attach my signature: '), new radiogroupcontrol($user->bb_user->attach_signature,$yesno,false,100,3)); //Show the avatar pic if there is one available. if ($user->bb_user->file_id != 0) { global $db; $file = $db->selectObject('file', 'id='.$user->bb_user->file_id); $form->register(null,"",new htmlcontrol('
')); - $form->register('file',$i18n['changefile'],new uploadcontrol()); + $form->register('file',gt('Change your Avatar File:
(Avatar Pictures may be no larger than 80x80)'),new uploadcontrol()); $form->register(null,"",new htmlcontrol('filename.' border="0" />')); } else { - $form->register('file',$i18n['file'],new uploadcontrol()); + $form->register('file',gt('Avatar File:
(Avatar Pictures may be no larger than 80x80)'),new uploadcontrol()); } return $form; @@ -98,9 +95,6 @@ function saveProfile($values,$user,$is_new) { $fileup = getimagesize ( $filenew ); if ($fileup[2] > 0 && $fileup[1] > 0) { if ($fileup[0] <= 80 && $fileup[1] <= 80) { -// if (!defined('SYS_FILES')) include_once(BASE.'framework/core/subsystems-1/files.php'); -// include_once(BASE.'framework/core/subsystems-1/files.php'); - $directory = 'files/bbmodule/avatars'; $fname = null; $file = null; diff --git a/framework/core/subsystems-1/users/profileextensions/inboxextension.php b/framework/core/subsystems-1/users/profileextensions/inboxextension.php index 11bb54bfd6..124c230e9e 100644 --- a/framework/core/subsystems-1/users/profileextensions/inboxextension.php +++ b/framework/core/subsystems-1/users/profileextensions/inboxextension.php @@ -18,18 +18,16 @@ ################################################## class inboxextension { - function name() { return exponent_lang_loadKey('subsystems/users/profileextensions/inboxextension.php','extension_name'); } + function name() { return 'Private Message Center Extension'; } function author() { return 'James Hunt'; } - function description() { return exponent_lang_loadKey('subsystems/users/profileextensions/inboxextension.php','extension_description'); } + function description() { return 'Allow users to configure email forwarding, and view their private messages from their profile.'; } function modifyForm($form,$u) { // new if !isset($user->id) - $i18n = exponent_lang_loadFile('subsystems/users/profileextensions/inboxextension.php'); - if (!isset($u->_inbox_config) || $u->_inbox_config == null) { $u->_inbox_config = inboxextension::_blank(); } - $form->register(null,'',new htmlcontrol('
'.$i18n['header'].'')); - $form->register('inbox_forward',$i18n['forward'], new checkboxcontrol($u->_inbox_config->forward,true)); + $form->register(null,'',new htmlcontrol('
'.gt('Private Message Center Options').'')); + $form->register('inbox_forward',gt('Forward All Private Messages to my Email Address'), new checkboxcontrol($u->_inbox_config->forward,true)); return $form; } diff --git a/framework/core/subsystems-1/users/profileextensions/phoneextension.php b/framework/core/subsystems-1/users/profileextensions/phoneextension.php index 81589df3bc..2faad89132 100644 --- a/framework/core/subsystems-1/users/profileextensions/phoneextension.php +++ b/framework/core/subsystems-1/users/profileextensions/phoneextension.php @@ -20,37 +20,34 @@ // GREP:HARDCODEDTEXT - 3am-6am is not i18n! class phoneextension { - function name() { return exponent_lang_loadKey('subsystems/users/profileextensions/phoneextension.php','extension_name'); } + function name() { return 'Phone Extension'; } function author() { return 'Jeremy Shinall'; } - function description() { return exponent_lang_loadKey('subsystems/users/profileextensions/phoneextension.php','extension_description'); } + function description() { return 'Stores phone numbers for the user.'; } function modifyForm($form,$user) { // new if !isset($user->id) - - $i18n = exponent_lang_loadFile('subsystems/users/profileextensions/phoneextension.php'); - if (!isset($user->user_phone) || $user->user_phone == null) { $user->user_phone = phoneextension::_blankPhone(); } - $form->register(null,"",new htmlcontrol('
'.$i18n['header'].'')); - $form->register("home_phone",$i18n['home_phone'], new textcontrol($user->user_phone->home_phone,16,false,15)); - $form->register("bus_phone",$i18n['bus_phone'], new textcontrol($user->user_phone->bus_phone,16,false,15)); - $form->register("other_phone",$i18n['other_phone'], new textcontrol($user->user_phone->other_phone,16,false,15)); + $form->register(null,"",new htmlcontrol('
'.gt('Phone Information').'')); + $form->register("home_phone",gt('Home Phone'), new textcontrol($user->user_phone->home_phone,16,false,15)); + $form->register("bus_phone",gt('Business Phone'), new textcontrol($user->user_phone->bus_phone,16,false,15)); + $form->register("other_phone",gt('Other Phone'), new textcontrol($user->user_phone->other_phone,16,false,15)); // Define pref_contact dropdown sources - $pref_array = array('', $i18n['home_phone'], $i18n['bus_phone'], $i18n['other_phone'], $i18n['email']); + $pref_array = array('', gt('Home Phone'), gt('Business Phone'), gt('Other Phone'), gt('Email')); if (!isset($user->user_phone->pref_contact)) { - $form->register("pref_contact",$i18n['pref_contact'], new dropdowncontrol("", $pref_array)); + $form->register("pref_contact",gt('Preferred Contact Method'), new dropdowncontrol("", $pref_array)); } else { - $form->register("pref_contact",$i18n['pref_contact'], new dropdowncontrol($user->user_phone->pref_contact, $pref_array)); + $form->register("pref_contact",gt('Preferred Contact Method'), new dropdowncontrol($user->user_phone->pref_contact, $pref_array)); } //Define contact_time dropdown sources $time_array = array("", "12am - 3am", "3am - 6am", "6am - 9am", "9am - 12pm", "12pm - 3pm", "3pm - 6pm", "6pm - 9pm", "9pm - 12am"); if (!isset($user->user_phone->contact_time)) { - $form->register("contact_time",$i18n['contact_time'], new dropdowncontrol("", $time_array)); + $form->register("contact_time",gt('Preferred Contact Time'), new dropdowncontrol("", $time_array)); } else { - $form->register("contact_time",$i18n['contact_time'], new dropdowncontrol($user->user_phone->contact_time, $time_array)); + $form->register("contact_time",gt('Preferred Contact Time'), new dropdowncontrol($user->user_phone->contact_time, $time_array)); } return $form; } diff --git a/framework/core/subsystems-1/users/profileextensions/settingsextension.php b/framework/core/subsystems-1/users/profileextensions/settingsextension.php index de86212afb..eb7102c321 100644 --- a/framework/core/subsystems-1/users/profileextensions/settingsextension.php +++ b/framework/core/subsystems-1/users/profileextensions/settingsextension.php @@ -19,21 +19,18 @@ ################################################## class settingsextension { - function name() { return exponent_lang_loadKey('subsystems/users/profileextensions/settingsextension.php', 'extension_name'); } + function name() { return 'Settings Extension'; } function author() { return 'Maxim Mueller'; } - function description() { return exponent_lang_loadKey('subsystems/users/profileextensions/settingsextension.php', 'extension_description'); } + function description() { return "Stores a user's preferences for certain site settings."; } function modifyForm($form, $user) { // new if !isset($user->id) - - $i18n = exponent_lang_loadFile('subsystems/users/profileextensions/settingsextension.php'); - if (!isset($user->user_settings) || $user->user_settings == null) { $user->user_settings = settingsextension::_setDefaults(); } - $form->register(null, "", new htmlcontrol('
' . $i18n['header'] . '')); - $form->register("SITE_WYSIWYG_EDITOR", $i18n["SITE_WYSIWYG_EDITOR"], new textcontrol($user->user_settings->WYSIWYG_EDITOR, 16, false, 15)); - $form->register("USE_LANG", $i18n["USE_LANG"], new textcontrol($user->user_setings->USE_LANG, 16, false, 15)); + $form->register(null, "", new htmlcontrol('
' . gt('User Settings') . '')); + $form->register("SITE_WYSIWYG_EDITOR", gt('Preferred Editor'), new textcontrol($user->user_settings->WYSIWYG_EDITOR, 16, false, 15)); + $form->register("USE_LANG", gt('Preferred Language'), new textcontrol($user->user_setings->USE_LANG, 16, false, 15)); return $form; } diff --git a/framework/core/subsystems-1/workflow.php b/framework/core/subsystems-1/workflow.php index 261c703c13..6dcb0be42c 100644 --- a/framework/core/subsystems-1/workflow.php +++ b/framework/core/subsystems-1/workflow.php @@ -763,8 +763,6 @@ function exponent_workflow_form($datatype,$id) { function exponent_workflow_runActions($policy,$action_type,$revision) { global $db; $actions = $db->selectObjects("workflowaction","policy_id=".$policy->id." AND type=$action_type"); -// if (!defined('SYS_SORTING')) include_once(BASE.'framework/core/subsystems-1/sorting.php'); -// include_once(BASE.'framework/core/subsystems-1/sorting.php'); // usort($actions,"exponent_sorting_byRankAscending"); $actions = expSorter::sort(array('array'=>$actions,'sortby'=>'rank', 'order'=>'ASC')); foreach ($actions as $action) { diff --git a/framework/core/subsystems-1/workflow/actions/Debugging.php b/framework/core/subsystems-1/workflow/actions/Debugging.php deleted file mode 100644 index ad0963b680..0000000000 --- a/framework/core/subsystems-1/workflow/actions/Debugging.php +++ /dev/null @@ -1,38 +0,0 @@ -Debugging Output:"; - -echo "Action Type: " . $action_type; - -echo "

Policy Object:
"; -echo ""; -print_r($policy); -echo ""; - -echo "

Revision:
"; -echo ""; -print_r($revision); -echo ""; - -?> \ No newline at end of file diff --git a/framework/core/subsystems-1/workflow/actions/Redirect User.php b/framework/core/subsystems-1/workflow/actions/Redirect User.php deleted file mode 100644 index ca5f21cdd6..0000000000 --- a/framework/core/subsystems-1/workflow/actions/Redirect User.php +++ /dev/null @@ -1,24 +0,0 @@ - \ No newline at end of file diff --git a/framework/core/subsystems-1/workflow/actions/Show Back Link.php b/framework/core/subsystems-1/workflow/actions/Show Back Link.php deleted file mode 100644 index 7bb8b472ec..0000000000 --- a/framework/core/subsystems-1/workflow/actions/Show Back Link.php +++ /dev/null @@ -1,28 +0,0 @@ -Back to approval manager.'; - -?> \ No newline at end of file diff --git a/framework/core/subsystems-1/workflow/actions/Show Message.php b/framework/core/subsystems-1/workflow/actions/Show Message.php deleted file mode 100644 index 8d69557878..0000000000 --- a/framework/core/subsystems-1/workflow/actions/Show Message.php +++ /dev/null @@ -1,25 +0,0 @@ -parameters; -echo "

"; - -?> \ No newline at end of file diff --git a/framework/core/subsystems/expLang.php b/framework/core/subsystems/expLang.php index 5c6d57d850..02dfecf899 100755 --- a/framework/core/subsystems/expLang.php +++ b/framework/core/subsystems/expLang.php @@ -17,22 +17,42 @@ */ /** @define "BASE" "../../.." */ - /** * This is the class expLang * * @subpackage Core-Subsytems * @package Framework */ - class expLang { - static function loadLang() { - if (!defined('LANGUAGE')) return false; - - global $cur_lang, $default_lang, $defualt_lang_file; - $defualt_lang_file = BASE."framework/core/lang/English - US.php"; + public static function loadLang() { + if (!defined('LANGUAGE')) define('LANGUAGE', 'English - US'); + if (!defined('LANG')) { // LANG is needed by YUI + if ((is_readable(BASE . 'framework/core/lang/' . LANGUAGE . '.php')) && (LANGUAGE != 'English - US')) { + define('LANG', LANGUAGE); // Lang file exists. + } else { + define('LANG', 'English - US'); // Fallback to 'eng_US' if language file not present. + } + } + + if (file_exists(BASE . 'framework/core/lang/' . LANGUAGE.'.info.php')) { + $info = include(BASE . 'framework/core/lang/' . LANGUAGE.'.info.php'); + setlocale(LC_ALL, $info['locale']); + //DEPRECATED: we no longer use views for i18n + define('DEFAULT_VIEW', $info['default_view']); + // For anything related to character sets: + define('LANG_CHARSET', $info['charset']); + } else { + //DEPRECATED: we no longer use views for i18n + define('DEFAULT_VIEW', 'Default'); + // For anything related to character sets: + define('LANG_CHARSET', 'UTF-8'); + } + + global $cur_lang, $default_lang, $target_lang_file; $default_lang = include(BASE."framework/core/lang/English - US.php"); + //TODO the $default_lang_file should probably be the 'target' language? + $target_lang_file = BASE."framework/core/lang/English - US.php"; $cur_lang = include(BASE."framework/core/lang/".LANGUAGE.".php"); } @@ -46,10 +66,12 @@ public static function gettext($str) { } public function writeTemplate($str) { - global $default_lang, $defualt_lang_file; + global $default_lang, $target_lang_file; //!array_key_exists($str,$default_lang) + //TODO Probably should be able to build a language file even if you are using a non-English language + //TODO E.g., be able to dump all the new english stuff in the other language which isn't defined yet if (DEVELOPMENT && (defined("WRITE_LANG_TEMPLATE") && WRITE_LANG_TEMPLATE!=0) && LANGUAGE=="English - US") { - $fp = fopen($defualt_lang_file, 'w+') or die("I could not open $filename."); + $fp = fopen($target_lang_file, 'w+') or die("I could not open $target_lang_file."); $default_lang[$str] = $str; ksort($default_lang); fwrite($fp," diff --git a/framework/core/subsystems/expSession.php b/framework/core/subsystems/expSession.php index 965f34333d..ad58baeb45 100755 --- a/framework/core/subsystems/expSession.php +++ b/framework/core/subsystems/expSession.php @@ -37,7 +37,7 @@ class expSession { public static function set($var, $val) { $_SESSION[SYS_SESSION_KEY]['vars'][$var] = $val; } - + /** exdoc * This retrieves the value of a persistent session variable. Returns * null if the variable is not set in the session, or the value of the stored variable. @@ -46,6 +46,7 @@ public static function set($var, $val) { * cannot be changed using this call (for security / sanity reason) * * @param string $var The name of the variable to retrieve. + * @return mixed * @node Subsystems:Sessions */ public static function get($var) { diff --git a/framework/core/views/_maintenance.tpl b/framework/core/views/_maintenance.tpl index 625cb6310b..7753390e60 100644 --- a/framework/core/views/_maintenance.tpl +++ b/framework/core/views/_maintenance.tpl @@ -2,7 +2,7 @@ - {$smarty.const.SITE_TITLE} :: {$_TR.down} + {$smarty.const.SITE_TITLE} :: {'Down for Maintenance.'|gettext} *} - {$_TR.hier}
+ {'Site Hierarchy'|gettext}
{foreach from=$sections item=section}
depth}px"> @@ -41,7 +41,7 @@
{if $haveStandalones}


- {$_TR.pages}
+ {'Standalone Pages'|gettext}
{foreach from=$standalones item=section} diff --git a/framework/modules-1/simplepollmodule/views/_manageQuestions.tpl b/framework/modules-1/simplepollmodule/views/_manageQuestions.tpl index 85c92e9d05..bc824ee9cd 100644 --- a/framework/modules-1/simplepollmodule/views/_manageQuestions.tpl +++ b/framework/modules-1/simplepollmodule/views/_manageQuestions.tpl @@ -22,8 +22,8 @@ {else} Activate {/if} - {$_TR.alt_edit} - {$_TR.alt_delete} + {'Edit'|gettext} + 'Delete'|gettext} {foreachelse} diff --git a/framework/modules/administration/controllers/administrationController.php b/framework/modules/administration/controllers/administrationController.php index a88641f19a..2d01574939 100755 --- a/framework/modules/administration/controllers/administrationController.php +++ b/framework/modules/administration/controllers/administrationController.php @@ -353,7 +353,6 @@ public function toolbar() { $sorted = array(); foreach($menu as $m) $sorted[] = $m; - //slingbar position if (expSession::exists("slingbar_top")){ $top = expSession::get("slingbar_top"); @@ -361,7 +360,6 @@ public function toolbar() { $top = SLINGBAR_TOP; } - assign_to_template(array('menu'=>json_encode($sorted),"top"=>$top)); } @@ -379,7 +377,6 @@ public function test_smtp() { } public function toggle_minify() { -// if (!defined('SYS_CONFIG')) include_once(BASE.'framework/core/subsystems-1/config.php'); include_once(BASE.'framework/core/subsystems-1/config.php'); $value = (MINIFY == 1) ? 0 : 1; exponent_config_change('MINIFY', $value); @@ -389,7 +386,6 @@ public function toggle_minify() { } public function toggle_dev() { -// if (!defined('SYS_CONFIG')) include_once(BASE.'framework/core/subsystems-1/config.php'); include_once(BASE.'framework/core/subsystems-1/config.php'); $value = (DEVELOPMENT == 1) ? 0 : 1; exponent_config_change('DEVELOPMENT', $value); @@ -400,7 +396,6 @@ public function toggle_dev() { } public function toggle_maintenance() { -// if (!defined('SYS_CONFIG')) include_once(BASE.'framework/core/subsystems-1/config.php'); include_once(BASE.'framework/core/subsystems-1/config.php'); $value = (MAINTENANCE_MODE == 1) ? 0 : 1; exponent_config_change('MAINTENANCE_MODE', $value); @@ -438,11 +433,7 @@ public function clear_css_cache() { } public function clear_image_cache() { -// if (!defined('SYS_FILES')) include_once(BASE.'framework/core/subsystems-1/files.php'); -// include_once(BASE.'framework/core/subsystems-1/files.php'); expFile::removeFilesInDirectory(BASE.'tmp/pixidou'); // alt location for pixidou cache -// expFile::removeFilesInDirectory(BASE.'framework/modules/pixidou/images'); // location for pixidou cache - // phpThumb cache includes subfolders if (file_exists(BASE.'tmp/img_cache')) expFile::removeFilesInDirectory(BASE.'tmp/img_cache'); $message = "Image/Pixidou Cache has been cleared" ; flash('message',$message); @@ -450,8 +441,6 @@ public function clear_image_cache() { } public function clear_rss_cache() { -// if (!defined('SYS_FILES')) include_once(BASE.'framework/core/subsystems-1/files.php'); -// include_once(BASE.'framework/core/subsystems-1/files.php'); expFile::removeFilesInDirectory(BASE.'tmp/rsscache'); $message = "RSS/Podcast Cache has been cleared" ; flash('message',$message); @@ -459,12 +448,9 @@ public function clear_rss_cache() { } public function clear_all_caches() { -// if (!defined('SYS_FILES')) include_once(BASE.'framework/core/subsystems-1/files.php'); -// include_once(BASE.'framework/core/subsystems-1/files.php'); expTheme::removeSmartyCache(); expTheme::removeCss(); expFile::removeFilesInDirectory(BASE.'tmp/pixidou'); // alt location for pixidou cache -// expFile::removeFilesInDirectory(BASE.'framework/modules/pixidou/images'); // location for pixidou cache if (file_exists(BASE.'tmp/img_cache')) expFile::removeFilesInDirectory(BASE.'tmp/img_cache'); expFile::removeFilesInDirectory(BASE.'tmp/rsscache'); $message = "All the System Caches have been cleared" ; @@ -473,9 +459,7 @@ public function clear_all_caches() { } public function upload_extension() { -// if (!defined('SYS_FORMS')) require_once(BASE.'framework/core/subsystems-1/forms.php'); require_once(BASE.'framework/core/subsystems-1/forms.php'); -// exponent_forms_initialize(); $form = new form(); $form->register(null,'',new htmlcontrol(exponent_core_maxUploadSizeMessage())); $form->register('mod_archive','Extension Archive',new uploadcontrol()); @@ -527,14 +511,10 @@ public function install_extension() { if ($ext == '') { echo gt('Unknown archive format. Archives must either be regular ZIP files, TAR files, Gzipped Tarballs, or Bzipped Tarballs.').'
'; } else { -// if (!defined('SYS_FILES')) require_once(BASE.'framework/core/subsystems-1/files.php'); -// require_once(BASE.'framework/core/subsystems-1/files.php'); // Look for stale sessid directories: $sessid = session_id(); -// if (file_exists(BASE."extensionuploads/$sessid") && is_dir(BASE."extensionuploads/$sessid")) expFile::removeDirectory("extensionuploads/$sessid"); if (file_exists(BASE."tmp/extensionuploads/$sessid") && is_dir(BASE."tmp/extensionuploads/$sessid")) expFile::removeDirectory("tmp/extensionuploads/$sessid"); -// $return = expFile::makeDirectory("extensionuploads/$sessid"); $return = expFile::makeDirectory("tmp/extensionuploads/$sessid"); if ($return != SYS_FILES_SUCCESS) { switch ($return) { @@ -551,7 +531,6 @@ public function install_extension() { } } -// $dest = BASE."extensionuploads/$sessid/archive$ext"; $dest = BASE."tmp/extensionuploads/$sessid/archive$ext"; move_uploaded_file($_FILES['mod_archive']['tmp_name'],$dest); @@ -615,7 +594,6 @@ public function manage_themes() { } public function switch_themes() { -// if (!defined('SYS_CONFIG')) include_once(BASE.'framework/core/subsystems-1/config.php'); include_once(BASE.'framework/core/subsystems-1/config.php'); exponent_config_change('DISPLAY_THEME_REAL', $this->params['theme']); @@ -647,7 +625,6 @@ public function switch_themes() { public function configure_site () { // little glue to help things move along -// if (!defined('SYS_CONFIG')) require_once(BASE.'framework/core/subsystems-1/config.php'); require_once(BASE.'framework/core/subsystems-1/config.php'); // TYPES OF ANTISPAM CONTROLS... CURRENTLY ONLY ReCAPTCHA @@ -687,17 +664,9 @@ public function configure_site () { uasort($themes,'strnatcmp'); // Available Languages - $langs = array(); - if (is_readable(BASE.'framework/core/lang')) { - $lang_dh = opendir(BASE.'framework/core/lang'); - while (($lang_file = readdir($lang_dh)) !== false) { - if (substr($lang_file, -4) == '.php') { - $langs[str_replace(".php","",$lang_file)] = str_replace(".php","",$lang_file); - } - } - } - ksort($langs); - + $langs = expLang::langList(); +// ksort($langs); + // attribution $attribution = array('firstlast'=>'John Doe','lastfirst'=>'Doe, John','first'=>'John','username'=>'jdoe'); @@ -736,7 +705,6 @@ public function configure_site () { } public function update_siteconfig () { -// if (!defined('SYS_CONFIG')) include_once(BASE.'framework/core/subsystems-1/config.php'); include_once(BASE.'framework/core/subsystems-1/config.php'); foreach ($this->params['sc'] as $key => $value) { diff --git a/framework/modules/administration/views/administration/install_tables.tpl b/framework/modules/administration/views/administration/install_tables.tpl index 3779724e5a..eea5e19434 100644 --- a/framework/modules/administration/views/administration/install_tables.tpl +++ b/framework/modules/administration/views/administration/install_tables.tpl @@ -21,7 +21,7 @@

Installing and Upgrading Database Tables

- {$_TR.form_header} + {'Exponent is currently updating existing tables in its database, and installing new tables that it needs. Shown below is a summary of the actions that occured.'|gettext}

diff --git a/framework/modules-1/navigationmodule/views/_manager_hierarchy.tpl b/framework/modules-1/navigationmodule/views/_manager_hierarchy.tpl index b54b653979..b02bd42bef 100644 --- a/framework/modules-1/navigationmodule/views/_manager_hierarchy.tpl +++ b/framework/modules-1/navigationmodule/views/_manager_hierarchy.tpl @@ -32,13 +32,13 @@ -

{$_TR.form_title}

+

{'Manage Menu Hierarchy Pages'|gettext}

-

{$_TR.form_header}

+

{'Drag and drop tree items to re-order your site\'s hierarchy (main menu). Right click on any tree item for a context menu of options for that item.'|gettext}

{permissions} {if $user->isAdmin()} - {$_TR.new_top_level} + {'Create a New Top Level Page'|gettext} {/if} {/permissions} diff --git a/framework/modules-1/navigationmodule/views/_manager_pagesets.tpl b/framework/modules-1/navigationmodule/views/_manager_pagesets.tpl index 8f0d921418..df35378b87 100644 --- a/framework/modules-1/navigationmodule/views/_manager_pagesets.tpl +++ b/framework/modules-1/navigationmodule/views/_manager_pagesets.tpl @@ -15,15 +15,15 @@ diff --git a/framework/modules-1/navigationmodule/views/_manager_standalone.tpl b/framework/modules-1/navigationmodule/views/_manager_standalone.tpl index aed8d6ba66..ea1c18fbca 100644 --- a/framework/modules-1/navigationmodule/views/_manager_standalone.tpl +++ b/framework/modules-1/navigationmodule/views/_manager_standalone.tpl @@ -24,18 +24,18 @@ -

{$_TR.form_title}

+

{'Manage Standalone Pages'|gettext}

-

{$_TR.form_header}

- {$_TR.new} +

{'Standalone pages do not appear in the site hierarchy, but still have their own content and act just like other pages.'|gettext}

+ {'Create a New Standalone Page'|gettext} - - - + + + @@ -49,14 +49,14 @@ {$section->name}  {/if} {foreachelse} - + {/foreach}
{$_TR.page_title}{$_TR.actions}{$_TR.permissions}{'Page Title'|gettext}{'Actions'|gettext}{'Permissions'|gettext}
- {icon class=edit action=edit_contentpage record=$section title=$_TR.alt_edit} - {icon action=delete record=$section title=$_TR.alt_delete onclick="return confirm('`$_TR.delete_confirm`');"} + {icon class=edit action=edit_contentpage record=$section title='Edit'|gettext} + {icon action=delete record=$section title='Delete'|gettext onclick="return confirm('`'Delete'|gettext`');"} - {icon int=$section->id action=userperms _common=1 img=userperms.png title=$_TR.alt_userperm text="User"} - {icon int=$section->id action=groupperms _common=1 img=groupperms.png title=$_TR.alt_groupperm text="Group"} + {icon int=$section->id action=userperms _common=1 img=userperms.png title='Assign user permissions for this page'|gettext text="User"} + {icon int=$section->id action=groupperms _common=1 img=groupperms.png title='Assign group permissions for this page'|gettext text="Group"}
{$_TR.no_pages}
{'No standalone pages found'|gettext}
diff --git a/framework/modules-1/navigationmodule/views/_move_standalone.tpl b/framework/modules-1/navigationmodule/views/_move_standalone.tpl index 4f9303f3cb..53f663b5fe 100644 --- a/framework/modules-1/navigationmodule/views/_move_standalone.tpl +++ b/framework/modules-1/navigationmodule/views/_move_standalone.tpl @@ -13,6 +13,6 @@ * GPL: http://www.gnu.org/licenses/gpl.txt * *} -
{$_TR.form_title}
-
{$_TR.form_header}
+
{'Move Standalone Page'|gettext}
+
{'Select the standalone page you wish to move into the Site Hierarchy, and click "Save"'|gettext}
{$form_html} \ No newline at end of file diff --git a/framework/modules-1/navigationmodule/views/_view_template.tpl b/framework/modules-1/navigationmodule/views/_view_template.tpl index d93a0dbb95..8a39200b9e 100644 --- a/framework/modules-1/navigationmodule/views/_view_template.tpl +++ b/framework/modules-1/navigationmodule/views/_view_template.tpl @@ -17,11 +17,11 @@
- + {foreach from=$subs item=sub} {math equation="x+1" x=$sub->rank assign=nextrank} @@ -31,19 +31,19 @@ {$sub->name} @@ -51,4 +51,4 @@
<{$_TR.name}><{'Name of Section'|gettext}> -[ {$_TR.subpage} ] -[ {$_TR.properties} ] -[ {$_TR.content} ] +[ {'Add Subpage'|gettext} ] +[ {'Properties'|gettext} ] +[ {'Page Content'|gettext} ] -[ {$_TR.subpage} ] -[ {$_TR.properties} ] -[ {$_TR.content} ] -[ {$_TR.delete} ] +[ {'Add Subpage'|gettext} ] +[ {'Properties'|gettext} ] +[ {'Page Content'|gettext} ] +[ {'Delete'|gettext} ] {if $sub->last == 0} - {$_TR.alt_down} + {'Move Item Down'|gettext} {else} - {$_TR.alt_down_disabled} + {''|gettext} {/if} {if $sub->first == 0} - {$_TR.alt_up} + {'Move Item Up'|gettext} {else} - {$_TR.alt_up_disabled} + {''|gettext} {/if}


-{$_TR.back} +{'Back To Manager'|gettext} diff --git a/framework/modules-1/simplepollmodule/actions/manage_question.php b/framework/modules-1/simplepollmodule/actions/manage_question.php index 0ecbdede35..4a9bc18e2c 100644 --- a/framework/modules-1/simplepollmodule/actions/manage_question.php +++ b/framework/modules-1/simplepollmodule/actions/manage_question.php @@ -47,8 +47,6 @@ expHistory::flowSet(SYS_FLOW_PROTECTED,SYS_FLOW_ACTION); $answers = $db->selectObjects('poll_answer','question_id='.$question->id); -// if (!defined('SYS_SORTING')) require_once(BASE.'framework/core/subsystems-1/sorting.php'); -// require_once(BASE.'framework/core/subsystems-1/sorting.php'); // uasort($answers,'exponent_sorting_byRankAscending'); $answers = expSorter::sort(array('array'=>$answers,'sortby'=>'rank', 'order'=>'ASC', 'type'=>'a')); diff --git a/framework/modules-1/simplepollmodule/actions/results.php b/framework/modules-1/simplepollmodule/actions/results.php index 5c6937bbb8..005228e9b8 100644 --- a/framework/modules-1/simplepollmodule/actions/results.php +++ b/framework/modules-1/simplepollmodule/actions/results.php @@ -47,8 +47,6 @@ $total += $answers[$i]->vote_count; } -// if (!defined('SYS_SORTING')) require_once(BASE.'framework/core/subsystems-1/sorting.php'); -// require_once(BASE.'framework/core/subsystems-1/sorting.php'); // if (!function_exists('exponent_sorting_byVoteCountDescending')) { // function exponent_sorting_byVoteCountDescending($a,$b) { // return ($a->vote_count > $b->vote_count ? -1 : 1); diff --git a/framework/modules-1/simplepollmodule/class.php b/framework/modules-1/simplepollmodule/class.php index 76d54f64e7..3b2b3bb959 100644 --- a/framework/modules-1/simplepollmodule/class.php +++ b/framework/modules-1/simplepollmodule/class.php @@ -59,8 +59,6 @@ function show($view,$loc = null, $title = '') { if ($question) { $answers = $db->selectObjects('poll_answer','question_id='.$question->id); } -// if (!defined('SYS_SORTING')) require_once(BASE.'framework/core/subsystems-1/sorting.php'); -// require_once(BASE.'framework/core/subsystems-1/sorting.php'); // usort($answers,'exponent_sorting_byRankAscending'); $answers = expSorter::sort(array('array'=>$answers,'sortby'=>'rank', 'order'=>'ASC')); diff --git a/framework/modules-1/simplepollmodule/views/_manageQuestion.tpl b/framework/modules-1/simplepollmodule/views/_manageQuestion.tpl index cac0cc1b3a..9b6bfd7c53 100644 --- a/framework/modules-1/simplepollmodule/views/_manageQuestion.tpl +++ b/framework/modules-1/simplepollmodule/views/_manageQuestion.tpl @@ -37,20 +37,20 @@ {$answer->answer}
{if $permissions.manage_answer == 1} - {$_TR.alt_edit} - {$_TR.alt_delete} + {'Edit'|gettext} + {'Delete'|gettext} {if $smarty.foreach.loop.first} - {$_TR.alt_up_disabled} + {''|gettext} {else} {math assign=prev equation="x-1" x=$answer->rank} - {$_TR.alt_up} + {'Move Item Up'|gettext} {/if} {if $smarty.foreach.loop.last} - {$_TR.alt_down_disabled} + {''|gettext} {else} {math assign=next equation="x+1" x=$answer->rank} - {$_TR.alt_down} + {'Move Item Down'|gettext} {/if} {/if}
No questions found
diff --git a/framework/modules/administration/views/administration/optimize_database.tpl b/framework/modules/administration/views/administration/optimize_database.tpl index 3e60cf493a..af1c9943e8 100644 --- a/framework/modules/administration/views/administration/optimize_database.tpl +++ b/framework/modules/administration/views/administration/optimize_database.tpl @@ -30,7 +30,7 @@ {foreach from=$before key=table item=info} - + {/foreach} diff --git a/framework/modules/administration/views/administration/quicklinks_Administration_Links.tpl b/framework/modules/administration/views/administration/quicklinks_Administration_Links.tpl index 8ef18667c6..b76f147a9b 100755 --- a/framework/modules/administration/views/administration/quicklinks_Administration_Links.tpl +++ b/framework/modules/administration/views/administration/quicklinks_Administration_Links.tpl @@ -17,16 +17,16 @@ {if $user->id != '' && $user->id != 0} diff --git a/framework/modules/blog/controllers/blogController.php b/framework/modules/blog/controllers/blogController.php index 829b5c8ee5..11a68f7493 100755 --- a/framework/modules/blog/controllers/blogController.php +++ b/framework/modules/blog/controllers/blogController.php @@ -258,7 +258,7 @@ function metainfo() { // look up the record. if (isset($_REQUEST['author'])) { // set the meta info - $u = exponent_users_getUserByName($_REQUEST['author']); + $u = user::getUserByName($_REQUEST['author']); switch (DISPLAY_ATTRIBUTION) { case "firstlast": diff --git a/framework/modules/ecommerce/billingcalculators/cash.php b/framework/modules/ecommerce/billingcalculators/cash.php index a80aae7e7c..70ab82de9e 100755 --- a/framework/modules/ecommerce/billingcalculators/cash.php +++ b/framework/modules/ecommerce/billingcalculators/cash.php @@ -23,16 +23,13 @@ function post_process() { //Config Form function form($config_object) { -// if (!defined("SYS_FORMS")) include_once(BASE."framework/core/subsystems-1/forms.php"); include_once(BASE."framework/core/subsystems-1/forms.php"); -// exponent_forms_initialize(); $form = new form(); if (!$config_object) { $config_object->give_change = true; } $form->register("give_change","Give Change?",new checkboxcontrol($config_object->give_change)); $form->register("submit","",new buttongroupcontrol("Save","","Cancel")); -// exponent_forms_cleanup(); return $form->toHTML(); } @@ -44,15 +41,12 @@ function update($values, $config_object) { //Form for user input function userForm($config_object=null, $user_data=null) { -// if (!defined("SYS_FORMS")) include_once(BASE."framework/core/subsystems-1/forms.php"); include_once(BASE."framework/core/subsystems-1/forms.php"); -// exponent_forms_initialize(); $form = new form(); $htmlinfo = "You may place your order and pay with a check or money order. If paying by check, your order will be held util we receive the check and it clears our bank account. Money order orders will be processed upon our receipt of the money order.

"; $form->register(uniqid(""),"", new htmlcontrol($htmlinfo)); $form->register("cash_amount","Cash Amount:",new textcontrol()); -// exponent_forms_cleanup(); - return $form->toHTML(); + return $form->toHTML(); } //process user input. This function should return an object of the user input. diff --git a/framework/modules/ecommerce/billingcalculators/passthru.php b/framework/modules/ecommerce/billingcalculators/passthru.php index 1db3f0d0c4..f2fa114974 100755 --- a/framework/modules/ecommerce/billingcalculators/passthru.php +++ b/framework/modules/ecommerce/billingcalculators/passthru.php @@ -24,16 +24,13 @@ function post_process() { //Config Form function form($config_object) { -// if (!defined("SYS_FORMS")) include_once(BASE."framework/core/subsystems-1/forms.php"); include_once(BASE."framework/core/subsystems-1/forms.php"); -// exponent_forms_initialize(); $form = new form(); if (!$config_object) { $config_object->give_change = true; } $form->register("give_change","Give Change?",new checkboxcontrol($config_object->give_change)); $form->register("submit","",new buttongroupcontrol("Save","","Cancel")); -// exponent_forms_cleanup(); return $form->toHTML(); } @@ -45,15 +42,12 @@ function update($values, $config_object) { //Form for user input function userForm($config_object=null, $user_data=null) { -// if (!defined("SYS_FORMS")) include_once(BASE."framework/core/subsystems-1/forms.php"); include_once(BASE."framework/core/subsystems-1/forms.php"); -// exponent_forms_initialize(); $form = new form(); $htmlinfo = "You may place your order and pay with a check or money order. If paying by check, your order will be held util we receive the check and it clears our bank account. Money order orders will be processed upon our receipt of the money order.

"; $form->register(uniqid(""),"", new htmlcontrol($htmlinfo)); $form->register("cash_amount","Cash Amount:",new textcontrol()); -// exponent_forms_cleanup(); - return $form->toHTML(); + return $form->toHTML(); } //process user input. This function should return an object of the user input. diff --git a/framework/modules/ecommerce/controllers/ecomconfigController.php b/framework/modules/ecommerce/controllers/ecomconfigController.php index 00497f72f5..e5b2c1562d 100755 --- a/framework/modules/ecommerce/controllers/ecomconfigController.php +++ b/framework/modules/ecommerce/controllers/ecomconfigController.php @@ -150,7 +150,7 @@ public function edit_discount() { // foreach ($group->find() as $g){ //this is a workaround for older code. Use the previous line if possible: include_once(BASE.'framework/core/subsystems-1/users.php'); - $allGroups = exponent_users_getAllGroups(); + $allGroups = user::getAllGroups(); if (count($allGroups)) { foreach ($allGroups as $g) @@ -234,7 +234,7 @@ public function update_promocode() { public function manage_groupdiscounts() { global $db; expHistory::set('managable', $this->params); - $groups = exponent_users_getAllGroups(); + $groups = user::getAllGroups(); $discounts = $db->selectObjects('discounts'); $group_discounts = $db->selectObjects('groupdiscounts', null, 'rank'); assign_to_template(array('groups'=>$groups,'discounts'=>$discounts,'group_discounts'=>$group_discounts)); diff --git a/framework/modules/ecommerce/controllers/storeController.php b/framework/modules/ecommerce/controllers/storeController.php index 9531633809..ad89895050 100755 --- a/framework/modules/ecommerce/controllers/storeController.php +++ b/framework/modules/ecommerce/controllers/storeController.php @@ -250,10 +250,7 @@ function events_calendar() { expHistory::set('viewable', $this->params); -// if (!defined("SYS_DATETIME")) include_once(BASE."framework/core/subsystems-1/datetime.php"); include_once(BASE."framework/core/subsystems-1/datetime.php"); -// if (!defined('SYS_SORTING')) include_once(BASE.'framework/core/subsystems-1/sorting.php'); -// include_once(BASE.'framework/core/subsystems-1/sorting.php'); $time = isset($this->params['time']) ? $this->params['time'] : time(); assign_to_template(array('time'=>$time)); @@ -322,8 +319,6 @@ function events_calendar() { * Helper function for the Calendar view */ function _getEventsForDates($edates,$sort_asc = true) { -// if (!defined('SYS_SORTING')) include_once(BASE.'framework/core/subsystems-1/sorting.php'); -// include_once(BASE.'framework/core/subsystems-1/sorting.php'); // if ($sort_asc && !function_exists('exponent_sorting_byEventStartAscending')) { // function exponent_sorting_byEventStartAscending($a,$b) { // return ($a->eventstart < $b->eventstart ? 1 : -1); diff --git a/framework/modules/ecommerce/products/datatypes/product.php b/framework/modules/ecommerce/products/datatypes/product.php index 7e06ae8e38..4d114b3ac2 100755 --- a/framework/modules/ecommerce/products/datatypes/product.php +++ b/framework/modules/ecommerce/products/datatypes/product.php @@ -683,9 +683,6 @@ public function addContentToSearch() //only add top level products, not children if ($this->parent_id != 0 ) return true; -// if (!defined('SYS_SEARCH')) include_once(BASE.'framework/core/subsystems-1/search.php'); -// include_once(BASE.'framework/core/subsystems-1/search.php'); - $exists = $db->selectObject('search',"category='Products' AND ref_module='store' AND original_id = " . $this->id); $search = null; diff --git a/framework/modules/ecommerce/products/views/eventregistration/show.tpl b/framework/modules/ecommerce/products/views/eventregistration/show.tpl index 0c5c823715..6df559e190 100755 --- a/framework/modules/ecommerce/products/views/eventregistration/show.tpl +++ b/framework/modules/ecommerce/products/views/eventregistration/show.tpl @@ -28,8 +28,8 @@ {permissions level=$smarty.const.UILEVEL_PERMISSIONS}
{if $permissions.configure == 1 or $permissions.administrate == 1} - - {$_TR.alt_edit} + + { {icon action=delete record=$product title="Delete this product"} {/if} diff --git a/framework/modules/ecommerce/products/views/eventregistration/storeListing.tpl b/framework/modules/ecommerce/products/views/eventregistration/storeListing.tpl index 89c2f08774..3ba540994f 100755 --- a/framework/modules/ecommerce/products/views/eventregistration/storeListing.tpl +++ b/framework/modules/ecommerce/products/views/eventregistration/storeListing.tpl @@ -30,8 +30,8 @@ {permissions level=$smarty.const.UILEVEL_PERMISSIONS}
{if $permissions.configure == 1 or $permissions.administrate == 1} - - {$_TR.alt_edit} + + { {icon action=delete record=$listing title="Delete this product"} {/if} diff --git a/framework/modules/ecommerce/products/views/giftcard/storeListing.tpl b/framework/modules/ecommerce/products/views/giftcard/storeListing.tpl index 734d9d2180..7d83ce4743 100755 --- a/framework/modules/ecommerce/products/views/giftcard/storeListing.tpl +++ b/framework/modules/ecommerce/products/views/giftcard/storeListing.tpl @@ -40,8 +40,8 @@ {permissions level=$smarty.const.UILEVEL_PERMISSIONS}
{if $permissions.configure == 1 or $permissions.administrate == 1} - - {$_TR.alt_edit} + + { {icon action=delete record=$listing title="Delete this product"} {/if} diff --git a/framework/modules/ecommerce/views/store/events_calendar.tpl b/framework/modules/ecommerce/views/store/events_calendar.tpl index 5826c22619..338bb84eef 100755 --- a/framework/modules/ecommerce/views/store/events_calendar.tpl +++ b/framework/modules/ecommerce/views/store/events_calendar.tpl @@ -19,17 +19,17 @@

{if $moduletitle}{$moduletitle}{/if}

-
{$table}{math format="%.3f" equation="x / 1024" x=$info->data_total} {$_TR.kb}{math format="%.3f" equation="x / 1024" x=$info->data_total} {'kb'|gettext}
- +
« {$now|format_date:"%B %Y"} »
+ - - - - - - - + + + + + + + {math equation="x-86400" x=$now assign=dayts} {foreach from=$monthly item=week key=weeknum} diff --git a/framework/modules/migration/views/migration/configure.tpl b/framework/modules/migration/views/migration/configure.tpl index fc9aa29e27..4bc89b1eb7 100755 --- a/framework/modules/migration/views/migration/configure.tpl +++ b/framework/modules/migration/views/migration/configure.tpl @@ -35,5 +35,6 @@ {control type="text" name="prefix" label="Exponent Table Prefix" value=$config.prefix|default:'exponent'} {control type=buttongroup submit="Save Config" cancel="Cancel"} {/form} - Next Step -> Migrate Users & Groups + {br}
{br} + Next Step -> Migrate Users & Groups \ No newline at end of file diff --git a/framework/modules/migration/views/migration/manage_content.tpl b/framework/modules/migration/views/migration/manage_content.tpl index 4fbe2ba46d..bf5871ca5c 100755 --- a/framework/modules/migration/views/migration/manage_content.tpl +++ b/framework/modules/migration/views/migration/manage_content.tpl @@ -60,5 +60,6 @@ {control type="checkbox" name="wipe_content" label="Erase all current content before import?" value=1 checked=false} {control type="buttongroup" submit="Migrate Content" cancel="Cancel"} {/form} -
This is the Final Migration Step
+ {br}
{br} +
This is the Final Migration Step
\ No newline at end of file diff --git a/framework/modules/migration/views/migration/manage_files.tpl b/framework/modules/migration/views/migration/manage_files.tpl index 27a19398ea..e5e7f5bb81 100755 --- a/framework/modules/migration/views/migration/manage_files.tpl +++ b/framework/modules/migration/views/migration/manage_files.tpl @@ -38,5 +38,6 @@
« {$now|format_date:"%B %Y"} »
{$_TR.sunday}{$_TR.monday}{$_TR.tuesday}{$_TR.wednesday}{$_TR.thursday}{$_TR.friday}{$_TR.saturday}{'Sunday'|gettext}{'Monday'|gettext}{'Tuesday'|gettext}{'Tuesday'|gettext}{'Thursday'|gettext}{Friday|gettext}{'Saturday'|gettext}
{control type="buttongroup" submit="Migrate Files" cancel="Cancel"} {/form} - Next Step -> Migrate Content + {br}
{br} + Next Step -> Migrate Content \ No newline at end of file diff --git a/framework/modules/migration/views/migration/manage_pages.tpl b/framework/modules/migration/views/migration/manage_pages.tpl index 506467c50a..76978d7146 100755 --- a/framework/modules/migration/views/migration/manage_pages.tpl +++ b/framework/modules/migration/views/migration/manage_pages.tpl @@ -69,5 +69,6 @@ {control type="checkbox" name="wipe_pages" label="Erase all current pages and then try again?" value=1 checked=false} {control type="buttongroup" submit="Migrate Pages" cancel="Cancel"} {/form} - Next Step -> Migrate Files + {br}
{br} + Next Step -> Migrate Files \ No newline at end of file diff --git a/framework/modules/migration/views/migration/manage_users.tpl b/framework/modules/migration/views/migration/manage_users.tpl index c6183c7216..291b720062 100755 --- a/framework/modules/migration/views/migration/manage_users.tpl +++ b/framework/modules/migration/views/migration/manage_users.tpl @@ -125,5 +125,6 @@ {control type="buttongroup" submit="Migrate Users/Groups" cancel="Cancel"} {/form} - Next Step -> Migrate Pages + {br}
{br} + Next Step -> Migrate Pages \ No newline at end of file diff --git a/framework/modules/migration/views/migration/migrate_content.tpl b/framework/modules/migration/views/migration/migrate_content.tpl index 1ba5533e9f..b97868a00b 100755 --- a/framework/modules/migration/views/migration/migrate_content.tpl +++ b/framework/modules/migration/views/migration/migrate_content.tpl @@ -47,5 +47,6 @@ {/foreach} -
This is the Final Migration Step
+ {br}
{br} +
This is the Final Migration Step
\ No newline at end of file diff --git a/framework/modules/migration/views/migration/migrate_files.tpl b/framework/modules/migration/views/migration/migrate_files.tpl index 876fcc6fb5..50ca170137 100755 --- a/framework/modules/migration/views/migration/migrate_files.tpl +++ b/framework/modules/migration/views/migration/migrate_files.tpl @@ -68,5 +68,6 @@ {/foreach} - Next Step -> Migrate Content + {br}
{br} + Next Step -> Migrate Content \ No newline at end of file diff --git a/framework/modules/motd/controllers/motdController.php b/framework/modules/motd/controllers/motdController.php index 13f93b8a4a..e57d52325c 100755 --- a/framework/modules/motd/controllers/motdController.php +++ b/framework/modules/motd/controllers/motdController.php @@ -58,7 +58,6 @@ function showall() { } function update() { -// if (!defined("SYS_DATETIME")) include_once(BASE."framework/core/subsystems-1/datetime.php"); include_once(BASE."framework/core/subsystems-1/datetime.php"); $timestamp = mktime(0, 0, 0, $this->params['month'], 1); $endday = exponent_datetime_endOfMonthDay($timestamp); diff --git a/framework/modules/news/views/news/showall.tpl b/framework/modules/news/views/news/showall.tpl index f1e0b093a8..e6dde4fd18 100755 --- a/framework/modules/news/views/news/showall.tpl +++ b/framework/modules/news/views/news/showall.tpl @@ -23,10 +23,10 @@ {permissions}
{if $permissions.create == true || $permissions.edit == true} - {$_TR.create_news|default:"Add a news post"} + {"Add a news post"|gettext} {/if} {if $permissions.showUnpublished == 1 } - | {$_TR.view_expired|default:"View Expired/Unpublished News"} + | {"View Expired/Unpublished News"|gettext} {/if}
{/permissions} diff --git a/framework/modules/users/controllers/usersController.php b/framework/modules/users/controllers/usersController.php index 9a7ff5a02a..91610d8664 100755 --- a/framework/modules/users/controllers/usersController.php +++ b/framework/modules/users/controllers/usersController.php @@ -242,7 +242,6 @@ public function manage_sessions() { $db->delete('sessionticket','last_active < ' . (time() - SESSION_TIMEOUT)); } -// if (!defined('SYS_DATETIME')) require_once(BASE.'framework/core/subsystems-1/datetime.php'); require_once(BASE.'framework/core/subsystems-1/datetime.php'); if (isset($_GET['id']) && $_GET['id'] == 0) { @@ -560,7 +559,6 @@ public function edit_group() { public function manage_group_memberships() { global $db, $user; expHistory::set('manageable', $this->params); -// if (!defined('SYS_USERS')) require_once(BASE.'framework/core/subsystems-1/users.php'); require_once(BASE.'framework/core/subsystems-1/users.php'); $memb = $db->selectObject('groupmembership','member_id='.$user->id.' AND group_id='.$this->params['id'].' AND is_admin=1'); @@ -570,7 +568,7 @@ public function manage_group_memberships() { if (exponent_permissions_check('user_management',exponent_core_makeLocation('administrationmodule'))) $perm_level = 2; $group = $db->selectObject('group','id='.$this->params['id']); - $users = exponent_users_getAllUsers(0); + $users = user::getAllUsers(0); $members = array(); $admins = array(); diff --git a/framework/modules/users/extensions/user_avatar.php b/framework/modules/users/extensions/user_avatar.php index f204bc03cd..5b2ce49053 100755 --- a/framework/modules/users/extensions/user_avatar.php +++ b/framework/modules/users/extensions/user_avatar.php @@ -57,7 +57,7 @@ public function update($params=array()) { // if the user chose gravatar, create the link and save it! if (!empty($params['use_gravatar'])) { $this->use_gravatar = $params['use_gravatar']; - $emailMD5 = md5(strtolower(trim(exponent_users_getEmailById($params['user_id'])))); + $emailMD5 = md5(strtolower(trim(user::getEmailById($params['user_id'])))); $this->image = "http://www.gravatar.com/avatar/" . $emailMD5 . ".jpg"; } elseif (!empty($_FILES['avatar']['tmp_name'])) { // if the user uploaded a new avatar lets save it! $info = expFile::getImageInfo($_FILES['avatar']['tmp_name']); diff --git a/framework/modules/users/models/profileextension.php b/framework/modules/users/models/profileextension.php index 2547156edd..e581327249 100644 --- a/framework/modules/users/models/profileextension.php +++ b/framework/modules/users/models/profileextension.php @@ -19,6 +19,49 @@ class profileextension extends expRecord { protected $table = 'profileextension'; + + /** exdoc + * This method queries the ork/modules/users/extensions/ directory for + * a list of installed User Profile Extension class files. It returns the class + * names, in an array. This function does not take into account whether or not + * the administrator has activated or deactivated certain profiles. + * + * In order to be picked up by this function (and therefore the rest of the Users + * subsystem) a profile extension filename MUST end in 'extension.php', and + * therefore the classname MUST end in 'extension'. + * + * Returns an array of installed (but not necessarily activated) user profile + * extensions. If this array is empty, either Exponent encountered a problem + * reading the Profile Extensions directory, or there were simply no extensions + * to list. + * @node Subsystems:Users + * @return array + */ + public static function listExtensions() { + // A holding array to keep the extension class names we find. This will be returned + // to the caller when we are completely done. + $ext = array(); + // Store the base directory in a variable, for readability later on. + $ext_dir = BASE.'framework/modules/users/extensions'; + // Profiles directory has to be readable by the web server. + if (is_readable($ext_dir)) { + $dh = opendir($ext_dir); + // For each directory entry we find. + while (($file = readdir($dh)) !== false) { + if (is_file("$ext_dir/$file") && is_readable("$ext_dir/$file") && substr($file,-4,13) == '.php') { + // Only include readable, regular files that end in '.php' + + // Store the same data in the key and the value of the array. This is safe + // since we are getting file names from a single directory. The .php + // suffix needs to be stripped out. + $ext[substr($file,0,-4)] = substr($file,0,-4); + } + } + } + // Return the list to the calling scope. If something went wrong, an empty + // array will be returned. + return $ext; + } } ?> diff --git a/framework/modules/users/models/user.php b/framework/modules/users/models/user.php index 3bd6c6a181..66e0db7996 100644 --- a/framework/modules/users/models/user.php +++ b/framework/modules/users/models/user.php @@ -196,7 +196,7 @@ public function getGroupMemberships() { if (!$this->isLoggedIn()) return array(); // For administrators, we synthesize group memberships - they effectively belong to all groups. - if ($this->isAdmin()) return exponent_users_getAllGroups(true, true); + if ($this->isAdmin()) return user::getAllGroups(true, true); $groups = array(); // Holding array for the groups. foreach ($db->selectObjects('groupmembership','member_id='.$this->id) as $m) { @@ -232,6 +232,104 @@ public function isTempUser() { return is_numeric(expUtil::right($this->username,10)) ? true : false; } + + public static function getEmailById($id) { + global $db; + return $db->selectValue('user','email','id='.$id); + } + + /** exdoc + * Gets a list of all user accounts in the system. By giving different + * combinations of the two boolean arguments. threee different lists + * of users can be returned. Returns alist of users, according to the two parameters passed in. + * + * @param bool|int $allow_admin Whether or not to include admin accounts in the returned list. + * @param bool|int $allow_normal Whether or not to include normal accounts in the returned list. + * @return array + */ + public static function getAllUsers($allow_admin=1,$allow_normal=1) { + global $db; + if ($allow_admin && $allow_normal) return $db->selectObjects('user'); + else if ($allow_admin) return $db->selectObjects('user','is_admin=1 OR is_acting_admin = 1'); + else if ($allow_normal) return $db->selectObjects('user','is_admin=0 AND is_acting_admin = 0'); + else return array(); + } + + /** exdoc + * This function pulls a user object from the subsystem's storage mechanism, + * according to the username. For the default implementation, this is equivalent + * to a $db->selectObject() call, but it may not be the same for other implementations. + * Returns a basic user object, and null if no user was found. + * + * This function does NOT perform user caching like the exponent_users_getUserById + * function does. Multiple calls to retrieve the same user result in multiple calls + * to the database. + * + * @param string $name The username of the user account to retrieve. + * @return array + * @node Subsystems:Users + */ + public static function getUserByName($name) { + global $db; + $tmpu = $db->selectObject('user',"username='$name'"); + if ($tmpu && $tmpu->is_admin == 1) { + // User is an admin. Update is_acting_admin, just in case. + // This can be removed as soon as 0.95 is deprecated. + $tmpu->is_acting_admin = 1; + } + return $tmpu; + } + + /** exdoc + * This function pulls a group object from the subsystem's storage mechanism, + * according to the group name. For the default implementation, this is equivalent + * to a $db->selectObject() call, but it may not be the same for other implementations. + * Returns a group object, and null if no group was found. + * + * This function does NOT perform group caching like the exponent_users_getUserById + * function does. Multiple calls to retrieve the same group result in multiple calls + * to the database. + * + * @param integer $name The name of the group account to retrieve. + * @return array + * @node Subsystems:Users + */ + public static function getGroupByName($name) { + global $db; + return $db->selectObject('group',"name='$name'"); + } + + /** exdoc + * Gets a list of all group in the system. By giving different + * combinations of the two boolean arguments. threee different lists + * of groups can be returned. Returns a list of groups, according to + * the two parameters passed in. + * + * @param bool $allow_exclusive Whether or not to include exclusive groups in the returned list. + * @param bool $allow_inclusive Whether or not to include inclusive groups in the returned list. + * @return array + * @node Subsystems:Users + */ + public static function getAllGroups($allow_exclusive=1,$allow_inclusive=1) { + global $db; + if ($allow_exclusive && $allow_inclusive) { + // For both, just do a straight selectObjects call, with no WHERE criteria. + return $db->selectObjects('group'); + } else if ($allow_exclusive) { + // At this point, we know that $allow_inclusive was passed as false + // So, we need to retrieve groups that are not inclusive. + return $db->selectObjects('group','inclusive = 0'); + } else if ($allow_inclusive) { + // At this point, we know that $allow_exclusive was passed as false + // So, we need to retrieve groups that are inclusive. + return $db->selectObjects('group','inclusive = 1'); + } else { + // Both arguments were passed as false. This is nonsensical, but why not + // let the programmer shoot themselves in the foot. Return an empty array. + return array(); + } + } + } ?> diff --git a/framework/plugins/block.paginate.php b/framework/plugins/block.paginate.php index 13fc03b8b7..6c85e90a38 100644 --- a/framework/plugins/block.paginate.php +++ b/framework/plugins/block.paginate.php @@ -20,7 +20,6 @@ function smarty_block_paginate($params,$content,&$smarty) { if ($content) { -// if (!defined("SYS_JAVASCRIPT")) require_once(BASE."framework/core/subsystems-1/javascript.php"); require_once(BASE."framework/core/subsystems-1/javascript.php"); ?> diff --git a/framework/plugins/function.attribution.php b/framework/plugins/function.attribution.php index f58508c704..ede2e5311a 100644 --- a/framework/plugins/function.attribution.php +++ b/framework/plugins/function.attribution.php @@ -20,7 +20,6 @@ function smarty_function_attribution($params,&$smarty) { if (isset($params['user_id'])) { -// if (!defined("SYS_USERS")) require_once(BASE."framework/core/subsystems-1/users.php"); require_once(BASE."framework/core/subsystems-1/users.php"); $u = exponent_users_getUserById($params['user_id']); } elseif (isset($params['user'])) { diff --git a/framework/plugins/function.control.php b/framework/plugins/function.control.php index 5694530f04..f2e42bd6db 100644 --- a/framework/plugins/function.control.php +++ b/framework/plugins/function.control.php @@ -25,9 +25,7 @@ function smarty_function_control($params,&$smarty) { // || $params['type'] == 'captcha' || $params['type'] == 'recaptcha' || $params['type'] == 'antispam') { || $params['type'] == 'recaptcha' || $params['type'] == 'antispam') { -// if (!defined('SYS_FORMS')) require_once(BASE.'framework/core/subsystems-1/forms.php'); require_once(BASE.'framework/core/subsystems-1/forms.php'); -// exponent_forms_initialize(); // if a label wasn't passed in then we need to set one. //if (empty($params['label'])) $params['label'] = $params['name']; diff --git a/framework/plugins/function.exponent_sessions_get.php b/framework/plugins/function.exponent_sessions_get.php index f558c73663..33ef92266c 100644 --- a/framework/plugins/function.exponent_sessions_get.php +++ b/framework/plugins/function.exponent_sessions_get.php @@ -19,8 +19,6 @@ /** @define "BASE" "../.." */ function smarty_function_sessions_get($params,&$smarty) { -// if (!defined("SYS_SESSIONS")) include_once(BASE."framework/core/subsystems-1/sessions.php"); -// include_once(BASE."framework/core/subsystems-1/sessions.php"); $smarty->assign($params['var'], expSession::get($params['var'])); } diff --git a/framework/plugins/function.get_user.php b/framework/plugins/function.get_user.php index ad2327fae9..d4ed142e39 100644 --- a/framework/plugins/function.get_user.php +++ b/framework/plugins/function.get_user.php @@ -19,8 +19,6 @@ /** @define "BASE" "../.." */ function smarty_function_get_user($params,&$smarty) { -// if (!defined("SYS_SESSIONS")) include_once(BASE."framework/core/subsystems-1/sessions.php"); -// include_once(BASE."framework/core/subsystems-1/sessions.php"); if (expSession::loggedIn()) { global $user; if (isset($params['assign'])) $smarty->assign($params['assign'],$user); diff --git a/framework/plugins/function.img.php b/framework/plugins/function.img.php index cda0c1b31b..14a70a41ea 100644 --- a/framework/plugins/function.img.php +++ b/framework/plugins/function.img.php @@ -400,7 +400,7 @@ function smarty_function_img($params,&$smarty) { //If we are in the production mode, display default image for the dead link images if(!DEVELOPMENT) { - $src .= '&err=' . URL_FULL. 'framework/core/subsystems-1/image/default_preview_notfound.gif'; + $src .= '&err=' . URL_FULL. 'framework/core/assets/images/default_preview_notfound.gif'; } $source .= ' src="'.$src.'"'; diff --git a/framework/plugins/function.object_to_js.php b/framework/plugins/function.object_to_js.php index 6b5f4cf636..91bb29cccd 100644 --- a/framework/plugins/function.object_to_js.php +++ b/framework/plugins/function.object_to_js.php @@ -19,10 +19,7 @@ /** @define "BASE" "../.." */ function smarty_function_object_to_js($params,&$smarty) { - -// if (!defined("SYS_JAVASCRIPT")) require_once(BASE."framework/core/subsystems-1/javascript.php"); require_once(BASE."framework/core/subsystems-1/javascript.php"); - echo "var ".$params['name']." = new Array();\n"; if (isset($params['objects']) && count($params['objects']) > 0) { diff --git a/framework/plugins/function.popupdatetimecontrol.php b/framework/plugins/function.popupdatetimecontrol.php index 9071820d0d..162d5e42f9 100644 --- a/framework/plugins/function.popupdatetimecontrol.php +++ b/framework/plugins/function.popupdatetimecontrol.php @@ -20,9 +20,7 @@ function smarty_function_control($params,&$smarty) { if (isset($params['name']) ) { -// if (!defined('SYS_FORMS')) require_once(BASE.'framework/core/subsystems-1/forms.php'); require_once(BASE.'framework/core/subsystems-1/forms.php'); -// exponent_forms_initialize(); $control = new $params['type']; echo $control->controlToHTML($params['name']); } diff --git a/framework/plugins/function.scaffold.php b/framework/plugins/function.scaffold.php index f670f0e694..80895a6201 100644 --- a/framework/plugins/function.scaffold.php +++ b/framework/plugins/function.scaffold.php @@ -20,9 +20,7 @@ function smarty_function_scaffold($params,&$smarty) { if (isset($params['model']) ) { -// if (!defined('SYS_FORMS')) require_once(BASE.'framework/core/subsystems-1/forms.php'); require_once(BASE.'framework/core/subsystems-1/forms.php'); - //exponent_forms_initialize(); global $db; require_once $smarty->_get_plugin_filepath('function','control'); diff --git a/framework/plugins/function.userlistcontrol.php b/framework/plugins/function.userlistcontrol.php index 9d1760c9ed..4b6e50a16b 100644 --- a/framework/plugins/function.userlistcontrol.php +++ b/framework/plugins/function.userlistcontrol.php @@ -20,11 +20,8 @@ function smarty_function_userlistcontrol($params,&$smarty) { echo ''; -// if (!defined('SYS_FORMS')) require_once(BASE.'framework/core/subsystems-1/forms.php'); -// if (!defined('SYS_USERS')) require_once(BASE.'framework/core/subsystems-1/users.php'); require_once(BASE.'framework/core/subsystems-1/forms.php'); require_once(BASE.'framework/core/subsystems-1/users.php'); -// exponent_forms_initialize(); global $db; $users = $db->selectObjects("user",null,"username"); diff --git a/framework/plugins/function.yuilogger.php b/framework/plugins/function.yuilogger.php index 0e66a52253..4372267ee9 100644 --- a/framework/plugins/function.yuilogger.php +++ b/framework/plugins/function.yuilogger.php @@ -18,7 +18,6 @@ /** @define "BASE" "../.." */ function smarty_function_yuilogger($params,&$smarty) { -// if (!defined('SYS_JAVASCRIPT')) require_once(BASE.'framework/core/subsystems-1/javascript.php'); require_once(BASE.'framework/core/subsystems-1/javascript.php'); global $userjsfiles; $logger = " diff --git a/framework/plugins/modifier.is_logged_in.php b/framework/plugins/modifier.is_logged_in.php index f6e46902fc..3f9073ba06 100644 --- a/framework/plugins/modifier.is_logged_in.php +++ b/framework/plugins/modifier.is_logged_in.php @@ -19,8 +19,6 @@ /** @define "BASE" "../.." */ function smarty_modifier_is_logged_in($string) { -// if (!defined("SYS_SESSIONS")) include_once(BASE."framework/core/subsystems-1/sessions.php"); -// include_once(BASE."framework/core/subsystems-1/sessions.php"); if(expSession::loggedIn()) { return true; } else { diff --git a/index.php b/index.php index 0619b91d7a..1dddf6d7b5 100644 --- a/index.php +++ b/index.php @@ -88,8 +88,6 @@ function epb($buffer, $mode) { $page = $pftheme == null ? $page : $pftheme; // if there was no theme found then just use the current subtheme } - $base_i18n = exponent_lang_loadFile('index.php'); - if (is_readable($page)) { if (!expJavascript::inAjaxAction()) { include_once($page); @@ -98,7 +96,7 @@ function epb($buffer, $mode) { expTheme::runAction(); } } else { - echo sprintf($base_i18n['not_readable'], $page); + echo sprintf(gt('Page "%s" not readable.'), $page); } if (PRINTER_FRIENDLY == 1) { @@ -110,7 +108,7 @@ function epb($buffer, $mode) { //$microtime_str = explode(' ',microtime()); //$i_end = $microtime_str[0] + $microtime_str[1]; -//echo "\r\n'; +//echo "\r\n'; ob_end_flush(); diff --git a/install/include/sanity.php b/install/include/sanity.php index 4012c5f024..da5a97959a 100644 --- a/install/include/sanity.php +++ b/install/include/sanity.php @@ -29,8 +29,6 @@ define('SANITY_WARNING', 1); define('SANITY_ERROR', 2); -$global_i18n = exponent_lang_loadFile('install/include/sanity.php'); - function sanity_checkFile($file,$as_file,$flags) { $__oldumask = umask(0); if (!file_exists($file)) { @@ -135,99 +133,89 @@ function sanity_checkFiles() { } function sanity_checkServer() { - global $global_i18n; $status = array( - $global_i18n['check_db']=>_sanity_checkDB(), - $global_i18n['check_gd']=>_sanity_checkGD(), - 'PHP 5.2.1+'=>_sanity_checkPHPVersion(), - $global_i18n['check_zlib']=>_sanity_checkZlib(), - $global_i18n['check_xml']=>_sanity_checkXML(), - $global_i18n['check_safemode']=>_sanity_CheckSafeMode(), - $global_i18n['check_basedir']=>_sanity_checkOpenBaseDir(), - $global_i18n['check_upload']=>_sanity_checkTemp(ini_get('upload_tmp_dir')), - $global_i18n['check_temp']=>_sanity_checkTemp(BASE.'tmp'), + gt('Database Backend')=>_sanity_checkDB(), + gt('GD Graphics Library 2.0+')=>_sanity_checkGD(), + gt('PHP 5.2.1+')=>_sanity_checkPHPVersion(), + gt('ZLib Support')=>_sanity_checkZlib(), + gt('XML (Expat) Library Support')=>_sanity_checkXML(), + gt('Safe Mode Not Enabled')=>_sanity_CheckSafeMode(), + gt('Open BaseDir Not Enabled')=>_sanity_checkOpenBaseDir(), + gt('File Uploads Enabled')=>_sanity_checkTemp(ini_get('upload_tmp_dir')), + gt('Temporary File Creation')=>_sanity_checkTemp(BASE.'tmp'), ); return $status; } function _sanity_checkGD() { - global $global_i18n; $info = gd_info(); if ($info['GD Version'] == 'Not Supported') { - return array(SANITY_WARNING,$global_i18n['no_gd']); + return array(SANITY_WARNING,gt('No GD Support')); } else if (strpos($info['GD Version'],'2.0') === false) { - return array(SANITY_WARNING,sprintf($global_i18n['old_gd'],$info['GD Version'])); + return array(SANITY_WARNING,sprintf(gt('Older Version Installed (%s)'),$info['GD Version'])); } return array(SANITY_FINE,$info['GD Version']); } function _sanity_checkPHPVersion() { - global $global_i18n; if (version_compare(phpversion(),'5.2.1','>=')) { return array(SANITY_FINE,phpversion()); } else { - return array(SANITY_ERROR,'This version of ExponentCMS requires PHP 5.2.1 or higher. You are running PHP '.phpversion().'
'.$global_i18n['not_supported']); + return array(SANITY_ERROR,'This version of ExponentCMS requires PHP 5.2.1 or higher. You are running PHP '.phpversion().'
'.gt('(not supported)')); } } function _sanity_checkZlib() { - global $global_i18n; if (function_exists('gzdeflate')) { - return array(SANITY_FINE,$global_i18n['passed']); + return array(SANITY_FINE,gt('Passed')); } else { - return array(SANITY_ERROR,$global_i18n['failed']); + return array(SANITY_ERROR,gt('Failed')); } } function _sanity_checkSafeMode() { - global $global_i18n; if (ini_get('safe_mode') == 1) { - return array(SANITY_WARNING,$global_i18n['failed']); + return array(SANITY_WARNING,gt('Failed')); } else { - return array(SANITY_FINE,$global_i18n['passed']); + return array(SANITY_FINE,gt('Passed')); } } function _sanity_checkXML() { - global $global_i18n; if (function_exists('xml_parser_create')) { - return array(SANITY_FINE,$global_i18n['passed']); + return array(SANITY_FINE,gt('Passed')); } else { - return array(SANITY_WARNING,$global_i18n['failed']); + return array(SANITY_WARNING,gt('Failed')); } } function _sanity_checkOpenBaseDir() { - global $global_i18n; $path = ini_get('open_basedir'); if ($path == '') { - return array(SANITY_FINE,$global_i18n['passed']); + return array(SANITY_FINE,gt('Passed')); } else { - return array(SANITY_WARNING,$global_i18n['failed']); + return array(SANITY_WARNING,gt('Failed')); } } function _sanity_checkTemp($dir) { - global $global_i18n; $file = tempnam($dir,'temp'); if (is_readable($file) && expUtil::isReallyWritable($file)) { unlink($file); - return array(SANITY_FINE,$global_i18n['passed']); + return array(SANITY_FINE,gt('Passed')); } else { - return array(SANITY_ERROR,$global_i18n['failed']); + return array(SANITY_ERROR,gt('Failed')); } } function _sanity_checkDB() { -// if (!defined('SYS_DATABASE')) require_once(BASE.'framework/core/subsystems-1/database.php'); require_once(BASE.'framework/core/subsystems-1/database.php'); // $have_good = false; - global $global_i18n; if (count(exponent_database_backends(1)) > 0) { - return array(SANITY_FINE,$global_i18n['supported']); + return array(SANITY_FINE,gt('Supported')); } else { - return array(SANITY_ERROR,$global_i18n['no_db_support']); + return array(SANITY_ERROR,gt('No Databases Supported')); } } diff --git a/install/index.php b/install/index.php index 07e7611ca6..7a788d7b4f 100644 --- a/install/index.php +++ b/install/index.php @@ -24,6 +24,12 @@ define('SCRIPT_EXP_RELATIVE','install/'); define('SCRIPT_FILENAME','index.php'); + +// Initialize the language +if (isset($_REQUEST['lang'])) { + if (!defined('LANGUAGE')) define('LANGUAGE', trim($_REQUEST['lang'],"'")); +} + include_once('../exponent.php'); if (!file_exists('not_configured') && file_exists(BASE.'conf/config.php')) { @@ -31,10 +37,8 @@ exit(gt('This Exponent Site has already been configured.')); } -//if (!defined('SYS_CONFIG')) include_once(BASE . 'framework/core/subsystems-1/config.php'); include_once(BASE . 'framework/core/subsystems-1/config.php'); -// Initialize the language if (isset($_POST['sc'])) { if (file_exists("../conf/config.php")) { diff --git a/install/pages/install-1.php b/install/pages/install-1.php index 7b7214e7ee..6c7994bf83 100644 --- a/install/pages/install-1.php +++ b/install/pages/install-1.php @@ -149,9 +149,11 @@ $write_file = 1; } +$lang = (defined('LANGUAGE')) ? "&lang='".LANGUAGE."'" : ''; + if ($errcount == 0) { ?> - +
- +
\ No newline at end of file diff --git a/install/pages/welcome.php b/install/pages/welcome.php index 27fa273211..8cb688095e 100644 --- a/install/pages/welcome.php +++ b/install/pages/welcome.php @@ -25,4 +25,28 @@

+ + +

+

+ +

+ +
+ + +
+ +
+
+ +
diff --git a/install/popups/db_create.php b/install/popups/db_create.php index 5008218e7d..d7d8e314af 100644 --- a/install/popups/db_create.php +++ b/install/popups/db_create.php @@ -17,8 +17,6 @@ # ################################################## -$i18n = exponent_lang_loadFile('install/popups/db_create.php'); - ?> - +
- +

-|  |  | +|  |  |


- +
- + - + - + - +
@@ -83,14 +81,14 @@ function buildHelp(dbname,username,password,target) {

- +

- +

-
- -
- +
+ +
+