Example #1
0
 public function showForm($mes)
 {
     $ns = e107::getRender();
     $frm = new form();
     $text = $frm->form_open('post', e_SELF);
     $text .= "<table class='table adminform'>";
     $text .= "<tr><td>" . LAN_RADIUS_01 . "</td><td>";
     $text .= $frm->form_text('radius_server', 35, vartrue($this->radius['radius_server']), 120);
     $text .= "</td></tr>\n";
     $text .= "<tr><td>" . LAN_RADIUS_02 . "</td><td>";
     $text .= $frm->form_text('radius_secret', 35, vartrue($this->radius['radius_secret']), 200);
     $text .= "</td></tr>\n";
     $tmp = $this->alt_auth_get_field_list('radius', $frm, $this->radius, FALSE);
     if ($tmp) {
         $text .= "<tr><td class='forumheader2' colspan='2'>" . LAN_ALT_27 . "</td></tr>\n" . $tmp;
         unset($tmp);
     }
     $text .= "<tr><td class='forumheader' colspan='2' style='text-align:center;'>";
     // $text .= $frm -> form_button("submit", "update", LAN_ALT_2);
     $text .= e107::getForm()->admin_button('update', LAN_UPDATE, 'update');
     $text .= "</td></tr>\n";
     $text .= "</table>\n";
     $text .= $frm->form_close();
     $ns->tablerender(LAN_RADIUS_06, $mes->render() . $text);
     $ns->tablerender(LAN_ALT_40 . LAN_ALT_41, $this->alt_auth_test_form('radius', $frm));
 }
 /**
  * Render menu.
  */
 function renderMenu()
 {
     $tpl = e107::getTemplate('nodejs_comment');
     $sc = e107::getScBatch('nodejs_comment', true);
     $tp = e107::getParser();
     $cm = e107::getComment();
     $amount = (int) vartrue($this->plugPrefs['comment_display'], 10);
     /**
      * getCommentData() returns with array, which contains:
      * - comment_datestamp
      * - comment_author_id
      * - comment_author
      * - comment_comment
      * - comment_subject
      * - comment_type
      * - comment_title
      * - comment_url
      */
     $items = $cm->getCommentData($amount);
     $text = $tp->parseTemplate($tpl['MENU']['LATEST']['HEADER'], true, $sc);
     foreach ($items as $item) {
         $sc->setVars($item);
         $text .= $tp->parseTemplate($tpl['MENU']['LATEST']['ITEM'], true, $sc);
     }
     if (empty($items)) {
         $text .= '<a href="#" class="list-group-item no-posts text-center">' . LAN_PLUGIN_NODEJS_COMMENT_FRONT_05 . '</a>';
     }
     $text .= $tp->parseTemplate($tpl['MENU']['LATEST']['FOOTER'], true, $sc);
     e107::getRender()->tablerender(LAN_PLUGIN_NODEJS_COMMENT_FRONT_04, $text);
     unset($text);
 }
Example #3
0
function setstyle_shortcode($parm)
{
    global $style;
    // BC
    $style = $parm;
    // BC
    e107::getRender()->setStyle($parm);
}
Example #4
0
 /**
  * Available parameters (GET string format)
  * - cols (integer): number of items per column, default 1
  * - no_fill_empty (boolean): don't fill last column with empty items (if required), default 0
  * - tablestyle (string): mode to be used with <code>tablerender()</code>, default 'featurebox'
  * - notablestyle (null): if isset - disable <code>tablerender()</code>
  * - force (boolean): force category model load , default false
  * - ids (string): comma separated id list - load specific featurebox items, default empty 
  * 
  * @param string $parm parameters
  * @param string $mod category template
  * @example {FEATUREBOX=cols=2|tabs}
  */
 function sc_featurebox($parm = null, $mod = '')
 {
     if ($parm == null && $mod == '') {
         $type = vartrue(e107::getPlugPref('featurebox', 'menu_category'), 'bootstrap_carousel');
         $text = e107::getParser()->parseTemplate("{FEATUREBOX|" . $type . "}");
         return $text;
     }
     // TODO cache
     if (!e107::isInstalled('featurebox')) {
         return '';
     }
     if (!$mod) {
         $ctemplate = 'default';
     } else {
         $ctemplate = $mod;
     }
     parse_str($parm, $parm);
     $category = $this->getCategoryModel($ctemplate, vartrue($parm['force']) ? true : false);
     $defopt = array('force' => 0, 'no_fill_empty' => 0, 'tablestyle' => 'featurebox', 'cols' => 1, 'ids' => '', 'notablestyle' => null);
     // reset to default, update current
     $category->setParams($defopt)->updateParams($parm);
     if (!$category->hasData()) {
         return '';
     }
     $tmpl = $this->getFboxTemplate($ctemplate);
     $type = vartrue($tmpl['js_type'], '');
     // Legacy support (prototype.js)
     if (vartrue($tmpl['js'])) {
         $tmp = explode(',', $tmpl['js']);
         foreach ($tmp as $file) {
             e107::js('footer', $file, $type);
         }
     }
     $tp = e107::getParser();
     if (vartrue($tmpl['js_inline'])) {
         $data = $tp->toText($category->getData('fb_category_parms'));
         $jsInline = str_replace("{FEATUREBOX_PARMS}", "{" . trim($data) . "}", $tmpl['js_inline']);
         e107::js('footer-inline', $jsInline, $type, 3);
     }
     // Fix - don't use tablerender if no result (category could contain hidden items)
     $ret = $this->render($category, $ctemplate, $parm);
     if (empty($ret)) {
         e107::getMessage()->addDebug('Featurebox returned nothing.')->addDebug('Category: ' . print_a($category, true))->addDebug('Template: ' . $ctemplate)->addDebug('Param: ' . print_a($parm, true));
         return '';
     }
     $ret = $tp->parseTemplate($tmpl['list_start'], true, $category) . $ret . $tp->parseTemplate($tmpl['list_end'], true, $category);
     if (isset($parm['notablestyle'])) {
         return $ret;
     }
     return e107::getRender()->tablerender(LAN_PLUGIN_FEATUREBOX_NAME, $ret, vartrue($parm['tablestyle'], 'featurebox'), true);
 }
Example #5
0
 function render()
 {
     $tp = e107::getParser();
     $sql = e107::getDb('nfp');
     $pref = e107::getPref();
     $qry = $this->getQuery();
     if ($results = $sql->gen($qry)) {
         $text = "<ul>";
         while ($row = $sql->fetch()) {
             $datestamp = $tp->toDate($row['post_datestamp'], 'relative');
             $id = $row['thread_id'];
             $topic = $row['thread_datestamp'] == $row['post_datestamp'] ? '' : 'Re:';
             $topic .= strip_tags($tp->toHTML($row['thread_name'], true, 'emotes_off, no_make_clickable, parse_bb', '', $pref['menu_wordwrap']));
             $row['thread_sef'] = $this->forumObj->getThreadSef($row);
             if ($row['post_user_anon']) {
                 $poster = $row['post_user_anon'];
             } else {
                 if ($row['user_name']) {
                     $poster = "<a href='" . e107::getUrl()->create('user/profile/view', array('name' => $row['user_name'], 'id' => $row['post_user'])) . "'>{$row['user_name']}</a>";
                 } else {
                     $poster = '[deleted]';
                 }
             }
             $post = strip_tags($tp->toHTML($row['post_entry'], true, 'emotes_off, no_make_clickable', '', $pref['menu_wordwrap']));
             $post = $tp->text_truncate($post, $this->menuPref['characters'], $this->menuPref['postfix']);
             // Count previous posts for calculating proper (topic) page number for the current post.
             //	$postNum = $sql2->count('forum_post', '(*)', "WHERE post_id <= " . $row['post_id'] . " AND post_thread = " . $row['thread_id'] . " ORDER BY post_id ASC");
             //	$postPage = ceil($postNum / vartrue($this->plugPref['postspage'], 10)); // Calculate (topic) page number for the current post.
             //	$thread = $sql->retrieve('forum_thread', '*', 'thread_id = ' . $row['thread_id']); 	// Load thread for passing it to e107::url().
             // Create URL for post.
             // like: e107_plugins/forum/forum_viewtopic.php?f=post&id=1
             $url = e107::url('forum', 'topic', $row, array('query' => array('f' => 'post', 'id' => intval($row['post_id']))));
             $text .= "<li>";
             if ($this->menuPref['title']) {
                 $text .= "<a href='{$url}'>{$topic}</a><br />{$post}<br /><small class='text-muted muted'>" . LAN_FORUM_MENU_001 . " {$poster} {$datestamp}</small>";
             } else {
                 $text .= "<a href='{$url}'>" . LAN_FORUM_MENU_001 . "</a> {$poster} <small class='text-muted muted'>{$datestamp}</small><br />{$post}<br />";
             }
             $text .= "</li>";
         }
         $text .= "</ul>";
     } else {
         $text = LAN_FORUM_MENU_002;
     }
     $caption = varset($this->menuPref['caption'][e_LANGUAGE], $this->menuPref['caption']);
     e107::getRender()->tablerender($caption, $text, 'nfp_menu');
 }
 /**
  * Render menu contents.
  */
 function renderMenu()
 {
     $template = e107::getTemplate('nodejs_online');
     $sc = e107::getScBatch('nodejs_online', true);
     $tp = e107::getParser();
     e107_require_once(e_PLUGIN . 'nodejs_online/includes/nodejs_online.php');
     $users = nodejs_online_get_online_users();
     $sc->setVars(array('count' => count($users)));
     $text = $tp->parseTemplate($template['MENU']['HEADER'], true, $sc);
     foreach ($users as $uid => $user) {
         $sc->setVars(array('user' => $user));
         $text .= $tp->parseTemplate($template['MENU']['ITEM'], true, $sc);
     }
     $text .= $tp->parseTemplate($template['MENU']['FOOTER'], true);
     e107::getRender()->tablerender(LAN_NODEJS_ONLINE_MENU_01, $text);
     unset($text);
 }
Example #7
0
function show_importdb_form()
{
    $ns = e107::getRender();
    $parm = altAuthGetParams('importdb');
    $frm = new form();
    $text = $frm->form_open('post', e_SELF);
    $text .= "<table class='table adminform'>\r\n\t<colgroup span='2'>\r\n\t\t<col class='col-label' />\r\n\t\t<col class='col-control' />\r\n\t</colgroup>";
    $text .= "<tr><td colspan='2'>" . IMPORTDB_LAN_11 . "</td></tr>";
    $text .= "<tr><td>" . IMPORTDB_LAN_9 . "</td><td>";
    $text .= altAuthGetPasswordSelector('importdb_password_method', $frm, $parm['importdb_password_method'], TRUE);
    $text .= "</td></tr>";
    $text .= "</table><div class='buttons-bar center'>";
    $text .= e107::getForm()->admin_button("update", LAN_UPDATE, 'update');
    $text .= "</div>";
    $text .= $frm->form_close();
    $ns->tablerender(IMPORTDB_LAN_10, $text);
    $ns->tablerender(LAN_ALT_40 . LAN_ALT_41, alt_auth_test_form('importdb', $frm));
}
 /**
  * Render menu contents.
  */
 function renderMenu()
 {
     $template = e107::getTemplate('paypal_donation');
     $sc = e107::getScBatch('paypal_donation', true);
     $tp = e107::getParser();
     $db = e107::getDb();
     $db->select('paypal_donation', '*', 'pd_status = 1 ORDER BY pd_weight ASC');
     $text = '';
     while ($row = $db->fetch()) {
         if (check_class($row['pd_visibility']) === true) {
             $item = array('menu_item' => $row, 'amounts' => $this->getAmounts($row['pd_id']), 'raised' => $this->getRaised($row['pd_id']));
             $sc->setVars($item);
             $text .= $tp->parseTemplate($template['MENU'], true, $sc);
         }
     }
     e107::getRender()->tablerender(LAN_PAYPAL_DONATION_FRONT_01, $text);
     unset($text);
 }
Example #9
0
    function init()
    {
        $ns = e107::getRender();
        if (e_QUERY == 'bbcode') {
            echo $this->bbcodeForm();
            return;
        }
        $text = "<div class='alert alert-warning'>Warning: These will only work if you have a bootstrap-based theme installed</div>";
        $text .= '
		<ul class="nav nav-tabs">';
        $text .= '<li class="active" ><a href="#mbuttons" data-toggle="tab">Buttons</a></li>';
        $text .= '<li><a href="#badges" data-toggle="tab">Labels &amp; Badges</a></li>';
        $text .= '<li><a href="#glyphs" data-toggle="tab">Glyphicons</a></li>';
        $text .= '</ul>';
        $text .= '<div class="tab-content">';
        $text .= '<div class="tab-pane active left" id="mbuttons">' . $this->buttonForm() . '</div>';
        $text .= '<div class="tab-pane left" id="badges">' . $this->badgeForm() . '</div>';
        $text .= '<div class="tab-pane left" id="glyphs">' . $this->glyphicons() . '</div>';
        $text .= '</div>';
        echo $text;
    }
Example #10
0
function show_admins()
{
    $sql = e107::getDb();
    $frm = e107::getForm();
    $ns = e107::getRender();
    $mes = e107::getMessage();
    $tp = e107::getParser();
    $prm = e107::getUserPerms();
    $sql->db_Select("user", "*", "user_admin='1'");
    $text = "\n\t<form action='" . e_SELF . "' method='post' id='del_administrator'>\n\t\t<fieldset id='core-administrator-list'>\n\t\t\t<legend class='e-hideme'>" . ADMSLAN_13 . "</legend>\n\t\t\t<table class='table adminlist'>\n\t\t\t\t<colgroup>\n\t\t\t\t\t<col style='width:  5%' />\n\t\t\t\t\t<col style='width: 20%' />\n\t\t\t\t\t<col style='width: 65%' />\n\t\t\t\t\t<col style='width: 10%' />\n\t\t\t\t</colgroup>\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th>ID</th>\n\t\t\t\t\t\t<th>" . ADMSLAN_56 . "</th>\n\t\t\t\t\t\t<th>" . ADMSLAN_18 . "</th>\n\t\t\t\t\t\t<th class='center last'>" . LAN_OPTIONS . "</th>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>\n\n\t";
    while ($row = $sql->db_Fetch()) {
        //$permtxt = "";
        $text .= "\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>" . $row['user_id'] . "</td>\n\t\t\t\t\t\t<td><a href='" . e107::getUrl()->create('user/profile/view', array('id' => $row['user_id'], 'name' => $row['user_name'])) . "'>" . $row['user_name'] . "</a></td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t" . $prm->renderperms($row['user_perms'], $row['user_id'], "words") . "\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td class='center'>\n\t\t";
        if ($row['user_id'] != "1") {
            $text .= "\n\t\t\t\t\t\t\t" . $frm->submit_image("edit_admin[{$row['user_id']}]", 'edit', 'edit', LAN_EDIT) . "\n\t\t\t\t\t\t\t" . $frm->submit_image("del_admin[{$row['user_id']}]", 'del', 'delete', $tp->toJS(ADMSLAN_59 . "? [" . $row['user_name'] . "]")) . "\n\n\t\t\t";
        }
        $text .= "\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t";
    }
    $text .= "\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t\t" . $frm->hidden('del_administrator_confirm', '1') . "\n\t\t</fieldset>\n\t</form>\n\n\t";
    $ns->tablerender(ADMSLAN_13, $mes->render() . $text);
}
Example #11
0
 function render()
 {
     $ns = e107::getRender();
     $mes = e107::getMessage();
     $admin_cat = e107::getNav()->adminCats();
     $text = "<div>";
     $text .= "<ul class='nav nav-tabs'>";
     foreach ($admin_cat['id'] as $cat_key => $cat_id) {
         $cls = $cat_key == 1 ? "class='active'" : "";
         $text .= "<li {$cls} ><a data-toggle='tab' href='#core-main-" . $cat_key . "'>" . $admin_cat['title'][$cat_key] . "</a></li>";
     }
     $text .= "</ul>";
     //    print_a($this->links);
     $text .= "<div class='tab-content adminform'>";
     foreach ($admin_cat['id'] as $id => $cat_id) {
         $cls = $id == 1 ? "active" : "";
         $text .= "<div class='tab-pane {$cls} adminform' style='width:95%' id='core-main-{$id}'>" . $this->renderCat($id) . "</div>";
     }
     $text .= "</div>";
     $text .= "</div>";
     $ns->tablerender(ADLAN_47 . " " . ADMINNAME, $mes->render() . $text);
 }
 /**
  * Render menu.
  */
 function renderMenu()
 {
     $tpl = e107::getTemplate('nodejs_forum');
     $sc = e107::getScBatch('nodejs_forum', true);
     $tp = e107::getParser();
     $items = $this->getLatestForumPosts();
     $text = $tp->parseTemplate($tpl['MENU']['RECENT']['HEADER'], true, $sc);
     foreach ($items as $item) {
         // Get topic page number.
         $postNum = $this->getPostNum($item['thread']['thread_id'], $item['post']['post_id']);
         $postPage = ceil($postNum / vartrue($this->plugForumPrefs['postspage'], 10));
         $item['topicPage'] = $postPage;
         $sc->setVars($item);
         $text .= $tp->parseTemplate($tpl['MENU']['RECENT']['ITEM'], true, $sc);
     }
     if (empty($items)) {
         $text .= '<div class="no-posts text-center">' . LAN_PLUGIN_NODEJS_FORUM_FRONT_05 . '</div>';
     }
     $text .= $tp->parseTemplate($tpl['MENU']['RECENT']['FOOTER'], true, $sc);
     e107::getRender()->tablerender(LAN_PLUGIN_NODEJS_FORUM_FRONT_04, $text);
     unset($text);
 }
Example #13
0
 function showImages($cat)
 {
     $mes = e107::getMessage();
     $tp = e107::getParser();
     $template = e107::getTemplate('gallery');
     $sc = e107::getScBatch('gallery', TRUE);
     $sc->total = e107::getMedia()->countImages($cat);
     $sc->amount = 12;
     // TODO Add Pref. amount per page.
     $sc->curCat = $cat;
     $sc->from = $_GET['frm'] ? intval($_GET['frm']) : 0;
     $list = e107::getMedia()->getImages($cat, $sc->from, $sc->amount);
     $catname = $tp->toHtml($this->catList[$cat]['media_cat_title'], false, 'defs');
     $inner = "";
     foreach ($list as $row) {
         $sc->setVars($row);
         $inner .= $tp->parseTemplate($template['LIST_ITEM'], TRUE);
     }
     $text = $tp->parseTemplate($template['LIST_START'], TRUE);
     $text .= $inner;
     $text .= $tp->parseTemplate($template['LIST_END'], TRUE);
     e107::getRender()->tablerender("Gallery :: " . $catname, $mes->render() . $text);
 }
Example #14
0
 public function showForm()
 {
     $ns = e107::getRender();
     $parm = $this->altAuthGetParams('e107db');
     $frm = new form();
     $text = $frm->form_open('post', e_SELF);
     $text .= "<table class='table adminform'>\r\n\t\t<colgroup span='2'>\r\n\t\t\t<col class='col-label' />\r\n\t\t\t<col class='col-control' />\r\n\t\t</colgroup>";
     $text .= "<tr><td>" . LAN_ALT_26 . "</td><td>";
     $text .= E107DB_LAN_1;
     $text .= "</td></tr>";
     $text .= $this->alt_auth_get_db_fields('e107db', $frm, $parm, 'server|uname|pwd|db|prefix|classfilt');
     $text .= "<tr><td>" . E107DB_LAN_9 . "</td><td>";
     $text .= $this->altAuthGetPasswordSelector('e107db_password_method', $frm, $parm['e107db_password_method'], FALSE);
     $text .= "</td></tr>";
     $text .= "<tr><td colspan='2'><br />" . E107DB_LAN_11 . "</td></tr>";
     $text .= $this->alt_auth_get_field_list('e107db', $frm, $parm, TRUE);
     $text .= "</table><div class='buttons-bar center'>";
     $text .= e107::getForm()->admin_button("update", LAN_UPDATE, 'update');
     //	$text .= $frm -> form_button("submit", "update", LAN_ALT_UPDATESET);
     $text .= '</div>';
     $text .= $frm->form_close();
     $ns->tablerender(E107DB_LAN_10, $text);
     $ns->tablerender(LAN_ALT_40 . LAN_ALT_41, $this->alt_auth_test_form('e107db', $frm));
 }
Example #15
0
function show_otherdb_form()
{
    $ns = e107::getRender();
    $parm = altAuthGetParams('otherdb');
    $frm = new form();
    $text = $frm->form_open("post", e_SELF);
    $text .= "<table class='table adminform'>";
    $text .= "<tr><td>" . LAN_ALT_26 . "</td><td>";
    $text .= OTHERDB_LAN_15;
    $text .= "</td></tr>";
    $text .= alt_auth_get_db_fields('otherdb', $frm, $parm, 'server|uname|pwd|db|table|ufield|pwfield|salt');
    $text .= "<tr><td>" . OTHERDB_LAN_9 . "</td><td>";
    $text .= altAuthGetPasswordSelector('otherdb_password_method', $frm, $parm['otherdb_password_method'], TRUE);
    $text .= "</td></tr>";
    $text .= "<tr><td class='forumheader2' colspan='2'>" . LAN_ALT_27 . "</td></tr>";
    $text .= alt_auth_get_field_list('otherdb', $frm, $parm, FALSE);
    $text .= "<tr><td class='forumheader' colspan='2' style='text-align:center;'>";
    $text .= e107::getForm()->admin_button("update", LAN_UPDATE, 'update');
    $text .= '</td></tr>';
    $text .= '</table>';
    $text .= $frm->form_close();
    $ns->tablerender(OTHERDB_LAN_10, $text);
    $ns->tablerender(LAN_ALT_40 . LAN_ALT_41, alt_auth_test_form('otherdb', $frm));
}
Example #16
0
function admin_purge_related($table, $id)
{
    $ns = e107::getRender();
    $tp = e107::getParser();
    $msg = "";
    $tp->parseTemplate("");
    // Delete any related comments
    require_once e_HANDLER . "comment_class.php";
    $_com = new comment();
    $num = $_com->delete_comments($table, $id);
    if ($num) {
        $msg .= $num . " " . LAN_COMMENTS . " " . LAN_DELETED . "<br />";
    }
    // Delete any related ratings
    require_once e_HANDLER . "rate_class.php";
    $_rate = new rater();
    $num = $_rate->delete_ratings($table, $id);
    if ($num) {
        $msg .= LAN_RATING . " " . LAN_DELETED . "<br />";
    }
    if ($msg) {
        $ns->tablerender(LAN_DELETE, $msg);
    }
}
Example #17
0
        $qs = explode(".", e_QUERY);
    }
    $action = varset($qs[0], 'display');
}
switch ($action) {
    case 'initial':
        $text = "Set the classes to which a new member of the site is assigned initially. \n\tIf you have verification enabled, this assignment may take place either when the user signs up, or when the user is verified.<br /><br />\n\t  And remember that if you are using hierarchical user classes, a user is automatically a member of all classes 'above' each selected class in the tree";
        break;
    case 'options':
        $text = "The Setup options allow you to create and remove the default class hierarchy. You can see the effect by looking at the user tree.<br />\n\tThis won't destroy your other class information, and you can modify or remove the hierarchy later.<br /><br />\n\tYou should only need to rebuild the class hierarchy if database corruption occurs";
        break;
    case 'membs':
        $text = "Now on user admin page";
        break;
    case 'debug':
        $text = "For advanced users only - shows the hierarchy of the classes, plus the assigned classes and the classes to which the first 20 site members have access.<br />\n\tThe number in front of the class name is its unique ID (reference number). The 'Everyone' class has an ID of 0 (zero). e107 uses these IDs throughout to refer to classes.<br />\n\tAfter the class name is the class visibility and editability - [vis:253, edit: 27] for example. This means that the class will be visible in most selectors only if the current user is a member of class 253, \n\tand the user may edit their class membership only if they are a member of class 27.<br />\n\tFinally, after the '=', is a list of all classes either above or below each class in the tree, plus the ID of that class. Thus a user who is a member of a particular class will\n\t be a member of all the classes in this list.<br /><br />\n\tTo help with understanding, the class membership of the first 20 members is shown. The first entry on each line shows the classes of which the user is a member. The \n\t second entry lists all the classes where the user is a member once inheritance takes effect. The third entry shows which class memberships they can edit";
        break;
    case 'test':
    case 'special':
        $text = "Don't use this!!! For the devs only!!!";
        break;
    case 'edit':
    case 'config':
        $text = "You can create classes, or edit existing classes from this page.<br />\n         This is useful for restricting users to certain parts of your site. For example, you could create a class called TEST, \n\t\t then create a forum which only allowed users in the TEST class to access it.<br /><br />\n\t\t The class name is displayed in drop-down lists and the like; in some places the more detailed description is also displayed.<br /><br />\n\t\t The class icon may be displayed in various places on the site, if one is set.<br /><br />\n\t\t To allow users to determine whether they can be a member of a class, allow them to manage it. If you set 'no-one' here, only the admins\n\t\t can manage membership of the class<br /><br />\n\t\t The 'visibility' field allows you to hide the class from most members - applies in some of the drop-down lists and checkboxes.<br /><br />\n\t\t The 'class parent' allows you to set a hierarchy of classes. If the 'top' of the hierarchy is the 'Everybody/Public' or 'Member' classes, the \n\t\t classes lower down the hierarchy also have the rights of their parent class, and that classes' parent, and so on. If the 'top' of the hierarchy is\n\t\t the 'No One/Nobody' class, then rights are accumulated in the opposite direction - a class accumlates all the rights of a class <b>below</b> them in the \n\t\t tree. The resulting tree is shown in the lower part of the page; you can expand and contract branches by clicking on the '+' and '-' boxes.";
        break;
    case 'display':
    default:
        $text = "You can select classes for editing, and also delete existing classes, from this page.";
}
e107::getRender()->tablerender($caption, $text);
Example #18
0
 function rssadminoptions()
 {
     $mes = e107::getMessage();
     $ns = e107::getRender();
     $tp = e107::getParser();
     global $rss_shortcodes, $row, $RSS_ADMIN_OPTIONS_TABLE;
     $text = $tp->parseTemplate($RSS_ADMIN_OPTIONS_TABLE, FALSE, $rss_shortcodes);
     $ns->tablerender(LAN_OPTIONS, $mes->render() . $text);
     return;
 }
Example #19
0
function forum_rules($action = 'check')
{
    if (ADMIN == true) {
        $type = 'forum_rules_admin';
    } elseif (USER == true) {
        $type = 'forum_rules_member';
    } else {
        $type = 'forum_rules_guest';
    }
    $result = e107::getDb()->select('generic', 'gen_chardata', "gen_type = '{$type}' AND gen_intdata = 1");
    if ($action == 'check') {
        return $result;
    }
    if ($result) {
        $row = e107::getDb()->fetch();
        $rules_text = e107::getParser()->toHTML($row['gen_chardata'], true);
    } else {
        $rules_text = LAN_FORUM_0072;
    }
    $text = '';
    if (deftrue('BOOTSTRAP')) {
        $breadarray = array(array('text' => e107::pref('forum', 'title', LAN_PLUGIN_FORUM_NAME), 'url' => e107::url('forum', 'index')), array('text' => LAN_FORUM_0016, 'url' => null));
        $text = e107::getForm()->breadcrumb($breadarray);
    }
    $text .= "<div id='forum-rules'>" . $rules_text . "</div>";
    $text .= "<div class='center'>" . e107::getForm()->pagination(e107::url('forum', 'index'), LAN_BACK) . "</div>";
    e107::getRender()->tablerender(LAN_FORUM_0016, $text, array('forum', 'forum_rules'));
}
Example #20
0
File: page.php Project: armpit/e107
 public function renderPage($template, $vars = null)
 {
     if (null === $vars) {
         $ret = e107::getParser()->parseTemplate($template, true, $this->batch);
     } else {
         $ret = e107::getParser()->simpleParse($template, $vars);
     }
     if ($this->renderMode) {
         $mode = $this->renderMode;
     } else {
         $mode = vartrue($this->template['tableRender'], 'cpage-page-view');
     }
     return e107::getRender()->tablerender($this->page['page_title'], $ret, $mode, true);
 }
Example #21
0
 /**
  * Render Category tree
  *
  * @param array $template 
  * @param array $parms [return, parsesc=>1|0, mode=>string]
  * @param boolean $tablerender
  * @return string
  */
 function render($template = array(), $parms = array(), $tablerender = true)
 {
     if (!$this->hasTree()) {
         return '';
     }
     $ret = array();
     $tp = e107::getParser();
     if (!isset($parms['parsesc'])) {
         $parms['parsesc'] = true;
     }
     $parsesc = $parms['parsesc'] ? true : false;
     $active = '';
     if (e_PAGE == 'news.php') {
         $tmp = explode('.', e_QUERY);
         if (vartrue($tmp[1])) {
             $active = $tmp[1];
         }
     }
     $bullet = defined('BULLET') ? THEME_ABS . 'images/' . BULLET : THEME_ABS . 'images/bullet2.gif';
     $obj = new e_vars(array('bullet' => $bullet));
     foreach ($this->getTree() as $cat) {
         $obj->active = '';
         if ($active && $active == $cat->getId()) {
             $obj->active = ' active';
         }
         $ret[] = $cat->toHTML($template['item'], $parsesc, $obj);
     }
     if ($ret) {
         $separator = varset($template['separator'], '');
         $ret = $template['start'] . implode($separator, $ret) . $template['end'];
         $return = isset($parms['return']) ? true : false;
         if ($tablerender) {
             $caption = vartrue($parms['caption']) ? defset($parms['caption'], $parms['caption']) : LAN_NEWSCAT_MENU_TITLE;
             // found in plugins/news/languages/English.php
             $mod = true === $tablerender ? 'news_categories_menu' : $tablerender;
             return e107::getRender()->tablerender($caption, $ret, varset($parms['mode'], $mod), $return);
         }
         if ($return) {
             return $ret;
         }
         echo $ret;
     }
     return '';
 }
Example #22
0
function render_newscats()
{
    // --  CNN Style Categories. ----
    $tp = e107::getParser();
    $ns = e107::getRender();
    $pref = e107::getPref();
    if (isset($pref['news_cats']) && $pref['news_cats'] == '1') {
        $text3 = $tp->toHTML("{NEWS_CATEGORIES}", TRUE, 'TITLE');
        $ns->tablerender(LAN_NEWS_23, $text3, 'news_cat');
    }
}
Example #23
0
 function submitPage($mode = FALSE, $type = FALSE)
 {
     global $e107cache, $admin_log, $e_event;
     $frm = e107::getForm();
     $sql = e107::getDb();
     $tp = e107::getParser();
     $ns = e107::getRender();
     $mes = e107::getMessage();
     $page_title = $tp->toDB($_POST['page_title']);
     //		print_a($_POST);
     //		if(is_array($_POST['data']) && is_array($_POST['subtitle']))
     $newData = array();
     foreach ($_POST as $k => $v) {
         if (substr($k, 0, 4) == 'data' && trim($v) != '') {
             list($tm, $key) = explode("_", $k);
             if ($mode == FALSE) {
                 $newData[] = "[newpage=" . $_POST['page_subtitle'][$key] . "]\n";
             }
             $newData[] = $v;
         }
         // return;
     }
     //	return;
     $newData = implode("\n\n", $newData);
     // echo nl2br($newData);
     $page_text = $tp->toDB($newData);
     $pauthor = $_POST['page_display_authordate_flag'] ? USERID : 0;
     // Ideally, this check should be done in the front-end.
     $update = 0;
     // Make sure some updates happen
     $page_sef = '';
     $page_metad = '';
     $page_metak = '';
     if (!$type) {
         if (!empty($_POST['page_sef'])) {
             $page_sef = eHelper::secureSef($_POST['page_sef']);
         }
         if (empty($page_sef)) {
             $page_sef = eHelper::title2sef($_POST['page_title']);
         }
         if (!empty($_POST['page_metadscr'])) {
             $page_metad = $tp->toDB(eHelper::formatMetaDescription($_POST['page_metadscr']));
         }
         if (!empty($_POST['page_metakeys'])) {
             $page_metak = eHelper::formatMetaKeys($_POST['page_metakeys']);
         }
     }
     if (!$type && (!$page_title || !$page_sef)) {
         e107::getMessage()->addError(CUSLAN_34, 'default', true);
         e107::getRedirect()->redirect(e_ADMIN_ABS . 'cpage.php');
     }
     // FIXME Causes false positives on Update.. - what is trying to be achieved with this check?
     /*
     if(!$type && $sql->db_Count('page', '(page_id)', ($mode ? "page_id != {$mode} AND " : '')."page_sef != '{$page_sef}'"))
     {
     	e107::getMessage()->addError(CUSLAN_34, 'default', true);
     	
     	e107::getMessage()->addDebug("type=".$type, 'default', true);
     	e107::getMessage()->addDebug("page_title=".$page_title, 'default', true);
     	e107::getMessage()->addDebug("page_sef=".$page_sef, 'default', true);
     	e107::getMessage()->addDebug("Mode=".$mode, 'default', true);					
     	
     	e107::getRedirect()->redirect(e_ADMIN_ABS.'cpage.php');
     }
     */
     if ($type && empty($_POST['menu_name'])) {
         e107::getMessage()->addError(CUSLAN_36, 'default', true);
         e107::getRedirect()->redirect(e_ADMIN_ABS . 'cpage.php');
     }
     if ($mode) {
         // Saving existing page/menu after edit
         // Don't think $_POST['page_ip_restrict'] is ever set.
         $menuname = $type && vartrue($_POST['menu_name']) ? ", page_theme = '" . $tp->toDB($_POST['menu_name']) . "'" : "";
         $status = $sql->db_Update("page", "page_title='{$page_title}', page_sef='{$page_sef}', page_chapter='" . intval($_POST['page_chapter']) . "', page_metakeys='{$page_metak}', page_metadscr='{$page_metad}', page_text='{$page_text}', page_datestamp='" . time() . "', page_author='{$pauthor}', page_rating_flag='" . intval($_POST['page_rating_flag']) . "', page_comment_flag='" . intval($_POST['page_comment_flag']) . "', page_password='******'page_password'] . "', page_class='" . $_POST['page_class'] . "', page_ip_restrict='" . varset($_POST['page_ip_restrict'], '') . "', page_template='" . $_POST['page_template'] . "' {$menuname} WHERE page_id='{$mode}'") ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
         if ($status == E_MESSAGE_SUCCESS) {
             $update++;
         }
         $mes->add($message, $status);
         $admin_log->log_event('CPAGE_02', $mode . '[!br!]' . $page_title . '[!br!]' . $pauthor, E_LOG_INFORMATIVE, '');
         $e107cache->clear("page_{$mode}");
         $e107cache->clear("page-t_{$mode}");
         $data = array('method' => 'update', 'table' => 'page', 'id' => $mode, 'plugin' => 'page', 'function' => 'submitPage');
         $this->message = $e_event->triggerHook($data);
         if ($type) {
             $menu_name = $tp->toDB($_POST['menu_name']);
             // not to be confused with menu-caption.
             // Need to check whether menu already in table, else we can't distinguish between a failed update and no update needed
             if ($sql->db_Select('menus', 'menu_name', "`menu_path` = '{$mode}'")) {
                 // Updating existing entry
                 if ($sql->db_Update('menus', "menu_name='{$menu_name}' WHERE menu_path='{$mode}' ") !== FALSE) {
                     $update++;
                 }
             }
         }
         //$url = e107::getUrl()->sc('page/view', array('name' => $tp->post_toForm($_POST['page_title']), 'id' => $mode));
         /*
         				 
         				// Prevent links being updated in another language unless the table is present. 
         			if((($pref['sitelanguage'] != $sql->mySQLlanguage) && ($sql->mySQLlanguage!='')) && ($sql->db_IsLang("links")=='links'))
         			{
         				//echo "DISABLED LINK CREATION";
         				//echo ' Sitelan='.$pref['sitelanguage'];
         				//echo " Dblang=".$sql->mySQLlanguage;
         				//echo " Links=".$sql->db_IsLang("links");
         			
         				return;	
         			}
         				 
         				 
         				 
         				if ($_POST['page_link'])
         				{
         					// FIXME extremely ugly, just join on created link ID by new field page_link 
         					if ($sql->db_Select("links", "link_id", "link_url='".$url."' && link_name!='".$tp->toDB($_POST['page_link'])."'"))
         					{
         						$sql->db_Update("links", "link_name='".$tp->toDB($_POST['page_link'])."' WHERE link_url='".$url."'");
         						$update++;
         						$e107cache->clear("sitelinks");
         					}
         					else if (!$sql->db_Select("links", "link_id", "link_url='".$url."'"))
         					{
         						$sql->db_Insert("links", "0, '".$tp->toDB($_POST['page_link'])."', '".$url."', '', '', 1, 0, 0, 0, ".$_POST['page_class']);
         						$update++;
         						$e107cache->clear("sitelinks");
         					}
         				} else {
         					if ($sql->db_Select("links", "link_id", "link_url='".$url."'"))
         					{
         						$sql->db_Delete("links", "link_url='".$url."'");
         						$update++;
         						$e107cache->clear("sitelinks");
         					}
         				}*/
         $mes = e107::getMessage();
         $mes->autoMessage($update, 'update', LAN_UPDATED, false, false);
         // Display result of update
     } else {
         // New page/menu
         $menuname = $type ? $tp->toDB($_POST['menu_name']) : "";
         $addMsg = $type ? CUSLAN_51 : CUSLAN_27;
         $info = array('page_title' => $page_title, 'page_sef' => $page_sef, 'page_chapter' => varset($_POST['page_chapter'], 0), 'page_metakeys' => $page_metak, 'page_metadscr' => $page_metad, 'page_text' => $page_text, 'page_author' => $pauthor, 'page_datestamp' => time(), 'page_rating_flag' => varset($_POST['page_rating_flag'], 0), 'page_comment_flag' => varset($_POST['page_comment_flag'], ''), 'page_password' => varset($_POST['page_password'], ''), 'page_class' => varset($_POST['page_class'], e_UC_PUBLIC), 'page_ip_restrict' => '', 'page_theme' => $menuname, 'page_template' => varset($_POST['page_template'], ''));
         $pid = e107::getMessage()->autoMessage($sql->db_Insert('page', $info), 'insert', $addMsg, LAN_CREATED_FAILED, false);
         $admin_log->log_event('CPAGE_01', $menuname . '[!br!]' . $page_title . '[!br!]' . $pauthor, E_LOG_INFORMATIVE, '');
         if ($type) {
             $info = array('menu_name' => $menuname, 'menu_location' => 0, 'menu_order' => 0, 'menu_class' => '0', 'menu_pages' => '', 'menu_path' => $pid);
             e107::getMessage()->autoMessage($sql->db_Insert('menus', $info), 'insert', CUSLAN_52, LAN_CREATED_FAILED, false);
         }
         /*if(vartrue($_POST['page_link']))
         		{
         			//$link = 'page.php?'.$pid;
         			$url = e107::getUrl()->sc('page/view', array('name' => $tp->post_toForm($_POST['page_title']), 'id' => $pid));
         			if (!$sql->db_Select("links", "link_id", "link_name='".$tp->toDB($_POST['page_link'])."'"))
         			{
         				$linkname = $tp->toDB($_POST['page_link']);
         				$sql->db_Insert("links", "0, '{$linkname}', '{$url}', '', '', 1, 0, 0, 0, ".$_POST['page_class']);
         				$e107cache->clear("sitelinks");
         			}
         		}*/
         $data = array('method' => 'create', 'table' => 'page', 'id' => $pid, 'plugin' => 'page', 'function' => 'submitPage');
         $this->message = $e_event->triggerHook($data);
     }
 }
Example #24
0
 public function initialPage()
 {
     $pref = e107::pref('core');
     $mes = e107::getMessage();
     $ns = e107::getRender();
     $frm = e107::getForm();
     //		$e_userclass    = $this->getUserClassAdmin();
     $text = "";
     $initial_classes = varset($pref['initial_user_classes'], '');
     $irc = explode(',', $initial_classes);
     $icn = array();
     foreach ($irc as $i) {
         if (trim($i)) {
             $icn[] = e107::getUserClass()->getName($i);
         }
     }
     $class_text = $frm->userclass('init_classes', $initial_classes, 'checkbox', array('options' => 'classes,force'));
     //	$class_text = e107::getUserClass()->uc_checkboxes('init_classes', $initial_classes, 'classes, force', TRUE);
     //	$class_text = e107::getUserClass()->vetted_tree('init_classes',array($e_userclass,'checkbox_desc'), $initial_classes, 'classes, force, no-excludes');
     $mes->addInfo(UCSLAN_49);
     $text = "<div>\n\t\t\t<form method='post' action='" . e_SELF . "?mode=main&action=initial' id='initialForm'>\n\t\t\t<table class='table table-bordered adminform'>\n\t\t\t<tr><td>" . UCSLAN_43 . "</td><td>";
     if (count($icn) > 0) {
         //  $text .= implode(', ',$icn);
     } else {
         $text .= UCSLAN_44;
     }
     if ($class_text) {
         $text .= $class_text . "</td></tr><tr><td>";
         $sel_stage = varset($pref['init_class_stage'], 2);
         $initClassStages = array(1 => UCSLAN_47, 2 => UCSLAN_48);
         $text .= UCSLAN_45 . "<br />\t</td>\n\t\t\t\t    <td>" . $frm->select('init_class_stage', $initClassStages, $sel_stage) . "<span class='field-help'>" . UCSLAN_46 . "</span>\n\n\t\t\t\t    </td></tr></table>\n\t\t\t\t    <div class='buttons-bar'>" . $frm->admin_button('set_initial_classes', 'no-value', 'create', LAN_UPDATE) . "</div>";
     } else {
         $text .= UCSLAN_39;
     }
     $text .= "</td></tr></table></form></div>";
     return $mes->render() . $text;
     //	$ns->tablerender(ADLAN_38.SEP.UCSLAN_40, $mes->render() . $text);
 }
Example #25
0
 public function configurePage()
 {
     $ns = e107::getRender();
     $frm = e107::getForm();
     $pref = e107::pref('core');
     //	e107::getMessage()->addInfo($notice);
     $text = "<table class='table adminform'>\n\t\t\t\t<colgroup>\n\t\t\t\t\t<col class='col-label' />\n\t\t\t\t\t<col class='col-control' />\n\t\t\t\t</colgroup>\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><label for='social-login-active'>Social Signup/Login</label>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t" . $frm->radio_switch('social_login_active', $pref['social_login_active']) . "\n\t\t\t\t\t\t\t\t<div class='smalltext field-help'>Allows users to signup/login with their social media accounts. When enabled, this option will still allow users to signup/login even if the core user registration system above is disabled. </div>\n\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\n\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>Application Keys and IDs <br /></td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<table class='table table-bordered table-striped'>\n\t\t\t\t\t\t\t<colgroup>\n\t\t\t\t\t\t\t\t<col class='col-label' />\n\t\t\t\t\t\t\t\t<col class='col-control' />\n\t\t\t\t\t\t\t</colgroup>\n\n\t\t\t\t\t";
     if (!is_array($pref['social_login'])) {
         $pref['social_login'] = array();
     }
     foreach ($this->social_logins as $prov => $val) {
         $label = varset($this->social_external[$prov]) ? "<a class='e-tip' rel='external' title='Get a key from the provider' href='" . $social_external[$prov] . "'>" . $prov . "</a>" : $prov;
         $radio_label = strtolower($prov);
         $text .= "\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><label for='social-login-" . $radio_label . "-enabled'>" . $label . "</label></td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t";
         foreach ($val as $k => $v) {
             switch ($k) {
                 case 'enabled':
                     $eopt = array('class' => 'e-expandit');
                     $text .= $frm->radio_switch('social_login[' . $prov . '][enabled]', vartrue($pref['social_login'][$prov]['enabled']), '', '', $eopt);
                     break;
                 case 'keys':
                     // $cls = vartrue($pref['single_login'][$prov]['keys'][$tk]) ? "class='e-hideme'" : '';
                     $sty = vartrue($pref['social_login'][$prov]['keys'][vartrue($tk)]) ? "" : "e-hideme";
                     $text .= "<div class='e-expandit-container {$sty}' id='option-{$prov}' >";
                     foreach ($v as $tk => $idk) {
                         $eopt = array('placeholder' => $tk, 'size' => 'xxlarge');
                         $text .= "<br />" . $frm->text('social_login[' . $prov . '][keys][' . $tk . ']', vartrue($pref['social_login'][$prov]['keys'][$tk]), 100, $eopt);
                     }
                     $text .= "</div>";
                     break;
                 case 'scope':
                     $text .= $frm->hidden('social_login[' . $prov . '][scope]', 'email');
                     break;
                 default:
                     break;
             }
         }
         $text .= "</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t";
     }
     $text .= "</table>\n\t\t\t\t\t</td></tr>\n\n\n\t\t\t\t</tbody></table>\n\t\t\t";
     // -------------------------------
     //
     //
     $text2 = "\n\t\t\t\t\t<table class='table'>\n\t\t\t\t\t\t<colgroup>\n\t\t\t\t\t\t\t<col class='col-label' />\n\t\t\t\t\t\t\t<col class='col-control' />\n\t\t\t\t\t\t</colgroup>\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t";
     //XXX XURL Definitions.
     $xurls = array('facebook' => array('label' => "Facebook", "placeholder" => "eg. https://www.facebook.com/e107CMS"), 'twitter' => array('label' => "Twitter", "placeholder" => "eg. https://twitter.com/e107"), 'youtube' => array('label' => "Youtube", "placeholder" => "eg.https://youtube.com/e107Inc"), 'google' => array('label' => "Google+", "placeholder" => ""), 'linkedin' => array('label' => "LinkedIn", "placeholder" => "eg. http://www.linkedin.com/groups?home=&gid=1782682"), 'github' => array('label' => "Github", "placeholder" => "eg. https://github.com/e107inc"), 'flickr' => array('label' => "Flickr", "placeholder" => ""), 'instagram' => array('label' => "Instagram", "placeholder" => ""), 'pinterest' => array('label' => "Pinterest", "placeholder" => ""), 'vimeo' => array('label' => "Vimeo", "placeholder" => ""));
     foreach ($xurls as $k => $var) {
         $keypref = "xurl[" . $k . "]";
         $text_label = "xurl-" . $k . "";
         $def = "XURL_" . strtoupper($k);
         $opts = array('size' => 'xxlarge', 'placeholder' => $var['placeholder']);
         $text2 .= "\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><label for='" . $text_label . "'>Your " . $var['label'] . " page</label></td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t" . $frm->text($keypref, $pref['xurl'][$k], false, $opts) . "\n\t\t\t\t\t\t\t<div class='field-help'>Used by some themes to provide a link to your " . $var['label'] . " page. (" . $def . ")</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t";
     }
     $text2 .= "\n\t\t\t\t</tbody>\n\t\t\t</table>\n\n";
     $tabs = array();
     $tabs[] = array('caption' => "Apps", 'text' => $text);
     $tabs[] = array('caption' => 'Pages', 'text' => $text2);
     $ret = $frm->open('social', 'post', null, 'class=form-horizontal') . $frm->tabs($tabs);
     $ret .= "<div class='buttons-bar center'>\n\n\t\t\t" . $frm->button('save_social', 1, 'submit', LAN_SAVE) . "\n\n\t\t\t\t</div>";
     $ret .= $frm->close();
     return $ret;
 }
Example #26
0
 function renderTableSelect()
 {
     $frm = e107::getForm();
     $ns = e107::getRender();
     $mes = e107::getMessage();
     $text = "\n\t\t<form method='post' action='" . e_SELF . (e_QUERY ? '?' . e_QUERY : '') . "' id='core-db-verify-sql-tables-form'>\n\t\t\t<fieldset id='core-db-verify-sql-tables'>\n\t\t\t\t<legend>" . DBVLAN_14 . "</legend>\n\t\t\t\t<table class='table table-striped adminlist'>\n\t\t\t\t\t<colgroup>\n\t\t\t\t\t\t<col style='width: 100%'></col>\n\t\t\t\t\t</colgroup>\n\t\t\t\t\t<thead>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th class='first form-inline'><label for='check-all-verify-jstarget-verify-table'>" . $frm->checkbox_toggle('check-all-verify', 'verify_table', false) . " " . LAN_CHECKALL . ' | ' . LAN_UNCHECKALL . "</label></th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</thead>\n\t\t\t\t\t<tbody>\n\t\t";
     foreach (array_keys($this->tables) as $t => $x) {
         $text .= "\n\t\t\t\t<tr>\n\t\t\t\t\t<td>" . $frm->checkbox('verify_table[' . $t . ']', $x, false, array('label' => $x)) . "</td>\n\t\t\t\t</tr>\n\t\t\t";
     }
     $text .= "\n\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t\t\t<div class='buttons-bar center'>\n\t\t\t\t\t\t\t" . $frm->admin_button('db_verify', DBVLAN_15) . "\n\t\t\t\t\t\t\t" . $frm->admin_button('db_tools_back', LAN_BACK, 'back') . "\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</fieldset>\n\t\t\t\t</form>\n\t\t";
     $ns->tablerender(DBVLAN_23 . ' - ' . DBVLAN_16, $mes->render() . $text);
 }
Example #27
0
 function render_infopanel_options($render = false)
 {
     // $frm = e107::getSingleton('e_form');
     $frm = e107::getForm();
     $mes = e107::getMessage();
     $ns = e107::getRender();
     $start = "<div>\n\t\tTo customize this page, please <a title = 'Customize Admin' href='" . e_SELF . "?mode=customize&amp;iframe=1' class='e-modal-iframe'>click here</a>.\n\t\t</div>\n\t    ";
     if ($render == false) {
         return "";
     }
     $text2 = "<div id='customize_icons' class='forumheader3' style='border:0px;margin:0px'>\n\t    <form method='post' id='e-modal-form' action='" . e_SELF . "'>";
     $text2 .= $ns->tablerender("Personalize Icons", $this->render_infopanel_icons(), 'personalize', true);
     $text2 .= "<div class='clear'>&nbsp;</div>";
     $text2 .= $ns->tablerender("Personalize Menus", $this->render_infopanel_menu_options(), 'personalize', true);
     //	$text2 .= render_infopanel_icons();
     //$text2 .= "<div class='clear'>&nbsp;</div>";
     //	$text2 .= "<h3>Menus</h3>";
     //	$text2 .= render_infopanel_menu_options();
     $text2 .= "<div class='clear'>&nbsp;</div>";
     $text2 .= "<div id='button' class='buttons-bar center'>";
     $text2 .= $frm->admin_button('submit-mye107', 'Save', 'create');
     $text2 .= "</div></form>";
     //	$text2 .= "</div>";
     //	$end = "</div>";
     return $mes->render() . $text2;
 }
Example #28
0
 function renderForm()
 {
     $ns = e107::getRender();
     $mes = e107::getMessage();
     $caption = LAN_UPDATE;
     $text = "\r\n\t\t<form method='post' action='" . e_SELF . "'>\r\n\t\t\t<fieldset id='core-e107-update'>\r\n\t\t\t<legend>{$caption}</legend>\r\n\t\t\t\t<table class='table adminlist'>\r\n\t\t\t\t\t<colgroup>\r\n\t\t\t\t\t\t<col style='width: 60%' />\r\n\t\t\t\t\t\t<col style='width: 40%' />\r\n\t\t\t\t\t</colgroup>\r\n\t\t\t\t\t<thead>\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t<th>" . LAN_UPDATE_55 . "</th>\r\n\t\t\t\t\t\t\t<th class='last'>" . LAN_UPDATE_2 . "</th>\r\n\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t</thead>\r\n\t\t\t\t\t<tbody>\r\n\t\t";
     $text .= $this->core();
     $text .= $this->plugins();
     $text .= "\r\n\t\t\t\t\t</tbody>\r\n\t\t\t\t</table>\r\n\t\t\t</fieldset>\r\n\t\t</form>\r\n\t\t\t";
     $ns->tablerender("Updates", $mes->render() . $text);
 }
Example #29
0
/**
 *
 */
function show_upload_filetypes()
{
    $ns = e107::getRender();
    $e_userclass = e107::getUserClass();
    if (!getperms("0")) {
        exit;
    }
    //TODO still needed?
    $definition_source = DOWLAN_71;
    $source_file = '';
    $edit_upload_list = varset($_POST['upload_do_edit'], false);
    if (isset($_POST['generate_filetypes_xml'])) {
        // Write back edited data to filetypes_.xml
        $file_text = "<e107Filetypes>\n";
        foreach ($_POST['file_class_select'] as $k => $c) {
            if (!isset($_POST['file_line_delete_' . $c]) && vartrue($_POST['file_type_list'][$k])) {
                $file_text .= "   <class name='{$c}' type='{$_POST['file_type_list'][$k]}' maxupload='" . vartrue($_POST['file_maxupload'][$k], ini_get('upload_max_filesize')) . "'/>\n";
            }
        }
        $file_text .= "</e107Filetypes>";
        if (($handle = fopen(e_UPLOAD_TEMP_DIR . e_SAVE_FILETYPES, 'wt')) == FALSE || fwrite($handle, $file_text) == FALSE || fclose($handle) == FALSE) {
            $text = DOWLAN_88 . e_UPLOAD_TEMP_DIR . e_SAVE_FILETYPES;
        } else {
            $text = DOWLAN_86 . e_UPLOAD_TEMP_DIR . e_SAVE_FILETYPES . '<br/>' . DOWLAN_87 . e_ADMIN . e_READ_FILETYPES . '<br/>';
        }
        $ns->tablerender(DOWLAN_49, $text);
    }
    $current_perms = array();
    if ($edit_upload_list && is_readable(e_UPLOAD_TEMP_DIR . e_SAVE_FILETYPES) || !$edit_upload_list && is_readable(e_ADMIN . e_READ_FILETYPES)) {
        require_once e_HANDLER . 'xml_class.php';
        $xml = new xmlClass();
        $xml->setOptArrayTags('class');
        $source_file = $edit_upload_list ? e_UPLOAD_TEMP_DIR . e_SAVE_FILETYPES : e_ADMIN . e_READ_FILETYPES;
        $temp_vars = $xml->loadXMLfile($source_file, true, false);
        if ($temp_vars === FALSE) {
            echo "Error parsing XML file!";
        } else {
            foreach ($temp_vars['class'] as $v1) {
                $v = $v1['@attributes'];
                $current_perms[$v['name']] = array('type' => $v['type'], 'maxupload' => $v['maxupload']);
            }
        }
    } elseif (is_readable(e_ADMIN . 'filetypes.php')) {
        $source_file = 'filetypes.php';
        $current_perms[e_UC_MEMBER] = array('type' => implode(',', array_keys(get_allowed_filetypes('filetypes.php', ''))), 'maxupload' => '2M');
        if (is_readable(e_ADMIN . 'admin_filetypes.php')) {
            $current_perms[e_UC_ADMIN] = array('type' => implode(',', array_keys(get_allowed_filetypes('admin_filetypes.php', ''))), 'maxupload' => '2M');
            $source_file .= ' + admin_filetypes.php';
        }
    } else {
        // Set a default
        $current_perms[e_UC_MEMBER] = array('type' => 'zip,tar,gz,jpg,png', 'maxupload' => '2M');
    }
    $frm = new e_form(true);
    //enable inner tabindex counter
    $columnInfo = array("ftypes_userclass" => array("title" => DOWLAN_73, "type" => "", "width" => "auto", "thclass" => "", "forced" => true), "ftypes_extension" => array("title" => DOWLAN_74, "type" => "", "width" => "auto", "thclass" => ""), "ftypes_max_size" => array("title" => DOWLAN_75, "type" => "", "width" => "auto", "thclass" => ""), "ftypes_confirm_del" => array("title" => DOWLAN_76, "type" => "", "width" => "auto", "thclass" => "last"));
    $filterColumns = array("ftypes_userclass", "ftypes_extension", "ftypes_max_size", "ftypes_confirm_del");
    $text = "\n         <form method='post' action='" . e_SELF . "?filetypes'>\n            <fieldset id='core-download-upload1'>\n               <div>\n                  <div>\n                     <input type='hidden' name='upload_do_edit' value='1'/><p>" . str_replace(array('--SOURCE--', '--DEST--'), array(e_UPLOAD_TEMP_DIR . e_SAVE_FILETYPES, e_ADMIN . e_READ_FILETYPES), DOWLAN_85) . "</p><p>" . DOWLAN_72 . $source_file . "\n                  </p></div>\n                  <table class='table adminform'>" . $frm->colGroup($columnInfo) . $frm->thead($columnInfo, $filterColumns) . "\n                     <tbody>\n      ";
    foreach ($current_perms as $uclass => $uinfo) {
        $text .= "\n            <tr>\n               <td>\n                  <select name='file_class_select[]' class='tbox'>\n                     " . $e_userclass->vetted_tree('file_class_select', array($e_userclass, 'select'), $uclass, 'member,main,classes,admin, no-excludes') . "\n                  </select>\n               </td>\n               <td><input type='text' name='file_type_list[]' value='{$uinfo['type']}' class='tbox' size='40'/></td>\n               <td><input type='text' name='file_maxupload[]' value='{$uinfo['maxupload']}' class='tbox' size='10'/></td>\n               <td><input type='checkbox' value='1' name='file_line_delete_{$uclass}'/></td>\n            </tr>\n         ";
    }
    // Now put up a box to add a new setting
    $text .= "\n                        <tr>\n                           <td colspan='" . count($columnInfo) . "'>" . DOWLAN_90 . "</td>\n                        </tr>\n                        <tr>\n                           <td><select name='file_class_select[]' class='tbox'>\n                           " . $e_userclass->vetted_tree('file_class_select', array($e_userclass, 'select'), '', 'member,main,classes,admin,blank, no-excludes') . "\n                           </select></td>\n                           <td><input type='text' name='file_type_list[]' value='' class='tbox' size='40'/></td>\n                           <td colspan='2'><input type='text' name='file_maxupload[]' value='" . ini_get('upload_max_filesize') . "' class='tbox' size='10'/></td>\n                        </tr>\n                     </tbody>\n                  </table>\n               </div>\n            </fieldset>\n            <div class='buttons-bar center'>\n               <input class='btn btn-default button' type='submit' name='generate_filetypes_xml' value='" . DOWLAN_77 . "'/>\n               </div>\n        \t\t</form>\n      ";
    $ns->tablerender(DOWLAN_23, $text);
}
Example #30
0
/*
* AnteUp - A Donation Tracking Plugin for e107
*
* Copyright (C) 2012-2015 Patrick Weaver (http://trickmod.com/)
* For additional information refer to the README.mkd file.
*
*/
require_once "../../class2.php";
require_once HEADERF;
require_once e_PLUGIN . "anteup/_class.php";
e107::lan('anteup');
$pref = e107::pref('anteup');
if (!empty($pref['anteup_paypal']) || $pref['anteup_paypal'] != "*****@*****.**") {
    $frm = e107::getForm();
    $tp = e107::getParser();
    $sc = e107::getScBatch('anteup', true);
    $template = e107::getTemplate('anteup');
    $text = $frm->open('donate_form', 'post', 'https://www.paypal.com/cgi-bin/webscr');
    $text .= $tp->parseTemplate($template['donate'], false, $sc);
    $text .= $frm->hidden('cmd', '_xclick');
    $text .= $frm->hidden('business', $pref['anteup_paypal']);
    $text .= $frm->hidden('notify_url', ANTEUP_ABS . 'ipn.php');
    $text .= $frm->hidden('return', ANTEUP_ABS . 'return.php?thanks');
    $text .= $frm->hidden('cancel_return', ANTEUP_ABS . 'return.php?cancel');
    $text .= $frm->close();
} else {
    $text = "<div class='center'>" . LAN_ANTEUP_DONATE_04 . "</div>";
}
e107::getRender()->tablerender(LAN_ANTEUP_DONATE_TITLE, $text);
require_once FOOTERF;