Commit 600ea398 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

Merge branch 'dev#99489_magasin_de_themes_bases_sur_bootstrap' into 'master'

onbootstrap

See merge request !3322
parents 62eed56a d94d9196
Pipeline #8858 passed with stage
in 44 minutes and 50 seconds
[submodule "tests_js/lib/qunit-phantomjs-runner"]
path = tests_js/lib/qunit-phantomjs-runner
url = http://git.afi-sa.fr/afi/qunit-phantomjs-runner.git
url = https://git.afi-sa.net/afi/qunit-phantomjs-runner.git
[submodule "library/storm"]
path = library/storm
url = http://git.afi-sa.fr/afi/storm.git
url = https://git.afi-sa.net/afi/storm.git
[submodule "library/Redmine"]
path = library/Redmine
url = http://git.afi-sa.fr/afi/php-redmine-api.git
url = https://git.afi-sa.net/afi/php-redmine-api.git
[submodule "library/iCal"]
path = library/iCal
url = http://git.afi-sa.net/afi/iCal.git
url = https://git.afi-sa.net/afi/iCal.git
[submodule "library/PhpParser"]
path = library/PhpParser
url = http://git.afi-sa.net/afi/PHP-Parser.git
url = https://git.afi-sa.net/afi/PHP-Parser.git
[submodule "library/matomo-php-tracker"]
path = library/matomo-php-tracker
url = http://git.afi-sa.fr/afi/matomo-php-tracker.git
url = https://git.afi-sa.net/afi/matomo-php-tracker.git
[submodule "library/phpseclib"]
path = library/phpseclib
url = https://git.afi-sa.net/afi/phpseclib.git
......
......@@ -48,11 +48,10 @@ class Admin_WidgetController extends ZendAfi_Controller_Action {
public function addAction() {
$this->view->titre = $this->_('Ajouter une boite');
if (!$profil = Class_Profil::find($this->_getParam('id_profil')))
return $this->_redirectClose($this->_getReferer());
if (($template_section = $this->_getParam('template'))
if (('' != ($template_section = $this->_getParam('template')))
|| ($this->_request->isPost() && ('' != $this->_getParam('module_type')))) {
return $this->_addNewWidget($profil, $template_section);
}
......@@ -64,7 +63,7 @@ class Admin_WidgetController extends ZendAfi_Controller_Action {
protected function _addNewWidget($profil, $template_section) {
if ($template_section) {
if ('' != $template_section) {
$template_no = $this->_getParam('template_no');
$template = $this->_readTemplates()['sections'][$template_section]['templates'][$template_no];
}
......@@ -84,6 +83,12 @@ class Admin_WidgetController extends ZendAfi_Controller_Action {
? $template['configuration']
: [];
$preferences = array_merge(Class_Systeme_ModulesAccueil::getInstance()
->getModuleByCode($type_module)
->getDefaultValues(),
$preferences,
$this->_getPost());
$new_id = $profil->createNewModuleAccueilId();
$profil->updateModuleConfigAccueil($new_id,
......@@ -102,10 +107,7 @@ class Admin_WidgetController extends ZendAfi_Controller_Action {
->setProfileId($this->_getParam('id_profil'))
->setParent($this->_getParam('parent'))
->load()
->setNewDatas(array_merge(Class_Systeme_ModulesAccueil::getInstance()
->getModuleByCode($this->_getParam('module_type'))
->getDefaultValues(),
$this->_request->getPost()));
->setNewDatas($preferences);
$edit_widget_url = Class_Url::assemble(['module' => 'admin',
'controller' => 'widget',
......@@ -213,8 +215,7 @@ class Admin_WidgetController extends ZendAfi_Controller_Action {
protected function _readTemplates() {
$templates = file_get_contents(ROOT_PATH . 'public/opac/js/widget_templates/widget_templates.json');
return json_decode($templates, true);
return Class_Template::current()->getWidgetTemplates();
}
......
<?php
echo $this->renderWidgetTemplates($this->templates);
?>
......@@ -33,7 +33,7 @@ class BibController extends ZendAfi_Controller_Action {
return $this->_helper->json($this->_getJsonLibraries());
if (!empty((new Class_Session_Libraries)->getIds()))
$this->_redirect('opac/bib?geo_zone=reset');
$this->_redirect('opac/bib?geo_zone=reset');
$zones = Class_Zone::getLoader()->findAll();
$bibs = [];
......@@ -273,6 +273,31 @@ class BibController extends ZendAfi_Controller_Action {
}
public function renderAllAction() {
$id_module = $this->_getParam('id_module');
$module = Class_Profil::getCurrentProfil()->getModuleAccueilPreferences($id_module, 'LIBRARY');
$module_library = new Class_Systeme_ModulesAccueil_Library();
$preferences = array_merge($module_library->getDefaultValues(),
$module);
$preferences['ID_MODULE'] = $id_module;
$this->view->titre = $preferences['titre'];
$this->view->content = $this->view->librariesLinkToAll($preferences);
if ($this->_getParam('render') === 'ajax') {
$script_loader = Class_ScriptLoader::getInstance();
$scripts = $script_loader
->addAdminScript('onload_utils')
->addJQueryReady('setupAnchorsTarget();')
->html();
$this->_helper->HTMLAjaxResponse($scripts . $this->view->content);
}
}
protected function _getSelectedFilters() {
$filter_keys = (new Class_Systeme_ModulesAccueil_Library())->getStaticFiltersKeys();
return $this->_helper->selectedFilters($filter_keys);
......
......@@ -243,6 +243,24 @@ class CmsController extends ZendAfi_Controller_Action {
}
public function renderAllAction() {
$this->_initCalendarAndPreferences();
if ($this->_getParam('render') === 'ajax') {
$content = $this->view->calendarLinkToAll($this->view->calendar,
$this->view->preferences);
$script_loader = Class_ScriptLoader::getInstance();
$scripts = $script_loader
->addAdminScript('onload_utils')
->addJQueryReady('setupAnchorsTarget();')
->html();
$this->_helper->HTMLAjaxResponse($scripts . $content);
}
}
protected function _initCalendarAndPreferences() {
$id_module = $this->_getParam('id_module');
......
......@@ -40,4 +40,73 @@ class WidgetController extends ZendAfi_Controller_Action {
return $this->_helper->iframe($callback);
}
public function renderAllAction() {
if (!$id = $this->_getParam('widget_id'))
return $this->getResponse()->setHttpResponseCode(404);
if (!$profile_id = $this->_getParam('profile_id'))
return $this->getResponse()->setHttpResponseCode(404);
Class_Template::setCurrentFrom($profile_id);
if (!$widget = ((new Class_Systeme_Widget_Widget)
->setId($id)
->setProfileId($profile_id)
->load()))
return $this->getResponse()->setHttpResponseCode(404);
$this->view->widget = $widget;
}
public function previewAction() {
session_write_close();
$callback = function() {
if (null === ($section = $this->_getParam('section', null)))
return '';
if (null === ($index = $this->_getParam('index', null)))
return '';
$profile_id = Class_Profil::getCurrentProfil()->getId();
Class_Template::setCurrentFrom($profile_id);
$widget_templates = Class_Template::current()->getWidgetTemplates();
$template = $widget_templates['sections'][$section]['templates'][$index];
$type_module = isset($template)
? $template['type']
: '';
if (!$type_module)
return '';
if ('NOTIFY' == $type_module) {
(new ZendAfi_Controller_Action_Helper_FlashMessenger)->addNotification($this->_('1 nouvelle notification'), ['status' => 'success']);
ZendAfi_Controller_Action_Helper_FlashMessenger::reset();
}
$settings = isset($template)
? $template['configuration']
: [];
$settings = array_merge(Class_Systeme_ModulesAccueil::getInstance()
->getModuleByCode($type_module)
->getDefaultValues(),
$settings);
if ($widget = ((new Class_Systeme_Widget_Widget)
->loadFromSettings(['type_module' => $type_module,
'profile_id' => Class_Profil::getCurrentProfil()->getId(),
'preferences' => $settings])))
return Class_Template::current()->renderWidget($widget, $this->view);
};
return $this->_helper->iframe($callback);
}
}
\ No newline at end of file
<?php
echo $this->renderWidgetAll($this->widget);
\ No newline at end of file
......@@ -42,6 +42,18 @@ abstract class Class_Systeme_Widget_Abstract extends Class_Entity {
}
public function loadFromSettings($settings) {
return $this
->setProfileId(Class_Profil::getCurrentProfil()->getId())
->setId('no')
->init()
->_transmute($settings)
->setTitle($this->_getTitle())
->setForm($this->_getForm())
->setViewHelper($this->_getViewHelper());
}
public function init() {
if(!$this->getProfileId())
return;
......
......@@ -454,4 +454,9 @@ class Class_Template {
public function isLegacy() {
return false;
}
public function getWidgetTemplates() {
return '';
}
}
\ No newline at end of file
......@@ -479,7 +479,7 @@ class ZendAfi_View_Helper_Accueil_Base extends ZendAfi_View_Helper_ModuleAbstrac
$instance
->addOPACScript('renderFilters/ajaxifyFilters.js')
->addJQueryReady('$("#boite_' . $this->getIdModule() . '").ajaxifyFilters('. $opts .');');
->addJQueryReady('$("#boite_' . $this->getIdModule() . ',main .ajaxable").ajaxifyFilters('. $opts .');');
$filter_settings->isDisplayModeList()
? $instance->addStyleSheet(Class_Url::baseUrl() . '/public/opac/js/renderFilters/list.css')
......
......@@ -21,10 +21,11 @@
class ZendAfi_View_Helper_RenderWidgetTemplates extends ZendAfi_View_Helper_BaseHelper {
public function renderWidgetTemplates($templates) {
Class_ScriptLoader::getInstance()
->addJQueryReady('var widget = $(".widget_templates");'
.'widget.accordion({heightStyle: "content"});'
.'widget.accordion({heightStyle: "content", collapsible: true, active: false});'
.'widget.find("a").click(function() {widget.html("<div class=\'saving-process\'><p>' . $this->_('Ajout en cours') . str_replace('"', '\'', $this->view->tagLoadingImg()) . '</p></div>");});')
->addStylesheet(URL_JS . 'widget_templates/widget_templates.css');
......@@ -35,6 +36,7 @@ class ZendAfi_View_Helper_RenderWidgetTemplates extends ZendAfi_View_Helper_Base
['class' => 'widget_templates']);
}
public function renderSection($section_key, $section) {
return
$this->_tag('h3',
......@@ -70,6 +72,4 @@ class ZendAfi_View_Helper_RenderWidgetTemplates extends ZendAfi_View_Helper_Base
$this->_tag('img', null, ['src' => URL_JS . 'widget_templates/' . $template['icon']]),
['href' => $action_url]);
}
}
?>
\ No newline at end of file
}
\ No newline at end of file
......@@ -83,7 +83,7 @@ class Bokeh_Engine {
defineConstant('BOKEH_MAJOR_VERSION','8.0');
defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.33');
defineConstant('BOKEH_REMOTE_FILES', 'http://git.afi-sa.fr/afi/opacce/');
defineConstant('BOKEH_REMOTE_FILES', 'https://git.afi-sa.net/afi/opacce/');
defineConstant('ROOT_PATH', realpath(dirname(__FILE__).'/..').'/');
......
Subproject commit 617a9a9d7502fe498442f9e45b7561d2579341e7
Subproject commit e999f53a9da4da9331fdb78f62a597afbffd453a
......@@ -114,4 +114,10 @@ class Historic_Template extends Class_Template {
public function isLegacy() {
return true;
}
public function getWidgetTemplates() {
$templates = file_get_contents(ROOT_PATH . 'public/opac/js/widget_templates/widget_templates.json');
return json_decode($templates, true);
}
}
\ No newline at end of file
/* Global */
:root {
--front-text: black;
--front-text-white: white;
......@@ -18,7 +16,6 @@
--front-widget-background: #FFF;
--front-navbar-background: #CCC;
--front-background-overlay: rgba(0, 0 , 0 ,0.7);
--front-background-modale: rgba(0, 0 , 0 ,0.95);
--front-background-youtube: #ff0000;
--front-card-background: linear-gradient(to right, rgba(0,0,0,0), white, white);
--front-card-footer-background: linear-gradient(rgba(255, 255, 255, 0), white);
......@@ -584,17 +581,6 @@ dl.row {
overflow: hidden;
}
.section_content_wrapper .ui-sortable-placeholder {
visibility: visible !important;
background-color: var(--front-background-modale);
height: 200px;
}
.section_content_wrapper .ui-sortable {
height: 100%;
min-height: 50px;
}
.img-thumbnail {
overflow: hidden;
text-align: center;
......@@ -706,4 +692,8 @@ dl.row {
-moz-column-count: 5;
column-count: 5;
}
}
.navbar-nav.flex-column .dropdown-menu {
position: initial;
}
\ No newline at end of file
......@@ -77,7 +77,7 @@ class Intonation_Library_FormCustomizer_Abstract {
$this->_template->withNameSpace('expand_breakpoint'),
['label' => $this->_('Déplié à partir de la taille'),
'value' => Intonation_Library_Constants::RESPONSIVE_MODE_SMALL,
'order' => 1,
'order' => 0,
'multiOptions' => [Intonation_Library_Constants::RESPONSIVE_MODE_XSMALL => $this->_('très petite ( inférieur à 575px )'),
Intonation_Library_Constants::RESPONSIVE_MODE_SMALL => $this->_('petite ( entre 575px et 767px )'),
Intonation_Library_Constants::RESPONSIVE_MODE_MEDIUM => $this->_('moyenne ( entre 768px et 991px )'),
......
......@@ -43,6 +43,11 @@ class Intonation_Library_ProfilePatcher extends Class_Template_ProfilePatcher {
protected function _upgradeProfile() {
$this->_profile
->setCfgSiteParam('skin', '')
->setCfgSiteParam('browser', 'opac')
->setCfgSiteParam('parent_id', 'null')
->setCfgSiteParam('header_js', '')
->setCfgSiteParam('page_css', '')
->setCfgSiteParam('header_css', '')
->setCfgSiteParam('nb_divisions', '3')
->setCfgSiteParam('largeur_division1', '10')
->setCfgSiteParam('largeur_division2', '10')
......@@ -141,7 +146,6 @@ class Intonation_Library_ProfilePatcher extends Class_Template_ProfilePatcher {
Class_Profil::DIV_BANNIERE,
['titre' => 'logo',
'boite' => ['no_border', 'no_border_radius', 'no_shadow', 'no_background'],
'image' => '/userfiles/bannieres/logo_header.png',
'link' => '',
$this->_template->withNameSpace('width_xsmall') => 12,
$this->_template->withNameSpace('width_medium') => 3,
......
......@@ -33,20 +33,16 @@ class Intonation_Library_Widget_Carousel_Agenda_Definition extends Intonation_Li
public function __construct() {
parent::__construct();
$this->_libelle = $this->_('Boite agenda');
$this->_form = 'Intonation_Library_Widget_Carousel_Agenda_Form';
$this->_view_helper = 'Intonation_Library_Widget_Carousel_Agenda_View';
$this->_defaultValues = ['titre' => $this->_libelle,
'enabled_filters' => 'day;date;place',
'event_filter' => 'none',
'rendering' => static::CARD,
'layout' => static::WALL,
'rss' => false,
'embeded_code' => false,
'link_to_all' => false,
'order' => static::SORT_EVENT,
'size' => 9];
$this->_defaultValues = array_merge($this->_defaultValues,
['titre' => $this->_libelle,
'enabled_filters' => 'day;date;place',
'event_filter' => 'none',
'order' => static::SORT_EVENT]);
}
......
......@@ -84,6 +84,14 @@ class Intonation_Library_Widget_Carousel_Agenda_View extends Intonation_Library_
}
public function getLinkToAllContent() {
$this->view->titre = $this->_settings->getTitre();
$this->_initCalendar();
return $this->view->calendarLinkToAll($this->_calendar, $this->_settings);
}
protected function _emptyListMessage() {
return $this->view->tag('p', $this->_('Aucun événement'));
}
......
......@@ -37,16 +37,12 @@ class Intonation_Library_Widget_Carousel_Article_Definition extends Intonation_L
public function __construct() {
parent::__construct();
$this->_libelle = $this->_('Boite d\'articles');
$this->_form = 'Intonation_Library_Widget_Carousel_Article_Form';
$this->_view_helper = 'Intonation_Library_Widget_Carousel_Article_View';
$this->_defaultValues = ['titre' => $this->_libelle,
'rendering' => static::CARD_OVERLAY,
'layout' => static::WALL,
'rss' => false,
'embeded_code' => false,
'link_to_all' => false,
'order' => static::SORT_RANDOM,
'size' => 9];
$this->_defaultValues = array_merge($this->_defaultValues,
['titre' => $this->_libelle,
'order' => static::SORT_RANDOM]);
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment