]> _ Git - cubedesigners-v7.git/commitdiff
Wait #5571 @3
authorstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 14 Nov 2022 15:56:14 +0000 (15:56 +0000)
committerstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 14 Nov 2022 15:56:14 +0000 (15:56 +0000)
framework/application/controllers/AjaxController.php
framework/application/forms/Settings.php
framework/application/views/helpers/AlertMessage.php [new file with mode: 0644]
framework/application/views/helpers/ContactInfos.php
framework/application/views/helpers/FooterContact.php
framework/application/views/scripts/common/body.phtml
js/alert-message.js [new file with mode: 0644]
less/alert-message.less [new file with mode: 0644]

index cbd563601941b9f89a01746df7e76e36181797f6..e2183c532633e1c11ca9925d463bf0baada2136f 100644 (file)
@@ -42,6 +42,10 @@ class AjaxController extends CubeIT_Controller_AjaxController {
                 $this->_datas->addVariable("rea", $r);
         }
 
-}
+        public function alertMessageDismiss() {
+                $session = Bootstrap::getInstance()->getSession();
+                $session->hideAlertMessage = true;
+                return true;
+        }
 
-?>
+}
index 36e87a0fea4539e023075ee8fe59bf9dfe912372..afbf94a47ac9f130bc02dd1df4853873c0b01446 100644 (file)
@@ -63,7 +63,16 @@ class Cubedesigners_Form_Settings extends CubeIT_Form_Settings {
                $tags->setLabel(__('Tags'));
                $this->addElement($tags);
 
+        /* ALERT POPUP MESSAGE - used for important notifications */
+        $alert_message_enabled = new Zend_Form_Element_Checkbox('alert_message_enabled');
+        $alert_message_enabled->setLabel(__("Activer le message d'alerte"));
+        $alert_message_enabled->setValue(false);
+        $this->addElement($alert_message_enabled);
+
+        $alert_message = new CubeIT_Form_Element_Markitup('alert_message');
+        $alert_message->setLabel(__("Message d'alerte"));
+        $this->addElementLocalized($alert_message);
 
        }
 
-}
\ No newline at end of file
+}
diff --git a/framework/application/views/helpers/AlertMessage.php b/framework/application/views/helpers/AlertMessage.php
new file mode 100644 (file)
index 0000000..d9f23ce
--- /dev/null
@@ -0,0 +1,25 @@
+<?php\r
+\r
+class Cubedesigners_View_Helper_AlertMessage extends CubeIT_View_Helper_Abstract {\r
+\r
+    public function alertMessage() {\r
+\r
+        if (!Bootstrap::getInstance()->getOpt('alert_message_enabled', false) || Bootstrap::getInstance()->getSession()->hideAlertMessage) {\r
+            return '';\r
+        }\r
+\r
+        $this->addScriptAndStyle('alert-message');\r
+\r
+        $message = $this->view->markupDotclear(Bootstrap::getInstance()->getOpt('alert_message'), [], ['class' => 'alert-message-text']);\r
+\r
+        $content  = $message;\r
+        $content .= '<button class="alert-message-close"><svg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path d="M4,29a1,1,0,0,1-.71-.29,1,1,0,0,1,0-1.42l24-24a1,1,0,1,1,1.42,1.42l-24,24A1,1,0,0,1,4,29Z"/><path d="M28,29a1,1,0,0,1-.71-.29l-24-24A1,1,0,0,1,4.71,3.29l24,24a1,1,0,0,1,0,1.42A1,1,0,0,1,28,29Z"/></svg></button>';\r
+\r
+        $res = $this->htmlElement($content, 'div', ['class' => 'alert-message-content']);\r
+\r
+        return $this->htmlElement($res, 'div', ['id' => 'alertMessage', 'class' => 'alert-message-wrapper']);\r
+    }\r
+\r
+}\r
+\r
+?>\r
index 2ff8d08d88f15349b5a5e110f858dfd35320f472..cfa4926cd353e5e7387498e27ca64597c1d27a53 100644 (file)
@@ -26,10 +26,11 @@ class Cubedesigners_View_Helper_ContactInfos extends Zend_View_Helper_Abstract {
             $res.=$this->view->linkGeo(__("Plan d'accès"), $bureau['coordonnees']['adresse'] . ',' . $bureau['coordonnees']['ville'] . ',' . Zend_Locale::getTranslation($bureau['coordonnees']['pays'], 'territory'), array('class' => 'but mobile'));\r
             $res.='</div>';\r
 \r
-            $res.='<div class="numeros">';\r
-            $res.='<p itemprop="telephone">' . __('Tel') . ' ' . $this->view->linkPhone($bureau['coordonnees']['tel']) . '</p>';\r
-            //$res.='<p itemprop="faxNumber">' . __('Fax') . ' ' . $bureau['coordonnees']['fax'] . '</p>';\r
-            $res.='</div>';\r
+            // PHONE NUMBERS TEMPORARILY HIDDEN...\r
+            // $res.='<div class="numeros">';\r
+            // $res.='<p itemprop="telephone">' . __('Tel') . ' ' . $this->view->linkPhone($bureau['coordonnees']['tel']) . '</p>';\r
+            // //$res.='<p itemprop="faxNumber">' . __('Fax') . ' ' . $bureau['coordonnees']['fax'] . '</p>';\r
+            // $res.='</div>';\r
 \r
             $res.='</div>'; // .inner\r
 \r
index 57cdb9227b097b22a4ffe36f740584d153835e33..6cea4d81ddd389b66fe327e63e4435eafb0a97c2 100644 (file)
@@ -16,11 +16,12 @@ class Cubedesigners_View_Helper_FooterContact extends Zend_View_Helper_Abstract
 
                        $res .= '<p class="titre" itemprop="name">' . sprintf(__('Bureaux de %s'), $bureau['coordonnees']['nom']) . '<p>';
 
-                       $res .= '<div class="numeros">';
-                       $event = array('category' => 'phone', 'action' => 'call', 'label' => $bureau['coordonnees']['tel']);
-                       $res .= '<p itemprop="telephone">' . __('Tel') . ' ' . $this->view->linkPhone($bureau['coordonnees']['tel'], null, array('data-event' => $event)) . '</p>';
-                       //$res.='<p itemprop="faxNumber">' . __('Fax') . ' ' . $this->view->linkPhone($bureau['coordonnees']['fax']) . '</p>';
-                       $res .= '</div>';
+                       /* TEMPORARILY HIDING PHONE NUMBERS AFTER FAKE JOB ADS WERE POSTED IN THE NAME OF CUBEDESIGNERS... */
+                       // $res .= '<div class="numeros">';
+                       // $event = array('category' => 'phone', 'action' => 'call', 'label' => $bureau['coordonnees']['tel']);
+                       // $res .= '<p itemprop="telephone">' . __('Tel') . ' ' . $this->view->linkPhone($bureau['coordonnees']['tel'], null, array('data-event' => $event)) . '</p>';
+                       // //$res.='<p itemprop="faxNumber">' . __('Fax') . ' ' . $this->view->linkPhone($bureau['coordonnees']['fax']) . '</p>';
+                       // $res .= '</div>';
 
                        //$res.= $this->view->microdataPlace($bureau['coordonnees']['adresse']);
 
index 60fcfd91ae2ae5f47fe5bc83e6456984091f3190..776336f05864d1a75f5b97cd36fb1bff33889da8 100644 (file)
@@ -2,6 +2,7 @@
 
 echo '<body class="'. $this->bodyClass .'">' . "\n";
 echo $this->bannerCookies();
+echo $this->alertMessage();
 echo $this->render('admin/mockup.phtml');
 echo $this->render('admin/nav.phtml');
 echo $this->render('common/content.phtml');
diff --git a/js/alert-message.js b/js/alert-message.js
new file mode 100644 (file)
index 0000000..aa98272
--- /dev/null
@@ -0,0 +1,11 @@
+registerLoader(load_alert_message, true);
+
+function load_alert_message() {
+  $(document).on('click', '.alert-message-close', function() {
+    processAjaxURL('/ajax/alertMessageDismiss');
+    $("#alertMessage").fadeOut(function () {
+      $(this).remove();
+    });
+    return false;
+  });
+}
diff --git a/less/alert-message.less b/less/alert-message.less
new file mode 100644 (file)
index 0000000..e0dc2fa
--- /dev/null
@@ -0,0 +1,58 @@
+.alert-message {
+    &-wrapper {
+      background-color: rgba(0,0,0,0.7);
+      position: fixed;
+      top: 0;
+      right: 0;
+      bottom: 0;
+      left: 0;
+      overflow: hidden;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      z-index: 9999;
+    }
+
+    &-close {
+      position: absolute;
+      top: 2rem;
+      right: 2rem;
+      width: 2.5em;
+      height: 2.5em;
+      appearance: none;
+      border: none;
+      background: transparent;
+      cursor: pointer;
+
+      svg {
+        width: 100%;
+        height: auto;
+      }
+    }
+
+    &-content {
+      position: relative;
+      background-color: #fff;
+      padding: 2rem;
+      max-width: 68ch;
+      width: 95vw;
+      outline: 8px solid #fc0;
+      margin: 1rem;
+      font-size: 1.25em;
+    }
+
+    &-text {
+      line-height: 1.5;
+
+      & > * + * {
+        margin-top: 1em;
+      }
+
+      h1, h2, h3 {
+        margin-bottom: 0;
+        text-align: center;
+        line-height: 1.2;
+        font-weight: 700;
+      }
+    }
+}