/**
  * Load your component.
  *
  * @param \Cx\Core\ContentManager\Model\Entity\Page $page       The resolved page
  */
 public function load(\Cx\Core\ContentManager\Model\Entity\Page $page)
 {
     global $_CORELANG, $objTemplate, $subMenuTitle;
     switch ($this->cx->getMode()) {
         case \Cx\Core\Core\Controller\Cx::MODE_FRONTEND:
             $objForum = new Forum(\Env::get('cx')->getPage()->getContent());
             \Env::get('cx')->getPage()->setContent($objForum->getPage());
             //                $moduleStyleFile = $this->getDirectory() . '/css/frontend_style.css';
             break;
         case \Cx\Core\Core\Controller\Cx::MODE_BACKEND:
             $this->cx->getTemplate()->addBlockfile('CONTENT_OUTPUT', 'content_master', 'LegacyContentMaster.html');
             $objTemplate = $this->cx->getTemplate();
             \Permission::checkAccess(106, 'static');
             $subMenuTitle = $_CORELANG['TXT_FORUM'];
             $objForum = new ForumAdmin();
             $objForum->getPage();
             break;
     }
 }
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
/* message moderation
	by Daniel Perez - 2005
*/
require_once '../../env.inc.php';
require_once $gfwww . 'include/pre.php';
require_once $gfwww . 'forum/include/ForumHTML.class.php';
require_once $gfwww . 'forum/admin/ForumAdmin.class.php';
require_once $gfcommon . 'forum/Forum.class.php';
require_once $gfcommon . 'forum/ForumMessage.class.php';
$msg_id = getIntFromRequest("msg_id");
$group_id = getIntFromRequest('group_id');
$forum_id = getIntFromRequest("forum_id");
global $HTML;
$fa = new ForumAdmin();
if (!$forum_id || !$group_id || !$msg_id) {
    exit_missing_param();
}
if ($fa->Authorized($group_id)) {
    //user authorized, continue check
    if ($fa->isForumAdmin($forum_id)) {
        //print the message
        forum_header(array());
        $g =& $fa->GetGroupObject();
        $f = new Forum($g, $forum_id);
        if (!$f || !is_object($f)) {
            exit_error(_('Error'), "Error getting new Forum");
        } elseif ($f->isError()) {
            exit_error(_('Error'), $f->getErrorMessage());
        }
Beispiel #3
0
 */
/* message moderation
	by Daniel Perez - 2005
*/
require_once '../../env.inc.php';
require_once $gfwww . 'include/pre.php';
require_once $gfwww . 'forum/include/ForumHTML.class.php';
require_once $gfwww . 'forum/admin/ForumAdmin.class.php';
require_once $gfcommon . 'forum/Forum.class.php';
require_once $gfcommon . 'forum/ForumMessage.class.php';
require_once $gfwww . 'forum/include/AttachManager.class.php';
//attachent manager
$action = getStringFromRequest('action');
$group_id = getIntFromRequest('group_id');
$forum_id = getStringFromRequest("forum_id");
$fa = new ForumAdmin();
if ($fa->Authorized($group_id)) {
    //user authorized, continue check
    //if there�s no forum_id input, then the user must have access to all forums, thus he�s a group admin for the forums
    if (!$forum_id) {
        if ($fa->isGroupAdmin()) {
            forum_header(array('title' => _('Forums: Administration')));
            if (getStringFromRequest("Go")) {
                $fa->ExecuteAction("view_pending");
            } else {
                $fa->ExecuteAction($action);
            }
            forum_footer(array());
        } else {
            exit_permission_denied();
        }
Beispiel #4
0
 $fmf->setUp(0, 'threaded', 200, '');
 $style = $fmf->getStyle();
 $max_rows = $fmf->max_rows;
 $offset = $fmf->offset;
 $fh = new ForumHTML($f);
 if (!$fh || !is_object($fh)) {
     exit_error(_('Error'), _('Error getting new ForumHTML'));
 } elseif ($fh->isError()) {
     exit_error(_('Error'), $fh->getErrorMessage());
 }
 forum_header(array('title' => $fm->getSubject(), 'forum_id' => $forum_id));
 $title_arr = array();
 $title_arr[] = _('Message') . ': ' . $msg_id;
 echo $GLOBALS['HTML']->listTableTop($title_arr);
 echo "<tr class=\"tablecontent\"><td>\n";
 $fa = new ForumAdmin();
 if ($f->userIsAdmin()) {
     echo $fa->PrintAdminMessageOptions($msg_id, $group_id, 0, $forum_id);
     // 0 in thread id because that tells us to go back to message.php instead of forum.php
 }
 echo _('BY') . ': ' . $fm->getPosterRealName() . ' (' . util_make_link_u($fm->getPosterName(), $fm->getPosterID(), $fm->getPosterName()) . ')<br />';
 echo _('DATE') . ': ' . date(_('Y-m-d H:i'), $fm->getPostDate()) . '<br />';
 $am = new AttachManager();
 echo $am->PrintHelperFunctions();
 echo $am->PrintAttachLink($fm, $group_id, $forum_id) . '<br/>';
 echo _('SUBJECT') . ': ' . $fm->getSubject() . '<p>&nbsp;</p>';
 if (!strstr('<', $fm->getBody())) {
     echo nl2br($fm->getBody());
     //backwards compatibility for non html messages
 } else {
     echo $fm->getBody();
Beispiel #5
0
             exit_no_group();
         } elseif ($fa->isPermissionDeniedError()) {
             exit_permission_denied();
         }
     }
 } else {
     /*
     	Show main page for choosing
     	either moderator or delete
     */
     forum_header(array('title' => _('Forums: Administration')));
     //
     //	Add new forum
     //
     if ($p->isForumAdmin()) {
         $fa = new ForumAdmin();
         $fa->PrintAdminOptions();
     }
     //
     //	Get existing forums
     //
     $ff = new ForumFactory($g);
     if (!$ff || !is_object($ff) || $ff->isError()) {
         exit_error(_('Error'), $ff->getErrorMessage());
     }
     $farr =& $ff->getForums();
     if ($ff->isError()) {
         echo '<h1>' . sprintf(_('No Forums Found For %1$s'), $g->getPublicName()) . '</h1>';
         echo $ff->getErrorMessage();
         forum_footer(array());
         exit;
    function showNestedMessage(&$msg)
    {
        /*
        accepts a database result handle to display a single message
        		in the format appropriate for the nested messages
        */
        global $HTML, $group_id;
        /*
        See if this message is new or not
        If so, highlite it in bold
        */
        if ($this->Forum->getSavedDate() < $msg->getPostDate()) {
            $bold_begin = '<strong>';
            $bold_end = '</strong>';
        } else {
            $bold_begin = '';
            $bold_end = '';
        }
        $am = new AttachManager();
        $fa = new ForumAdmin();
        $msgforum =& $msg->getForum();
        $ret_val = '
		<table border="0">
			<tr>
				<td class="tablecontent" nowrap="nowrap">';
        if ($msgforum->userIsAdmin()) {
            $ret_val .= $fa->PrintAdminMessageOptions($msg->getID(), $group_id, $msg->getThreadID(), $msgforum->getID());
        }
        $ret_val .= _('By:') . ' ' . util_make_link_u($msg->getPosterName(), $msg->getPosterID(), $msg->getPosterRealName()) . '<br />
';
        $ret_val .= $am->PrintAttachLink($msg, $group_id, $msgforum->getID()) . '
					<br />' . util_make_link('/forum/message.php?msg_id=' . $msg->getID() . '&group_id=' . $group_id, html_image('ic/msg.png', "10", "12", array("border" => "0")) . $bold_begin . $msg->getSubject() . ' [ ' . _('reply') . ' ]' . $bold_end) . ' &nbsp; ' . '<br />' . date(_('Y-m-d H:i'), $msg->getPostDate()) . '
				</td>
			</tr>
			<tr>
				<td>
					';
        if (!strstr($msg->getBody(), '<')) {
            $ret_val .= nl2br($msg->getBody());
            //backwards compatibility for non html messages
        } else {
            $ret_val .= $msg->getBody();
        }
        $ret_val .= '
				</td>
			</tr>
		</table>';
        return $ret_val;
    }
Beispiel #7
0
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
/* attachment manager
	by Daniel Perez - 2005
*/
require_once '../../env.inc.php';
require_once $gfwww . 'include/pre.php';
require_once $gfwww . 'forum/include/ForumHTML.class.php';
require_once $gfwww . 'forum/admin/ForumAdmin.class.php';
require_once $gfcommon . 'forum/Forum.class.php';
require_once $gfcommon . 'forum/ForumFactory.class.php';
require_once $gfcommon . 'forum/ForumMessageFactory.class.php';
require_once $gfcommon . 'forum/ForumMessage.class.php';
$action = getStringFromRequest('action');
$group_id = getIntFromRequest('group_id');
$fa = new ForumAdmin();
if ($fa->Authorized($group_id)) {
    //user authorized, continue
    if ($fa->isGroupAdmin()) {
        forum_header(array('title' => _('Forums: Administration')));
        $fa->ExecuteAction($action);
        forum_footer(array());
    } else {
        exit_permission_denied();
    }
} else {
    //manage errors
    if ($fa->isGroupIdError()) {
        exit_no_group();
    } elseif ($fa->isPermissionDeniedError()) {
        exit_permission_denied();