Exemplo n.º 1
0
/**
 * @version $Id$
 * @author Matthew McNaney <mcnaney at gmail dot com>
 */
function pagesmith_update(&$content, $currentVersion)
{
    $home_dir = PHPWS_Boost::getHomeDir();
    switch ($currentVersion) {
        case version_compare($currentVersion, '1.0.1', '<'):
            $content[] = '<pre>';
            $db = new PHPWS_DB('ps_page');
            $result = $db->addTableColumn('front_page', 'smallint NOT NULL default 0');
            if (PHPWS_Error::logIfError($result)) {
                $content[] = "--- Unable to create table column 'front_page' on ps_page table.</pre>";
                return false;
            } else {
                $content[] = "--- Created 'front_page' column on ps_page table.";
            }
            $files = array('templates/page_list.tpl', 'javascript/update/head.js', 'conf/error.php', 'templates/page_templates/simple/page.tpl', 'templates/page_templates/twocolumns/page.tpl');
            pagesmithUpdateFiles($files, $content);
            if (!PHPWS_Boost::inBranch()) {
                $content[] = file_get_contents(PHPWS_SOURCE_DIR . 'mod/pagesmith/boost/changes/1_0_1.txt');
            }
            $content[] = '</pre>';
        case version_compare($currentVersion, '1.0.2', '<'):
            $content[] = '<pre>';
            $dest_dir = $home_dir . 'javascript/modules/pagesmith/passinfo/';
            if (!is_dir($dest_dir)) {
                if (is_writable($home_dir . 'javascript/modules/pagesmith/') && @mkdir($dest_dir)) {
                    $content[] = '--- SUCCEEDED creating "javascript/modules/passinfo/" directory.';
                } else {
                    $content[] = 'PageSmith 1.0.2 requires the javascript/modules/pagesmith/ directory be writable.</pre>';
                    return false;
                }
            } elseif (!is_writable($dest_dir)) {
                $content[] = 'PageSmith 1.0.2 requires the javascript/modules/pagesmith/passinfo/ directory be writable.</pre>';
                return false;
            }
            $source_dir = PHPWS_SOURCE_DIR . 'mod/pagesmith/javascript/passinfo/';
            if (!PHPWS_File::copy_directory($source_dir, $dest_dir)) {
                $content[] = "--- FAILED copying to {$dest_dir}.</pre>";
                return false;
            } else {
                $content[] = "--- SUCCEEDED copying to {$dest_dir} directory.";
            }
            if (!PHPWS_Boost::inBranch()) {
                $content[] = file_get_contents(PHPWS_SOURCE_DIR . 'mod/pagesmith/boost/changes/1_0_2.txt');
            }
            $content[] = '</pre>';
        case version_compare($currentVersion, '1.0.3', '<'):
            $content[] = '<pre>';
            $source_dir = PHPWS_SOURCE_DIR . 'mod/pagesmith/templates/page_templates/text_only/';
            $dest_dir = $home_dir . 'templates/pagesmith/page_templates/text_only/';
            if (PHPWS_File::copy_directory($source_dir, $dest_dir)) {
                $content[] = "--- Successfully copied {$source_dir}\n    to {$dest_dir}\n";
            } else {
                $content[] = "--- Failed to copy {$source_dir} to {$dest_dir}</pre>";
                return false;
            }
            $files = array('conf/config.php');
            pagesmithUpdateFiles($files, $content);
            if (!PHPWS_Boost::inBranch()) {
                $content[] = file_get_contents(PHPWS_SOURCE_DIR . 'mod/pagesmith/boost/changes/1_0_3.txt');
            }
            $content[] = '</pre>';
        case version_compare($currentVersion, '1.0.4', '<'):
            $content[] = '<pre>';
            $db = new PHPWS_DB('phpws_key');
            $db->addWhere('module', 'pagesmith');
            $db->addValue('edit_permission', 'edit_page');
            if (PHPWS_Error::logIfError($db->update())) {
                $content[] = 'Unable to update phpws_key table.</pre>';
                return false;
            } else {
                $content[] = 'Updated phpws_key table.';
            }
            $content[] = '1.0.4 changes
------------------
+ Fixed pagesmith edit permission.
+ PageSmith home pages were missing edit link.</pre>';
        case version_compare($currentVersion, '1.0.5', '<'):
            $content[] = '<pre>';
            pagesmithUpdateFiles(array('templates/page_templates/text_only/page.tpl'), $content);
            $content[] = '1.0.5 changes
----------------
+ Changed wording on move to front functionality
+ Added move to front to miniadmin
+ Fixed text_only template. Missing closing div tag.
</pre>';
        case version_compare($currentVersion, '1.0.6', '<'):
            $content[] = '<pre>
1.0.6 changes
-------------
+ Small fix to allow linkable images on cached pages.
</pre>';
        case version_compare($currentVersion, '1.0.7', '<'):
            $content[] = '<pre>';
            pagesmithUpdateFiles(array('templates/settings.tpl'), $content);
            $content[] = '1.0.7 changes
-------------
+ PageSmith can be set to automatically create a link when a new page
  is created.
+ Changing a page title now updates the menu link.
</pre>';
        case version_compare($currentVersion, '1.1.0', '<'):
            PHPWS_Core::initModClass('filecabinet', 'Cabinet.php');
            $content[] = '<pre>';
            Cabinet::convertImagesToFileAssoc('ps_block', 'type_id');
            $content[] = '--- Images converted for File Cabinet 2.0.0.';
            pagesmithUpdateFiles(array('javascript/passinfo/head.js', 'templates/page_templates/threesec/page.css', 'templates/page_templates/threesec/page.tpl', 'templates/page_templates/threesec/structure.xml', 'templates/page_templates/threesec/threesec.png'), $content);
            $content[] = '1.1.0 changes (unreleased)
-------------
+ PageSmith conforms to new File Cabinet update.
+ Added url parser to passinfo script to allow images to work with fck better.
</pre>';
        case version_compare($currentVersion, '1.2.1', '<'):
            $content[] = '<pre>';
            $source_tpl = PHPWS_SOURCE_DIR . 'mod/pagesmith/templates/page_templates/';
            $local_tpl = $home_dir . 'templates/pagesmith/page_templates/';
            $backup = $home_dir . 'templates/pagesmith/_page_templates/';
            $source_img = PHPWS_SOURCE_DIR . 'mod/pagesmith/img/folder_icons/';
            $local_img = $home_dir . 'images/mod/pagesmith/folder_icons/';
            if (is_dir($backup) || @PHPWS_File::copy_directory($local_tpl, $backup)) {
                $content[] = '--- Local page templates backed up to: ' . $backup;
            } else {
                $content[] = sprintf('--- Could not backup directory "%s" to "%s"</pre>', $local_tpl, $backup);
                return false;
            }
            if (PHPWS_File::copy_directory($source_tpl, $local_tpl)) {
                $content[] = '--- Local page templates updated.';
            } else {
                $content[] = sprintf('--- Could not copy directory "%s" to "%s"</pre>', $source_tpl, $local_tpl);
                return false;
            }
            if (PHPWS_File::copy_directory($source_img, $local_img)) {
                $content[] = '--- New page template icons copied locally.';
            } else {
                $content[] = sprintf('--- Could not copy directory "%s" to "%s"</pre>', $source_img, $local_img);
                return false;
            }
            if (!pagesmithSearchIndex()) {
                $content[] = '--- Unable to index pages in search. Check your error log.</pre>';
                return false;
            } else {
                $content[] = '--- Pages added to search';
            }
            $files = array('templates/pick_folder.tpl', 'templates/pick_template.tpl', 'templates/style.css', 'conf/folder_icons.php');
            pagesmithUpdateFiles($files, $content);
            $content[] = '1.2.1 changes
----------------
+ PageSmith now allows the sorting of templates
+ Page titles now added to search.
+ Wrong page ids don\'t 404. Send to message page.
+ Search indexing added to update and version raised.
+ Added search to pagesmith.
+ Changed to new url rewriting method.</pre>';
        case version_compare($currentVersion, '1.2.2', '<'):
            $content[] = '<pre>';
            $files = array('templates/page_list.tpl');
            pagesmithUpdateFiles($files, $content);
            $content[] = '
1.2.2 changes
---------------
+ Updated pagers to addSortHeaders.
+ Fixed direct access to page allowing view.
+ Front page does not alter page title.
+ Fixed some notices and a caching bug.
+ Changed wording on edit text windows.</pre>';
        case version_compare($currentVersion, '1.3.0', '<'):
            $db = new PHPWS_DB('ps_block');
            $db->dropTableColumn('btype');
            $db = new PHPWS_DB('ps_page');
            if (PHPWS_Error::logIfError($db->addTableColumn('parent_page', 'int NOT NULL default 0'))) {
                $content[] = 'Could not create ps_page.parent_page column.';
                return false;
            }
            if (PHPWS_Error::logIfError($db->addTableColumn('page_order', 'smallint NOT NULL default 0'))) {
                $content[] = 'Could not create ps_page.page_order column.';
                return false;
            }
            $db = new PHPWS_DB('ps_text');
            if (PHPWS_DB::getDBType() == 'mysql' || PHPWS_DB::getDBType() == 'mysqli') {
                if (PHPWS_Error::logIfError($db->alterColumnType('content', 'longtext NOT NULL'))) {
                    $content[] = 'Could not alter ps_text.content column.';
                }
            }
            $content[] = '<pre>';
            $files = array('javascript/passinfo/head.js', 'templates/page_form.tpl', 'javascript/delete_orphan/', 'javascript/confirm_delete/', 'javascript/update/head.js', 'templates/page_templates/threesec-tbl/', 'templates/orphans.tpl', 'templates/page_form.tpl', 'templates/page_frame.tpl', 'templates/page_list.tpl', 'templates/style.css', 'templates/sublist.tpl', 'templates/upload_template.tpl', 'img/add.png', 'img/delete.png', 'img/back.png', 'img/front.png');
            pagesmithUpdateFiles($files, $content);
            if (!PHPWS_Boost::inBranch()) {
                $content[] = file_get_contents(PHPWS_SOURCE_DIR . 'mod/pagesmith/boost/changes/1_3_0.txt');
            }
            $content[] = '</pre>';
        case version_compare($currentVersion, '1.3.1', '<'):
            $content[] = '<pre>';
            $files = array('templates/page_templates/threesec/page.tpl', 'templates/page_templates/threesec-tbl/page.tpl', 'templates/settings.tpl');
            pagesmithUpdateFiles($files, $content);
            $content[] = '1.3.1 changes
---------------
+ Page cache refreshed on page save.
+ Updated threesec templates to conform with norm box-title,
  box-content layout
+ Added ability to lengthen or shorten pagesmith links.
+ Added fix so edit mode does not parse smarttags.</pre>';
        case version_compare($currentVersion, '1.3.2', '<'):
            $content[] = '<pre>';
            Users_Permission::registerPermissions('pagesmith', $content);
            pagesmithUpdateFiles(array('templates/page_templates/'), $content);
            $content[] = '1.3.2 changes
----------------
+ Update was missing a permission update
+ Wrong permission getting called on settings
+ All page templates now have a class called pagesmith-page
+ Removed padding from page templates</pre>';
        case version_compare($currentVersion, '1.3.3', '<'):
            $db = new PHPWS_DB('ps_text');
            if (PHPWS_Error::logIfError($db->alterColumnType('content', 'longtext'))) {
                $content[] = 'Could not alter ps_text.content column.';
                return false;
            } else {
                $content[] = 'Updated ps_text.content column';
            }
            $content[] = '<pre>';
            pagesmithUpdateFiles(array('javascript/disable_links/', 'javascript/update/head.js'), $content);
            $content[] = 'Version 1.3.3
--------------------------------------------------------------------
+ Made ps_text.content null instead of not null
+ Made a change in page editing. Text spaces receive text without
  formatting. Prior to this change the parseOutput was run before
  sending the data to the editor. This stripped data that may need
  editing.
  Now the text is sent to the editor without processing. After post
  the text IS processed. This fixed the filters. Anchors will be
  busted AFTER the edit post but I don\'t think they really need to
  work in edit mode.
+ Added javascript to prevent accidental link clicks in edit mode.
+ change_link was an id, changed to a class since there were several
  on a page.</pre>';
        case version_compare($currentVersion, '1.3.4', '<'):
            $content[] = '<pre>1.3.4 changes
-------------
+ Fixed link shortening
+ Restored missing placeholder width and height
+ Fixed lost text bug.
</pre>';
        case version_compare($currentVersion, '1.4.0', '<'):
            $content[] = '<pre>1.4.0 changes
-------------
+ Icon class implemented.
+ Fixed on disableLinks script.
+ Added black page check on saving. Prohibits empty content from being saved to the database.
+ Added option to turn off "Back to top" links.
+ Added default installation page.
+ PHP 5 strict fixes.</pre>';
        case version_compare($currentVersion, '1.4.1', '<'):
            $content[] = '<pre>1.4.1 changes
-------------
Fixed bug causing blank editors on edit.</pre>';
        case version_compare($currentVersion, '1.4.2', '<'):
            $content[] = '<pre>1.4.2 changes
-------------
+ Added conditionals to try and prevent blank page posting.
+ Updated javascript to jquery code.
+ Added some new templates.
.</pre>';
        case version_compare($currentVersion, '1.5.0', '<'):
            $content[] = '<pre>1.5.0 changes
---------------
+ New method of editing text. Click on text instead of edit image.
+ Javascript window replaced with Jquery dialog.
</pre>';
        case version_compare($currentVersion, '1.5.1', '<'):
            $content[] = '<pre>1.5.1 changes
---------------
+ Mouseover edit behavior changed.
+ Publish on date added.
</pre>';
        case version_compare($currentVersion, '1.5.2', '<'):
            $content[] = '<pre>1.5.2 changes
---------------
- Fixed error message
- Empty orphans are removed automatically.
- Dialog editor made modal.
</pre>';
        case version_compare($currentVersion, '1.5.3', '<'):
            $content[] = '<pre>1.5.3 changes
---------------
+ Edit hinting changed to Boostrap standard
+ Removed upload template tab and code
+ Font Awesome used in icons
+ Tweaked page listing.
+ Removed default background color from page template.
+ Fixed bug with pages saving untitled.
</pre>';
        case version_compare($currentVersion, '1.5.4', '<'):
            $content[] = '<pre>1.5.4 changes
---------------
+ Added titles to admin icons
+ Removed @ to prevent PHP warning message
+ Style changes to pager listing
+ Pop up width is relative to browser
</pre>';
        case version_compare($currentVersion, '1.6.0', '<'):
            $db = \Database::newDB();
            $table = $db->addTable('ps_page');
            $table->addFieldConditional('template', 'art');
            $table->addValue('template', 'banner');
            $db->update();
            $db->clearConditional();
            $table->reset();
            $c1 = $table->getFieldConditional('template', 'vtour');
            $c2 = $table->getFieldConditional('template', 'VTOUR');
            $db->addConditional($db->createConditional($c1, $c2, 'OR'));
            $table->addValue('template', 'threesec');
            $db->update();
            $content[] = '<pre>1.6.0 changes
---------------
+ Rewrote page templates to be Bootstrap compatible.
+ Removed art and vtour template.
</pre>';
        case version_compare($currentVersion, '1.6.1', '<'):
            $content[] = '<pre>1.6.1 changes
---------------
+ changed content editor pop up to use bootstrap modal instead of jquery dialog
+ Bootstrap styling to some UI elements
+ Back to top link pulled right with new icon
</pre>';
        case version_compare($currentVersion, '1.7.0', '<'):
            $content[] = <<<EOF
<pre>1.7.0 changes
------------------
+ Removed hardcoded h2 styles on some templates
+ Back to top default setting added
+ Clicking off edit window saves content
</pre>
EOF;
        case version_compare($currentVersion, '1.8.0', '<'):
            $db = \Database::newDB();
            $lb = $db->addTable('layout_box');
            $lb->addFieldConditional('module', 'pagesmith');
            $db->delete();
            $content[] = <<<EOF
<pre>1.8.0 changes
------------------
+ Removed all PageSmith pages from layout_box table. Was kept only for multiple front pages which no one used.
</pre>
EOF;
        case version_compare($currentVersion, '1.9.0', '<'):
            $db = \Database::newDB();
            $pp = $db->addTable('ps_page');
            $st = $pp->addDataType('show_title', 'smallint');
            $st->add();
            $content[] = <<<EOF
<pre>1.9.0 changes
------------------
+ Added: Ability to hide title
+ Changed: Pagesmith editing works within Bootstrap modals.
+ Changed: Adapted to work with CKEditor 4.
+ Changed: Front page is now Highlander style.
</pre>
EOF;
        case version_compare($currentVersion, '1.9.1', '<'):
            $db = \Database::newDB();
            $pp = $db->addTable('ps_page');
            if (!$pp->columnExists('hide_title') && $pp->columnExists('show_title')) {
                $dt = $pp->getDatatype('show_title');
                $dt->change('hide_title');
            }
            $content[] = <<<EOF
<pre>1.9.1 changes
------------------
+ Fixed: Code uses hide_title. Column name was show_title.
</pre>
EOF;
        case version_compare($currentVersion, '1.9.2', '<'):
            $content[] = <<<EOF
<pre>1.9.2 changes
------------------
+ Fixed: hide_title was not properly formated in install.sql
+ Fixed: Reduced edit popup window height.
+ Feature: Added save button to CKEditor that works in maximize.
+ Feature: Added page update check to page submission.
+ Change: Save button is styled and larger.
+ Change: New page defaults to Text Only template.
</pre>
EOF;
        case version_compare($currentVersion, '1.10.0', '<'):
            $db = \Database::newDB();
            $t1 = $db->addTable('ps_page');
            $dt = $t1->addDatatype('deleted', 'smallint');
            $dt->setDefault(0);
            $dt->add();
            $content[] = <<<EOF
<pre>
1.10.0 Changes
---------------
+ Deleted pages are kept in database
</pre>
EOF;
    }
    // end switch
    return true;
}
Exemplo n.º 2
0
/**
 * update file for menu
 *
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @version $Id$
 */
function menu_update(&$content, $currentVersion)
{
    $home_directory = PHPWS_Boost::getHomeDir();
    switch ($currentVersion) {
        case version_compare($currentVersion, '1.2.0', '<'):
            $content[] = '<pre>Menu versions prior to 1.2.0 are not supported for update.
Please download 1.2.1.</pre>';
            break;
        case version_compare($currentVersion, '1.2.1', '<'):
            $content[] = '<pre>1.2.1 changes
-----------------
+ Fixed bug with making home link.
</pre>';
        case version_compare($currentVersion, '1.3.0', '<'):
            $files = array('conf/config.php', 'templates/admin/settings.tpl', 'templates/links/link.tpl', 'templates/popup_admin.tpl');
            $content[] = '<pre>';
            if (PHPWS_Boost::updateFiles($files, 'menu')) {
                $content[] = '--- Successfully updated the following files:';
            } else {
                $content[] = '--- Was unable to copy the following files:';
            }
            $content[] = '     ' . implode("\n     ", $files);
            $content[] = '
1.3.0 changes
-----------------
+ Admin icon for links is now clickable. Pulls up window of options.
+ Added ability to disable floating admin links.
</pre>';
        case version_compare($currentVersion, '1.3.1', '<'):
            $files = array('templates/site_map.tpl');
            $content[] = '<pre>';
            if (PHPWS_Boost::updateFiles($files, 'menu')) {
                $content[] = '--- Successfully updated the following files:';
            } else {
                $content[] = '--- Was unable to copy the following files:';
            }
            $content[] = '     ' . implode("\n     ", $files);
            $content[] = '
1.3.1 changes
-----------------
+ Bug # 1609737. Fixed site_map.tpl file. Thanks Andy.
</pre>';
        case version_compare($currentVersion, '1.4.0', '<'):
            $content[] = '<pre>';
            $basic_dir = $home_directory . 'templates/menu/menu_layout/basic/';
            $horz_dir = $home_directory . 'templates/menu/menu_layout/horizontal/';
            if (!is_dir($basic_dir)) {
                if (PHPWS_File::copy_directory(PHPWS_SOURCE_DIR . 'mod/menu/templates/menu_layout/basic/', $basic_dir)) {
                    $content[] = "--- Successfully copied directory: {$basic_dir}";
                } else {
                    $content[] = "--- Failed to copy directory: {$basic_dir}</pre>";
                    return false;
                }
            }
            if (!is_dir($horz_dir)) {
                if (PHPWS_File::copy_directory(PHPWS_SOURCE_DIR . 'mod/menu/templates/menu_layout/horizontal/', $horz_dir)) {
                    $content[] = "--- Successfully copied directory: {$horz_dir}";
                } else {
                    $content[] = "--- Failed to copy directory: {$horz_dir}</pre>";
                    return false;
                }
            }
            menuUpdateFiles(array('conf/error.php'), $content);
            if (!PHPWS_Boost::inBranch()) {
                $content[] = file_get_contents(PHPWS_SOURCE_DIR . 'mod/menu/boost/changes/1_4_0.txt');
            }
            $content[] = '</pre>';
        case version_compare($currentVersion, '1.4.1', '<'):
            $content[] = '<pre>';
            $files = array('templates/admin/settings.tpl', 'templates/admin/menu_list.tpl');
            menuUpdateFiles($files, $content);
            if (!PHPWS_Boost::inBranch()) {
                $content[] = file_get_contents(PHPWS_SOURCE_DIR . 'mod/menu/boost/changes/1_4_1.txt');
            }
            $content[] = '</pre>';
        case version_compare($currentVersion, '1.4.2', '<'):
            $content[] = '<pre>';
            $db = new PHPWS_DB('menus');
            $db->addWhere('template', 'basic.tpl');
            $db->addValue('template', 'basic');
            if (PHPWS_Error::logIfError($db->update())) {
                $content[] = '--- Failed to update menus table.';
            } else {
                $content[] = '--- Updated menu table with correct template directory.';
            }
            $files = array('templates/admin/settings.tpl');
            menuUpdateFiles($files, $content);
            if (!PHPWS_Boost::inBranch()) {
                $content[] = file_get_contents(PHPWS_SOURCE_DIR . 'mod/menu/boost/changes/1_4_2.txt');
            }
            $content[] = '</pre>';
        case version_compare($currentVersion, '1.4.3', '<'):
            $content[] = '<pre>';
            $files = array('templates/admin/settings.tpl');
            menuUpdateFiles($files, $content);
            if (!PHPWS_Boost::inBranch()) {
                $content[] = file_get_contents(PHPWS_SOURCE_DIR . 'mod/menu/boost/changes/1_4_3.txt');
            }
            $content[] = '</pre>';
        case version_compare($currentVersion, '1.4.4', '<'):
            $content[] = '<pre>
1.4.4 Changes
--------------
+ Added three new menu functions:
  o quickLink - inserts a new link on any menu pinned on all pages;
                passed a title and url.
  o quickKeyLink - same as above but passed key_id
  o updateKeyLink - causes a link to reset its url, title, and active
                    status based on the condition of the current key
                    it is based on.</pre>';
        case version_compare($currentVersion, '1.4.5', '<'):
            $content[] = '<pre>
1.4.5 Changes
--------------
+ Fixed some submenus not appearing when sibling chosen.</pre>';
        case version_compare($currentVersion, '1.4.6', '<'):
            $content[] = '<pre>';
            menuUpdateFiles(array('templates/admin/menu_list.tpl'), $content);
            $content[] = '1.4.6 Changes
--------------
+ Update to addSortHeaders.
+ Adding missing paging navigation.</pre>';
        case version_compare($currentVersion, '1.5.0', '<'):
            $db = new PHPWS_DB('menu_links');
            PHPWS_Error::logIfError($db->alterColumnType('title', 'varchar(255) not null'));
            $files = array('templates/style.css', 'templates/menu_layout/basic/menu.tpl', 'templates/menu_layout/basic/link.tpl', 'templates/menu_layout/horizontal/menu.tpl', 'templates/admin/settings.tpl', 'img/icon_indent.png', 'img/icon_outdent.gif', 'javascript/admin_link/', 'conf/config.php');
            $content[] = '<pre>';
            menuUpdateFiles($files, $content);
            $content[] = '1.5.0 Changes
--------------
+ RFE #2060159: Pin page link appears in miniadmin if admin mode is
  set to appear there.
+ Fixed bug #2079194. Deleting menu now removes links as well. Thanks
  Tommy.
+ Added option to expand menus when admin mode is enabled
+ Reworded menu admin link.
+ Added more ajax controls (add, delete, move) to the admin menu.
+ getTitle returns link without decoding it. Needed to prevent
  breakage with quotation marks.
+ Increased some popup window sizes
+ Fixed current link problem with unkeyed items.
+ Increased link title length in database.
</pre>';
        case version_compare($currentVersion, '1.5.1', '<'):
            $content[] = '<pre>1.5.1 changes
-------------------
+ Fixed menu preventing unpinning.
+ Default is now false for menu expansion in admin mode.</pre>';
        case version_compare($currentVersion, '1.5.2', '<'):
            $content[] = '<pre>';
            $files = array('templates/site_map.tpl', 'templates/menu_layout/basic/menu.tpl', 'templates/menu_layout/horizontal/menu.tpl');
            menuUpdateFiles($files, $content);
            $content[] = '1.5.2 changes
---------------
+ Added Verdon\'s edit full menu sitemap
+ Removed duplicate pin page link in miniadmin
+ Wrapped default menu template in box-content div per patch by Obones
+ Local links created on key pages were not made current.
+ Commented out pin page link in template</pre>';
        case version_compare($currentVersion, '1.6.0', '<'):
            $db = new PHPWS_DB('menus');
            if (PHPWS_Error::logIfError($db->addTableColumn('key_id', 'int not null default 0'))) {
                return false;
            }
            PHPWS_Core::initModClass('menu', 'Menu_Item.php');
            $menus = $db->getObjects('Menu_Item');
            if (!empty($menus) && !PHPWS_Error::logIfError($menus)) {
                foreach ($menus as $m) {
                    $m->save();
                }
            }
            $content[] = '<pre>';
            $files = array('img/icon_outdent.gif', 'conf/config.php', 'javascript/admin_link/default.php', 'javascript/admin_link/menu.js', 'templates/admin/settings.tpl');
            menuUpdateFiles($files, $content);
            $content[] = '1.6.0 changes
---------------
+ Fixed bugs with popup menu.
+ Added "outdent" ability
+ Added ability to set view permissions on menus.
+ Added option to have add links always on.
</pre>';
        case version_compare($currentVersion, '1.6.1', '<'):
            $content[] = '<pre>';
            $files = array('templates/menu_layout/basic/link.tpl', 'templates/menu_layout/horizontal/link.tpl', 'templates/style.css', 'conf/config.php', 'img/icon_outdent.gif');
            menuUpdateFiles($files, $content);
            $content[] = '1.6.1 changes
---------------
+ Fixed up arrows and indent icons not appearing.
</pre>';
        case version_compare($currentVersion, '1.6.2', '<'):
            $content[] = '<pre>1.6.2 changes
---------------
+ Added file include for missing class.
+ Added missing indent tags to popup_admin.tpl</pre>
';
        case version_compare($currentVersion, '1.6.3', '<'):
            $content[] = '<pre>1.6.3 changes
---------------
+ View permission fix.
+ Icon class used.
+ PHP 5 strict fixes</pre>
';
        case version_compare($currentVersion, '1.6.4', '<'):
            $content[] = '<pre>1.6.4 changes
---------------
+ Bug fix with database initialization
+ Added code from Eloi George reducing DB queries</pre>
';
        case version_compare($currentVersion, '1.6.5', '<'):
            $content[] = '<pre>1.6.5 changes
----------------
+ Patch from Eloi that reduces database calls on menu creation.
+ Fixed notice bugs from link movement
</pre>';
        case version_compare($currentVersion, '1.6.6', '<'):
            $content[] = '<pre>1.6.6 changes
----------------
+ Fixed bug with javascript in menu admin.
+ Changed getUrl to return just the href and not a complete tag.
</pre>';
        case version_compare($currentVersion, '1.6.7', '<'):
            $content[] = '<pre>1.6.7 changes
----------------
+ Fixed bug with add link not appearing on home page
+ Re-ordered administrative options in "mouse hover" menu for menu link
+ Added additional conditional to prevent menu expansion on a blank url
</pre>';
        case version_compare($currentVersion, '1.6.8', '<'):
            $content[] = '<pre>1.6.8 changes
----------------
+ menu-link-href class added to the "a" menu tag.
+ Font Awesome links used in admin functionality.
+ Old graphic files removed.
+ Changed some working to make admin options more clear.
</pre>';
        case version_compare($currentVersion, '2.0.0', '<'):
            $db = \Database::newDB();
            $tbl = $db->addTable('menus');
            $tbl->addDataType('queue', 'smallint')->add();
            $tbl->addField('id');
            $count = 0;
            while ($id = $db->selectColumn()) {
                $count++;
                $tbl->addValue('queue', $count);
                $tbl->addFieldConditional('id', $id);
                $db->update();
                $tbl->resetValues();
                $db->clearConditional();
            }
            $content[] = '<pre>2.0.0 changes
----------------
+ Rewrote large parts of administration
+ Category view for menus
</pre>';
        case version_compare($currentVersion, '2.0.1', '<'):
            $db = \Database::newDB();
            $tbl = $db->addTable('menus');
            $tbl->addDataType('assoc_key', 'int')->add();
            $content[] = '<pre>2.0.1 changes
----------------
+ Can associate page to a menu
</pre>';
        case version_compare($currentVersion, '2.0.2', '<'):
            $db = \Database::newDB();
            $tbl = $db->addTable('menus');
            $dt = $tbl->addDataType('assoc_url', 'varchar');
            $dt->setIsNull(true);
            $dt->add();
            $content[] = '<pre>2.0.2 changes
----------------
+ Can associate url to a menu
</pre>';
        case version_compare($currentVersion, '2.0.3', '<'):
            $new_directory = $home_directory . 'images/menu/';
            if (!is_dir($new_directory)) {
                $status = mkdir($new_directory);
                if (!$status) {
                    $content[] = "Could not create directory {$new_directory}.";
                    return false;
                }
            }
            $db = \Database::newDB();
            $tbl = $db->addTable('menus');
            $dt = $tbl->addDataType('assoc_image', 'varchar');
            $dt->setIsNull(true);
            $dt->add();
            $content[] = "<pre>2.0.3 changes\n----------------\n+ Created {$new_directory}\n+ Can associate image to a menu\n</pre>";
        case version_compare($currentVersion, '2.0.4', '<'):
            $content[] = "<pre>2.0.4 changes\n----------------\n+ Fixed home icon set as active when menu associated page is chosen.\n</pre>";
        case version_compare($currentVersion, '2.0.5', '<'):
            $content[] = "<pre>2.0.5 changes\n----------------\n+ Reset menu button now sorts all links as well\n+ Menu images not loaded if tablet width or below\n</pre>";
        case version_compare($currentVersion, '2.1.0', '<'):
            $content[] = <<<EOF
<pre>2.1.0 changes
-----------------
+ Created settings icon for display type and character limit.
+ If PageSmith creates a menu link, an access shortcut will be used if it exists.
+ Removed old icons.
+ Menu assoc_url will pull shortcut if it exists for page.
+ Added button to shortcut all links.
+ Menu can copy carousel images.
+ Added ability for menu links to have external and pdf icons.
+ Fixed: local links changes into bad http urls.
+ Fixed: Menu images will work on classic menus.
+ Fixed: Theme template style sheets not working.
+ Fixed: isDummy check was not set for home page.
+ Added Bootstrap icons
+ Fixed: Menu link no getting saved if PageSmith pages are not available.
+ Fixed: Home link highlighted with other links.
+ Fixed: Drop down options not working in MiniAdmin
</pre>           
EOF;
    }
    return true;
}