Commit ed944082 authored by Patrick Barroca's avatar Patrick Barroca 😁
Browse files

Merge branch 'no_more_entities_for_buttons' into 'master'

performance : no more entities for buttons

See merge request afi/opacce!4131
parents abaf16d8 78d2714a
- ticket #137747 : Performances : Amélioration des performances de l'espace d'administration et du magasin de thèmes
\ No newline at end of file
<?php
if ((new ZendAfi_Acl_AdminControllerGroup)->isAllowed(Class_Users::getIdentity(), 'activity', 'add'))
echo $this->Button_New((new Class_Entity())
echo $this->Button_New((new Class_Button)
->setText($this->_('Ajouter une activité')));
echo $this->button((new Class_Entity)
echo $this->button((new Class_Button)
->setText($this->_('Exporter les activités de l\'année %s (.csv)',
$this->selected_year))
->setUrl($this->url(['module' => 'admin',
......
<?php
$button = (new Class_Entity)
->setText($this->_('Ajouter un media'))
->setUrl($this->url(['action' => 'add-ressource',
'id' => $this->album->getId()]));
echo $this->button_New($button);
echo $this->button_New((new Class_Button)
->setText($this->_('Ajouter un media'))
->setUrl($this->url(['action' => 'add-ressource',
'id' => $this->album->getId()])));
echo $this->tagUploadMultiple('albumRessourcesUpload',
$this->_('Ajouter des medias'),
......@@ -164,7 +162,7 @@ echo $this->tagUploadMultiple('albumRessourcesUpload',
</fieldset>
<?php } ?>
<?php
echo $this->button_Back((new Class_Entity())
echo $this->button_Back((new Class_Button)
->setText($this->_('Retour'))
->setUrl($this->url(['controller' => 'album',
'action' => 'index',
......
......@@ -22,11 +22,11 @@ $infos = [
<div class="boutons">
<?php
echo $this->button(
(new Class_Entity())->setText($this->_('Supprimer'))
->setUrl($this->url(['action' => 'force-delete']))
->setImage($this->tagImg(Class_Admin_Skin::current()->getIconUrl('buttons',
'delete'))));
echo $this->button((new Class_Button)
->setText($this->_('Supprimer'))
->setUrl($this->url(['action' => 'force-delete']))
->setImage($this->tagImg(Class_Admin_Skin::current()->getIconUrl('buttons',
'delete'))));
echo $this->button_Back();
?>
</div>
......@@ -4,10 +4,10 @@
<?php
echo $this->button_New(
(new Class_Entity())->setText($this->_('Ajouter une localisation'))
->setUrl($this->url(['action' => 'addlocalisation',
'id_bib' => $this->id_bib])));
echo $this->button_New((new Class_Button)
->setText($this->_('Ajouter une localisation'))
->setUrl($this->url(['action' => 'addlocalisation',
'id_bib' => $this->id_bib])));
if($this->localisations)
{
......
......@@ -188,8 +188,8 @@ Class_ScriptLoader::getInstance()->addTagSelection();
</fieldset>
</form>
<?php
$back_buttton_settings = (new Class_Entity())->setUrl($this->url(['action' => 'localisations',
'id_bib' => $this->id_bib]));
$back_buttton_settings = (new Class_Button)->setUrl($this->url(['action' => 'localisations',
'id_bib' => $this->id_bib]));
echo $this->tag('div',
$this->button_Submit() . $this->button_Back($back_buttton_settings),
['class' => 'admin-buttons']);
......
......@@ -3,7 +3,7 @@
<script type="text/javascript" src="<?php echo URL_ADMIN_JS?>slimbox/autoload_image_simple.js"> </script>
<?php
echo $this->Button_New((new Class_Entity())
echo $this->Button_New((new Class_Button)
->setUrl($this->url(['action' => 'addplan']))
->setText($this->_('Ajouter un plan')));
?>
......
......@@ -36,8 +36,8 @@
<table>
<tr>
<td align="right" style="padding-right:5px;"><?php echo $this->Button_Submit(); ?> </td>
<td align="left" style="padding-left:5px;"> <?php echo $this->Button_Back((new Class_Entity())
->setUrl($this->url(['action' => 'plans']))); ?></td>
<td align="left" style="padding-left:5px;"> <?php echo $this->Button_Back((new Class_Button)
->setUrl($this->url(['action' => 'plans']))); ?></td>
</tr>
</table>
</form>
......
......@@ -69,16 +69,16 @@ $datas = json_decode(json_encode($datas));
$label = $this->_('Activé');
$class .= ' enabled';
}
echo $this->button((new Class_Entity)
->setText($label)
->setAttribs(['disabled' => 'disabled',
'onclick' => 'return;',
'class' => $class]));
echo $this->button((new Class_Button)
->setText($label)
->setAttribs(['disabled' => 'disabled',
'onclick' => 'return;',
'class' => $class]));
if(isset($connector->dashboard_url))
echo $this->button((new Class_Entity)
->setUrl($connector->dashboard_url)
->setText($this->_('Tableau de bord')));
echo $this->button((new Class_Button)
->setUrl($connector->dashboard_url)
->setText($this->_('Tableau de bord')));
?>
</td>
</tr>
......
......@@ -4,8 +4,8 @@ Class_ScriptLoader::getInstance()->addSearchInputInPath($this->_('Filtrer les do
if (Class_Users::getIdentity()->hasRightAccessDomaines()) { ?>
<center>
<div align="center"><br>
<?php echo $this->Button_New((new Class_Entity())
->setText($this->_('Ajouter un domaine')));?>
<?php echo $this->Button_New((new Class_Button)
->setText($this->_('Ajouter un domaine')));?>
</div>
</center>
<?php } ?>
......
......@@ -48,14 +48,13 @@ else {
true));
if (!$this->isPopup())
echo $this->button((new Class_Entity())
->setText($this->_('Modifier le domaine '))
->setAttribs(['title' => $this->_('Modifier le domaine : %s',
$this->catalogue->getLibelle())])
->setUrl($this->url(['action' => 'edit',
'id_catalogue' => $this->catalogue->getId()]))
->setImage($this->tagImg(Class_Admin_Skin::current()
->getIconUrl('buttons', 'configuration'))));
echo $this->button((new Class_Button)
->setText($this->_('Modifier le domaine '))
->setTitle($this->_('Modifier le domaine : %s', $this->catalogue->getLibelle()))
->setUrl($this->url(['action' => 'edit',
'id_catalogue' => $this->catalogue->getId()]))
->setImage($this->tagImg(Class_Admin_Skin::current()
->getIconUrl('buttons', 'configuration'))));
}
echo $this->pager($this->nb_notices,
......
......@@ -32,15 +32,15 @@ echo $this->tag('p', $this->_('Toutes les données de l\'article seront effacée
echo $this
->tag('div',
$this->Button((new Class_Entity())
->setUrl($this->url(['action' => 'force-delete']))
->setText($this->_('Supprimer'))
->setImage($this->tagImg(Class_Admin_Skin::current()
->getIconUrl('buttons', 'remove'))))
. $this->Button_Back((new Class_Entity())
->setUrl($this->url(['module' => 'admin',
'controller' => 'cms',
'action' => 'index',
'id_cat' => $this->model->getIdCat()],
null, true))),
$this->button((new Class_Button)
->setUrl($this->url(['action' => 'force-delete']))
->setText($this->_('Supprimer'))
->setImage($this->tagImg(Class_Admin_Skin::current()
->getIconUrl('buttons', 'remove'))))
. $this->Button_Back((new Class_Button)
->setUrl($this->url(['module' => 'admin',
'controller' => 'cms',
'action' => 'index',
'id_cat' => $this->model->getIdCat()],
null, true))),
['class' => 'boutons']);
<?php
echo $this->Button_Back((new Class_Entity())
echo $this->Button_Back((new Class_Button)
->setText($this->_('Retour à la liste'))
->setUrl($this->url(['controller' => 'custom-fields'])));
echo $this->Button_New((new Class_Entity())
echo $this->Button_New((new Class_Button)
->setText($this->_('Nouveau type de champ ')));
$indexable_renderer = function($model, $attrib) {
......
<?php
$button = $this->button((new Class_Button)
->setText($this->_('Générer'))
->setAttribs(['id' => 'generate'])
->setImage($this->tagImg(Class_Admin_Skin::current()->getIconUrl('actions',
'test'),
['style' => 'filter: invert();'])));
echo $this->renderForm($this->form,
['prepend' => [$this->button(
(new Class_Entity())->setText($this->_('Générer'))
->setAttribs(['id' => 'generate'])
->setImage($this->tagImg(Class_Admin_Skin::current()->getIconUrl('actions',
'test'),
['style' => 'filter: invert();'])))]]);
['prepend' => [$button]]);
Class_ScriptLoader::getInstance()
->addAdminScript('custom-fields/custom_fields')
......@@ -26,5 +27,3 @@ $('#menu_itemgenerate a').click(function() {
eval($('textarea[name=\"script\"]').val());
});
");
?>
<?php
echo $this->Button_New((new Class_Entity())
echo $this->Button_New((new Class_Button)
->setText($this->_('Nouveau rapport')));
echo $this->tagModelTable(
......
<?php
echo $this->button((new Class_Entity())
echo $this->button((new Class_Button)
->setText($this->_('Types de champs personnalisés'))
->setUrl($this->url(['controller' => 'custom-fields-meta']))
->setImage($this->tagImg(Class_Admin_Skin::current()->getIconUrl('buttons', 'configuration'))));
......
<?php
$skin = Class_Admin_Skin::current();
echo $this->Button((new Class_Entity())
echo $this->Button((new Class_Button)
->setUrl($this->url(['action' => 'items-csv']))
->setText($this->_('Exporter les documents (.csv)'))
->setImage($this->tagImg($skin->getIconUrl('actions', 'test'),
......@@ -8,7 +8,7 @@ echo $this->Button((new Class_Entity())
->setAttribs(['style' => 'float:right']));
echo $this->Button((new Class_Entity())
echo $this->Button((new Class_Button)
->setUrl($this->url(['action' => 'list-csv']))
->setText($this->_('Exporter les rendez-vous (.csv)'))
->setImage($this->tagImg($skin->getIconUrl('actions', 'test'),
......
<?php
echo $this->Button_Back((new Class_Entity())
echo $this->Button_Back((new Class_Button)
->setText($this->_('Retour à la liste des agendas'))
->setUrl($this->url(['module' => 'admin',
'controller' => 'external-agendas',
......
<?php
echo $this->Button_New((new Class_Entity())
echo $this->Button_New((new Class_Button)
->setText($this->_('Ajouter un agenda'))
->setUrl($this->url(['action' => 'add', 'id' => null])));
......
......@@ -7,18 +7,18 @@ $this->disable_onchange = true;
$federation_review = Class_FederationReview::getInstance();
echo $federation_review->isDisplayEnabled()
? $this->Button_Cancel((new Class_Entity())
? $this->Button_Cancel((new Class_Button)
->setText($this->_('Désactiver l\'affichage des avis communautaires'))
->setUrl($this->url(['action' => 'disable-display'])))
: $this->Button_New((new Class_Entity())
: $this->Button_New((new Class_Button)
->setText($this->_('Activer l\'affichage des avis communautaires'))
->setUrl($this->url(['action' => 'enable-display'])));
echo $federation_review->isShareEnabled()
? $this->Button_Cancel((new Class_Entity())
? $this->Button_Cancel((new Class_Button)
->setText($this->_('Désactiver l\'envoi des avis de ce portail à la communauté'))
->setUrl($this->url(['action' => 'disable-share'])))
: $this->Button_New((new Class_Entity())
: $this->Button_New((new Class_Button)
->setText($this->_('Activer l\'envoi des avis de ce portail à la communauté'))
->setUrl($this->url(['action' => 'enable-share'])));
......
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