• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getGroupDepsForConditions函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getGroupDepsForConditions函数的典型用法代码示例。如果您正苦于以下问题:PHP getGroupDepsForConditions函数的具体用法?PHP getGroupDepsForConditions怎么用?PHP getGroupDepsForConditions使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getGroupDepsForConditions函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: _questiongroupbar

 /**
  * Shows admin menu for question groups
  * @param int Survey id
  * @param int Group id
  */
 function _questiongroupbar($iSurveyID, $gid, $qid = null, $action = null)
 {
     $clang = $this->getController()->lang;
     $baselang = Survey::model()->findByPk($iSurveyID)->language;
     Yii::app()->loadHelper('replacements');
     // TODO: check that surveyid and thus baselang are always set here
     $sumresult4 = Questions::model()->findAllByAttributes(array('sid' => $iSurveyID, 'gid' => $gid, 'language' => $baselang));
     $sumcount4 = count($sumresult4);
     $grpresult = Groups::model()->findAllByAttributes(array('gid' => $gid, 'language' => $baselang));
     // Check if other questions/groups are dependent upon this group
     $condarray = getGroupDepsForConditions($iSurveyID, "all", $gid, "by-targgid");
     $groupsummary = "<div class='menubar'>\n" . "<div class='menubar-title ui-widget-header'>\n";
     //$sumquery1 = "SELECT * FROM ".db_table_name('surveys')." inner join ".db_table_name('surveys_languagesettings')." on (surveyls_survey_id=sid and surveyls_language=language) WHERE sid=$iSurveyID"; //Getting data for this survey
     $sumresult1 = Survey::model()->with(array('languagesettings' => array('condition' => 'surveyls_language=language')))->findByPk($iSurveyID);
     //$sumquery1, 1) ; //Checked //  if surveyid is invalid then die to prevent errors at a later time
     $surveyinfo = $sumresult1->attributes;
     $surveyinfo = array_merge($surveyinfo, $sumresult1->languagesettings[0]->attributes);
     $surveyinfo = array_map('flattenText', $surveyinfo);
     //$surveyinfo = array_map('htmlspecialchars', $surveyinfo);
     $aData['activated'] = $activated = $surveyinfo['active'];
     foreach ($grpresult as $grow) {
         $grow = $grow->attributes;
         $grow = array_map('flattenText', $grow);
         $aData = array();
         $aData['activated'] = $activated;
         $aData['qid'] = $qid;
         $aData['QidPrev'] = $QidPrev = getQidPrevious($iSurveyID, $gid, $qid);
         $aData['QidNext'] = $QidNext = getQidNext($iSurveyID, $gid, $qid);
         if ($action == 'editgroup' || $action == 'addquestion' || $action == 'viewquestion' || $action == "editdefaultvalues") {
             $gshowstyle = "style='display: none'";
         } else {
             $gshowstyle = "";
         }
         $aData['gshowstyle'] = $gshowstyle;
         $aData['surveyid'] = $iSurveyID;
         $aData['gid'] = $gid;
         $aData['grow'] = $grow;
         $aData['clang'] = $clang;
         $aData['condarray'] = $condarray;
         $aData['sumcount4'] = $sumcount4;
         $aData['iIconSize'] = Yii::app()->getConfig('adminthemeiconsize');
         $aData['imageurl'] = Yii::app()->getConfig('adminimageurl');
         $groupsummary .= $this->getController()->render('/admin/survey/QuestionGroups/questiongroupbar_view', $aData, true);
     }
     $groupsummary .= "\n</table>\n";
     $finaldata['display'] = $groupsummary;
     $this->getController()->render('/survey_view', $finaldata);
 }
开发者ID:ryu1inaba,项目名称:LimeSurvey,代码行数:53,代码来源:Survey_Common_Action.php


示例2: set_group_properties

 /**
  * RPC Routine to set group properties.
  *
  * @access public
  * @param string $sSessionKey Auth credentials
  * @param integer $iGroupID  - ID of the survey
  * @param array|struct $aGroupData - An array with the particular fieldnames as keys and their values to set on that particular survey
  * @return array Of succeeded and failed modifications according to internal validation.
  */
 public function set_group_properties($sSessionKey, $iGroupID, $aGroupData)
 {
     if ($this->_checkSessionKey($sSessionKey)) {
         $oGroup = QuestionGroup::model()->findByAttributes(array('gid' => $iGroupID));
         if (is_null($oGroup)) {
             return array('status' => 'Error: Invalid group ID');
         }
         if (Permission::model()->hasSurveyPermission($oGroup->sid, 'survey', 'update')) {
             $aResult = array();
             // Remove fields that may not be modified
             unset($aGroupData['sid']);
             unset($aGroupData['gid']);
             // Remove invalid fields
             $aDestinationFields = array_flip(QuestionGroup::model()->tableSchema->columnNames);
             $aGroupData = array_intersect_key($aGroupData, $aDestinationFields);
             $aGroupAttributes = $oGroup->getAttributes();
             if (empty($aGroupData)) {
                 return array('status' => 'No valid Data');
             }
             foreach ($aGroupData as $sFieldName => $sValue) {
                 //all dependencies this group has
                 $has_dependencies = getGroupDepsForConditions($oGroup->sid, $iGroupID);
                 //all dependencies on this group
                 $depented_on = getGroupDepsForConditions($oGroup->sid, "all", $iGroupID, "by-targgid");
                 //We do not allow groups with dependencies to change order - that would lead to broken dependencies
                 if ((isset($has_dependencies) || isset($depented_on)) && $sFieldName == 'group_order') {
                     $aResult[$sFieldName] = 'Group with dependencies - Order cannot be changed';
                     continue;
                 }
                 $oGroup->setAttribute($sFieldName, $sValue);
                 try {
                     // save the change to database - one by one to allow for validation to work
                     $bSaveResult = $oGroup->save();
                     fixSortOrderGroups($oGroup->sid);
                     $aResult[$sFieldName] = $bSaveResult;
                     //unset failed values
                     if (!$bSaveResult) {
                         $oGroup->{$sFieldName} = $aGroupAttributes[$sFieldName];
                     }
                 } catch (Exception $e) {
                     //unset values that cause exception
                     $oGroup->{$sFieldName} = $aGroupAttributes[$sFieldName];
                 }
             }
             return $aResult;
         } else {
             return array('status' => 'No permission');
         }
     } else {
         return array('status' => 'Invalid Session key');
     }
 }
开发者ID:kasutori,项目名称:LimeSurvey,代码行数:61,代码来源:remotecontrol_handle.php


示例3: _nquestiongroupbar

 function _nquestiongroupbar($aData)
 {
     if (isset($aData['questiongroupbar'])) {
         if (!isset($aData['gid'])) {
             if (isset($_GET['gid'])) {
                 $aData['gid'] = $_GET['gid'];
             }
         }
         $surveyid = $aData['surveyid'];
         $gid = $aData['gid'];
         $oSurvey = $aData['oSurvey'];
         $baselang = $oSurvey->language;
         $sumresult4 = Question::model()->findAllByAttributes(array('sid' => $surveyid, 'gid' => $gid, 'language' => $baselang));
         $sumcount4 = count($sumresult4);
         $aData['sumcount4'] = $sumcount4;
         $sumresult1 = Survey::model()->with(array('languagesettings' => array('condition' => 'surveyls_language=language')))->findByPk($surveyid);
         //$sumquery1, 1) ; //Checked //  if surveyid is invalid then die to prevent errors at a later time
         $surveyinfo = $sumresult1->attributes;
         $surveyinfo = array_merge($surveyinfo, $sumresult1->defaultlanguage->attributes);
         $surveyinfo = array_map('flattenText', $surveyinfo);
         //$surveyinfo = array_map('htmlspecialchars', $surveyinfo);
         $aData['activated'] = $activated = $surveyinfo['active'];
         $condarray = getGroupDepsForConditions($surveyid, "all", $gid, "by-targgid");
         $aData['condarray'] = $condarray;
         $aData['languagelist'] = $oSurvey->getAllLanguages();
         $this->getController()->renderPartial("/admin/survey/QuestionGroups/nquestiongroupbar_view", $aData);
     }
 }
开发者ID:jgianpiere,项目名称:lime-survey,代码行数:28,代码来源:Survey_Common_Action.php


示例4: view

 public function view($surveyid, $gid)
 {
     $aData = array();
     $aData['surveyid'] = $iSurveyID = $surveyid;
     $aData['gid'] = $gid;
     $baselang = Survey::model()->findByPk($surveyid)->language;
     $condarray = getGroupDepsForConditions($surveyid, "all", $gid, "by-targgid");
     $aData['condarray'] = $condarray;
     $grow = QuestionGroup::model()->findByPk(array('gid' => $gid, 'language' => $baselang));
     $grow = $grow->attributes;
     $grow = array_map('flattenText', $grow);
     $aData['surveyid'] = $surveyid;
     $aData['gid'] = $gid;
     $aData['grow'] = $grow;
     $aData['sidemenu']['questiongroups'] = true;
     $aData['sidemenu']['group_name'] = $grow['group_name'];
     $surveyinfo = Survey::model()->findByPk($iSurveyID)->surveyinfo;
     $aData['title_bar']['title'] = $surveyinfo['surveyls_title'] . "(" . gT("ID") . ":" . $iSurveyID . ")";
     $aData['questiongroupbar']['buttons']['view'] = true;
     ///////////
     // sidemenu
     $aData['sidemenu']['state'] = true;
     $aData['sidemenu']['explorer']['state'] = true;
     $aData['sidemenu']['explorer']['gid'] = isset($gid) ? $gid : false;
     $aData['sidemenu']['explorer']['qid'] = false;
     $this->_renderWrappedTemplate('survey/QuestionGroups', 'group_view', $aData);
 }
开发者ID:BertHankes,项目名称:LimeSurvey,代码行数:27,代码来源:questiongroups.php


示例5: getbuttons

 public function getbuttons()
 {
     // Find out if the survey is active to disable add-button
     $oSurvey = Survey::model()->findByPk($this->sid);
     $surveyIsActive = $oSurvey->active !== 'N';
     $baselang = $oSurvey->language;
     // Add question to this group
     $url = Yii::app()->createUrl("admin/questions/sa/newquestion/surveyid/{$this->sid}/gid/{$this->gid}");
     $button = '<a class="btn btn-default list-btn ' . ($surveyIsActive ? 'disabled' : '') . ' "  data-toggle="tooltip"  data-placement="left" title="' . gT('Add new question to group') . '" href="' . $url . '" role="button"><span class="glyphicon glyphicon-plus-sign " ></span></a>';
     // Group edition
     // Edit
     $url = Yii::app()->createUrl("admin/questiongroups/sa/edit/surveyid/{$this->sid}/gid/{$this->gid}");
     $button .= '  <a class="btn btn-default  list-btn" href="' . $url . '" role="button" data-toggle="tooltip" title="' . gT('Edit group') . '"><span class="glyphicon glyphicon-pencil " ></span></a>';
     // View summary
     $url = Yii::app()->createUrl("/admin/questiongroups/sa/view/surveyid/");
     $url .= '/' . $this->sid . '/gid/' . $this->gid;
     $button .= '  <a class="btn btn-default  list-btn" href="' . $url . '" role="button" data-toggle="tooltip" title="' . gT('Group summary') . '"><span class="glyphicon glyphicon-list-alt " ></span></a>';
     $iQuestionsInGroup = Question::model()->countByAttributes(array('sid' => $this->sid, 'gid' => $this->gid, 'language' => $baselang));
     // Delete
     if ($oSurvey->active != "Y" && Permission::model()->hasSurveyPermission($this->sid, 'surveycontent', 'delete') && $iQuestionsInGroup > 0) {
         $condarray = getGroupDepsForConditions($this->sid, "all", $this->gid, "by-targgid");
         if (is_null($condarray)) {
             $confirm = 'if (confirm(\'' . gT("Deleting this group will also delete any questions and answers it contains. Are you sure you want to continue?", "js") . '\')) { window.open(\'' . Yii::app()->createUrl("admin/questiongroups/sa/delete/surveyid/{$this->sid}/gid/{$this->gid}") . '\',\'_top\'); };';
             $button .= '<a class="btn btn-default"  data-toggle="tooltip" title="' . gT("Delete") . '" href="#" role="button"
                         onclick="' . $confirm . '">
                             <span class="text-danger glyphicon glyphicon-trash"></span>
                         </a>';
         } else {
             $alert = 'alert(\'' . gT("Impossible to delete this group because there is at least one question having a condition on its content", "js") . '\'); return false;';
             $button .= '<a class="btn btn-default"  data-toggle="tooltip" title="' . gT("Delete") . '" href="#" role="button"
                         onclick="' . $alert . '">
                             <span class="text-danger glyphicon glyphicon-trash"></span>
                         </a>';
         }
     }
     return $button;
 }
开发者ID:joaocc,项目名称:LimeSurvey--LimeSurvey,代码行数:37,代码来源:QuestionGroup.php


示例6: _nquestiongroupbar

 /**
  * Show admin menu for question group view
  *
  * @param array $aData ?
  */
 function _nquestiongroupbar($aData)
 {
     if (isset($aData['questiongroupbar'])) {
         if (!isset($aData['gid'])) {
             if (isset($_GET['gid'])) {
                 $aData['gid'] = $_GET['gid'];
             }
         }
         $aData['surveyIsActive'] = $aData['oSurvey']->active !== 'N';
         $surveyid = $aData['surveyid'];
         $gid = $aData['gid'];
         $oSurvey = $aData['oSurvey'];
         $baselang = $oSurvey->language;
         $aData['sumcount4'] = Question::model()->countByAttributes(array('sid' => $surveyid, 'gid' => $gid, 'language' => $baselang));
         $sumresult1 = Survey::model()->with(array('languagesettings' => array('condition' => 'surveyls_language=language')))->findByPk($surveyid);
         //$sumquery1, 1) ; //Checked //  if surveyid is invalid then die to prevent errors at a later time
         $surveyinfo = $sumresult1->attributes;
         $surveyinfo = array_merge($surveyinfo, $sumresult1->defaultlanguage->attributes);
         $surveyinfo = array_map('flattenText', $surveyinfo);
         //$surveyinfo = array_map('htmlspecialchars', $surveyinfo);
         $aData['activated'] = $activated = $surveyinfo['active'];
         $condarray = getGroupDepsForConditions($surveyid, "all", $gid, "by-targgid");
         $aData['condarray'] = $condarray;
         $aData['languagelist'] = $oSurvey->getAllLanguages();
         if (isset($aData['questiongroupbar']['closebutton']['url'])) {
             $sAlternativeUrl = $aData['questiongroupbar']['closebutton']['url'];
             $aForbiddenWordsInUrl = array('add');
             $aData['questiongroupbar']['closebutton']['url'] = Yii::app()->request->getUrlReferrer(Yii::app()->createUrl($sAlternativeUrl), $aForbiddenWordsInUrl);
         }
         $this->getController()->renderPartial("/admin/survey/QuestionGroups/questiongroupbar_view", $aData);
     }
 }
开发者ID:sickpig,项目名称:LimeSurvey,代码行数:37,代码来源:Survey_Common_Action.php


示例7: view

 public function view($surveyid, $gid)
 {
     $aData = array();
     $aData['surveyid'] = $iSurveyID = $surveyid;
     $aData['gid'] = $gid;
     $baselang = Survey::model()->findByPk($surveyid)->language;
     $condarray = getGroupDepsForConditions($surveyid, "all", $gid, "by-targgid");
     $aData['condarray'] = $condarray;
     $grow = QuestionGroup::model()->findByPk(array('gid' => $gid, 'language' => $baselang));
     $grow = $grow->attributes;
     $grow = array_map('flattenText', $grow);
     $aData['surveyid'] = $surveyid;
     $aData['gid'] = $gid;
     $aData['grow'] = $grow;
     $aData['sidebar']['questiongroups'] = true;
     $aData['sidebar']['group_name'] = $grow['group_name'];
     $surveyinfo = Survey::model()->findByPk($iSurveyID)->surveyinfo;
     $aData['title_bar']['title'] = $surveyinfo['surveyls_title'] . "(" . gT("ID") . ":" . $iSurveyID . ")";
     $aData['questiongroupbar']['buttons']['view'] = TRUE;
     //$aData['questiongroupbar']['returnbutton']['url'] = $this->getController()->createUrl("admin/survey/sa/listquestiongroups/", array('surveyid'=>$surveyid));
     //$aData['questiongroupbar']['returnbutton']['text'] = gT('return to question group list');
     $this->_renderWrappedTemplate('survey/QuestionGroups', 'group_view', $aData);
 }
开发者ID:jgianpiere,项目名称:lime-survey,代码行数:23,代码来源:questiongroups.php



注:本文中的getGroupDepsForConditions函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getGroupInfo函数代码示例发布时间:2022-05-15
下一篇:
PHP getGroup函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap