當前位置: 首頁>>代碼示例>>PHP>>正文


PHP modMediaSource::getSourceProperties方法代碼示例

本文整理匯總了PHP中modMediaSource::getSourceProperties方法的典型用法代碼示例。如果您正苦於以下問題:PHP modMediaSource::getSourceProperties方法的具體用法?PHP modMediaSource::getSourceProperties怎麽用?PHP modMediaSource::getSourceProperties使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在modMediaSource的用法示例。


在下文中一共展示了modMediaSource::getSourceProperties方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: initialize

 /**
  * Initializes component into different contexts.
  *
  * @param string $ctx The context to load. Defaults to web.
  * @param array $scriptProperties
  *
  * @return boolean
  */
 public function initialize($ctx = 'web', $scriptProperties = array())
 {
     $this->config = array_merge($this->config, $scriptProperties);
     $this->config['ctx'] = $ctx;
     if (empty($this->initialized[$ctx])) {
         $properties = $this->ms2Gallery->getSourceProperties();
         $config_js = array('ctx' => $ctx, 'jsUrl' => $this->config['jsUrl'] . 'web/', 'cssUrl' => $this->config['cssUrl'] . 'web/', 'actionUrl' => $this->config['actionUrl'], 'source' => array('size' => !empty($properties['maxUploadSize']) ? $properties['maxUploadSize'] : 3145728, 'height' => !empty($properties['maxUploadHeight']) ? $properties['maxUploadHeight'] : 1080, 'width' => !empty($properties['maxUploadWidth']) ? $properties['maxUploadWidth'] : 1920, 'extensions' => !empty($properties['allowedFileTypes']) ? $properties['allowedFileTypes'] : 'jpg,jpeg,png,gif'));
         $this->modx->regClientStartupScript('<script type="text/javascript">ms2GalleryFormConfig=' . $this->modx->toJSON($config_js) . '</script>', true);
         $css = !empty($this->config['frontend_css']) ? $this->config['frontend_css'] : $this->config['cssUrl'] . 'web/default.css';
         if (!empty($css) && preg_match('/\\.css/i', $css)) {
             $this->modx->regClientCSS($css);
         }
         $js = !empty($this->config['frontend_js']) ? $this->config['frontend_js'] : $this->config['jsUrl'] . 'web/default.js';
         if (!empty($js) && preg_match('/\\.js/i', $js)) {
             $this->modx->regClientScript($js);
         }
         $this->modx->regClientScript($this->config['jsUrl'] . 'web/lib/plupload/plupload.full.min.js');
         $this->modx->regClientScript($this->config['jsUrl'] . 'web/files.js');
         $lang = $this->modx->getOption('cultureKey');
         if ($lang != 'en' && file_exists($this->config['jsUrl'] . 'web/lib/plupload/i18n/' . $lang . '.js')) {
             $this->modx->regClientScript($this->config['jsUrl'] . 'web/lib/plupload/i18n/' . $lang . '.js');
         }
         $this->initialized[$ctx] = true;
     }
     return true;
 }
開發者ID:bendasvadim,項目名稱:ms2GalleryForm,代碼行數:34,代碼來源:ms2galleryform.class.php


注:本文中的modMediaSource::getSourceProperties方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。