$this->_datas->addVariable("rea", $r);
}
-}
+ public function alertMessageDismiss() {
+ $session = Bootstrap::getInstance()->getSession();
+ $session->hideAlertMessage = true;
+ return true;
+ }
-?>
+}
$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
+}
--- /dev/null
+<?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
$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
$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']);
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');
--- /dev/null
+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;
+ });
+}
--- /dev/null
+.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;
+ }
+ }
+}