Merge branch 'develop' into refactoring-profiling
This commit is contained in:
commit
bc4aa1495c
|
|
@ -1,4 +1,4 @@
|
|||
* **Build 24x** (2015-04-xx)
|
||||
* **Build 250** (2015-04-28)
|
||||
- Protected files can now be downloaded by administrators using the `fileupload` form widget.
|
||||
- The `{% content %}` tag now supports passing parameters, parsed by a basic template engine (see Cms > Content block docs).
|
||||
|
||||
|
|
|
|||
|
|
@ -746,11 +746,12 @@ class RelationController extends ControllerBehavior
|
|||
$config->context = $this->evalFormContext('pivot', !!$this->manageId);
|
||||
$config->alias = $this->alias . 'ManagePivotForm';
|
||||
|
||||
$foreignKeyName = $this->relationModel->getQualifiedKeyName();
|
||||
|
||||
/*
|
||||
* Existing record
|
||||
*/
|
||||
if ($this->manageId) {
|
||||
$foreignKeyName = $this->relationModel->getQualifiedKeyName();
|
||||
$hydratedModel = $this->relationObject->where($foreignKeyName, $this->manageId)->first();
|
||||
|
||||
$config->model = $hydratedModel;
|
||||
|
|
@ -760,10 +761,19 @@ class RelationController extends ControllerBehavior
|
|||
]));
|
||||
}
|
||||
}
|
||||
/*
|
||||
* New record
|
||||
*/
|
||||
else {
|
||||
if ($this->foreignId && ($foreignModel = $this->relationModel->find($this->foreignId))) {
|
||||
$foreignModel->exists = false;
|
||||
$config->model = $foreignModel;
|
||||
if ($this->foreignId) {
|
||||
$foreignModel = $this->relationModel
|
||||
->whereIn($foreignKeyName, (array) $this->foreignId)
|
||||
->first();
|
||||
|
||||
if ($foreignModel) {
|
||||
$foreignModel->exists = false;
|
||||
$config->model = $foreignModel;
|
||||
}
|
||||
}
|
||||
|
||||
$pivotModel = $this->relationObject->newPivot();
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ class Backend extends Facade
|
|||
* Get the registered name of the component.
|
||||
*
|
||||
* Resolves to:
|
||||
* - Backend\Classes\BackendHelper
|
||||
* - Backend\Helpers\Backend
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -351,7 +351,7 @@ class FileUpload extends FormWidgetBase
|
|||
|
||||
// Internal download link
|
||||
if (!$file->isImage() || !$file->isPublic()) {
|
||||
$file->path = \Backend\Controllers\Files::getDownloadUrl($file);
|
||||
$file->pathOverride = \Backend\Controllers\Files::getDownloadUrl($file);
|
||||
}
|
||||
|
||||
return $file;
|
||||
|
|
|
|||
|
|
@ -145,9 +145,9 @@ return [
|
|||
'create_title' => "Nouveau :name",
|
||||
'update_title' => "Éditer :name",
|
||||
'preview_title' => "Aperçu :name",
|
||||
'create_success' => 'Le :name a été créé avec succès',
|
||||
'update_success' => 'Le :name a été modifié avec succès',
|
||||
'delete_success' => 'Le :name a été supprimé avec succès',
|
||||
'create_success' => 'Ce(tte) :name a été créé(e) avec succès',
|
||||
'update_success' => 'Ce(tte) :name a été modifié(e) avec succès',
|
||||
'delete_success' => 'Ce(tte) :name a été supprimé(e) avec succès',
|
||||
'missing_id' => "L'ID de l'enregistrement du formulaire n'est pas précisé.",
|
||||
'missing_model' => 'Le formulaire utilisé dans la classe :class n\'a pas de modèle défini.',
|
||||
'missing_definition' => "Le formulaire utilisé n'a pas de champ pour ':field'.",
|
||||
|
|
|
|||
|
|
@ -210,7 +210,6 @@ class Controller
|
|||
/*
|
||||
* Post-processing
|
||||
*/
|
||||
|
||||
$result = $this->postProcessResult($page, $url, $result);
|
||||
|
||||
/*
|
||||
|
|
@ -234,7 +233,7 @@ class Controller
|
|||
* Renders a page in its entirety, including component initialization.
|
||||
* AJAX will be disabled for this process.
|
||||
* @param string $pageFile Specifies the CMS page file name to run.
|
||||
* @param array $parameters Routing parameters.
|
||||
* @param array $parameters Routing parameters.
|
||||
* @param \Cms\Classes\Theme $theme Theme object
|
||||
*/
|
||||
public static function render($pageFile, $parameters = [], $theme = null)
|
||||
|
|
@ -429,8 +428,8 @@ class Controller
|
|||
* Run page functions
|
||||
*/
|
||||
CmsException::mask($this->page, 300);
|
||||
$response = (($result = $this->pageObj->onStart()) ||
|
||||
($result = $this->page->runComponents()) ||
|
||||
$response = (($result = $this->pageObj->onStart()) ||
|
||||
($result = $this->page->runComponents()) ||
|
||||
($result = $this->pageObj->onEnd())) ? $result : null;
|
||||
CmsException::unmask();
|
||||
|
||||
|
|
@ -471,7 +470,7 @@ class Controller
|
|||
{
|
||||
$html = MediaViewHelper::instance()->processHtml($html);
|
||||
|
||||
$holder = (object)['html'=>$html];
|
||||
$holder = (object) ['html' => $html];
|
||||
|
||||
Event::fire('cms.page.postprocess', [$this, $url, $page, $holder]);
|
||||
|
||||
|
|
|
|||
|
|
@ -19,11 +19,14 @@ class MediaViewHelper
|
|||
*/
|
||||
public function processHtml($html)
|
||||
{
|
||||
if (!is_string($html)) {
|
||||
return $html;
|
||||
}
|
||||
|
||||
$mediaTags = $this->extractMediaTags($html);
|
||||
foreach ($mediaTags as $tagInfo) {
|
||||
$pattern = preg_quote($tagInfo['declaration']);
|
||||
$generatedMarkup = $this->generateMediaTagaMarkup($tagInfo['type'], $tagInfo['src']);
|
||||
|
||||
$html = mb_ereg_replace($pattern, $generatedMarkup, $html);
|
||||
}
|
||||
|
||||
|
|
@ -42,7 +45,7 @@ class MediaViewHelper
|
|||
|
||||
if (preg_match_all('/\<figure\s+[^\>]+\>[^\<]*\<\/figure\>/i', $html, $matches)) {
|
||||
foreach ($matches[0] as $mediaDeclaration) {
|
||||
foreach ($tagDefinitions as $type=>$pattern) {
|
||||
foreach ($tagDefinitions as $type => $pattern) {
|
||||
$nameMatch = [];
|
||||
if (preg_match($pattern, $mediaDeclaration, $nameMatch)) {
|
||||
$result[] = [
|
||||
|
|
@ -62,20 +65,23 @@ class MediaViewHelper
|
|||
{
|
||||
$partialName = $type == 'audio' ? 'oc-audio-player' : 'oc-video-player';
|
||||
|
||||
if ($this->playerPartialExists($partialName))
|
||||
return Controller::getController()->renderPartial($partialName, ['src'=>$src]);
|
||||
if ($this->playerPartialExists($partialName)) {
|
||||
return Controller::getController()->renderPartial($partialName, ['src' => $src]);
|
||||
}
|
||||
|
||||
return $this->getDefaultPlayerMarkup($type, $src);
|
||||
}
|
||||
|
||||
protected function playerPartialExists($name)
|
||||
{
|
||||
if (array_key_exists($name, $this->playerPartialFlags))
|
||||
if (array_key_exists($name, $this->playerPartialFlags)) {
|
||||
return $this->playerPartialFlags[$name];
|
||||
}
|
||||
|
||||
$controller = Controller::getController();
|
||||
if (!$controller)
|
||||
if (!$controller) {
|
||||
throw new Phpr_ApplicationException('Media tags can only be processed for front-end requests.');
|
||||
}
|
||||
|
||||
$partial = Partial::loadCached($controller->getTheme(), $name);
|
||||
|
||||
|
|
@ -85,10 +91,11 @@ class MediaViewHelper
|
|||
protected function getDefaultPlayerMarkup($type, $src)
|
||||
{
|
||||
switch ($type) {
|
||||
case 'video' :
|
||||
case 'video':
|
||||
return '<video src="'.e($src).'" controls></video>';
|
||||
break;
|
||||
case 'audio' :
|
||||
|
||||
case 'audio':
|
||||
return '<audio src="'.e($src).'" controls></audio>';
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,13 +102,8 @@ class Page extends CmsCompoundObject
|
|||
* @param array $params Route parameters to consider in the URL.
|
||||
* @return string
|
||||
*/
|
||||
public static function url($page, $params = [], $absolute = true)
|
||||
public static function url($page, $params = [])
|
||||
{
|
||||
/* @deprecated remove if year >= 2016 -- remove 3rd argument */
|
||||
if ($absolute !== true) {
|
||||
traceLog('Deprecated warning: Third argument of Page::url() has no affect, consider removing it.');
|
||||
}
|
||||
|
||||
/*
|
||||
* Reuse existing controller or create a new one,
|
||||
* assuming that the method is called not during the front-end
|
||||
|
|
|
|||
|
|
@ -96,6 +96,9 @@ class Router
|
|||
|
||||
if ($cacheable) {
|
||||
$fileName = $this->getCachedUrlFileName($url, $urlList);
|
||||
if (is_array($fileName)) {
|
||||
list($fileName, $this->parameters) = $fileName;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -113,7 +116,9 @@ class Router
|
|||
$urlList = [];
|
||||
}
|
||||
|
||||
$urlList[$url] = $fileName;
|
||||
$urlList[$url] = !empty($this->parameters)
|
||||
? [$fileName, $this->parameters]
|
||||
: $fileName;
|
||||
|
||||
$key = $this->getUrlListCacheKey();
|
||||
Cache::put($key, serialize($urlList), Config::get('cms.urlCacheTtl', 1));
|
||||
|
|
|
|||
|
|
@ -228,5 +228,65 @@ return [
|
|||
'manage_layouts' => 'Håndter layouts',
|
||||
'manage_partials' => 'Håndter partials',
|
||||
'manage_themes' => 'Håndter maler'
|
||||
],
|
||||
'media' => [
|
||||
'invalid_path' => "Ugyldig filsti: ':path'.",
|
||||
'menu_label' => 'Media',
|
||||
'upload' => 'Last opp',
|
||||
'move' => 'Flytt',
|
||||
'delete' => 'Slett',
|
||||
'add_folder' => 'Ny mappe',
|
||||
'search' => 'Søk',
|
||||
'filter_everything' => 'Alle filer',
|
||||
'filter_images' => 'Bilder',
|
||||
'filter_video' => 'Video',
|
||||
'filter_audio' => 'Lyd',
|
||||
'filter_documents' => 'Dokumenter',
|
||||
'library' => 'Bibliotek',
|
||||
'folder_size_items' => 'fil(er)',
|
||||
'size' => 'Størrelse',
|
||||
'title' => 'Tittel',
|
||||
'last_modified' => 'Sist endret',
|
||||
'public_url' => 'URL',
|
||||
'click_here' => 'Klikk her',
|
||||
'thumbnail_error' => 'Kunne ikke lage thumbnail.',
|
||||
'return_to_parent' => 'Gå til forrige mappe',
|
||||
'return_to_parent_label' => 'Gå opp ..',
|
||||
'nothing_selected' => 'Ingenting er valgt.',
|
||||
'multiple_selected' => 'Flere filer er valgt.',
|
||||
'uploading_file_num' => 'Laster opp :number fil(er)...',
|
||||
'uploading_complete' => 'Opplasting fullført',
|
||||
'order_by' => 'Sorter etter',
|
||||
'search' => 'Søk',
|
||||
'folder' => 'Mappe',
|
||||
'no_files_found' => 'Ingen filer ble funnet.',
|
||||
'delete_empty' => 'Ingen filer er valgt.',
|
||||
'delete_confirm' => 'Vil du virkelig slette valgte fil(er)?',
|
||||
'error_renaming_file' => 'Kunne ikke gi filen nytt navn.',
|
||||
'new_folder_title' => 'Ny mappe',
|
||||
'folder_name' => 'Mappenavn',
|
||||
'error_creating_folder' => 'Kunne ikke opprette ny mappe',
|
||||
'folder_or_file_exist' => 'En fil eller mappe med det navnet eksisterer allerede.',
|
||||
'move_empty' => 'Vennligst velg filer å flytte.',
|
||||
'move_popup_title' => 'Flytt filer eller mapper',
|
||||
'move_destination' => 'Målmappe',
|
||||
'please_select_move_dest' => 'Vennligst velg en målmappe.',
|
||||
'move_dest_src_match' => 'Please select another destination folder.',
|
||||
'empty_library' => 'Mediabiblioteket er tomt. Last opp filer eller opprett mapper for å komme i gang.',
|
||||
'insert' => 'Insert',
|
||||
'crop_and_insert' => 'Crop & Insert',
|
||||
'select_single_image' => 'Vennligst velg ett enkelt bilde.',
|
||||
'selection_not_image' => 'Valgte fil er ikke et bilde.',
|
||||
'restore' => 'Angre endringer',
|
||||
'resize' => 'Endre størrelse...',
|
||||
'selection_mode_normal' => 'Normal',
|
||||
'selection_mode_fixed_ratio' => 'Fast forhold',
|
||||
'selection_mode_fixed_size' => 'Fast størrelse',
|
||||
'height' => 'Høyde',
|
||||
'width' => 'Bredde',
|
||||
'selection_mode' => 'Valgmodus',
|
||||
'resize_image' => 'Endre bildestørrelse',
|
||||
'image_size' => 'Bildestørrelse:',
|
||||
'selected_size' => 'Valgt:'
|
||||
]
|
||||
];
|
||||
|
|
|
|||
|
|
@ -53,6 +53,12 @@ return [
|
|||
'my_settings' => 'Mine innstillinger'
|
||||
]
|
||||
],
|
||||
'theme' => [
|
||||
'name' => [
|
||||
'label' => 'Tema-navn',
|
||||
'help' => 'Navngi temaet ved et unikt navn. For eksempel, RainLab.Vanilla'
|
||||
]
|
||||
],
|
||||
'plugin' => [
|
||||
'unnamed' => 'Navnløs plugin',
|
||||
'name' => [
|
||||
|
|
@ -157,7 +163,9 @@ return [
|
|||
'install' => [
|
||||
'project_label' => 'Tilkoble prosjekt',
|
||||
'plugin_label' => 'Installér',
|
||||
'theme_label' => 'Installér tema',
|
||||
'missing_plugin_name' => 'Vennligst oppgi pluginens navn.',
|
||||
'missing_theme_name' => 'Oppgi tema-navn for å installere.',
|
||||
'install_completing' => 'Fullfører installasjonen',
|
||||
'install_success' => 'Plugin har blitt installert.'
|
||||
],
|
||||
|
|
@ -165,7 +173,7 @@ return [
|
|||
'title' => 'Håndtere oppdateringer',
|
||||
'name' => 'Programvareoppdateringer',
|
||||
'menu_label' => 'Oppdateringer',
|
||||
'menu_description' => 'Oppdatere systemet, håndtere og installere plugins og themes.',
|
||||
'menu_description' => 'Oppdatere systemet, håndtere og installere plugins og temaer.',
|
||||
'check_label' => 'Se etter oppdateringer',
|
||||
'retry_label' => 'Prøv igjen',
|
||||
'plugin_name' => 'Navn',
|
||||
|
|
@ -185,10 +193,10 @@ return [
|
|||
'plugin_version_none' => 'Ny plugin',
|
||||
'plugin_version_old' => 'Nåværende v:version',
|
||||
'plugin_version_new' => 'v:version',
|
||||
'theme_label' => 'Theme',
|
||||
'theme_new_install' => 'New theme installation.', # ---
|
||||
'theme_downloading' => 'Laster ned theme: :name',
|
||||
'theme_extracting' => 'Pakker opp theme: :name',
|
||||
'theme_label' => 'Tema',
|
||||
'theme_new_install' => 'Ny tema-installasjon.',
|
||||
'theme_downloading' => 'Laster ned tema: :name',
|
||||
'theme_extracting' => 'Pakker opp tema: :name',
|
||||
'update_label' => 'Oppdatér programvare',
|
||||
'update_completing' => 'Ferdiggjør oppdatering',
|
||||
'update_loading' => 'Henter tilgjengelige oppdateringer...',
|
||||
|
|
@ -255,9 +263,11 @@ return [
|
|||
'name' => 'System',
|
||||
'manage_system_settings' => 'Håndtere systeminnstillinger',
|
||||
'manage_software_updates' => 'Håndtere programvareoppdateringer',
|
||||
'access_logs' => 'Se systemlogger',
|
||||
'manage_mail_templates' => 'Håndtere e-postmaler',
|
||||
'manage_mail_settings' => 'Håndtere e-postinnstillinger',
|
||||
'manage_other_administrators' => 'Håndtere andre administratorer',
|
||||
'view_the_dashboard' => 'Se dashboard'
|
||||
'view_the_dashboard' => 'Se dashboard',
|
||||
'manage_branding' => 'Tilpasse backend'
|
||||
]
|
||||
];
|
||||
|
|
|
|||
|
|
@ -99,4 +99,4 @@ return [
|
|||
|
||||
'attributes' => [],
|
||||
|
||||
);
|
||||
];
|
||||
|
|
|
|||
Loading…
Reference in New Issue