echo '<input type="hidden" name="SuggestionId" value="' . $this->suggestionId . '">'; } if (isset($this->suggestionsUri)) { echo '<input type="hidden" name="SuggestionURI" value="' . $this->suggestionsUri . '">'; } } else { if (isset($vars['IdGroup']) && $vars['IdGroup'] != 0 && is_numeric($vars['IdGroup'])) { echo '<input type="hidden" name="IdGroup" value="' . intval($vars['IdGroup']) . '">'; } else { echo '<input type="hidden" name="IdGroup" value="0">'; } } ?> <?php if (isset($this->suggestionsGroupId) || $groupsforum == SuggestionsModel::getGroupId()) { ?> <fieldset class="row" id = "fpost_vis_fieldset" > <legend onclick = "toggleFieldsets('fpost_vis');" ><?php echo $words->getFormatted("ForumSuggestionsVisibilityAndLanguage"); ?> </legend> <div id="fpost_vis"> <p><?php echo $words->get('SuggestionsGroupInfoReply'); ?> </p> <input type="hidden" name="PostVisibility" id="PostVisibility" value="MembersOnly"/> <input type="hidden" name="IdLanguage" id="IdLanguage" value="0"/> </div> </fieldset>
public function replySuggestionsProcess() { $callbackId = PFunctions::hex2base64(sha1(__METHOD__)); if (PPostHandler::isHandling()) { $groupId = SuggestionsModel::getGroupId(); $this->_model->setGroupId($groupId); return $this->_model->replyProcess(true); } else { PPostHandler::setCallback($callbackId, __CLASS__, __METHOD__); return $callbackId; } }
public function __construct() { parent::__construct(); $this->THREADS_PER_PAGE = Forums::CV_THREADS_PER_PAGE; //Variable because it can change wether the user is logged or no $this->POSTS_PER_PAGE = Forums::CV_POSTS_PER_PAGE; //Variable because it can change wether the user is logged or no $layoutbits = new MOD_layoutbits(); switch ($layoutbits->GetPreference("PreferenceForumFirstPage")) { case "Pref_ForumFirstPageLastPost": $this->setTopMode(Forums::CV_TOPMODE_FORUM); break; case "Pref_ForumFirstPageCategory": $this->setTopMode(Forums::CV_TOPMODE_CATEGORY); break; default: $this->setTopMode(Forums::CV_TOPMODE_LANDING); break; } if (!isset($_SESSION['IdMember'])) { $this->THREADS_PER_PAGE = 100; // Variable because it can change wether the user is logged or no $this->POSTS_PER_PAGE = 200; // Variable because it can change wether the user is logged or no } $MyGroups = array(); $this->words = new MOD_words(); $this->BW_Right = MOD_right::get(); $this->IdGroup = 0; // By default no group $this->ByCategories = false; // toggle or not toglle the main view is TopCategories or TopLevel $this->ForumOrderList = $layoutbits->GetPreference("PreferenceForumOrderListAsc"); // Decide if it is an active LoggeMember or not if (empty($_SESSION["IdMember"]) or empty($_SESSION["MemberStatus"]) or $_SESSION["MemberStatus"] == 'Pending' or $_SESSION["MemberStatus"] == 'NeedMore') { $this->PublicThreadVisibility = " (ThreadVisibility = 'NoRestriction') AND (ThreadDeleted != 'Deleted')"; $this->PublicPostVisibility = " (PostVisibility = 'NoRestriction') AND (PostDeleted != 'Deleted')"; $this->ThreadGroupsRestriction = " (IdGroup = 0 OR ThreadVisibility = 'NoRestriction')"; $this->PostGroupsRestriction = " (IdGroup = 0 OR PostVisibility = 'NoRestriction')"; } else { $this->PublicThreadVisibility = "(ThreadVisibility != 'ModeratorOnly') AND (ThreadDeleted != 'Deleted')"; $this->PublicPostVisibility = "(PostVisibility != 'ModeratorOnly') AND (PostDeleted !='Deleted')"; $this->PostGroupsRestriction = " PostVisibility IN ('MembersOnly','NoRestriction') OR (PostVisibility='GroupOnly' AND IdGroup in(0"; $this->ThreadGroupsRestriction = " ThreadVisibility IN ('MembersOnly','NoRestriction') OR (ThreadVisibility = 'GroupOnly' and IdGroup in(0"; $qry = $this->dao->query("SELECT IdGroup FROM membersgroups WHERE IdMember = " . $_SESSION["IdMember"] . " AND Status = 'In'"); if (!$qry) { throw new PException('Failed to retrieve groups for member id =#' . $_SESSION["IdMember"] . ' !'); } while ($rr = $qry->fetch(PDB::FETCH_OBJ)) { $this->PostGroupsRestriction = $this->PostGroupsRestriction . "," . $rr->IdGroup; $this->ThreadGroupsRestriction = $this->ThreadGroupsRestriction . "," . $rr->IdGroup; array_push($MyGroups, $rr->IdGroup); // Save the group list } $this->ThreadGroupsRestriction .= "," . SuggestionsModel::getGroupId(); $this->PostGroupsRestriction = $this->PostGroupsRestriction . "))"; $this->ThreadGroupsRestriction = $this->ThreadGroupsRestriction . "))"; } // Prepares additional visibility options for moderator if ($this->BW_Right->HasRight("ForumModerator")) { $this->PublicPostVisibility = " PostVisibility IN ('NoRestriction', 'MembersOnly','GroupOnly','ModeratorOnly')"; $this->PublicThreadVisibility = " ThreadVisibility IN ('NoRestriction', 'MembersOnly','GroupOnly','ModeratorOnly')"; if ($this->BW_Right->HasRight("ForumModerator", "AllGroups") or $this->BW_Right->HasRight("ForumModerator", "All")) { $this->PostGroupsRestriction = " (1=1)"; $this->ThreadGroupsRestriction = " (1=1)"; } } $this->MyGroups = $MyGroups; }
private function getVisibilityCheckbox($visibility, $highestVisibility, $IdGroup, $newTopic) { if ($IdGroup == 0) { // Indicate to the form that only MembersOnly is allowed; this is a hack to avoid too much code changes return ''; } if ($IdGroup == SuggestionsModel::getGroupId()) { // Indicate to the form that only MembersOnly is allowed; return ''; } if ($highestVisibility == 'GroupOnly') { // This will tell the form that the post is GroupOnly (IdGroup set and no visibilityCheckbox content return ''; } if (!$newTopic) { $name = "PostVisibility"; $word = 'ForumVisibilityGroupOnlyPost'; } else { $name = "ThreadVisibility"; $word = 'ForumVisibilityGroupOnlyThread'; } $words = new MOD_words(); $out = '<input type="checkbox" name="' . $name . '" id="' . $name . '" value="GroupOnly"'; if ($visibility == 'GroupOnly') { $out .= ' checked="checked" '; } $out .= '/> <label for="' . $name . '">' . $words->get($word) . '</label>'; return $out; }
<?php echo $callbackTags; ?> <h3><?php echo $this->purifier->purify($this->suggestion->summary . " (" . $words->get('SuggestionsVoteEnds', $this->suggestion->nextstatechange) . ")"); ?> </h3> <p><?php echo $this->purifier->purify($this->suggestion->description); ?> </p> <?php if (!$this->viewOnly) { ?> <p><?php echo $words->get('SuggestionsVoteDiscussion', '<a href="/groups/' . SuggestionsModel::getGroupId() . '/forum/s' . $this->suggestion->threadId . '">', '</a>'); ?> </p> <?php } ?> <hr class="suggestion" /> <?php foreach ($this->suggestion->options as $option) { ?> <div class="option floatbox"> <div class="floatbox float_left"> <p><strong><?php echo $this->purifier->purify($option->summary); ?> </strong></p>