diff --git a/CONTRIBUTING.textile b/CONTRIBUTING.textile deleted file mode 100644 index d860641..0000000 --- a/CONTRIBUTING.textile +++ /dev/null @@ -1,36 +0,0 @@ -h1. Contributing - -Please take a quick look at this document before to make contribution process easier for all parties involved. - -h2. License - -"GNU General Public License, version 2":https://github.com/gocom/rah_flat/blob/master/LICENSE. By contributing code, you agree to license your additions under the GPLv2 license. - -h2. Configure git - -For convenience your committer, git user, should be linked to your GitHub account: - -bc. $ git config --global user.name "John Doe" -$ git config --global user.email john.doe@example.com - -Make sure to use an email address that is linked to your GitHub account. It can be a throwaway address or you can use GitHub's email protection features. We don't want your emails, but this is to make sure we know who did what. All commits nicely link to their author, instead of them coming from foobar@invalid.tld. - -h2. Dependencies - -Dependencies are managed using "Composer":http://getcomposer.org. After you have cloned the repository, run composer install: - -bc. $ composer install - -And update before testing and committing: - -bc. $ composer update - -h2. Coding standard - -The project follows the "PSR-0":https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md and "PSR-2":https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide-meta.md standards with PHP 5.2 style namespacing. You can use PHP_CodeSniffer to make sure your additions follow them too: - -bc. $ ./vendor/bin/phpcs --standard=phpcs.xml src - -h2. Versioning - -"Semantic Versioning":http://semver.org/ and major.minor.path format. diff --git a/LICENSE b/LICENSE index 8c40fbc..43511ea 100644 --- a/LICENSE +++ b/LICENSE @@ -276,64 +276,3 @@ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - -How to Apply These Terms to Your New Programs - -If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - -To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - -{description} -Copyright (C) {year} {fullname} - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along -with this program; if not, write to the Free Software Foundation, Inc., -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - -Gnomovision version 69, Copyright (C) year name of author -Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. -This is free software, and you are welcome to redistribute it -under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - -Yoyodyne, Inc., hereby disclaims all copyright interest in the program -`Gnomovision' (which makes passes at compilers) written by James Hacker. - -{signature of Ty Coon}, 1 April 1989 -Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/README.textile b/README.textile index 53a730c..af20e4f 100644 --- a/README.textile +++ b/README.textile @@ -1,6 +1,6 @@ -h1. rah_flat +h1. oui_flat -"Download":https://github.com/NicolasGraph/rah_flat/releases | "Donate to the original author":http://rahforum.biz/donate/rah_flat +"Download":https://github.com/NicolasGraph/oui_flat/releases This plugin makes your "Textpattern CMS":http://www.textpattern.com database more flat, manageable and editable. Edit templates, forms, pages, preferences, variables and sections as flat files. Use any editor, work in teams and store your website's source under your favorite "version control system":http://en.wikipedia.org/wiki/Revision_control. @@ -24,7 +24,7 @@ h2. Table of contents h2(#requirements). Plugin requirements -rah_flat’s minimum requirements: +oui_flat’s minimum requirements: * Textpattern 4.5+ @@ -39,7 +39,7 @@ h2(#prefs). Preferences / options * *Security key for the public callback* - Security key for the public callback hook URL. Importing is done when the URL is accessed. The URL follows the format of: * *Production status for the systematic upload* - The site production status for which you want to activate the systematic templates upload (see "Basics":#basics). -bc. http://example.com/?rah_flat_key={yourKey} +bc. http://example.com/?oui_flat_key={yourKey} Where @http://example.com/@ is your site's URL, and @{yourKey}@ is the security key you specified. @@ -52,7 +52,7 @@ Your flat files are imported to the database: 1. Variables are imported only once to avoid the override of user strings. To update them, remove or rename .json files and refresh. -If you want to exclude a certain content type from importing, just don't create a directory for it. No directory, and rah_flat will leave the database alone when it comes to that content type. +If you want to exclude a certain content type from importing, just don't create a directory for it. No directory, and oui_flat will leave the database alone when it comes to that content type. h3. About variables @@ -135,7 +135,7 @@ Here is an example of content for a @menu_sections.json@ file. bc.. { "value": "articles, about, contact", "type": "PREF_HIDDEN", - "event": "rah_flat_var", + "event": "oui_flat_var", "html": "text_input", "position": "10", "is_private": true @@ -145,12 +145,12 @@ p. where each data is optional and the default values are the following: * @"value": "…"@ - _default: '' (empty)_ - The default value of the preference. * @"type": "…"@ - _default: PREF_PLUGIN (for Txp 4.6, else PREF_ADVANCED)_ - To hide a pref in the _Preferences_ tab, use _PREF_HIDDEN_, you should probably not use _PREF_CORE_. -* "event": "…" - _default: 'rah_flat_var'_ - The prefs group name where you want to display your custom pref. +* "event": "…" - _default: 'oui_flat_var'_ - The prefs group name where you want to display your custom pref. * @"html": "…"@ - _default: 'text_input'_ - To display radio buttons, use _onoffradio_ or _yesnoradio_. * @"position": "…"@ - _default: 0_ - Use position to sort your prefs. * @"is_private": "…"@ - _default: false_ - If _true_, the pref will be user related. -p. While you can call your custom preference as a Txp variable like so: @@; they will be prefixed with @rah_flat_var_@ under the preferences tab and you will need to use the textpack as below to add user friendly titles. +p. While you can call your custom preference as a Txp variable like so: @@; they will be prefixed with @oui_flat_var_@ under the preferences tab and you will need to use the textpack as below to add user friendly titles. h3(#textpacks). Textpacks @@ -158,7 +158,7 @@ Here is an example of content for a @en-gb.json@ file. bc.. { "admin": { - "rah_flat_var_menu_sections": "Sections used in the menu" + "oui_flat_var_menu_sections": "Sections used in the menu" }, "common": { }, @@ -172,7 +172,7 @@ p. Text strings are only updated if they already exist, otherwise, they can be i h2(#author). Author -"Jukka Svahn":http://rahforum.biz/, forked by "Nicolas Morand":https://github.com/ from v0.3.0. +"Nicolas Morand":https://github.com/, from "rah_flat":https://github.com/gocom/rah_flat by "Jukka Svahn":http://rahforum.biz/. h2(#licence). Licence @@ -182,16 +182,21 @@ h2(#Changelog). Changelog * To do: Fix the _Options_ link. -h3. Version 0.5.0- 2016/08/26 +h3. Version 0.6.0 - 2017/03/14 + +* Changed: Back to @oui_@ plugin author prefix. +* Changed: Lighten compiled code by removing duplicated license infos. + +h3. Version 0.5.0 (rah_flat) - 2016/08/26 * Changed: Forms are stored by types in subfolders and don't need prefixes anymore. * Added: Custom form types are changed to 'misc' when the plugin is disable to avoid an error in the Forms tab. * Changed: Preferences update affects values only. * Added: Prefs are hidden in the admin if set via flat files and get back to visible when the plugin is disabled. * Added: Custom prefs (in the variables folder) accept more paramters in .json files. -* Changed: Custom prefs (in the variables folder) now have a rah_flat_var_ prefix added to their name. +* Changed: Custom prefs (in the variables folder) now have a oui_flat_var_ prefix added to their name. -h3. Version 0.4.0 (oui_flat) - 2015/11/29 +h3. Version 0.4.0 - 2015/11/29 * Changed: Forked by Nicolas Morand. * Added: Custom preferences can be created and use as Txp variables. @@ -200,12 +205,12 @@ h3. Version 0.4.0 (oui_flat) - 2015/11/29 h3. Version 0.3.0 - 2014/03/28 * Added: Drop access to a admin-side panel only if the specific content-type is active and has a directory set up. -* Added: Invokable @rah_flat.import@ callback event. +* Added: Invokable @oui_flat.import@ callback event. * Added: Sections and preferences get their names from the filename. * Added: Preferences are always just updated, no strands are created. * Added: Preference fields that are not specified in a file are kept as-is in the database. * Added: French translation by "Patrick Lefevre":https://github.com/cara-tm. -* Changed: Renamed confusing @rah_flat_Import_Template@ interface to @rah_flat_Import_ImportInterface@. +* Changed: Renamed confusing @oui_flat_Import_Template@ interface to @oui_flat_Import_ImportInterface@. h3. Version 0.2.0 - 2014/03/19 diff --git a/composer.json b/composer.json index 31060da..1159fce 100644 --- a/composer.json +++ b/composer.json @@ -1,24 +1,24 @@ { - "name": "rah/rah_flat", + "name": "nicolasgraph/oui_flat", "description": "Textpattern CMS templates as flat files", "keywords": ["textpattern", "plugin", "flat", "template"], - "homepage": "https://github.com/gocom/rah_flat", + "homepage": "https://github.com/nicolasgraph/oui_flat", "license": "GPL-2.0", "type": "textpattern-plugin", "authors": [ { - "name": "Jukka Svahn", - "homepage": "http://rahforum.biz", + "name": "Nicolas Morand, Jukka Svahn", + "homepage": "https://github.com/nicolasgraph", "role": "Developer" } ], "support": { - "issues": "https://github.com/gocom/rah_flat/issues", - "source": "https://github.com/gocom/rah_flat" + "issues": "https://github.com/nicolasgraph/oui_flat/issues", + "source": "https://github.com/nicolasgraph/oui_flat" }, "require": { "php": ">=5.2.0", - "textpattern/lock": ">=4.4.1", + "textpattern/lock": ">=4.6", "textpattern/installer": "*" }, "require-dev": { diff --git a/manifest.json b/manifest.json index ff7fbb4..42056c6 100755 --- a/manifest.json +++ b/manifest.json @@ -1,9 +1,9 @@ { - "name" : "rah_flat", + "name" : "oui_flat", "description" : "Edit Textpattern's database prefs, contents and page templates as flat files", - "version" : "0.5.0", + "version" : "0.6.0", "type" : 1, - "author" : "Jukka Svahn (forked by Nicolas Morand)", + "author" : "Nicolas Morand, Jukka Svahn", "author_uri" : "http://github.com/NicolasGraph", "order" : 5, "flags" : 3, diff --git a/src/Rah/Flat.php b/src/Rah/Flat.php index 8d1b9ca..977ef62 100644 --- a/src/Rah/Flat.php +++ b/src/Rah/Flat.php @@ -1,24 +1,24 @@ . + * along with oui_flat. If not, see . */ /** @@ -27,7 +27,7 @@ * @internal */ -class Rah_Flat +class Oui_Flat { protected $deleting = false; @@ -38,35 +38,35 @@ class Rah_Flat public function __construct() { if (@txpinterface == 'admin') { - add_privs('prefs.rah_flat', '1'); - add_privs('prefs.rah_flat_var', '1'); - register_callback(array($this, 'options'), 'plugin_prefs.rah_flat', null, 1); - register_callback(array($this, 'install'), 'plugin_lifecycle.rah_flat', 'installed'); - register_callback(array($this, 'disable'), 'plugin_lifecycle.rah_flat', 'disabled'); - register_callback(array($this, 'uninstall'), 'plugin_lifecycle.rah_flat', 'deleted'); + add_privs('prefs.oui_flat', '1'); + add_privs('prefs.oui_flat_var', '1'); + register_callback(array($this, 'options'), 'plugin_prefs.oui_flat', null, 1); + register_callback(array($this, 'install'), 'plugin_lifecycle.oui_flat', 'installed'); + register_callback(array($this, 'disable'), 'plugin_lifecycle.oui_flat', 'disabled'); + register_callback(array($this, 'uninstall'), 'plugin_lifecycle.oui_flat', 'deleted'); } - if (get_pref('rah_flat_path')) { - new rah_flat_Import_Variables('variables'); - new rah_flat_Import_Prefs('prefs'); - new rah_flat_Import_Sections('sections'); - new rah_flat_Import_Pages('pages'); - new rah_flat_Import_Styles('styles'); - new rah_flat_Import_Textpacks('textpacks'); - $forms = txpath . '/' . get_pref('rah_flat_path') . '/forms'; + if (get_pref('oui_flat_path')) { + new oui_flat_Import_Variables('variables'); + new oui_flat_Import_Prefs('prefs'); + new oui_flat_Import_Sections('sections'); + new oui_flat_Import_Pages('pages'); + new oui_flat_Import_Styles('styles'); + new oui_flat_Import_Textpacks('textpacks'); + $forms = txpath . '/' . get_pref('oui_flat_path') . '/forms'; if (file_exists($forms) && is_dir($forms) && is_readable($forms)) { foreach (array_diff(scandir($forms), array('.', '..')) as $formType) { if (is_dir($forms . '/' . $formType)) { - new rah_flat_Import_Forms('forms/'.$formType); + new oui_flat_Import_Forms('forms/'.$formType); } } } register_callback(array($this, 'injectVars'), 'pretext_end'); register_callback(array($this, 'endpoint'), 'textpattern'); - register_callback(array($this, 'initWrite'), 'rah_flat.import'); + register_callback(array($this, 'initWrite'), 'oui_flat.import'); - if (in_list(get_pref('production_status'), get_pref('rah_flat_upload_levels'))) { + if (in_list(get_pref('production_status'), get_pref('oui_flat_upload_levels'))) { register_callback(array($this, 'callbackHandler'), 'textpattern'); register_callback(array($this, 'callbackHandler'), 'admin_side', 'body_end'); } @@ -83,7 +83,7 @@ public function injectVars() $prefset = safe_rows('name, val', 'txp_prefs', "name like 'rah\_flat\_var\_%'"); foreach ($prefset as $pref) { - $variable[substr($pref['name'], strlen('rah_flat_var_'))] = $pref['val']; + $variable[substr($pref['name'], strlen('oui_flat_var_'))] = $pref['val']; } } @@ -98,9 +98,9 @@ public function install() $position = 250; $options = array( - 'rah_flat_path' => array('text_input', ''), - 'rah_flat_key' => array('text_input', md5(uniqid(mt_rand(), true))), - 'rah_flat_upload_levels' => array('upload_levels', 'debug, testing'), + 'oui_flat_path' => array('text_input', ''), + 'oui_flat_key' => array('text_input', md5(uniqid(mt_rand(), true))), + 'oui_flat_upload_levels' => array('upload_levels', 'debug, testing'), ); foreach ($options as $name => $val) { @@ -108,7 +108,7 @@ public function install() set_pref( $name, $val[1], - 'rah_flat', + 'oui_flat', defined('PREF_PLUGIN') ? PREF_PLUGIN : PREF_ADVANCED, $val[0], $position @@ -126,7 +126,7 @@ public function install() public function options() { $url = defined('PREF_PLUGIN') - ? '?event=prefs#prefs_group_rah_flat' + ? '?event=prefs#prefs_group_oui_flat' : '?event=prefs&step=advanced_prefs'; header('Location: ' . $url); } @@ -159,8 +159,8 @@ public function disable() public function uninstall() { safe_delete('txp_prefs', "name like 'rah\_flat\_%'"); - safe_delete('txp_lang', "owner = 'rah_flat'"); - safe_delete('txp_lang', "owner = 'rah_flat_lang'"); + safe_delete('txp_lang', "owner = 'oui_flat'"); + safe_delete('txp_lang', "owner = 'oui_flat_lang'"); $this->deleting = true; } @@ -170,7 +170,7 @@ public function uninstall() public function initWrite() { - callback_event('rah_flat.import_to_database'); + callback_event('oui_flat.import_to_database'); } /** @@ -181,7 +181,7 @@ public function callbackHandler() { if (!$this->deleting) { try { - callback_event('rah_flat.import'); + callback_event('oui_flat.import'); } catch (Exception $e) { trigger_error($e->getMessage()); } @@ -194,14 +194,14 @@ public function callbackHandler() public function endpoint() { - if (!get_pref('rah_flat_key') || get_pref('rah_flat_key') !== gps('rah_flat_key')) { + if (!get_pref('oui_flat_key') || get_pref('oui_flat_key') !== gps('oui_flat_key')) { return; } header('Content-Type: application/json; charset=utf-8'); try { - callback_event('rah_flat.import'); + callback_event('oui_flat.import'); } catch (Exception $e) { txp_status_header('500 Internal Server Error'); @@ -221,7 +221,7 @@ public function endpoint() /** * Set upload_levels pref - * To do: move in rah_flat class? + * To do: move in oui_flat class? */ function upload_levels($name, $val) { @@ -234,4 +234,4 @@ function upload_levels($name, $val) return selectInput($name, $vals, $val, true, '', $name); } -new rah_flat(); +new oui_flat(); diff --git a/src/Rah/Flat/Import/Base.php b/src/Rah/Flat/Import/Base.php index 587c13d..dd3dd53 100644 --- a/src/Rah/Flat/Import/Base.php +++ b/src/Rah/Flat/Import/Base.php @@ -1,24 +1,24 @@ . + * along with oui_flat. If not, see . */ /** @@ -28,11 +28,11 @@ * this class or its theriatives. * * For instance the following would create a new import - * definition using the rah_flat_Import_Pages as the + * definition using the oui_flat_Import_Pages as the * base: * * - * class Abc_My_Import_Definition extends rah_flat_Import_Pages + * class Abc_My_Import_Definition extends oui_flat_Import_Pages * { * public function getPanelName() * { @@ -58,7 +58,7 @@ * */ -abstract class Rah_Flat_Import_Base implements rah_flat_Import_ImportInterface +abstract class Oui_Flat_Import_Base implements oui_flat_Import_ImportInterface { /** * The directory. @@ -83,7 +83,7 @@ abstract class Rah_Flat_Import_Base implements rah_flat_Import_ImportInterface public function __construct($directory) { $this->directory = $directory; - register_callback(array($this, 'init'), 'rah_flat.import_to_database'); + register_callback(array($this, 'init'), 'oui_flat.import_to_database'); $this->dropPermissions(); } @@ -93,7 +93,7 @@ public function __construct($directory) public function getTemplateIterator($directory) { - return new rah_flat_TemplateIterator($directory); + return new oui_flat_TemplateIterator($directory); } /** @@ -102,7 +102,7 @@ public function getTemplateIterator($directory) public function getDirectoryPath() { - if ($this->directory && ($directory = get_pref('rah_flat_path'))) { + if ($this->directory && ($directory = get_pref('oui_flat_path'))) { $directory = txpath . '/' . $directory . '/' . $this->directory; return $directory; } diff --git a/src/Rah/Flat/Import/Forms.php b/src/Rah/Flat/Import/Forms.php index 1aa4ca9..20c560a 100644 --- a/src/Rah/Flat/Import/Forms.php +++ b/src/Rah/Flat/Import/Forms.php @@ -1,31 +1,31 @@ . + * along with oui_flat. If not, see . */ /** * Imports form partials. */ -class Rah_Flat_Import_Forms extends rah_flat_Import_Base +class Oui_Flat_Import_Forms extends oui_flat_Import_Base { /** @@ -50,7 +50,7 @@ public function getTableName() * {@inheritdoc} */ - public function importTemplate(rah_flat_TemplateIterator $file) + public function importTemplate(oui_flat_TemplateIterator $file) { safe_upsert( $this->getTableName(), @@ -60,7 +60,7 @@ public function importTemplate(rah_flat_TemplateIterator $file) ); } - public function dropRemoved(rah_flat_TemplateIterator $template) + public function dropRemoved(oui_flat_TemplateIterator $template) { $name = array(); diff --git a/src/Rah/Flat/Import/ImportInterface.php b/src/Rah/Flat/Import/ImportInterface.php index 8867152..9fedc10 100644 --- a/src/Rah/Flat/Import/ImportInterface.php +++ b/src/Rah/Flat/Import/ImportInterface.php @@ -1,37 +1,37 @@ . + * along with oui_flat. If not, see . */ /** * Interface for import definitions. * * - * class Abc_Import_Definition implements rah_flat_Import_ImportInterface + * class Abc_Import_Definition implements oui_flat_Import_ImportInterface * { * } * */ -interface Rah_Flat_Import_ImportInterface +interface Oui_Flat_Import_ImportInterface { /** * Constructor. @@ -41,7 +41,7 @@ interface Rah_Flat_Import_ImportInterface * be accessed manually. * * - * new rah_flat_Import_Forms('forms'); + * new oui_flat_Import_Forms('forms'); * * * @param string $directory The directory hosting the templates @@ -83,7 +83,7 @@ public function dropPermissions(); * @throws Exception */ - public function dropRemoved(rah_flat_TemplateIterator $template); + public function dropRemoved(oui_flat_TemplateIterator $template); /** * Gets the panel name. @@ -110,11 +110,11 @@ public function getTableName(); * This method executes the SQL statement to import * the template file. * - * @param rah_flat_TemplateIterator $file The template file + * @param oui_flat_TemplateIterator $file The template file * @throws Exception */ - public function importTemplate(rah_flat_TemplateIterator $file); + public function importTemplate(oui_flat_TemplateIterator $file); /** * Gets an array of database columns in the table. diff --git a/src/Rah/Flat/Import/Pages.php b/src/Rah/Flat/Import/Pages.php index 2a353b5..78adf6f 100644 --- a/src/Rah/Flat/Import/Pages.php +++ b/src/Rah/Flat/Import/Pages.php @@ -1,31 +1,31 @@ . + * along with oui_flat. If not, see . */ /** * Imports page templates. */ -class Rah_Flat_Import_Pages extends rah_flat_Import_Base +class Oui_Flat_Import_Pages extends oui_flat_Import_Base { /** * {@inheritdoc} @@ -49,7 +49,7 @@ public function getTableName() * {@inheritdoc} */ - public function importTemplate(rah_flat_TemplateIterator $file) + public function importTemplate(oui_flat_TemplateIterator $file) { safe_upsert( $this->getTableName(), @@ -62,7 +62,7 @@ public function importTemplate(rah_flat_TemplateIterator $file) * {@inheritdoc} */ - public function dropRemoved(rah_flat_TemplateIterator $template) + public function dropRemoved(oui_flat_TemplateIterator $template) { $name = array(); diff --git a/src/Rah/Flat/Import/Prefs.php b/src/Rah/Flat/Import/Prefs.php index 2576b0e..1f1dabb 100644 --- a/src/Rah/Flat/Import/Prefs.php +++ b/src/Rah/Flat/Import/Prefs.php @@ -1,31 +1,31 @@ . + * along with oui_flat. If not, see . */ /** * Imports preferences. */ -class Rah_Flat_Import_Prefs extends rah_flat_Import_Sections +class Oui_Flat_Import_Prefs extends oui_flat_Import_Sections { /** * {@inheritdoc} @@ -49,7 +49,7 @@ public function getTableName() * {@inheritdoc} */ - public function importTemplate(rah_flat_TemplateIterator $file) + public function importTemplate(oui_flat_TemplateIterator $file) { extract(lAtts(array( 'value' => '', @@ -64,7 +64,7 @@ public function importTemplate(rah_flat_TemplateIterator $file) * {@inheritdoc} */ - public function dropRemoved(rah_flat_TemplateIterator $template) + public function dropRemoved(oui_flat_TemplateIterator $template) { $name = array(); diff --git a/src/Rah/Flat/Import/Sections.php b/src/Rah/Flat/Import/Sections.php index 5c155bc..483d22f 100644 --- a/src/Rah/Flat/Import/Sections.php +++ b/src/Rah/Flat/Import/Sections.php @@ -1,31 +1,31 @@ . + * along with oui_flat. If not, see . */ /** * Imports sections. */ -class Rah_Flat_Import_Sections extends rah_flat_Import_Pages +class Oui_Flat_Import_Sections extends oui_flat_Import_Pages { /** * {@inheritdoc} @@ -49,7 +49,7 @@ public function getTableName() * {@inheritdoc} */ - public function importTemplate(rah_flat_TemplateIterator $file) + public function importTemplate(oui_flat_TemplateIterator $file) { $sql = array(); $where = "name = '".doSlash($file->getTemplateName())."'"; diff --git a/src/Rah/Flat/Import/Styles.php b/src/Rah/Flat/Import/Styles.php index 6c0ff34..3405118 100644 --- a/src/Rah/Flat/Import/Styles.php +++ b/src/Rah/Flat/Import/Styles.php @@ -1,31 +1,31 @@ . + * along with oui_flat. If not, see . */ /** * Imports template styles. */ -class Rah_Flat_Import_Styles extends rah_flat_Import_Pages +class Oui_Flat_Import_Styles extends oui_flat_Import_Pages { /** * {@inheritdoc} @@ -49,7 +49,7 @@ public function getTableName() * {@inheritdoc} */ - public function importTemplate(rah_flat_TemplateIterator $file) + public function importTemplate(oui_flat_TemplateIterator $file) { safe_upsert( $this->getTableName(), diff --git a/src/Rah/Flat/Import/Textpacks.php b/src/Rah/Flat/Import/Textpacks.php index 4459416..0f82709 100644 --- a/src/Rah/Flat/Import/Textpacks.php +++ b/src/Rah/Flat/Import/Textpacks.php @@ -1,31 +1,31 @@ . + * along with oui_flat. If not, see . */ /** * Imports Textpacks. */ -class Rah_Flat_Import_Textpacks extends rah_flat_Import_Sections +class Oui_Flat_Import_Textpacks extends oui_flat_Import_Sections { /** @@ -50,7 +50,7 @@ public function getTableName() * {@inheritdoc} */ - public function importTemplate(rah_flat_TemplateIterator $file) + public function importTemplate(oui_flat_TemplateIterator $file) { global $DB; @@ -62,7 +62,7 @@ public function importTemplate(rah_flat_TemplateIterator $file) if ($r and (mysqli_affected_rows($DB->link) or safe_count($this->getTableName(), $where))) { $r; } else { - $set .= ", owner = 'rah_flat_lang'"; + $set .= ", owner = 'oui_flat_lang'"; $where = implode(', ', (preg_split("/ AND /", $where))); safe_insert($this->getTableName(), join(', ', array($where, $set))); } @@ -100,7 +100,7 @@ protected function formatStatement($field, $value) * {@inheritdoc} */ - public function dropRemoved(rah_flat_TemplateIterator $template) + public function dropRemoved(oui_flat_TemplateIterator $template) { while ($template->valid()) { @@ -114,9 +114,9 @@ public function dropRemoved(rah_flat_TemplateIterator $template) $name[] = "'".doSlash($key)."'"; } if ($name) { - safe_delete($this->getTableName(), $lang.' AND '.$event.' AND name not in ('.implode(',', $name).') AND owner = "rah_flat_lang"'); + safe_delete($this->getTableName(), $lang.' AND '.$event.' AND name not in ('.implode(',', $name).') AND owner = "oui_flat_lang"'); } else { - safe_delete($this->getTableName(), $lang.' AND '.$event.' AND owner = "rah_flat_lang"'); + safe_delete($this->getTableName(), $lang.' AND '.$event.' AND owner = "oui_flat_lang"'); } } } diff --git a/src/Rah/Flat/Import/Variables.php b/src/Rah/Flat/Import/Variables.php index 8f63bfa..02f43fd 100644 --- a/src/Rah/Flat/Import/Variables.php +++ b/src/Rah/Flat/Import/Variables.php @@ -1,31 +1,31 @@ . + * along with oui_flat. If not, see . */ /** * Imports custom preferences (variables). */ -class Rah_Flat_Import_Variables extends rah_flat_Import_Prefs +class Oui_Flat_Import_Variables extends oui_flat_Import_Prefs { /** * {@inheritdoc} @@ -49,18 +49,18 @@ public function getTableName() * {@inheritdoc} */ - public function importTemplate(rah_flat_TemplateIterator $file) + public function importTemplate(oui_flat_TemplateIterator $file) { extract(lAtts(array( 'value' => '', 'type' => defined('PREF_PLUGIN') ? 'PREF_PLUGIN' : 'PREF_ADVANCED', - 'event' => 'rah_flat_var', + 'event' => 'oui_flat_var', 'html' => 'text_input', 'position' => '', 'is_private' => false, ), $file->getTemplateJSONContents(), false)); - $name = 'rah_flat_var_'.$file->getTemplateName(); + $name = 'oui_flat_var_'.$file->getTemplateName(); if (get_pref($name, false) === false) { set_pref($name, $value, $event, constant($type), $html, $position, $is_private); @@ -71,12 +71,12 @@ public function importTemplate(rah_flat_TemplateIterator $file) * {@inheritdoc} */ - public function dropRemoved(rah_flat_TemplateIterator $template) + public function dropRemoved(oui_flat_TemplateIterator $template) { $name = array(); while ($template->valid()) { - $name[] = "'rah_flat_var_".doSlash($template->getTemplateName())."'"; + $name[] = "'oui_flat_var_".doSlash($template->getTemplateName())."'"; $template->next(); } diff --git a/src/Rah/Flat/TemplateIterator.php b/src/Rah/Flat/TemplateIterator.php index 320c4ef..d657816 100644 --- a/src/Rah/Flat/TemplateIterator.php +++ b/src/Rah/Flat/TemplateIterator.php @@ -1,24 +1,24 @@ . + * along with oui_flat. If not, see . */ /** @@ -27,7 +27,7 @@ * This class iterates over template files. * * - * $template = new rah_flat_TemplateIterator(); + * $template = new oui_flat_TemplateIterator(); * while ($template->valid()) { * $template->getTemplateName(); * $template->getTemplateContents(); @@ -37,7 +37,7 @@ * @see DirectoryIterator */ -class Rah_Flat_TemplateIterator extends DirectoryIterator +class Oui_Flat_TemplateIterator extends DirectoryIterator { /** * Template name pattern. diff --git a/textpacks/en-gb.textpack b/textpacks/en-gb.textpack index 50a766d..df57718 100755 --- a/textpacks/en-gb.textpack +++ b/textpacks/en-gb.textpack @@ -1,7 +1,7 @@ #@admin #Default language, en-us, en-gb -rah_flat => Template files (rah_flat) -rah_flat_path => Templates path -rah_flat_key => Update key -rah_flat_upload_levels => Production status for the systematic upload -rah_flat_var => Template variables (rah_flat) +oui_flat => Template files (oui_flat) +oui_flat_path => Templates path +oui_flat_key => Update key +oui_flat_upload_levels => Production status for the systematic upload +oui_flat_var => Template variables (oui_flat) diff --git a/textpacks/fr-fr.textpack b/textpacks/fr-fr.textpack index 5f68321..f07c094 100644 --- a/textpacks/fr-fr.textpack +++ b/textpacks/fr-fr.textpack @@ -1,7 +1,7 @@ #@admin #@language fr-fr -rah_flat => Fichiers du thème (rah_flat) -rah_flat_path => Chemin vers les fichiers -rah_flat_key => Clé de mise à jour -rah_flat_upload_levels => Statut(s) de production pour le téléchargement systématique -rah_flat_var => Variables du thème (rah_flat) +oui_flat => Fichiers du thème (oui_flat) +oui_flat_path => Chemin vers les fichiers +oui_flat_key => Clé de mise à jour +oui_flat_upload_levels => Statut(s) de production pour le téléchargement systématique +oui_flat_var => Variables du thème (oui_flat)