Просмотр исходного кода

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

AntonLV 12 лет назад
Родитель
Сommit
edd39065eb

+ 18 - 5
build.xml

@@ -217,11 +217,9 @@
             <fileset refid="files_dist" />
         </copy>
 
-        <chmod file="${deploy_path}/cache" mode="0777" />
-        <chmod file="${deploy_path}/cache_public" mode="0777" />
-        <chmod file="${deploy_path}/logs" mode="0777" />
-        <chmod file="${deploy_path}/tmp" mode="0777" />
-        <chmod file="${deploy_path}/storage" mode="0777" />
+        <phingcall target="change_permissions">
+            <property name="files_path" value="${deploy_path}" />
+        </phingcall>
 
         <phingcall target="install">
             <property name="install_base_dir" value="${deploy_path}" />
@@ -231,6 +229,21 @@
 
     </target>
 
+    <!-- ============================================  -->
+    <!-- Target: change permissions                    -->
+    <!-- ============================================  -->
+    <target name="change_permissions">
+        <property name="files_path" value="${project.basedir}" override="yes" />
+        <echo msg="Change permissions in '${files_path}' folder..." />
+
+        <chmod file="${files_path}/cache" mode="0777" />
+        <chmod file="${files_path}/cache_public" mode="0777" />
+        <chmod file="${files_path}/logs" mode="0777" />
+        <chmod file="${files_path}/tmp" mode="0777" />
+        <chmod file="${files_path}/storage" mode="0777" />
+        <chmod file="${files_path}/plugins/ffmpeg/ffmpeg.exe" mode="0755" />
+    </target>
+
     <!-- ============================================  -->
     <!-- Target: clean                                 --> 
     <!-- ============================================  -->

+ 1 - 1
inc/classes/BxDolGridQuery.php

@@ -79,7 +79,7 @@ class BxDolGridQuery extends BxDolDb
             if (!$aActions || !is_array($aActions))
                 continue;
             foreach ($aActions as $sKey => $aRow)
-                $aObject[$sActionField][$sKey] = $aRow['title'] || $aRow['icon'] ? array('title' => _t($aRow['title']), 'icon' => $aRow['icon'], 'confirm' => $aRow['confirm']) : array();
+                $aObject[$sActionField][$sKey] = $aRow['title'] || $aRow['icon'] ? array('title' => _t($aRow['title']), 'icon' => $aRow['icon'], 'confirm' => $aRow['confirm'], 'icon_only' => $aRow['icon_only']) : array();
         }
 
         return $aObject;

+ 2 - 1
inc/classes/BxDolKey.php

@@ -26,7 +26,7 @@ bx_import('BxDolKeyQuery');
  *  bx_import('BxDolKey'); // import class
  *  $oKeys = BxDolKey::getInstance(); // get object instance
  *  if ($oKeys) // check if object is available for using
- *      echo $oKeys->getNewKey (3600); // get new hashed key, which will be automatically deleted after 1 hour
+ *      echo $oKeys->getNewKey (false, 3600); // get new hashed key, which will be automatically deleted after 1 hour
  * @endcode
  *
  * Check if hashed key exists:
@@ -78,6 +78,7 @@ class BxDolKey extends BxDol implements iBxDolSingleton
 
     /**
      * Get new key.
+     * @param $aData - some data to associate with the key
      * @param $iExpire - number of seconds to generated key after, by default - 1 week
      * @return newly generated key string
      */

+ 1 - 0
inc/classes/BxDolTranscoderImage.php

@@ -62,6 +62,7 @@ bx_import('BxDolTranscoderImageQuery');
  *     - w - width of resulted image.
  *     - h - height of resulted image.
  *     - square_resize - make resulted image square, even of original image is not square, 'w' and 'h' parameters must be the same.
+ *     - crop_resize - crop image to destination size with filling whole area of destination size.
  *     - force_type - always change type of the image to the specified type: jpg, png, gif.
  * - Grayscale - make image grayscale, there is no parameters for this filter
  *

+ 5 - 4
inc/classes/BxDolTranscoderVideo.php

@@ -21,7 +21,7 @@ bx_import('BxDolTranscoderVideoQuery');
  *
  * To generate video which plays in all moders browsers along with video poster, 
  * you need to create 3 different video transcoding objects which will generate .mp4, .webm videos and video poster.
- * Video is convering upon first access, so it is probably better to force video conversion by calling @see BxDolTranscoderVideo::getFileUrl just after video uploading.
+ * Video is converting upon first access, so it is probably better to force video conversion by calling @see BxDolTranscoderVideo::getFileUrl just after video uploading.
  * Video for conversion is queued and when cron is run video conversion is performed.
  * While video is pending for conversion or in the process then 
  * @see BxDolTranscoderVideo::getFileUrl methods returns empty string for video and predefined image for video poster.
@@ -46,12 +46,12 @@ bx_import('BxDolTranscoderVideoQuery');
  *
  * Available filters:
  * - Mp4 - this filter convert video into .mp4 format along with resizing, the parameters are the following:
- *     - h - height of resulted video (360 by default), for video it is highly recommended to specify only height parameter (no width parameter, )
+ *     - h - height of resulted video (360px by default), for video it is highly recommended to specify only height parameter (without width parameter)
  *     - video_bitrate - video bitrate (512k by default)
  *     - audio_bitrate - video bitrate (128k by default)
  *     - ffmpeg_options - additional command line options for ffmepeg, as key => value array (empty by default)
  * - Webm - this filter convert video into .webm format along with resizing, the parameters are the same as for Mp4 filter
- * - Poster - this filter generates video thumbnail, it tries to get poster at 0, 3 and 5 seconds from the beginning, it gets first not fully blacke/white thumb
+ * - Poster - this filter generates video thumbnail, it tries to get poster at 0, 3 and 5 seconds from the beginning, it gets first not fully black/white thumb
  *
  *
  * Example of usage:
@@ -80,6 +80,7 @@ bx_import('BxDolTranscoderVideoQuery');
  *     </video>'; 
  * @endcode
  *
+ * Also @see transcoder_videos sample for complete example.
  */
 class BxDolTranscoderVideo extends BxDolTranscoder implements iBxDolFactoryObject
 {
@@ -200,7 +201,7 @@ class BxDolTranscoderVideo extends BxDolTranscoder implements iBxDolFactoryObjec
             @unlink($sFileOut);
         }
 
-        $sCommand = BX_SYSTEM_FFMPEG . ' -y -i "' . escapeshellcmd($sFile) . '" ' . $sOptions . ' ' . $sFileOut . ' 2>&1';
+        $sCommand = escapeshellcmd(BX_SYSTEM_FFMPEG) . ' -y -i ' . escapeshellarg($sFile) . ' ' . $sOptions . ' ' . escapeshellarg($sFileOut) . ' 2>&1';
         $sOutput = `$sCommand`;
         $this->addToLog("\n---\n{$sCommand}\n{$sOutput}\n");
 

+ 1 - 0
install/sql/system.sql

@@ -2864,6 +2864,7 @@ CREATE TABLE IF NOT EXISTS `sys_grid_actions` (
   `name` varchar(255) NOT NULL,
   `title` varchar(255) NOT NULL,
   `icon` varchar(255) NOT NULL,
+  `icon_only` tinyint(4) NOT NULL DEFAULT '0',
   `confirm` tinyint(4) NOT NULL DEFAULT '1',
   `order` int(11) NOT NULL,
   UNIQUE KEY `object_name_type` (`object`,`type`,`name`)

+ 1 - 0
studio/classes/BxDolStudioTools.php

@@ -35,6 +35,7 @@ class BxDolStudioTools extends BxDolIO
             'logs',
             'tmp',
             'storage',
+            'plugins/ffmpeg/ffmpeg.exe',
         );
 
         $this->aPostInstallPermissions = array(

+ 2 - 5
template/grid.html

@@ -2,7 +2,7 @@
 <div id="__id_wrap__">
 
     <bx_if:display_header>
-        <div class="bx-grid-header bx-def-margin-top">
+        <div class="bx-grid-header bx-def-margin-top bx-clearfix">
 
             <bx_if:filter>
                 <div style="float:left;">
@@ -16,7 +16,6 @@
                 </div>
             </bx_if:actions_independent>
 
-            <div class="bx-clear"></div>
         </div>
     </bx_if:display_header>
 
@@ -46,7 +45,7 @@
 
         <hr class="bx-def-hr" />
 
-        <div class="bx-grid-footer bx-def-margin-bottom bx-def-margin-sec-top">
+        <div class="bx-grid-footer bx-def-margin-bottom bx-def-margin-sec-top bx-clearfix">
             <bx_if:actions_bulk>
                 <div style="float:left;">
                     __actions_bulk__
@@ -56,8 +55,6 @@
             <div style="float:right;">
                 __paginate__
             </div>
-
-            <div class="bx-clear"></div>
         </div>
 
     </div>

+ 4 - 1
template/scripts/BxBaseGrid.php

@@ -519,6 +519,9 @@ class BxBaseGrid extends BxDolGrid
 
     protected function _getActionDefault ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
     {
+        if ($a['icon_only'] && empty($a['attr']['title']) && !empty($a['title']))
+            $a['attr']['title'] = $a['title'];
+
         $sAttr = $this->_convertAttrs(
             $a, 'attr',
             'bx-btn bx-def-margin-sec-left' . ($isSmall ? ' bx-btn-small' : '') . ($isDisabled ? ' bx-btn-disabled' : '') // add default classes
@@ -532,7 +535,7 @@ class BxBaseGrid extends BxDolGrid
             elseif ($sIconUrl = $this->_oTemplate->getIconUrl($a['icon']))
                 $sImage = '<i style="background-image:url(' . $sIconUrl . ');"></i>';
         }
-        return '<button ' . $sAttr . '>' . $sIcon . $sImage . $a['title'] . '</button>';
+        return '<button ' . $sAttr . '>' . $sIcon . $sImage . ($a['icon_only'] ? '' : $a['title']) . '</button>';
     }
 
     protected function _getActionDivider ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())

+ 14 - 0
template/scripts/BxBasePage.php

@@ -41,6 +41,13 @@ class BxBasePage extends BxDolPage
                 exit;
             }
 
+            bx_alert('system', 'page_output_block', 0, false, array(
+                'page_name' => $this->_sObject,
+                'page_object' => $this,
+                'page_query' => $this->_oQuery,
+                'block_id' => (int)$iBlockId,
+            ));
+
             header( 'Content-type:text/html;charset=utf-8' );
             echo $this->_getBlockOnlyCode($iBlockId);
             exit;
@@ -70,6 +77,13 @@ class BxBasePage extends BxDolPage
             $oCache->setData($sKey, $sPageCode, $this->_aObject['cache_lifetime']);
         }
 
+        bx_alert('system', 'page_output', 0, false, array(
+            'page_name' => $this->_sObject,
+            'page_object' => $this,
+            'page_query' => $this->_oQuery,
+            'page_code' => &$sPageCode,
+        ));
+
         return $sPageCode;
     }