diff --git a/e107_core/shortcodes/batch/admin_shortcodes.php b/e107_core/shortcodes/batch/admin_shortcodes.php
index b2a257fca..b5dacd565 100644
--- a/e107_core/shortcodes/batch/admin_shortcodes.php
+++ b/e107_core/shortcodes/batch/admin_shortcodes.php
@@ -575,6 +575,42 @@ class admin_shortcodes
function sc_admin_pm($parm)
{
if(!e107::isInstalled('pm')) return;
+
+ $sql = e107::getDb();
+ $count = $sql->count('private_msg','(*)','WHERE pm_read = 0');
+
+ if ($count >0)
+ {
+ $countDisp = ' '.$count.' ' ;
+ }
+ else
+ {
+ $countDisp = '';
+ }
+
+ $text = '
+ ';
+
+ return $text;
+
+ // e107_plugins/pm/pm.php
+
+
+
+
+
$text = '
@@ -1291,7 +1327,9 @@ class admin_shortcodes
$menu_vars = $this->getOtherNav($parm);
return e107::getNav()->admin('', '', $menu_vars, $$tmpl, FALSE, FALSE);
}
-
+
+
+
// MAIN LINK
if($parm != 'no-main')
{
@@ -1641,7 +1679,7 @@ class admin_shortcodes
$c = 0;
foreach($languages as $lng)
{
- $checked = ($lng == e_LANGUAGE) ? " " : " ";
+ $checked = ($lng == e_LANGUAGE) ? " " : " ";
$tmp[$c]['text'] = $lng;
$tmp[$c]['description'] = '';
diff --git a/e107_plugins/pm/admin_config.php b/e107_plugins/pm/admin_config.php
new file mode 100644
index 000000000..173ca6eb8
--- /dev/null
+++ b/e107_plugins/pm/admin_config.php
@@ -0,0 +1,223 @@
+ array(
+ 'controller' => 'private_msg_ui',
+ 'path' => null,
+ 'ui' => 'private_msg_form_ui',
+ 'uipath' => null
+ ),
+ /*
+ 'block' => array(
+ 'controller' => 'private_msg_block_ui',
+ 'path' => null,
+ 'ui' => 'private_msg_block_form_ui',
+ 'uipath' => null
+ ),
+ */
+ );
+
+
+ protected $adminMenu = array(
+
+ 'main/list' => array('caption'=> "Inbox", 'perm' => 'P'),
+ 'main/create' => array('caption'=> "Compose", 'perm' => 'P'),
+
+ // 'block/list' => array('caption'=> LAN_MANAGE, 'perm' => 'P'),
+ // 'block/create' => array('caption'=> LAN_CREATE, 'perm' => 'P'),
+
+ /*
+ 'main/prefs' => array('caption'=> LAN_PREFS, 'perm' => 'P'),
+ 'main/custom' => array('caption'=> 'Custom Page', 'perm' => 'P')
+ */
+
+ );
+
+ protected $adminMenuAliases = array(
+ 'main/edit' => 'main/list'
+ );
+
+ protected $menuTitle = 'pm';
+}
+
+
+
+
+
+class private_msg_ui extends e_admin_ui
+{
+
+ protected $pluginTitle = 'Private Messaging';
+ protected $pluginName = 'pm';
+ protected $table = 'private_msg';
+ protected $pid = 'pm_id';
+ protected $perPage = 10;
+ protected $listQry = '';
+ protected $listOrder = "pm_sent DESC";
+
+ protected $fields = array ( 'checkboxes' => array ( 'title' => '', 'type' => null, 'data' => null, 'width' => '5%', 'thclass' => 'center', 'forced' => '1', 'class' => 'center', 'toggle' => 'e-multiselect', ),
+ 'pm_id' => array ( 'title' => LAN_ID, 'data' => 'int', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
+ 'pm_from' => array ( 'title' => 'From', 'type' => 'number', 'noedit'=>true, 'data' => 'int', 'filter'=>true, 'width' => '10%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
+ 'pm_to' => array ( 'title' => 'To', 'type' => 'user', 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
+ 'pm_sent' => array ( 'title' => LAN_DATE, 'type' => 'datestamp', 'data' => 'int', 'width' => '10%', 'help' => '', 'readParms' => '', 'writeParms' => 'auto=1&readonly=1', 'class' => 'center', 'thclass' => 'center', ),
+ 'pm_subject' => array ( 'title' => LAN_TITLE, 'type' => 'text', 'data' => 'str', 'width' => '15%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
+ 'pm_text' => array ( 'title' => 'Message', 'type' => 'bbarea', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => 'expand=1&truncate=50', 'writeParms' => 'size=medium', 'class' => 'left', 'thclass' => 'left', ),
+ 'pm_read' => array ( 'title' => 'Read', 'type' => 'boolean', 'noedit'=>1, 'data' => 'int', 'batch'=>true, 'filter'=>true, 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
+
+ 'pm_sent_del' => array ( 'title' => 'Del', 'type' => 'boolean', 'noedit'=>true, 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
+ 'pm_read_del' => array ( 'title' => 'Del', 'type' => 'boolean', 'noedit'=>true, 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
+ 'pm_attachments' => array ( 'title' => 'Attachments', 'type' => 'text', 'noedit'=>true, 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
+ 'pm_option' => array ( 'title' => 'Option', 'type' => 'text', 'noedit'=>true, 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
+ 'pm_size' => array ( 'title' => 'Size', 'type' => 'boolean', 'noedit'=>true, 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
+ 'options' => array ( 'title' => 'Options', 'type' => null, 'data' => null, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center last', 'forced' => '1', ),
+ );
+
+ protected $fieldpref = array('pm_id', 'pm_from', 'pm_to', 'pm_sent', 'pm_read', 'pm_subject', 'pm_text');
+
+ // optional
+ public function init()
+ {
+ // $this->listQry = "SELECT p.*,u.user_name FROM #private_msg AS p LEFT JOIN #user AS u ON p.pm_from = u.user_id ";
+
+ if(vartrue($_GET['iframe']))
+ {
+ define('e_IFRAME', true);
+ }
+
+ // Prevent snooping of other people's messages. ;-) //XXX Not working Yet. FIXME!
+ if(varset($_GET['filter_options']))
+ {
+ list($tmp,$field,$id) = explode("__",$_GET['filter_options']);
+
+
+ // echo "FIELD = ".$field;
+ // $this->getDispatcher()->setRequest('filter_options')
+
+ if($field == 'pm_to' && $id != USERID)
+ {
+ $_GET['filter_options'] = 'batch__pm_to__'.USERID;
+ }
+
+ if($field == 'pm_from' && $id != USERID)
+ {
+ $_GET['filter_options'] = 'batch__pm_from__'.USERID;
+ }
+
+ }
+
+
+ }
+
+ /*
+ protected = array(
+ 'pref_type' => array('title'=> 'type', 'type'=>'text', 'data' => 'string', 'validate' => true),
+ 'pref_folder' => array('title'=> 'folder', 'type' => 'boolean', 'data' => 'integer'),
+ 'pref_name' => array('title'=> 'name', 'type' => 'text', 'data' => 'string', 'validate' => 'regex', 'rule' => '#^[\w]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')
+ );
+
+
+
+
+
+ public function customPage()
+ {
+ $ns = e107::getRender();
+ $text = 'Hello World!';
+ $ns->tablerender('Hello',$text);
+
+ }
+ */
+
+}
+
+
+
+class private_msg_form_ui extends e_admin_form_ui
+{
+
+}
+
+/*
+
+
+class private_msg_block_ui extends e_admin_ui
+{
+
+ protected $pluginTitle = 'Private Messaging';
+ protected $pluginName = 'pm';
+ protected $table = 'private_msg_block';
+ protected $pid = 'pm_block_id';
+ protected $perPage = 10;
+
+ protected $fields = array ( 'checkboxes' => array ( 'title' => '', 'type' => null, 'data' => null, 'width' => '5%', 'thclass' => 'center', 'forced' => '1', 'class' => 'center', 'toggle' => 'e-multiselect', ),
+ 'pm_block_id' => array ( 'title' => 'LAN_ID', 'data' => 'int', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
+ 'pm_block_from' => array ( 'title' => 'From', 'type' => 'boolean', 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
+ 'pm_block_to' => array ( 'title' => 'To', 'type' => 'boolean', 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
+ 'pm_block_datestamp' => array ( 'title' => 'LAN_DATESTAMP', 'type' => 'datestamp', 'data' => 'int', 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
+ 'pm_block_count' => array ( 'title' => 'Count', 'type' => 'boolean', 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
+ 'options' => array ( 'title' => 'Options', 'type' => null, 'data' => null, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center last', 'forced' => '1', ),
+ );
+
+ protected $fieldpref = array('pm_block_datestamp');
+
+
+
+
+ // protected = array(
+ // 'pref_type' => array('title'=> 'type', 'type'=>'text', 'data' => 'string', 'validate' => true),
+ // 'pref_folder' => array('title'=> 'folder', 'type' => 'boolean', 'data' => 'integer'),
+ // 'pref_name' => array('title'=> 'name', 'type' => 'text', 'data' => 'string', 'validate' => 'regex', 'rule' => '#^[\w]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')
+ // );
+
+
+ // optional
+ public function init()
+ {
+
+ }
+
+
+ public function customPage()
+ {
+ $ns = e107::getRender();
+ $text = 'Hello World!';
+ $ns->tablerender('Hello',$text);
+
+ }
+
+
+}
+
+
+
+class private_msg_block_form_ui extends e_admin_form_ui
+{
+
+}
+ */
+
+
+new pm_admin();
+
+require_once(e_ADMIN."auth.php");
+e107::getAdminUI()->runPage();
+
+require_once(e_ADMIN."footer.php");
+exit;
+
+?>
\ No newline at end of file
diff --git a/e107_themes/templates/footer_default.php b/e107_themes/templates/footer_default.php
index c2eb688c6..53382f582 100644
--- a/e107_themes/templates/footer_default.php
+++ b/e107_themes/templates/footer_default.php
@@ -66,8 +66,11 @@ if (varset($e107_popup) != 1)
//
// B.2 Send footer template, stop timing, send simple page stats
//
- parseheader((varset($ph) ? $cust_footer : $FOOTER));
-
+ if(!deftrue('e_IFRAME'))
+ {
+ parseheader((varset($ph) ? $cust_footer : $FOOTER));
+ }
+
$eTimingStop = microtime();
global $eTimingStart;
$clockTime = e107::getSingleton('e107_traffic')->TimeDelta($eTimingStart, $eTimingStop);
@@ -158,7 +161,7 @@ if (varset($e107_popup) != 1)
}
else
{
- echo($rinfo ? "\n\n" : "");
+ echo($rinfo ? "\n\n" : "");
}
} // End of regular-page footer (the above NOT done for popups)
diff --git a/e107_themes/templates/header_default.php b/e107_themes/templates/header_default.php
index e8d2cf878..4f8db5004 100644
--- a/e107_themes/templates/header_default.php
+++ b/e107_themes/templates/header_default.php
@@ -533,8 +533,48 @@ e107Event.trigger('loaded', null, document);
e107::getJs()->renderJs('header_inline', 5);
-echo "
-\n";
+echo "\n";
+
+
+// ---------- New in 2.0 -------------------------------------------------------
+
+ $def = THEME_LAYOUT; // The active layout based on custompage matches.
+
+ // echo "DEF = ".$def."
";
+
+ if($def == 'legacyCustom' || $def=='legacyDefault' ) // 0.6 themes.
+ {
+ // echo "MODE 0.6";
+ if($def == 'legacyCustom')
+ {
+ $HEADER = ($CUSTOMHEADER) ? $CUSTOMHEADER : $HEADER;
+ $FOOTER = ($CUSTOMFOOTER) ? $CUSTOMFOOTER : $FOOTER;
+ }
+ }
+ elseif($def && $def != "legacyCustom" && (isset($CUSTOMHEADER[$def]) || isset($CUSTOMFOOTER[$def]))) // 0.7 themes
+ {
+ // echo " MODE 0.7";
+ $HEADER = ($CUSTOMHEADER[$def]) ? $CUSTOMHEADER[$def] : $HEADER;
+ $FOOTER = ($CUSTOMFOOTER[$def]) ? $CUSTOMFOOTER[$def] : $FOOTER;
+ }
+ elseif($def && isset($HEADER[$def]) && isset($FOOTER[$def])) // 0.8 themes - we use only $HEADER and $FOOTER arrays.
+ {
+ // echo " MODE 0.8";
+ $HEADER = $HEADER[$def];
+ $FOOTER = $FOOTER[$def];
+ }
+
+ if(deftrue('e_IFRAME'))
+ {
+ $HEADER = "";
+ $FOOTER = "";
+ $body_onload = " style='padding:15px;margin:0px'"; //TODO e-iframe css class.
+ }
+
+
+
+
+echo "\n";
// Header included notification, from this point header includes are not possible
define('HEADER_INIT', TRUE);
@@ -559,35 +599,6 @@ if ($e107_popup != 1) {
//
// M: Send top of body for custom pages and for news
//
-
-// ---------- New in 0.8 -------------------------------------------------------
-
- $def = THEME_LAYOUT; // The active layout based on custompage matches.
-
- // echo "DEF = ".$def."
";
-
- if($def == 'legacyCustom' || $def=='legacyDefault' ) // 0.6 themes.
- {
- // echo "MODE 0.6";
- if($def == 'legacyCustom')
- {
- $HEADER = ($CUSTOMHEADER) ? $CUSTOMHEADER : $HEADER;
- $FOOTER = ($CUSTOMFOOTER) ? $CUSTOMFOOTER : $FOOTER;
- }
- }
- elseif($def && $def != "legacyCustom" && (isset($CUSTOMHEADER[$def]) || isset($CUSTOMFOOTER[$def]))) // 0.7 themes
- {
- // echo " MODE 0.7";
- $HEADER = ($CUSTOMHEADER[$def]) ? $CUSTOMHEADER[$def] : $HEADER;
- $FOOTER = ($CUSTOMFOOTER[$def]) ? $CUSTOMFOOTER[$def] : $FOOTER;
- }
- elseif($def && isset($HEADER[$def]) && isset($FOOTER[$def])) // 0.8 themes - we use only $HEADER and $FOOTER arrays.
- {
- // echo " MODE 0.8";
- $HEADER = $HEADER[$def];
- $FOOTER = $FOOTER[$def];
- }
-
//XXX - remove all page detections
if (e_PAGE == 'news.php' && isset($NEWSHEADER))
{