コード例 #1
0
ファイル: surveyView.php プロジェクト: doorgets/cms
 private function send($uri_module = '')
 {
     $response = array();
     $response['data'] = array();
     $response['errors'] = array();
     $params = $this->doorGets->Params();
     $data = $params['GET'];
     if (!array_key_exists('value', $data) && in_array($data['value'], Constant::$surveyResponse)) {
         $response['errors']['value'] = 'not found';
     } else {
         $surveyService = new SurveyService($this->doorGets);
         $surveyService->add($uri_module, $data['value']);
         $response['data'] = $surveyService->getStats($uri_module);
     }
     return $response;
 }
コード例 #2
0
ファイル: modulesurveyView.php プロジェクト: doorgets/cms
 public function getContent()
 {
     $out = '';
     $lgActuel = $this->doorGets->getLangueTradution();
     $moduleInfos = $this->doorGets->moduleInfos($this->doorGets->Uri, $lgActuel);
     $listeCategories = $this->doorGets->categorieSimple;
     unset($listeCategories[0]);
     $aActivation = $this->doorGets->getArrayForms('activation');
     $Rubriques = array('index' => $this->doorGets->__('Index'), 'add' => $this->doorGets->__('Ajouter'), 'edit' => $this->doorGets->__('Modifier'), 'delete' => $this->doorGets->__('Supprimer'));
     // get Content for edit / delete
     $params = $this->doorGets->Params();
     if (array_key_exists('uri', $params['GET'])) {
         $uri = $params['GET']['uri'];
         $isContent = $this->doorGets->dbQS($uri, $this->doorGets->Table, 'uri');
         if (!empty($isContent)) {
             if ($lgGroupe = @unserialize($isContent['groupe_traduction'])) {
                 $idLgGroupe = $lgGroupe[$lgActuel];
                 $isContentTraduction = $this->doorGets->dbQS($idLgGroupe, $this->doorGets->Table . '_traduction');
                 if (!empty($isContentTraduction)) {
                     $isContent = array_merge($isContent, $isContentTraduction);
                     $this->isContent = $isContent;
                     $surveyService = new SurveyService($this->doorGets);
                     $stats = $surveyService->getStats($isContent['uri']);
                 }
             }
         }
     }
     $ActionFile = 'modules/' . $this->doorGets->controllerNameNow() . '/user_' . $this->doorGets->controllerNameNow() . '_' . $this->Action;
     $tpl = Template::getView($ActionFile);
     ob_start();
     if (is_file($tpl)) {
         include $tpl;
     }
     $out .= ob_get_clean();
     return $out;
 }
コード例 #3
0
ファイル: survey.tpl.php プロジェクト: doorgets/cms
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    
******************************************************************************
******************************************************************************/
/*
 * Variables :
 * 
       $content
*/
$labelModuleGroup = $this->getActiveModules();
$urlAfterAction = urlencode(PROTOCOL . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
$urlEdition = URL_USER . $this->_lgUrl . '?controller=modulesurvey&uri=' . $isSurvey['uri'] . '&lg=' . $this->getLangueTradution() . '&back=' . $urlAfterAction;
$surveyService = new SurveyService($this);
$canRespond = $surveyService->firewall($isSurvey['uri'], $this->user['id']);
$stats = $surveyService->getStats($isSurvey['uri']);
$value = '';
if (!empty($canRespond)) {
    $value = $canRespond['value'];
}
?>
<!-- doorGets:start:widgets/survey -->
<div id="survey-[{!$uri_module!}]" class="survey-static survey-static-[{!$uri_module!}]">
    [{?($this->isUser && in_array($Module['id'],$this->_User['liste_widget'])):}]
    <div class="btn-group btn-front-edit-[{!$uri_module!}] navbar-right pull-right z-max-index">
        <a class="btn btn-default dropdown-toggle" data-toggle="dropdown" href="#">
            <b  class="glyphicon glyphicon-cog"></b> [{!$this->__('Action')!}]
            <span class="caret"></span>
        </a>