Преглед изворни кода

Merge branch 'master' of https://github.com/boonex/dolphin

AntonLV пре 12 година
родитељ
комит
e3b1ed9eef

+ 24 - 5
inc/classes/BxDolImageResize.php

@@ -34,6 +34,7 @@ class BxDolImageResize extends BxDol implements iBxDolSingleton {
 
 
     var $w = 64, $h = 64; ///< size of destination image
     var $w = 64, $h = 64; ///< size of destination image
     var $_isCrop = false;
     var $_isCrop = false;
+    var $_isAutoCrop = false;
     var $_cropX, $_cropY, $_cropW, $_cropH;
     var $_cropX, $_cropY, $_cropW, $_cropH;
     var $_iForceOutputType = false; ///< force IMAGE_TYPE_PNG, IMAGE_TYPE_PNG, IMAGE_TYPE_GIF or false to keep the original format // TODO: check if this setting works when ImageMagick is used
     var $_iForceOutputType = false; ///< force IMAGE_TYPE_PNG, IMAGE_TYPE_PNG, IMAGE_TYPE_GIF or false to keep the original format // TODO: check if this setting works when ImageMagick is used
     var $_iJpegQuality = 90; ///< jpeg quality
     var $_iJpegQuality = 90; ///< jpeg quality
@@ -123,6 +124,7 @@ class BxDolImageResize extends BxDol implements iBxDolSingleton {
 
 
     function removeCropOptions () {
     function removeCropOptions () {
         $this->_isCrop = false;
         $this->_isCrop = false;
+        $this->_isAutoCrop = false;
     }
     }
 
 
     function setCropOptions ($x, $y, $w, $h) {
     function setCropOptions ($x, $y, $w, $h) {
@@ -133,6 +135,12 @@ class BxDolImageResize extends BxDol implements iBxDolSingleton {
         $this->_cropH = $h;
         $this->_cropH = $h;
     }
     }
 
 
+    /**
+     * Crop image to destination size with filling whole area of destination size
+     */
+    function setAutoCrop ($b) {
+        $this->_isAutoCrop = $b;
+    }
 
 
     function setJpegOutput ($b) {
     function setJpegOutput ($b) {
         $this->setOutputType($b ? IMAGE_TYPE_JPG : false);
         $this->setOutputType($b ? IMAGE_TYPE_JPG : false);
@@ -239,8 +247,23 @@ class BxDolImageResize extends BxDol implements iBxDolSingleton {
         $xd = $yd = 0;
         $xd = $yd = 0;
         $xs = $ys = 0;
         $xs = $ys = 0;
 
 
-        if ($this->_isCrop) {
+        if ($this->_isAutoCrop) {
+            $sourceRatio = (float) ($size[0] / $size[1]);
+            $destRatio = (float) ($this->w / $this->h);
+            if ( $sourceRatio > $destRatio )
+                $resizeRatio = (float) ($this->h / $size[1]);
+            else
+                $resizeRatio = (float) ($this->w / $size[0]);
+            $destW = (int) ($resizeRatio * $size[0]);
+            $destH = (int) ($resizeRatio * $size[1]);
 
 
+            if ($destW > $this->w)
+                $this->setCropOptions (floor(($size[0] - $this->w/$resizeRatio)/2.0), 0, floor($this->w/$resizeRatio), $size[1]);
+            elseif ($destH > $this->h)
+                $this->setCropOptions (0, floor(($size[1] - $this->h/$resizeRatio)/2.0), $size[0], floor($this->h/$resizeRatio));
+        }
+
+        if ($this->_isCrop) {
             $size[0] = $this->_cropW;
             $size[0] = $this->_cropW;
             $size[1] = $this->_cropH;
             $size[1] = $this->_cropH;
 
 
@@ -279,13 +302,9 @@ class BxDolImageResize extends BxDol implements iBxDolSingleton {
             $sourceRatio = (float) ($size[0] / $size[1]);
             $sourceRatio = (float) ($size[0] / $size[1]);
             $destRatio = (float) ($this->w / $this->h);
             $destRatio = (float) ($this->w / $this->h);
             if ( $sourceRatio > $destRatio )
             if ( $sourceRatio > $destRatio )
-            {
                 $resizeRatio = (float) ($this->w / $size[0]);
                 $resizeRatio = (float) ($this->w / $size[0]);
-            }
             else
             else
-            {
                 $resizeRatio = (float) ($this->h / $size[1]);
                 $resizeRatio = (float) ($this->h / $size[1]);
-            }
             $destW = (int) ($resizeRatio * $size[0]);
             $destW = (int) ($resizeRatio * $size[0]);
             $destH = (int) ($resizeRatio * $size[1]);
             $destH = (int) ($resizeRatio * $size[1]);
 
 

+ 6 - 3
inc/classes/BxDolImageTranscoder.php

@@ -515,12 +515,15 @@ class BxDolImageTranscoder extends BxDol implements iBxDolFactoryObject {
         $o->removeCropOptions ();
         $o->removeCropOptions ();
 
 
         if (isset($aParams['w']) && isset($aParams['h']))
         if (isset($aParams['w']) && isset($aParams['h']))
-            $o->setSize ($aParams['w'], $aParams['h']);                
+            $o->setSize ($aParams['w'], $aParams['h']);
 
 
-        if (isset($aParams['square_resize']) && $aParams['square_resize'])
+        if (isset($aParams['crop_resize']) && $aParams['crop_resize']) {
+            $o->setAutoCrop (true);
+        } elseif (isset($aParams['square_resize']) && $aParams['square_resize']) {
             $o->setSquareResize (true);
             $o->setSquareResize (true);
-        else
+        } else {
             $o->setSquareResize (false);
             $o->setSquareResize (false);
+        }
 
 
         $this->_checkForceType ($o, $aParams);
         $this->_checkForceType ($o, $aParams);
 
 

+ 1 - 1
inc/security.inc.php

@@ -53,7 +53,7 @@ if ((-1 != $iImpactLog || -1 != $iImpactBlock) && !defined('BX_DOL_CRON_EXECUTE'
 
 
 
 
         $init->config['General']['HTML_Purifier_Path'] = BX_DIRECTORY_PATH_PLUGINS . 'htmlpurifier/HTMLPurifier.standalone.php';
         $init->config['General']['HTML_Purifier_Path'] = BX_DIRECTORY_PATH_PLUGINS . 'htmlpurifier/HTMLPurifier.standalone.php';
-        $init->config['General']['HTML_Purifier_Cache'] = '../../htmlpurifier/standalone/HTMLPurifier/DefinitionCache/Serializer/';
+        $init->config['General']['HTML_Purifier_Cache'] = rtrim(BX_DIRECTORY_PATH_CACHE, '/');
 
 
         $ids = new IDS_Monitor($request, $init);
         $ids = new IDS_Monitor($request, $init);
         $result = $ids->run();
         $result = $ids->run();

+ 2 - 0
inc/utils.inc.php

@@ -553,6 +553,8 @@ function clear_xss($val) {
 
 
         $oConfig = HTMLPurifier_Config::createDefault();
         $oConfig = HTMLPurifier_Config::createDefault();
 
 
+        $oConfig->set('Cache.SerializerPath', rtrim(BX_DIRECTORY_PATH_CACHE, '/'));
+
         $oConfig->set('HTML.SafeObject', 'true');
         $oConfig->set('HTML.SafeObject', 'true');
         $oConfig->set('Output.FlashCompat', 'true');
         $oConfig->set('Output.FlashCompat', 'true');
         $oConfig->set('HTML.FlashAllowFullScreen', 'true');
         $oConfig->set('HTML.FlashAllowFullScreen', 'true');

+ 29 - 2
install/classes/BxDolInstallController.php

@@ -72,6 +72,8 @@ class BxDolInstallController
 
 
         $this->_oView->out('permissions.php', compact('sPermissionsStyles', 'sPermissionsTable', 'bPermissionsOk'));
         $this->_oView->out('permissions.php', compact('sPermissionsStyles', 'sPermissionsTable', 'bPermissionsOk'));
 
 
+        $this->_oView->setToolbarItem('question', 'http://www.boonex.com/trac/dolphin/wiki/DetailedInstall#InstallScript-Step1-Permissions', _t('_sys_inst_help_permissions'), '_blank');
+
         $this->_oView->pageEnd($this->_getTitle());
         $this->_oView->pageEnd($this->_getTitle());
     }
     }
 
 
@@ -84,16 +86,41 @@ class BxDolInstallController
 
 
         $this->_oView->out('site_config.php', compact('sForm'));
         $this->_oView->out('site_config.php', compact('sForm'));
 
 
+        $this->_oView->setToolbarItem('question', 'http://www.boonex.com/trac/dolphin/wiki/DetailedInstall#Part2:CreateaDatabaseandaUser', _t('_sys_inst_help_site_config'), '_blank');
+
         $this->_oView->pageEnd($this->_getTitle());
         $this->_oView->pageEnd($this->_getTitle());
     }
     }
 
 
     function actionFinish () 
     function actionFinish () 
     {
     {
+        require_once(BX_INSTALL_PATH_HEADER);
+
         $this->_oView->pageStart();
         $this->_oView->pageStart();
 
 
-        $s = 'TODO: finish page';
+        $sPathToPhp = "/replace/it/with/path/to/php/binary";
+        $a = array(
+            '/usr/local/bin/php', 
+            '/usr/bin/php',
+            '/opt/local/bin/php',
+        );
+        foreach ($a as $sPath)
+            if (file_exists($sPath))
+                $sPathToPhp = $sPath;
+
+        $this->_oView->out('finish.php', compact('sPathToPhp'));
+
+        $this->_oView->setToolbarItem('question', 'http://www.boonex.com/trac/dolphin/wiki/DetailedInstall#InstallScript-Step5-CronJobs', _t('_sys_inst_help_finish'), '_blank');
+
+        $this->_oView->pageEnd($this->_getTitle());
+    }
+
+    function actionRemoveInstall () 
+    {
+        require_once(BX_INSTALL_PATH_HEADER);
+
+        $this->_oView->pageStart();
 
 
-        $this->_oView->out('finish.php', compact('s'));
+        $this->_oView->out('remove_install.php', array());
 
 
         $this->_oView->pageEnd($this->_getTitle());
         $this->_oView->pageEnd($this->_getTitle());
     }
     }

+ 7 - 0
install/classes/BxDolInstallSiteConfig.php

@@ -262,6 +262,10 @@ EOF;
             if (!$this->check ($sKey, isset($a[$sKey]) ? $a[$sKey] : '', $r))
             if (!$this->check ($sKey, isset($a[$sKey]) ? $a[$sKey] : '', $r))
                 $aErrorFields[$sKey] = true;
                 $aErrorFields[$sKey] = true;
         }
         }
+
+        if (!empty($aErrorFields)) 
+            $aErrorFields[BX_INSTALL_ERR_GENERAL] = _t('_sys_inst_msg_form_error');
+
         return $aErrorFields;
         return $aErrorFields;
     }
     }
 
 
@@ -341,6 +345,9 @@ EOF;
             }            
             }            
         } 
         } 
 
 
+        bx_import('BxDolAccount');
+        bx_login(BxDolAccount::getInstance($a['admin_email'])->id());
+
         return array();
         return array();
     }
     }
 
 

+ 14 - 0
install/classes/BxDolInstallView.php

@@ -16,6 +16,8 @@ class BxDolInstallView
     protected $_sPathCss = '../template/css/';
     protected $_sPathCss = '../template/css/';
     protected $_sUrlJs = '../';
     protected $_sUrlJs = '../';
 
 
+    protected $_aToolbarItem = array();
+
     protected $_aFilesCss = array (
     protected $_aFilesCss = array (
         'common.css',
         'common.css',
         'default.less',
         'default.less',
@@ -23,6 +25,7 @@ class BxDolInstallView
         'icons.css',
         'icons.css',
         'colors.css',
         'colors.css',
         'forms.css',
         'forms.css',
+        'menu.css',
         'media-desktop.css',
         'media-desktop.css',
         'media-tablet.css',
         'media-tablet.css',
         'media-phone.css',
         'media-phone.css',
@@ -53,6 +56,7 @@ class BxDolInstallView
 
 
     function pageEnd ($sTitle)
     function pageEnd ($sTitle)
     {
     {
+        $aToolbarItem = $this->_aToolbarItem;
         $sInlineCSS = $this->_getInlineCSS();
         $sInlineCSS = $this->_getInlineCSS();
         $sFilesCSS = $this->_getFilesCSS();
         $sFilesCSS = $this->_getFilesCSS();
         $sFilesJS = $this->_getFilesJS();
         $sFilesJS = $this->_getFilesJS();
@@ -60,6 +64,16 @@ class BxDolInstallView
         include($this->_sDirTemplates . '_page.php');
         include($this->_sDirTemplates . '_page.php');
     }
     }
 
 
+    function setToolbarItem($sIcon, $sLink, $sTitle = '', $sTarget = '') 
+    {
+        $this->_aToolbarItem = array(
+            'icon' => $sIcon, 
+            'link' => $sLink, 
+            'title' => $sTitle,
+            'target' => $sTarget,
+        );
+    }
+
     protected function _getFilesCSS()
     protected function _getFilesCSS()
     {
     {
         $s = '';
         $s = '';

+ 6 - 0
install/css/styles.css

@@ -60,3 +60,9 @@ html, body {
 .bx-install-site-config .bx-form-input-wrapper-submit button {
 .bx-install-site-config .bx-form-input-wrapper-submit button {
     display:inline-block;
     display:inline-block;
 } 
 } 
+
+.bx-install-finish textarea {
+    display:block;
+    width:70%;
+    height:60px;
+}

+ 1 - 1
install/index.php

@@ -23,7 +23,7 @@ define ('BX_INSTALL_DIR_PLUGINS', '../plugins/');
 define ('BX_INSTALL_DIR_TEMPLATES', './templates/');
 define ('BX_INSTALL_DIR_TEMPLATES', './templates/');
 define ('BX_INSTALL_DIR_CLASSES', './classes/');
 define ('BX_INSTALL_DIR_CLASSES', './classes/');
 
 
-define ('BX_INSTALL_PATH_HEADER', '../inc/header_test.inc.php');
+define ('BX_INSTALL_PATH_HEADER', '../inc/header.inc.php');
 
 
 if (!defined('BX_DOL_MODULE_TYPE_MODULE')) {
 if (!defined('BX_DOL_MODULE_TYPE_MODULE')) {
     define('BX_DOL_MODULE_TYPE_MODULE', 'module');
     define('BX_DOL_MODULE_TYPE_MODULE', 'module');

+ 6 - 37
install/patterns/header.inc.php

@@ -89,19 +89,16 @@ define('BX_DOL_SECRET', '%SECRET%');
 
 
 define('CHECK_DOLPHIN_REQUIREMENTS', 1);
 define('CHECK_DOLPHIN_REQUIREMENTS', 1);
 if (defined('CHECK_DOLPHIN_REQUIREMENTS')) {
 if (defined('CHECK_DOLPHIN_REQUIREMENTS')) {
-    //check requirements
     $aErrors = array();
     $aErrors = array();
-
     $aErrors[] = (ini_get('register_globals') == 0) ? '' : '<font color="red">register_globals is On (warning, you should have this param in Off state, or your site will unsafe)</font>';
     $aErrors[] = (ini_get('register_globals') == 0) ? '' : '<font color="red">register_globals is On (warning, you should have this param in Off state, or your site will unsafe)</font>';
     $aErrors[] = (ini_get('safe_mode') == 0) ? '' : '<font color="red">safe_mode is On, disable it</font>';
     $aErrors[] = (ini_get('safe_mode') == 0) ? '' : '<font color="red">safe_mode is On, disable it</font>';
     $aErrors[] = (version_compare(PHP_VERSION, '5.2.0', '<')) ? '<font color="red">PHP version too old, please update to PHP 5.2.0 at least</font>' : '';
     $aErrors[] = (version_compare(PHP_VERSION, '5.2.0', '<')) ? '<font color="red">PHP version too old, please update to PHP 5.2.0 at least</font>' : '';
     $aErrors[] = (!extension_loaded( 'mbstring')) ? '<font color="red">mbstring extension not installed. <b>Warning!</b> Dolphin cannot work without <b>mbstring</b> extension.</font>' : '';
     $aErrors[] = (!extension_loaded( 'mbstring')) ? '<font color="red">mbstring extension not installed. <b>Warning!</b> Dolphin cannot work without <b>mbstring</b> extension.</font>' : '';
-
     if (version_compare(phpversion(), "5.2", ">") == 1) {
     if (version_compare(phpversion(), "5.2", ">") == 1) {
         $aErrors[] = (ini_get('allow_url_include') == 0) ? '' : '<font color="red">allow_url_include is On (warning, you should have this param in Off state, or your site will unsafe)</font>';
         $aErrors[] = (ini_get('allow_url_include') == 0) ? '' : '<font color="red">allow_url_include is On (warning, you should have this param in Off state, or your site will unsafe)</font>';
     };
     };
 
 
-    $aErrors = array_diff($aErrors, array('')); //delete empty
+    $aErrors = array_diff($aErrors, array('')); // delete empty
     if (count($aErrors)) {
     if (count($aErrors)) {
         $sErrors = implode(" <br /> ", $aErrors);
         $sErrors = implode(" <br /> ", $aErrors);
         echo <<<EOF
         echo <<<EOF
@@ -114,7 +111,7 @@ EOF;
     }
     }
 }
 }
 
 
-//check correct hostname
+// check correct hostname
 $aUrl = parse_url( BX_DOL_URL_ROOT );
 $aUrl = parse_url( BX_DOL_URL_ROOT );
 if (isset($_SERVER['HTTP_HOST']) and 0 != strcasecmp($_SERVER['HTTP_HOST'], $aUrl['host']) and 0 != strcasecmp($_SERVER['HTTP_HOST'], $aUrl['host'] . ':80')) {
 if (isset($_SERVER['HTTP_HOST']) and 0 != strcasecmp($_SERVER['HTTP_HOST'], $aUrl['host']) and 0 != strcasecmp($_SERVER['HTTP_HOST'], $aUrl['host'] . ':80')) {
     header( "Location:http://{$aUrl['host']}{$_SERVER['REQUEST_URI']}" );
     header( "Location:http://{$aUrl['host']}{$_SERVER['REQUEST_URI']}" );
@@ -123,45 +120,17 @@ if (isset($_SERVER['HTTP_HOST']) and 0 != strcasecmp($_SERVER['HTTP_HOST'], $aUr
 
 
 // check if install folder exists
 // check if install folder exists
 if (!defined ('BX_SKIP_INSTALL_CHECK') && file_exists(BX_DIRECTORY_PATH_ROOT . 'install')) {
 if (!defined ('BX_SKIP_INSTALL_CHECK') && file_exists(BX_DIRECTORY_PATH_ROOT . 'install')) {
-    $ret = <<<EOJ
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
-        <head>
-            <title>Dolphin Smart Community Builder Installed</title>
-            <link href="install/general.css" rel="stylesheet" type="text/css" />
-            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-        </head>
-        <body>
-            <div id="main">
-            <div id="header">
-                <img src="install/images/boonex-logo.png" alt="" /></div>
-            <div id="content">
-                <div class="installed_pic">
-                    <img alt="Dolphin Installed" src="install/images/dolphin_installed.jpg" />
-            </div>
-
-            <div class="installed_text">
-                Please, remove INSTALL directory from your server and reload this page to activate your community site.
-            </div>
-            <div class="installed_text">
-                NOTE: Once you remove this page you can safely <a href="administration/modules.php">install modules via Admin Panel</a>.
-            </div>
-        </body>
-    </html>
-EOJ;
-    echo $ret;
-    exit();
+    header('Location:' . BX_DOL_URL_ROOT . 'install/index.php?action=remove_install');
+    exit;
 }
 }
 
 
-// set some PHP options
+// set PHP options
 error_reporting(E_ALL);
 error_reporting(E_ALL);
-
 ini_set('magic_quotes_sybase', 0);
 ini_set('magic_quotes_sybase', 0);
-
 mb_internal_encoding('UTF-8');
 mb_internal_encoding('UTF-8');
 mb_regex_encoding('UTF-8');
 mb_regex_encoding('UTF-8');
 
 
-// include files needed for basic functionality
+// include files necessary for basic functionality
 require_once(BX_DIRECTORY_PATH_CLASSES . "BxDol.php");
 require_once(BX_DIRECTORY_PATH_CLASSES . "BxDol.php");
 require_once(BX_DIRECTORY_PATH_INC . "utils.inc.php");
 require_once(BX_DIRECTORY_PATH_INC . "utils.inc.php");
 require_once(BX_DIRECTORY_PATH_INC . "security.inc.php");
 require_once(BX_DIRECTORY_PATH_INC . "security.inc.php");

+ 11 - 1
install/templates/_page.php

@@ -31,7 +31,17 @@
             <div id="bx-toolbar-content" class="bx-clearfix">
             <div id="bx-toolbar-content" class="bx-clearfix">
                 <div id="bx-menu-toolbar-1-container"></div>
                 <div id="bx-menu-toolbar-1-container"></div>
                 <div id="bx-logo-container"><a class="bx-def-font-contrasted"><?=$sTitle; ?></a></div>
                 <div id="bx-logo-container"><a class="bx-def-font-contrasted"><?=$sTitle; ?></a></div>
-                <div id="bx-menu-toolbar-2-container"></div>
+                <div id="bx-menu-toolbar-2-container">
+                    <?php if (!empty($aToolbarItem)): ?>
+                    <ul class="bx-menu-toolbar bx-menu-object-sys_toolbar_member">
+                        <li class="bx-def-color-bg-hl-hover ">
+                            <a title="<?=$aToolbarItem['title']; ?>" href="<?=$aToolbarItem['link']; ?>" target="<?=$aToolbarItem['target']; ?>" onclick="" class="bx-def-margin-sec-left bx-def-font-contrasted">
+                                <i class="sys-icon <?=$aToolbarItem['icon']; ?> bx-def-margin-sec-leftright"></i>
+                            </a>
+                        </li>
+                    </ul>
+                    <?php endif; ?>
+                </div>
             </div>
             </div>
         </div>
         </div>
     </div>
     </div>

+ 23 - 2
install/templates/finish.php

@@ -1,7 +1,28 @@
-<div class="bx-install-site-config">
+<div class="bx-install-finish">
 
 
     <h1><?php echo _t('_sys_inst_finish'); ?></h1>
     <h1><?php echo _t('_sys_inst_finish'); ?></h1>
 
 
-   <?=$s; ?>
+    <p class="bx-def-font-large" style="font-weight:bold;"><?php echo _t('_sys_inst_msg_finish'); ?></p>
+
+    <ol>
+        <!--
+        <li>
+            change permissions back
+        <li>
+        -->
+        <li>
+            <?php echo _t('_sys_inst_msg_finish_cron_jobs'); ?>
+            <textarea class="bx-form-input-textarea bx-def-font-inputs bx-def-margin-sec-top">
+MAILTO=<?php echo getParam('site_email') . "\n"; ?>
+* * * * * <?=$sPathToPhp; ?> -q <?=BX_DIRECTORY_PATH_ROOT; ?>periodic/cron.php
+            </textarea>
+        </li>
+        <li class="bx-def-margin-top">
+            <?php echo _t('_sys_inst_msg_finish_delete_install_folder'); ?>
+        </li>
+        <li class="bx-def-margin-top">
+            <?php echo _t('_sys_inst_msg_finish_goto_studio', BX_DOL_URL_ROOT); ?>
+        </li>
+    </ol>
 
 
 </div>
 </div>

+ 5 - 0
install/templates/remove_install.php

@@ -0,0 +1,5 @@
+<div class="bx-install-remove-install">
+
+    <p class="bx-def-font-large" style="font-weight:bold;"><?php echo _t('_sys_inst_msg_remove_install'); ?></p>
+
+</div>

+ 11 - 1
modules/boonex/english/data/langs/system.xml

@@ -3816,12 +3816,18 @@ If you don't know how to do it by yourself you can submit <a target="_blank" hre
     <string name="_sys_inst_conf_desc_template"><![CDATA[Template to install by default.]]></string>
     <string name="_sys_inst_conf_desc_template"><![CDATA[Template to install by default.]]></string>
 
 
     <string name="_sys_inst_msg_permissions_wrong"><![CDATA[Some files or folders rights aren't correct, please set necessary permissions then click "Continue".]]></string>
     <string name="_sys_inst_msg_permissions_wrong"><![CDATA[Some files or folders rights aren't correct, please set necessary permissions then click "Continue".]]></string>
+    <string name="_sys_inst_msg_form_error"><![CDATA[Please fix form errors.]]></string>
     <string name="_sys_inst_msg_db_err_connect"><![CDATA[Database connect failed]]></string>
     <string name="_sys_inst_msg_db_err_connect"><![CDATA[Database connect failed]]></string>
     <string name="_sys_inst_msg_db_err_select"><![CDATA[Database select failed]]></string>
     <string name="_sys_inst_msg_db_err_select"><![CDATA[Database select failed]]></string>
     <string name="_sys_inst_msg_file_read_failed"><![CDATA[File read failed: {0}]]></string>
     <string name="_sys_inst_msg_file_read_failed"><![CDATA[File read failed: {0}]]></string>
     <string name="_sys_inst_msg_file_write_failed"><![CDATA[File write failed: {0}]]></string>
     <string name="_sys_inst_msg_file_write_failed"><![CDATA[File write failed: {0}]]></string>
+    <string name="_sys_inst_msg_finish"><![CDATA[But some additional manual steps are required:]]></string>
+    <string name="_sys_inst_msg_finish_cron_jobs"><![CDATA[Setup the following cron jobs command:]]></string>
+    <string name="_sys_inst_msg_finish_delete_install_folder"><![CDATA[Remove <b>/install/</b> folder from Dolphin root folder.]]></string>
+    <string name="_sys_inst_msg_finish_goto_studio"><![CDATA[<a href="{0}studio/">Go to Studio</a> to add additional modules and customize the site.]]></string>
+    <string name="_sys_inst_msg_remove_install"><![CDATA[Please, remove INSTALL directory from your server and reload this page to activate your site.<br />After deletion you can safely go <a href="../studio/">to the site Studio</a> to add additional modules and customize the site.]]></string>
 
 
-	<string name="_sys_inst_finish"><![CDATA[Installation completed]]></string>
+	<string name="_sys_inst_finish"><![CDATA[Installation has been successfully completed]]></string>
 	<string name="_sys_inst_site_config"><![CDATA[Site configuration]]></string>
 	<string name="_sys_inst_site_config"><![CDATA[Site configuration]]></string>
     <string name="_sys_inst_title"><![CDATA[Dolphin {0} Installation]]></string>
     <string name="_sys_inst_title"><![CDATA[Dolphin {0} Installation]]></string>
     <string name="_sys_inst_start_installation"><![CDATA[Start installation]]></string>
     <string name="_sys_inst_start_installation"><![CDATA[Start installation]]></string>
@@ -3831,4 +3837,8 @@ If you don't know how to do it by yourself you can submit <a target="_blank" hre
     <string name="_sys_inst_refresh"><![CDATA[Refresh]]></string>
     <string name="_sys_inst_refresh"><![CDATA[Refresh]]></string>
     <string name="_sys_inst_continue"><![CDATA[Continue]]></string>
     <string name="_sys_inst_continue"><![CDATA[Continue]]></string>
 
 
+    <string name="_sys_inst_help_permissions"><![CDATA[Setting permissions help]]></string>
+    <string name="_sys_inst_help_site_config"><![CDATA[Creating database help]]></string>
+    <string name="_sys_inst_help_finish"><![CDATA[Help with cron jobs]]></string>
+
 </resources>
 </resources>

+ 2 - 1
modules/boonex/notes/install/sql/disable.sql

@@ -11,6 +11,7 @@ DELETE FROM `sys_objects_storage` WHERE `object` = 'bx_notes_photos' OR `object`
 DELETE FROM `sys_storage_tokens` WHERE `object` = 'bx_notes_photos' OR `object` = 'bx_notes_photos_resized';
 DELETE FROM `sys_storage_tokens` WHERE `object` = 'bx_notes_photos' OR `object` = 'bx_notes_photos_resized';
 
 
 DELETE FROM `sys_objects_transcoder_images` WHERE `object` = 'bx_notes_preview';
 DELETE FROM `sys_objects_transcoder_images` WHERE `object` = 'bx_notes_preview';
+DELETE FROM `sys_transcoder_images_filters` WHERE `transcoder_object` = 'bx_notes_preview';
 DELETE FROM `sys_transcoder_images_files` WHERE `transcoder_object` = 'bx_notes_preview';
 DELETE FROM `sys_transcoder_images_files` WHERE `transcoder_object` = 'bx_notes_preview';
 -- TODO: delete resized photo files as well
 -- TODO: delete resized photo files as well
 TRUNCATE TABLE `bx_notes_photos_resized`; 
 TRUNCATE TABLE `bx_notes_photos_resized`; 
@@ -38,4 +39,4 @@ DELETE FROM `sys_objects_cmts` WHERE `Name`='bx_notes';
 DELETE FROM `sys_objects_vote` WHERE `Name`='bx_notes';
 DELETE FROM `sys_objects_vote` WHERE `Name`='bx_notes';
 
 
 -- VIEWS
 -- VIEWS
-DELETE FROM `sys_objects_view` WHERE `Name`='bx_notes';
+DELETE FROM `sys_objects_view` WHERE `Name`='bx_notes';

+ 2 - 2
modules/boonex/notes/install/sql/enable.sql

@@ -27,7 +27,7 @@ INSERT INTO `sys_objects_transcoder_images` (`object`, `storage_object`, `source
 ('bx_notes_preview', 'bx_notes_photos_resized', 'Storage', 'a:1:{s:6:"object";s:15:"bx_notes_photos";}', 'no', '1', '2592000', '0');
 ('bx_notes_preview', 'bx_notes_photos_resized', 'Storage', 'a:1:{s:6:"object";s:15:"bx_notes_photos";}', 'no', '1', '2592000', '0');
 
 
 INSERT INTO `sys_transcoder_images_filters` (`transcoder_object`, `filter`, `filter_params`, `order`) VALUES 
 INSERT INTO `sys_transcoder_images_filters` (`transcoder_object`, `filter`, `filter_params`, `order`) VALUES 
-('bx_notes_preview', 'Resize', 'a:4:{s:1:"w";s:3:"100";s:1:"h";s:3:"100";s:13:"square_resize";s:1:"1";s:10:"force_type";s:3:"jpg";}', '0');
+('bx_notes_preview', 'Resize', 'a:4:{s:1:"w";s:3:"200";s:1:"h";s:3:"150";s:11:"crop_resize";s:1:"1";s:10:"force_type";s:3:"jpg";}', '0');
 
 
 
 
 -- PAGES
 -- PAGES
@@ -263,4 +263,4 @@ INSERT INTO `sys_objects_vote` (`Name`, `TableMain`, `TableTrack`, `PostTimeout`
 
 
 -- VIEWS
 -- VIEWS
 INSERT INTO `sys_objects_view` (`name`, `table_track`, `period`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
 INSERT INTO `sys_objects_view` (`name`, `table_track`, `period`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_count`, `class_name`, `class_file`) VALUES 
-('bx_notes', 'bx_notes_views_track', '86400', '1', 'bx_notes_posts', 'id', 'views', '', '');
+('bx_notes', 'bx_notes_views_track', '86400', '1', 'bx_notes_posts', 'id', 'views', '', '');

+ 2 - 2
modules/boonex/russian/data/langs/system.xml

@@ -3535,8 +3535,8 @@ More info about URI DNSBL: <br />
     <string name="_sys_inst_msg_db_err_connect"><![CDATA[Ошибка соединения с базой]]></string>
     <string name="_sys_inst_msg_db_err_connect"><![CDATA[Ошибка соединения с базой]]></string>
     <string name="_sys_inst_msg_db_err_select"><![CDATA[Ошибка выбора базы]]></string>
     <string name="_sys_inst_msg_db_err_select"><![CDATA[Ошибка выбора базы]]></string>
 
 
-    <string name="_sys_inst_title"><![CDATA[Инсталляция Дельфина {0}]]></string>
-    <string name="_sys_inst_start_installation"><![CDATA[Начать инсталляцию]]></string>
+    <string name="_sys_inst_title"><![CDATA[Установка Дельфина {0}]]></string>
+    <string name="_sys_inst_start_installation"><![CDATA[Начать установку]]></string>
     <string name="_sys_inst_server_audit"><![CDATA[Аудит сервера]]></string>
     <string name="_sys_inst_server_audit"><![CDATA[Аудит сервера]]></string>
     <string name="_sys_inst_hosting_warnings"><![CDATA[Есть некоторые замечания к настройкам сервера, можно перейти к <a href="?action=audit">аудиту сервера</a> для более подробной информации.]]></string>
     <string name="_sys_inst_hosting_warnings"><![CDATA[Есть некоторые замечания к настройкам сервера, можно перейти к <a href="?action=audit">аудиту сервера</a> для более подробной информации.]]></string>
 
 

+ 93 - 0
samples/image_resize.php

@@ -0,0 +1,93 @@
+<?php
+/**
+ * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
+ * CC-BY License - http://creativecommons.org/licenses/by/3.0/
+ *
+ * @defgroup    DolphinCore Samples
+ * @{
+ */
+
+/** 
+ * @page samples
+ * @section image_resize Image Resize
+ */
+
+$aPathInfo = pathinfo(__FILE__);
+require_once ($aPathInfo['dirname'] . '/../inc/header.inc.php');
+require_once(BX_DIRECTORY_PATH_INC . "params.inc.php");
+require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");
+
+bx_import('BxDolLanguages');
+bx_import('BxTemplFunctions');
+bx_import('BxDolImageResize');
+
+$oTemplate = BxDolTemplate::getInstance();
+$oTemplate->setPageNameIndex (BX_PAGE_DEFAULT);
+$oTemplate->setPageHeader ('Image Resize');
+$oTemplate->setPageContent ('page_main_code', PageCompMainCode());
+$oTemplate->getPageCode();
+
+/**
+ * page code function
+ */
+function PageCompMainCode() {
+
+    $sFile = '';
+    $sImgTmpDir = BX_DIRECTORY_PATH_TMP . 'img_resize_';
+    $sImgSrcDir = BX_DIRECTORY_PATH_ROOT . 'samples/img/landscape.jpg';
+
+    $o = BxDolImageResize::getInstance();
+    $o->removeCropOptions ();
+    $o->setJpegOutput(true);
+
+    switch (bx_get('action')) {
+        case 'img_src':
+            $sFile = $sImgSrcDir;
+            break;
+        case 'img_resize':
+            $sFile = $sImgTmpDir . 'resize.jpg';
+            $o->setSize (200, 150);
+            $o->resize($sImgSrcDir, $sFile);
+            break;
+        case 'img_resize_autocrop':
+            $sFile = $sImgTmpDir . 'resize_autocrop.jpg';
+            $o->setSize (200, 150);
+            $o->setAutoCrop (true);
+            $o->resize($sImgSrcDir, $sFile);
+            break;
+        case 'img_resize_square':
+            $sFile = $sImgTmpDir . 'resize_square.jpg';
+            $o->setSize (150, 150);
+            $o->setSquareResize (true);
+            $o->resize($sImgSrcDir, $sFile);
+            break;
+        case 'img_grayscale':
+            $sFile = $sImgTmpDir . 'grayscale.jpg';
+            $o->grayscale($sImgSrcDir, $sFile);
+            break;    
+    }
+
+    if ($sFile) {
+        header("Content-Type: image/jpeg");
+        readfile($sFile);
+        exit;
+    }
+
+    ob_start();
+    
+?>
+    Source:<br /> <img border=1 style="max-width:300px;" src ="<?=BX_DOL_URL_ROOT; ?>samples/image_resize.php?action=img_src" /> 
+    <hr class="bx-def-hr" />
+    Resized:<br /> <img border=1 src ="<?=BX_DOL_URL_ROOT; ?>samples/image_resize.php?action=img_resize" /> 
+    <hr class="bx-def-hr" />
+    Autocrop resized:<br /> <img border=1 src ="<?=BX_DOL_URL_ROOT; ?>samples/image_resize.php?action=img_resize_autocrop" /> 
+    <hr class="bx-def-hr" />
+    Square resized:<br /> <img border=1 src ="<?=BX_DOL_URL_ROOT; ?>samples/image_resize.php?action=img_resize_square" /> 
+    <hr class="bx-def-hr" />
+    Grayscaled:<br /> <img border=1 style="max-width:300px;" src ="<?=BX_DOL_URL_ROOT; ?>samples/image_resize.php?action=img_grayscale" /> 
+<?php
+
+    return DesignBoxContent("Image Resize", ob_get_clean(), BX_DB_PADDING_DEF);
+}
+
+/** @} */

BIN
samples/img/landscape.jpg


BIN
samples/img/landscape_wide.jpg


BIN
samples/img/portrate.jpg


BIN
samples/img/portrate_thin.jpg


BIN
samples/img/small.jpg


BIN
samples/img/square.jpg


+ 1 - 1
studio/classes/BxDolStudioTools.php

@@ -29,11 +29,11 @@ class BxDolStudioTools extends BxDolIO
         parent::__construct();
         parent::__construct();
 
 
         $this->aInstallPermissions = array(
         $this->aInstallPermissions = array(
+            'inc',
             'cache',
             'cache',
             'cache_public',
             'cache_public',
             'tmp',
             'tmp',
 //            'plugins/ffmpeg/ffmpeg.exe',
 //            'plugins/ffmpeg/ffmpeg.exe',
-            'plugins/htmlpurifier/standalone/HTMLPurifier/DefinitionCache/Serializer',
         );
         );
 
 
         $this->aPostInstallPermissions = array(
         $this->aPostInstallPermissions = array(