Пример #1
0
/**
 * @version $Id$
 * @author Matthew McNaney <mcnaney at gmail dot com>
 */
function rss_update(&$content, $version)
{
    switch ($version) {
        case version_compare($version, '0.1.0', '<'):
            $content[] = '- Changed to binary safe file pull.';
            $content[] = '- Added system error checks and warnings.';
        case version_compare($version, '0.1.1', '<'):
            $content[] = '- Channel title now linked to feed.';
            $content[] = '- mod_rewrite works with feed.';
        case version_compare($version, '0.1.2', '<'):
            $content[] = '<pre>
0.1.2 changes
-------------
+ Added some error checks to feed translation.
</pre>';
        case version_compare($version, '0.1.3', '<'):
            $content[] = '<pre>
0.1.3 changes
-------------
+ Added translate functions
</pre>';
        case version_compare($version, '0.1.4', '<'):
            PHPWS_Boost::updateFiles(array('img/rss.png'), 'rss');
            $content[] = '<pre>
0.1.4 changes
-------------
+ Add German translation files.
+ Updated language functions.
+ Changed control panel icon
</pre>';
        case version_compare($version, '0.2.0', '<'):
            $db = new PHPWS_DB('rss_channel');
            PHPWS_Error::logIfError($db->dropTableColumn('last_build_date'));
            $content[] = '<pre>';
            $files = array('templates/rss20.tpl', 'templates/settings.tpl');
            if (PHPWS_Boost::updateFiles($files, 'rss')) {
                $content[] = '--- Successfully updated the following files:';
            } else {
                $content[] = '--- Could NOT update the following files successfully:';
            }
            $content[] = '    ' . implode("\n    ", $files);
            $content[] = '
0.2.0 changes
---------------
+ RSS 2.0 is now useable.
+ Added settings page for some of the RSS 2.0 options
+ Removed a header line that caused some verification errors in the 2.0 template.
+ Changed template process. Some fields were missing from the feeds.
';
        case version_compare($version, '0.2.1', '<'):
            $content[] = '<pre>
0.2.1 changes
-------------
+ Changed rss popup window dimensions and form text length
</pre>';
        case version_compare($version, '0.2.2', '<'):
            $content[] = '<pre>
0.2.2 changes
-------------
+ Added line of code to Feed to prevent error on bad data.
+ Added Vietnamese translation.
</pre>';
        case version_compare($version, '0.2.3', '<'):
            PHPWS_Boost::updateFiles(array('templates/admin_feeds.tpl'), 'rss');
            $content[] = '<pre>
0.2.3 changes
-------------
+ Added error check on feed listing.
+ Shortened urls
+ Added sort button to feed listing.
</pre>';
        case version_compare($version, '0.2.4', '<'):
            $content[] = '<pre>
0.2.4 changes
-------------
+ Fixed the timeout setting for the rss caching.
</pre>';
        case version_compare($version, '0.2.5', '<'):
            $content[] = '<pre>
0.2.5 changes
-------------
+ Mod rewrite link added to rss feed.
+ High ascii characters have their ampersand parsed.
</pre>';
        case version_compare($version, '0.2.6', '<'):
            $content[] = '<pre>
0.2.6 changes
-------------
+ RSS will not pull expired or unpublished keys any longer.
</pre>';
        case version_compare($version, '0.3.0', '<'):
            $content[] = '<pre>
0.3.0 changes
-------------
+ Fixed feed date formats.
+ Sub ampersand code for straight &
+ PHP 5 formatted.
</pre>';
        case version_compare($version, '0.3.1', '<'):
            $content[] = '<pre>
0.3.1 changes
-------------
+ Patch #2500049 - Olivier Sannier : prepares a string for output in
  the resulting XML stream. It ensures it does not contain any XML
  entities and that the line breaks are output correctly.
</pre>';
        case version_compare($version, '0.3.2', '<'):
            $content[] = '<pre>
0.3.2 changes
--------------
+ Changed Channel to only pull active keys.</pre>';
        case version_compare($version, '0.3.3', '<'):
            $content[] = '<pre>
0.3.3 changes
--------------
+ Check made on feed array in case it was force fed it won\'t get overwritten.</pre>';
        case version_compare($version, '0.3.4', '<'):
            $content[] = '<pre>
0.3.4 changes
--------------
+ PHP 5 strict changes</pre>';
        case version_compare($version, '0.3.5', '<'):
            $content[] = '<pre>
0.3.5 changes
--------------
+ RSS feed date fix from Tommy de Jesus</pre>';
        case version_compare($version, '0.3.6', '<'):
            $content[] = '<pre>
0.3.6 changes
--------------
+ Fixed install registration.
+ Fixed labels under Bootstrap.
+ Missing CURRENT_LANGUAGE define added.
+ Bootstrap icons and tables added.
+ Put correct rss.php directory in file check.
</pre>';
    }
    return true;
}
Пример #2
0
/**
 * @author Matthew McNaney <mcnaney at gmail dot com>
 * @version $Id$
 */
function layout_update(&$content, $currentVersion)
{
    switch ($currentVersion) {
        case version_compare($currentVersion, '2.2.0', '<'):
            $content[] = 'This package will not update versions under 2.2.0.';
            return false;
        case version_compare($currentVersion, '2.2.1', '<'):
            $content[] = '+ Fixed improper sql call in update_220.sql file.';
        case version_compare($currentVersion, '2.3.0', '<'):
            $content[] = '<pre>';
            if (PHPWS_Boost::updateFiles(array('conf/config.php', 'conf/error.php'), 'layout')) {
                $content[] = 'Updated conf/config.php and conf/error.php file.';
            } else {
                $content[] = 'Unable to update conf/config.php and conf/error.php file.';
            }
            $content[] = '
2.3.0 changes
-------------
+ Removed references from object constructors.
+ Added the plug function to allow users to inject content directly
  into a theme.
+ Added translate functions.
+ Layout now looks for and includes a theme\'s theme.php file.
+ Fixed unauthorized access.
+ Added XML mode to config.php file. Puts Layout in XHTML+XML content mode.
+ Added missing media parameters to XML mode.
</pre>';
        case version_compare($currentVersion, '2.4.0', '<'):
            $files = array('img/layout.png', 'templates/no_cookie.tpl');
            $content[] = '<pre>';
            if (PHPWS_Boost::updateFiles($files, 'layout')) {
                $content[] = '--- Successfully updated the following files:';
            } else {
                $content[] = '--- Was unable to copy the following files:';
            }
            $content[] = '     ' . implode("\n     ", $files);
            $content[] = '
2.4.0 changes
-------------
+ Layout now checks and forces a user to enable cookies on their
  browser.
+ Rewrote Javascript detection. Was buggy before as session
  destruction could disrupt it.
+ Added German translations
+ Updated language functions
+ Fixed: bug in Layout confused a user\'s style sheet settings after
  the theme was changed.
+ Rewrote theme change code.
+ Added ability to force theme on layout settings construction.
+ Changed Control Panel icon
</pre>';
        case version_compare($currentVersion, '2.4.1', '<'):
            $files = array('conf/config.php');
            $content[] = '<pre>';
            if (PHPWS_Boost::updateFiles($files, 'layout')) {
                $content[] = '--- Successfully updated the following files:';
            } else {
                $content[] = '--- Was unable to copy the following files:';
            }
            $content[] = '     ' . implode("\n     ", $files);
            $content[] = '
2.4.1 changes
-------------
+ Bug #1741111 - Fixed moving a top box up and a bottom box down.
+ The cookie check is not determined by a define in the config file.
+ The cookie check was interfering with the rss feed. Cut off the page
  too quickly. Moved cookie check to the close.php file.
</pre>';
        case version_compare($currentVersion, '2.4.2', '<'):
            $content[] = '<pre>';
            $files = array('templates/arrange.tpl', 'conf/error.php', 'templates/move_box_select.tpl');
            layoutUpdateFiles($files, $content);
            if (!PHPWS_Boost::inBranch()) {
                $content[] = file_get_contents(PHPWS_SOURCE_DIR . 'mod/layout/boost/changes/2_4_2.txt');
            }
            $content[] = '</pre>';
        case version_compare($currentVersion, '2.4.3', '<'):
            $content[] = '<pre>2.4.3 changes
-----------------
+ nakedDisplay now allows a choice whether to use the blank template
  or not when it wraps. Default is to not.
+ Fixed noCache.
</pre>';
        case version_compare($currentVersion, '2.4.4', '<'):
            $content[] = '<pre>';
            $db = new PHPWS_DB('layout_config');
            if (PHPWS_Error::logIfError($db->dropTableColumn('userAllow'))) {
                $content[] = '--- An error occurred when trying to drop the userAllow column from the layout_config table.';
            } else {
                $content[] = '--- Dropped the userAllow column from the layout_config table.';
            }
            layoutUpdateFiles(array('templates/user_form.tpl'), $content);
            $content[] = '2.4.4 changes
-------------------
+ Dropped unused column from config table.
+ Added collapse function. Adds id="layout-collapse" to theme template
  under the {COLLAPSE} tag.
+ Changed method of checking for javascript status. Less chance for
  error.
+ Fixed notice.</pre>';
        case version_compare($currentVersion, '2.4.5', '<'):
            $content[] = '<pre>';
            $db = new PHPWS_DB('layout_config');
            if (PHPWS_Error::logIfError($db->addTableColumn('deity_reload', 'smallint not null default 0'))) {
                $content[] = 'Could not create layout_config.deity_reload column.';
                return false;
            } else {
                $content[] = 'Added layout_config.deity_reload column.';
            }
            layoutUpdateFiles(array('templates/metatags.tpl', 'conf/config.php'), $content);
            $content[] = '2.4.5 changes
--------------------
+ Added option to use a Key\'s summary or title to fill in the meta
  description.
+ Added new cacheHeader function to retain javascript and css
  information should a module return cached content before the above
  can be established.
+ Deities can now move a box to a theme locked area.
+ Added LAYOUT_IGNORE_JS_CHECK to force javascript use.
+ PHP 5 formatted';
        case version_compare($currentVersion, '2.4.6', '<'):
            $content[] = '<pre>2.4.6 changes
---------------------
+ Fix to cache headers
</pre>';
        case version_compare($currentVersion, '2.4.7', '<'):
            $content[] = '<pre>';
            layoutUpdateFiles(array('templates/themes.tpl'), $content);
            $content[] = '2.4.7 changes
---------------------
+ Added option to layout theme tab to disable or order module style
  sheet inclusion.
+ Can enable box move from mini admin
</pre>';
        case version_compare($currentVersion, '2.4.8', '<'):
            $content[] = '<pre>2.4.8 changes
---------------------
+ Bug#2424256 - Removed browser check to use @import on style sheets.
</pre>';
        case version_compare($currentVersion, '2.5.0', '<'):
            $content[] = '<pre>2.5.0 changes
---------------------
+ Icon class used.
+ Change of template directories to conform with core hub/branch change.
+ PHP 5 strict fixes.
+ New javascript detection method.
+ Default theme is now simple.
+ Allow admin to use hub or local themes.
</pre>';
        case version_compare($currentVersion, '2.5.1', '<'):
            $content[] = '<pre>2.5.1 changes
---------------------
+ Eloi George javascript patch applied
</pre>';
        case version_compare($currentVersion, '2.5.2', '<'):
            $content[] = '<pre>2.5.2 changes
---------------------
+ Eloi George templating patch added.
+ Fixed silent javascript failure.
</pre>';
        case version_compare($currentVersion, '2.5.3', '<'):
            $content[] = '<pre>2.5.3 changes
---------------------
+ Added HTTP tag for theming. Assists with http vs https
+ HOME_URL also added for theming.
</pre>';
        case version_compare($currentVersion, '2.5.4', '<'):
            $content[] = '<pre>2.5.4 changes
---------------------
+ Static notice corrected.
+ Page title can be changed from miniadmin
</pre>';
        case version_compare($currentVersion, '2.5.5', '<'):
            require_once PHPWS_SOURCE_DIR . 'mod/users/class/My_Page.php';
            My_Page::unregisterMyPage('layout');
            $content[] = '<pre>2.5.5 changes
---------------------
+ Unregister My Page
</pre>';
        case version_compare($currentVersion, '2.6.0', '<'):
            $content[] = <<<EOF
<pre>2.6.0 changes
--------------------
+ Removed Layout\\'s caching code.
+ Fixed layout's problem with locked content variables.
+ Fixed: Content without a content_var was overwriting previously unlabeled content.
+ Added Layout method includeJavascript. Shortcut for script inclusion over addJSHeader.
+ Added Font Awesome icons.
+ Reworded box move command in miniadmin.
+ Removed deprecated ckeditor function.
</pre>
EOF;
        case version_compare($currentVersion, '2.6.1', '<'):
            $content[] = <<<EOF
<pre>2.6.1 changes
--------------------
+ Added THEME_HTTP to the Layout wrap function.
</pre>
EOF;
        case version_compare($currentVersion, '2.7.0', '<'):
            if (PHPWS_Core::moduleExists('block')) {
                $db = Database::newDB();
                $t = $db->addTable('layout_config');
                $t->addField('header');
                $t->addField('footer');
                $config_result = $db->selectOneRow();
                if (!empty($config_result['header'])) {
                    $header_block = new Block_Item();
                    $header_block->title = 'Layout header';
                    $header_block->content = $_SESSION['Layout_Settings']->header;
                    $header_block->hide_title = true;
                    $header_block->save();
                }
                if (!empty($config_result['footer'])) {
                    $footer_block = new Block_Item();
                    $footer_block->title = 'Layout footer';
                    $footer_block->content = $_SESSION['Layout_Settings']->footer;
                    $footer_block->hide_title = true;
                    $footer_block->save();
                }
            }
            $content[] = <<<EOF
<pre>2.7.0 changes
--------------------
+ Removed header and footer. Moved data to Blocks.
+ Fixed some admin forms
</pre>
EOF;
    }
    return true;
}
Пример #3
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;
}
Пример #4
0
function fc_update_parent_links()
{
    // Nulling the url column for images with 'parent' set as url
    $db = new PHPWS_DB('images');
    $db->addWhere('url', 'parent');
    $db->addValue('url', NULL);
    PHPWS_Error::logIfError($db->update());
    // remove superfluous column
    PHPWS_Error::logIfError($db->dropTableColumn('parent_id'));
}
Пример #5
0
/**
 * Description
 * @author Jeff Tickle <jtickle at tux dot appstate dot edu>
 */
function analytics_update(&$content, $currentVersion)
{
    switch ($currentVersion) {
        case version_compare($currentVersion, '1.0.1', '<'):
            $db = new PHPWS_DB('analytics_tracker');
            $result = $db->addTableColumn('disable_if_logged', 'int NOT NULL default 0');
            if (PHPWS_Error::logIfError($result)) {
                $content[] = 'Unable to add disable_if_logged column to analytics_tracker table.';
                return false;
            }
            $files = array('templates/edit.tpl');
            if (PHPWS_Boost::updateFiles($files, 'analytics')) {
                $content[] = '--- Updated templates/edit.tpl';
            }
        case version_compare($currentVersion, '1.1.0', '<'):
            // install.sql has been wrong for awhile, this should fix any discrepancies
            $db = new PHPWS_DB('analytics_tracker');
            if (!$db->isTableColumn('disable_if_logged')) {
                $result = $db->addTableColumn('disable_if_logged', 'int NOT NULL default 0');
                if (PHPWS_Error::logIfError($result)) {
                    $content[] = 'Unable to add disable_if_logged column to analytics_tracker table.';
                    return false;
                }
                $content[] = '--- Added disable_if_logged option to database';
            }
            // Load new schema
            $db = new PHPWS_DB();
            $result = $db->importFile(PHPWS_SOURCE_DIR . 'mod/analytics/boost/update/1.1.0.sql');
            if (PHPWS_Error::logIfError($result)) {
                $content[] = 'Unable to import updated schema for version 1.1.0.';
                return false;
            }
            $content[] = '--- Updated Analytics schema to 1.1.0';
            // Move Google Analytics data to its own table
            $db = new PHPWS_DB('analytics_tracker');
            $db->addColumn('id');
            $db->addColumn('account');
            $db->addWhere('type', 'GoogleAnalyticsTracker');
            $result = $db->select();
            if (PHPWS_Error::logIfError($result)) {
                $content[] = 'Unable to select Google Analytics tracker from analytics_tracker table.';
                return false;
            }
            foreach ($result as $row) {
                $db = new PHPWS_DB('analytics_tracker_google');
                $db->addValue('id', $row['id']);
                // Adding UA- into the account identifier to reduce confusion
                $db->addValue('account', 'UA-' . $row['account']);
                $db->insert(false);
                $content[] = "--- Migrated Google Analytics configuration for account UA-{$row['account']}";
            }
            $db = new PHPWS_DB('analytics_tracker');
            $result = $db->dropTableColumn('account');
            if (PHPWS_Error::logIfError($result)) {
                $content[] = 'Unable to remove account column from analytics_tracker table.';
                return false;
            }
            $content[] = '--- Completed migration to Analytics 1.1.0 schema';
        case version_compare($currentVersion, '1.1.1', '<'):
            $content[] = <<<EOF
<pre>Version 1.1.1
-------------------
+ Piwik fix.
+ Fixed uninstall script
</pre>
EOF;
    }
    return true;
}