Version: 2.0
Release: Feb 1, 2006
Compatibility: QC v1.0+
Languages: en
Author: Wizzud
Contact: rb@wizzud.com

Template Edit

Plugin module for Quick.Cart by OpenSolution.org

Synopsis

The Template Edit plugin allows editting and manipulation of the template files/folders from the Admin control panel. It provides ...
  • Folder listings, with access indicators
  • File add, edit and delete
  • File and image upload
  • Image thumbnails
  • Theme replication and removal
This version differs from previous versions with its theme management and its compatibility with version 1.0+ of Quick.Cart (and it is not backwards compatible with earlier QC versions).

Compatibility

Quick.Cart versions prior to v1.0 : Not compatible.
Quick.Cart versions 1.0 upward : Compatible at the time of writing.
Other Plugins : The nature of this plugin is that it is relatively stand-alone and only has any impact on the Admin backend of Quick.Cart. As such there should be no compatibility issues with other plugins (and none are known of at the time of release!).

Prerequisites

None, other than meeting the Quick.Cart Compatibility requirements.
Highly recommended : Plugin Manager v2.0+, for themes and for ease of installation and management of the plugin itself.

Upgrade

There is no upgrade path, since this is first release available for the compatible Quick.Cart version(s).

Install

Where possible, the release folder is laid out in the correct folder structure to aid installation.
  1. Copy the entire templateEdit folder from the release/plugins/ folder into your Quick.Cart plugins/ folder.
  2. Copy the contents of the release/templates/admin/ folder to your Quick.Cart templates/admin/ folder (1 new file: templateEdit.tpl).
  3. Add a link in the admin menu bar to access the plugin manager. Please remember to make a copy of the template file before you change it!
    I would suggest adding the new 'templates' menu option as a sub-option, either below the 'configuration' option, or the 'tools' option if you have it (v1.1+). The example below uses the 'configuration' option, but for the 'tools' option simply substitute 'tools' wherever you see 'configuration' in the code.
    If you already have 'plugins' as one sub-option, edit templates/admin/page.tpl and ...
    Find the lines
    CODE
    <div id="configuration" class="menu" onmouseover="menuMouseover( event );">
       <a class="menuItem" href="?p=pluginsEdit"><span class="menuItemText">$lang[plugins]</span></a>
    </div>
    and insert one line (highlighted below) to make the code like
    CODE
    <div id="configuration" class="menu" onmouseover="menuMouseover( event );">
       <a class="menuItem" href="?p=pluginsEdit"><span class="menuItemText">$lang[plugins]</span></a>
       <a class="menuItem" href="?p=templatesList"><span class="menuItemText">$lang[templates]</span></a>
    </div>
    Otherwise, if you do not already have a sub-option on the menu, edit templates/admin/page.tpl and ...
    Replace the 1 line below
    CODE
    <a class="menuButton" href="?p=otherConfig" >$lang[configuration]</a>
    with
    CODE
    <a class="menuButton" href="?p=otherConfig"
       onmouseover="return buttonClick(event, 'configuration'); buttonMouseover(event, 'configuration');"
       >$lang[configuration]</a>

    Then look a couple of lines down from there, for a line containing just "</div>",and immediately below this line paste the following 3 lines
    CODE
    <div id="configuration" class="menu" onmouseover="menuMouseover( event );">
       <a class="menuItem" href="?p=templatesList"><span class="menuItemText">$lang[templates]</span></a>
    </div>
  4. If you have Plugin Manager installed, go to the Admin control panel, check the plugin's configuration, and enable it.
  5. If you do not have the Plugin Manager installed:
    • Check the settings in the file plugins/templateEdit/config.php and modify as required.
    • Edit plugins/plugins.php and insert the 1 line...
      CODE
      require DIR_PLUGINS.'templateEdit/templateEdit.php';
    • Edit plugins/actions_admin.php and insert the 1 line...
      CODE
      require DIR_PLUGINS.'templateEdit/actions_admin.php';

User Guide

In the Admin control panel select the 'templates' option/sub-option:
  • A list of the template, stylesheet and image files is presented, for the current default template folder.
  • Change the theme by selecting from the dropdown.
  • Change the template folder by selecting from the dropdown.
  • Icons to the left of file names indicate whether or not you have write access to the file.
  • Images have expandable thumbnail representations.
  • To edit a file, click the edit icon (if presented).
  • To delete a file, click on the delete icon (if presented). You will be asked to confirm the deletion!
  • To copy a file: Edit it, change the file name to a new (non-existing) name, and Save.
  • Two files (text or image) can be uploaded at any one time.
  • To remove a theme, click the icon beside the theme name. (The 'Default' theme can not be removed)
  • To replicate a theme, give it a new name (try to stick to letters, digits and the underscore character) and click the Copy button.
NOTE that the ability to edit (save), delete, or upload a file is dependent upon the permissions you have set on the folders and files below the templates folder. This plugin does not provide control over permissions, but it does give a visual guide as to whether you have write access to existing files in the files list.

Language

By default this plugin is only supplied with an English language file - /plugins/templateEdit/lang-en.php.
If you wish to provide translations for your own language, copy lang-en.php to lang-[2-char-code].php (within the same folder), where [2-char-code] is the recognised code for your language. For example, a Polish language file would be /plugins/templateEdit/lang-pl.php.
The Plugin Manager will automatically load the English file first, and then look for the language file in the Shop's configured language, so that the English text is always there as a backup.
~~ The End ~~