Warning, file /webapps/ocs-webserver/application/modules/default/views/helpers/VerificationCodePopup.php was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 <?php
0002 /**
0003  *  ocs-webserver
0004  *
0005  *  Copyright 2016 by pling GmbH.
0006  *
0007  *    This file is part of ocs-webserver.
0008  *
0009  *    This program is free software: you can redistribute it and/or modify
0010  *    it under the terms of the GNU Affero General Public License as
0011  *    published by the Free Software Foundation, either version 3 of the
0012  *    License, or (at your option) any later version.
0013  *
0014  *    This program is distributed in the hope that it will be useful,
0015  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
0016  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0017  *    GNU Affero General Public License for more details.
0018  *
0019  *    You should have received a copy of the GNU Affero General Public License
0020  *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
0021  **/
0022 
0023 class Default_View_Helper_VerificationCodePopup extends Zend_View_Helper_Abstract
0024 {
0025 
0026     public function verificationCodePopup($project_data, $link_1, $idPopupLayer, $view = null)
0027     {
0028         if (empty($link_1)) {
0029             return '';
0030         }
0031 
0032         if (isset($view)) {
0033             $this->view = $view;
0034         }
0035 
0036         $websiteOwner = new Local_Verification_WebsiteProject();
0037         $html_verifier = $websiteOwner->generateAuthCode(stripslashes($link_1));
0038         $this->view->inlineScript()->appendScript(
0039             '$(document).ready(function(){
0040                     ButtonCode.setupClipboardCopy(\'div#' . $idPopupLayer . ' #container-verification\');
0041                 });'
0042         );
0043 
0044         return $this->getHTMLCode($project_data, $html_verifier, $idPopupLayer);
0045 
0046     }
0047 
0048     protected function getHTMLCode($project_data, $html_verifier, $idPopupLayer)
0049     {
0050         return '<div id="' . $idPopupLayer . '" class="modal fade" role="dialog" aria-labelledby="modalVerificationCodeLabel" aria-hidden="true">
0051                     <div class="modal-dialog pling-modal">
0052                         <div class="modal-content">
0053                             <div class="modal-header">
0054                                 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
0055                                 <h3 id="modalVerificationCodeLabel" class="modal-title center">' . $this->view->translate('Get Verification Code') . '</h3>
0056                             </div>
0057                             <div class="modal-body">
0058                                 <div class="lightblue"></div>
0059                                 <p class="light">' . $this->view->translate('Copy the meta tag below and paste it into your site home page. It should go in the &lt;head&gt; section, before the first &lt;body&gt; section.') . '</p>
0060                                 <div class="center" id="container-verification">
0061                                     <div class="clipboard-copy clearfix embed-code">
0062                                         <div class="purple clipboard-code light span8" id="verification-code">
0063                                             &lt;meta name="ocs-site-verification" content="' . $html_verifier . '" /&gt;
0064                                         </div>
0065                                         <button class="btn btn-purple right light span4" data-clipboard-target="#verification-code">
0066                                             ' . $this->view->translate('COPY TO CLIPBOARD') . '
0067                                         </button>
0068                                     </div>
0069                                 </div>
0070                             </div>
0071                             <div class="modal-footer">
0072                                 <a role="button" class="btn btn-light-grey verify partial" href="' . $this->view->buildProductUrl($project_data->project_id, 'verifycode') . '" data-target="#msg-box-code-product' . $project_data->project_id . ' .modal-body" >' . $this->view->translate('Verify my product page') . '</a>
0073                                 <a role="button" class="btn btn-light-grey dismiss" href="#" data-dismiss="modal">' . $this->view->translate('Close') . '</a>
0074                             </div>
0075                         </div>
0076                     </div>
0077                 </div>
0078                 ';
0079     }
0080 
0081 }