-- Table structure for table `modx_manager_users`
--

CREATE TABLE `modx_manager_users` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `username` varchar(100) NOT NULL DEFAULT '',
  `password` varchar(100) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  UNIQUE KEY `username` (`username`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 COMMENT='Contains login information for backend users.';

--
-- Dumping data for table `modx_manager_users`
--

INSERT INTO `modx_manager_users` VALUES (1,'admin','2310f31d77b9e12d7ec957f932949148');

--
-- Table structure for table `modx_member_groups`
--

CREATE TABLE `modx_member_groups` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `user_group` int(10) NOT NULL DEFAULT '0',
  `member` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Contains data used for access permissions.';

--
-- Dumping data for table `modx_member_groups`
--


--
-- Table structure for table `modx_membergroup_access`
--

CREATE TABLE `modx_membergroup_access` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `membergroup` int(10) NOT NULL DEFAULT '0',
  `documentgroup` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Contains data used for access permissions.';

--
-- Dumping data for table `modx_membergroup_access`
--


--
-- Table structure for table `modx_membergroup_names`
--

CREATE TABLE `modx_membergroup_names` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Contains data used for access permissions.';

--
-- Dumping data for table `modx_membergroup_names`
--


--
-- Table structure for table `modx_site_content`
--

CREATE TABLE `modx_site_content` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `type` varchar(20) NOT NULL DEFAULT 'document',
  `contentType` varchar(50) NOT NULL DEFAULT 'text/html',
  `pagetitle` varchar(255) NOT NULL DEFAULT '',
  `longtitle` varchar(255) NOT NULL DEFAULT '',
  `description` varchar(255) NOT NULL DEFAULT '',
  `alias` varchar(255) DEFAULT '',
  `link_attributes` varchar(255) NOT NULL DEFAULT '',
  `published` int(1) NOT NULL DEFAULT '0',
  `pub_date` int(20) NOT NULL DEFAULT '0',
  `unpub_date` int(20) NOT NULL DEFAULT '0',
  `parent` int(10) NOT NULL DEFAULT '0',
  `isfolder` int(1) NOT NULL DEFAULT '0',
  `introtext` text COMMENT 'Used to provide quick summary of the document',
  `content` mediumtext,
  `richtext` tinyint(1) NOT NULL DEFAULT '1',
  `template` int(10) NOT NULL DEFAULT '1',
  `menuindex` int(10) NOT NULL DEFAULT '0',
  `searchable` int(1) NOT NULL DEFAULT '1',
  `cacheable` int(1) NOT NULL DEFAULT '1',
  `createdby` int(10) NOT NULL DEFAULT '0',
  `createdon` int(20) NOT NULL DEFAULT '0',
  `editedby` int(10) NOT NULL DEFAULT '0',
  `editedon` int(20) NOT NULL DEFAULT '0',
  `deleted` int(1) NOT NULL DEFAULT '0',
  `deletedon` int(20) NOT NULL DEFAULT '0',
  `deletedby` int(10) NOT NULL DEFAULT '0',
  `publishedon` int(20) NOT NULL DEFAULT '0',
  `publishedby` int(10) NOT NULL DEFAULT '0',
  `menutitle` varchar(255) NOT NULL DEFAULT '' COMMENT 'Menu title',
  `donthit` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Disable page hit count',
  `haskeywords` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'has links to keywords',
  `hasmetatags` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'has links to meta tags',
  `privateweb` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Private web document',
  `privatemgr` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Private manager document',
  `content_dispo` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0-inline, 1-attachment',
  `hidemenu` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Hide document from menu',
  PRIMARY KEY (`id`),
  KEY `id` (`id`),
  KEY `parent` (`parent`),
  KEY `aliasidx` (`alias`),
  FULLTEXT KEY `content_ft_idx` (`pagetitle`,`description`,`content`)
) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=latin1 COMMENT='Contains the site document tree.';

--
-- Dumping data for table `modx_site_content`
--

INSERT INTO `modx_site_content` VALUES (1,'document','text/html','Dealer Login','','','index','',1,0,0,0,0,'','',1,3,0,1,0,1,1130304721,1,1290123863,0,0,0,1130304721,1,'Base Install',0,0,0,0,0,0,0),(5,'document','text/html','Dealer Add','','','dealer-add','',1,0,0,2,0,'','<h1><a href=\"[~3~]\">Dealer Manager</a> >> [*pagetitle*]</h1>\r\n{{formSubmitStatus}}\r\n[[dealer_add]]',1,3,0,1,0,1,1290123368,1,1290124043,0,0,0,1290123423,1,'',0,0,0,1,0,0,0),(4,'document','text/html','Dealer Page','','','dealer-page','',1,1290123045,0,0,0,'','[[dealer_page]]',1,3,2,1,0,1,1290123067,1,1290123646,0,0,0,1290123067,1,'',0,0,0,0,0,0,0),(2,'document','text/html','Admin Login','','','admin-login','',1,1290122581,0,0,1,'','[[WebLogin? &loginhomeid=`3` &logouthomeid=`1` &group=`admin`]]\r\n<br class=\"clear\">',1,3,1,1,0,1,1290122603,1,1291419592,0,0,0,1290122603,1,'',0,0,0,0,0,0,0),(3,'document','text/html','Dealer Manager','','','dealer-manager','',1,1290122631,0,2,0,'','<div style=\"padding:25px;position:relative;\" >\r\n<h1>[*pagetitle*]</h1>\r\n[[dealer_manager]]</div>\r\n<br clear=\"both\">',1,3,0,1,0,1,1290122660,1,1291419745,0,0,0,1290122660,1,'',0,0,0,1,0,0,0),(6,'document','text/html','Dealer Edit','','','dealer-edit','',1,0,0,2,0,'','\r\n<h1><a href=\"[~3~]\">Dealer Manager</a> >> [*pagetitle*]</h1>\r\n{{formSubmitStatus}}\r\n[[dealer_edit]]',1,3,0,1,0,1,1290123429,1,1290124172,0,0,0,1290123457,1,'',0,0,0,1,0,0,0),(7,'document','text/html','Untitled Resource','','','untitled-resource','',1,1298502119,0,0,0,'','<p>Below is our current price sheet, please feel free to contact us with any questions 760.432.6333</p>\r\n<p>&nbsp;</p>\r\n<p><a href=\"assets/files/Honda_Price_1_11.pdf\">Click Here To View Price</a>r</p>\r\n<p><a href=\"assets/files/Honda_Price_1_11.pdf\">rtyurtyurtyu</a></p>',1,3,3,1,0,1,1298502144,1,1298502182,0,0,0,1298502144,1,'',0,0,0,0,0,0,1);

--
-- Table structure for table `modx_site_content_metatags`
--

CREATE TABLE `modx_site_content_metatags` (
  `content_id` int(11) NOT NULL DEFAULT '0',
  `metatag_id` int(11) NOT NULL DEFAULT '0',
  KEY `content_id` (`content_id`),
  KEY `metatag_id` (`metatag_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Reference table between meta tags and content';

--
-- Dumping data for table `modx_site_content_metatags`
--


--
-- Table structure for table `modx_site_htmlsnippets`
--

CREATE TABLE `modx_site_htmlsnippets` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL DEFAULT '',
  `description` varchar(255) NOT NULL DEFAULT 'Chunk',
  `editor_type` int(11) NOT NULL DEFAULT '0' COMMENT '0-plain text,1-rich text,2-code editor',
  `category` int(11) NOT NULL DEFAULT '0' COMMENT 'category id',
  `cache_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Cache option',
  `snippet` mediumtext,
  `locked` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 COMMENT='Contains the site chunks.';

--
-- Dumping data for table `modx_site_htmlsnippets`
--

INSERT INTO `modx_site_htmlsnippets` VALUES (1,'WebLoginSidebar','WebLogin Tpl',0,2,0,'<!-- #declare:separator <hr> --> \n<!-- login form section-->\n<form method=\"post\" name=\"loginfrm\" action=\"[+action+]\" style=\"margin: 0px; padding: 0px;\"> \n<input type=\"hidden\" value=\"[+rememberme+]\" name=\"rememberme\"> \n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tr>\n<td>\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n  <tr>\n	<td><b>User:</b></td>\n	<td><input type=\"text\" name=\"username\" tabindex=\"1\" onkeypress=\"return webLoginEnter(document.loginfrm.password);\" size=\"5\" style=\"width: 100px;\" value=\"[+username+]\" /></td>\n  </tr>\n  <tr>\n	<td><b>Password:</b></td>\n	<td><input type=\"password\" name=\"password\" tabindex=\"2\" onkeypress=\"return webLoginEnter(document.loginfrm.cmdweblogin);\" size=\"5\" style=\"width: 100px;\" value=\"\" /></td>\n  </tr>\n  <tr>\n	<td><label for=\"chkbox\" style=\"cursor:pointer\">Remember me:&nbsp; </label></td>\n	<td>\n	<table width=\"100%\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n	  <tr>\n		<td valign=\"top\"><input type=\"checkbox\" id=\"chkbox\" name=\"chkbox\" tabindex=\"4\" size=\"1\" value=\"\" [+checkbox+] onClick=\"webLoginCheckRemember()\" /></td>\n		<td align=\"right\">									\n		<input type=\"submit\" value=\"[+logintext+]\" name=\"cmdweblogin\" /></td>\n	  </tr>\n	</table>\n	</td>\n  </tr>\n  <tr>\n	<td colspan=\"2\"><a href=\"#\" onclick=\"webLoginShowForm(2);return false;\">Forget Password?</a></td>\n  </tr>\n</table>\n</td>\n</tr>\n</table>\n</form>\n<hr>\n<!-- log out hyperlink section -->\n<a href=\'[+action+]\'>[+logouttext+]</a>\n<hr>\n<!-- Password reminder form section -->\n<form name=\"loginreminder\" method=\"post\" action=\"[+action+]\" style=\"margin: 0px; padding: 0px;\">\n<input type=\"hidden\" name=\"txtpwdrem\" value=\"0\" />\n<table border=\"0\">\n	<tr>\n	  <td>Enter the email address of your account <br />below to receive your password:</td>\n	</tr>\n	<tr>\n	  <td><input type=\"text\" name=\"txtwebemail\" size=\"24\" /></td>\n	</tr>\n	<tr>\n	  <td align=\"right\"><input type=\"submit\" value=\"Submit\" name=\"cmdweblogin\" />\n	  <input type=\"reset\" value=\"Cancel\" name=\"cmdcancel\" onclick=\"webLoginShowForm(1);\" /></td>\n	</tr>\n  </table>\n</form>\n\n',0),(2,'mm_demo_rules','ManagerManager rules for the demo content. Should be modified for your own sites.',0,1,0,'// PHP *is* allowed\n// $news_role and $news_tpl will not apply to demo content but are left as a demonstration of what can be done\n\n// For everyone\nmm_default(\'pub_date\');\nmm_renameField(\'introtext\',\'Summary\');\nmm_changeFieldHelp(\'alias\', \'The URL that will be used to reach this resource. Only numbers, letters and hyphens can be used\');\nmm_widget_tags(\'documentTags\',\' \'); // Give blog tag editing capabilities to the \'documentTags (3)\' TV\nmm_widget_showimagetvs(); // Always give a preview of Image TVs\n// mm_widget_colors(\'color\', \'#666666\'); // make a color selector widget for the \'colour\' TV\n\n// For everyone except administrators\nmm_hideFields(\'link_attributes\', \'!1\');\nmm_hideFields(\'loginName \', \'!1\');\n// mm_renameField(\'alias\',\'URL alias\',\'!1\');\n\n// News editors role -- creating a variable makes it easier to manage if this changes in the future\n$news_role = \'3\';\nmm_hideFields(\'pagetitle,menutitle,link_attributes,template,menuindex,description,show_in_menu,which_editor,is_folder,is_richtext,log,searchable,cacheable,clear_cache\', $news_role);\nmm_renameTab(\'settings\', \'Publication settings\', $news_role);	\nmm_synch_fields(\'pagetitle,menutitle,longtitle\', $news_role);\nmm_renameField(\'longtitle\',\'Headline\', $news_role, \'\', \'This will be displayed at the top of each page\');\n\n// News story template\n$news_tpl = \'8\';\n// mm_createTab(\'Categories\',\'HrCats\', \'\', $news_tpl, \'\', \'600\');\n// mm_moveFieldsToTab(\'updateImage1\', \'general\', \'\', $news_tpl);\n// mm_hideFields(\'menuindex,show_in_menu\', \'\', $news_tpl);\nmm_changeFieldHelp(\'longtitle\', \'The story\\\'s headline\', \'\', $news_tpl);\nmm_changeFieldHelp(\'introtext\', \'A short summary of the story\', \'\', $news_tpl);\nmm_changeFieldHelp(\'parent\', \'To move this story to a different folder: Click this icon to activate, then choose a new folder in the tree on the left.\', \'\', $news_tpl);\n\n',0),(3,'formSubmitStatus','',0,8,0,'<div id=\"message_error\"  class=\"error\" style=\"display:none\">\r\n<span>Error!</span>\r\n<div id=\"textError\"></div>\r\n</div>\r\n<div id=\"message_success\"  class=\"success\" style=\"display:none\">\r\n<span>Congratulations!</span>\r\n<div id=\"textSuccess\"></div>\r\n</div>',0);

--
-- Table structure for table `modx_site_keywords`
--

CREATE TABLE `modx_site_keywords` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `keyword` varchar(40) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  UNIQUE KEY `keyword` (`keyword`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Site keyword list';

--
-- Dumping data for table `modx_site_keywords`
--


--
-- Table structure for table `modx_site_metatags`
--

CREATE TABLE `modx_site_metatags` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL DEFAULT '',
  `tag` varchar(50) NOT NULL DEFAULT '' COMMENT 'tag name',
  `tagvalue` varchar(255) NOT NULL DEFAULT '',
  `http_equiv` tinyint(4) NOT NULL DEFAULT '0' COMMENT '1 - use http_equiv tag style, 0 - use name',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Site meta tags';

--
-- Dumping data for table `modx_site_metatags`
--


--
-- Table structure for table `modx_site_module_access`
--

CREATE TABLE `modx_site_module_access` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `module` int(11) NOT NULL DEFAULT '0',
  `usergroup` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Module users group access permission';

--
-- Dumping data for table `modx_site_module_access`
--


--
-- Table structure for table `modx_site_module_depobj`
--

CREATE TABLE `modx_site_module_depobj` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `module` int(11) NOT NULL DEFAULT '0',
  `resource` int(11) NOT NULL DEFAULT '0',
  `type` int(2) NOT NULL DEFAULT '0' COMMENT '10-chunks, 20-docs, 30-plugins, 40-snips, 50-tpls, 60-tvs',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Module Dependencies';

--
-- Dumping data for table `modx_site_module_depobj`
--


--
-- Table structure for table `modx_site_modules`
--

CREATE TABLE `modx_site_modules` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL DEFAULT '',
  `description` varchar(255) NOT NULL DEFAULT '0',
  `editor_type` int(11) NOT NULL DEFAULT '0' COMMENT '0-plain text,1-rich text,2-code editor',
  `disabled` tinyint(4) NOT NULL DEFAULT '0',
  `category` int(11) NOT NULL DEFAULT '0' COMMENT 'category id',
  `wrap` tinyint(4) NOT NULL DEFAULT '0',
  `locked` tinyint(4) NOT NULL DEFAULT '0',
  `icon` varchar(255) NOT NULL DEFAULT '' COMMENT 'url to module icon',
  `enable_resource` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'enables the resource file feature',
  `resourcefile` varchar(255) NOT NULL DEFAULT '' COMMENT 'a physical link to a resource file',
  `createdon` int(11) NOT NULL DEFAULT '0',
  `editedon` int(11) NOT NULL DEFAULT '0',
  `guid` varchar(32) NOT NULL DEFAULT '' COMMENT 'globally unique identifier',
  `enable_sharedparams` tinyint(4) NOT NULL DEFAULT '0',
  `properties` text,
  `modulecode` mediumtext COMMENT 'module boot up code',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 COMMENT='Site Modules';

--
-- Dumping data for table `modx_site_modules`
--

INSERT INTO `modx_site_modules` VALUES (1,'Doc Manager','<strong>1.1</strong> Quickly perform bulk updates to the Documents in your site including templates, publishing details, and permissions',0,0,3,0,0,'',0,'',0,0,'',1,'','include_once(MODX_BASE_PATH.\'assets/modules/docmanager/classes/docmanager.class.php\');\ninclude_once(MODX_BASE_PATH.\'assets/modules/docmanager/classes/dm_frontend.class.php\');\ninclude_once(MODX_BASE_PATH.\'assets/modules/docmanager/classes/dm_backend.class.php\');\n\n$dm = new DocManager($modx);\n$dmf = new DocManagerFrontend($dm, $modx);\n$dmb = new DocManagerBackend($dm, $modx);\n\n$dm->ph = $dm->getLang();\n$dm->ph[\'theme\'] = $dm->getTheme();\n$dm->ph[\'ajax.endpoint\'] = MODX_SITE_URL.\'assets/modules/docmanager/tv.ajax.php\';\n$dm->ph[\'datepicker.offset\'] = $modx->config[\'datepicker_offset\'];\n$dm->ph[\'datetime.format\'] = $modx->config[\'datetime_format\'];\n\nif (isset($_POST[\'tabAction\'])) {\n    $dmb->handlePostback();\n} else {\n    $dmf->getViews();\n    echo $dm->parseTemplate(\'main.tpl\', $dm->ph);\n}');

--
-- Table structure for table `modx_site_plugin_events`
--

CREATE TABLE `modx_site_plugin_events` (
  `pluginid` int(10) NOT NULL,
  `evtid` int(10) NOT NULL DEFAULT '0',
  `priority` int(10) NOT NULL DEFAULT '0' COMMENT 'determines plugin run order'
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Links to system events';

--
-- Dumping data for table `modx_site_plugin_events`
--

INSERT INTO `modx_site_plugin_events` VALUES (1,80,0),(1,81,0),(1,93,0),(2,85,0),(2,87,0),(2,88,0),(3,28,0),(4,100,0),(5,28,0),(5,29,0),(5,35,0),(5,53,0),(6,29,0),(7,3,0),(7,13,0),(7,28,0),(7,31,0),(8,3,0);

--
-- Table structure for table `modx_site_plugins`
--

CREATE TABLE `modx_site_plugins` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL DEFAULT '',
  `description` varchar(255) NOT NULL DEFAULT 'Plugin',
  `editor_type` int(11) NOT NULL DEFAULT '0' COMMENT '0-plain text,1-rich text,2-code editor',
  `category` int(11) NOT NULL DEFAULT '0' COMMENT 'category id',
  `cache_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Cache option',
  `plugincode` mediumtext,
  `locked` tinyint(4) NOT NULL DEFAULT '0',
  `properties` text,
  `disabled` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Disables the plugin',
  `moduleguid` varchar(32) NOT NULL DEFAULT '' COMMENT 'GUID of module from which to import shared parameters',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=latin1 COMMENT='Contains the site plugins.';

--
-- Dumping data for table `modx_site_plugins`
--

INSERT INTO `modx_site_plugins` VALUES (1,'Forgot Manager Login','<strong>1.1.2</strong> Resets your manager login when you forget your password via email confirmation',0,3,0,'if(!class_exists(\'ForgotManagerPassword\')) {\n    class ForgotManagerPassword{\n        function ForgotManagerPassword(){\n            $this->errors = array();\n            $this->checkLang();\n        }\n\n        function getLink() {\n            global $_lang;\n  \n            $link = <<<EOD\n<a id=\"ForgotManagerPassword-show_form\" href=\"index.php?action=show_form\">{$_lang[\'forgot_your_password\']}</a>\nEOD;\n\n            return $link;\n        }\n\n        function getForm() {\n            global $_lang;\n\n            $form = <<<EOD\n<label id=\"FMP-email_label\" for=\"FMP_email\">{$_lang[\'account_email\']}:</label>\n<input id=\"FMP-email\" type=\"text\" />\n<button id=\"FMP-email_button\" type=\"button\" onclick=\"window.location = \'index.php?action=send_email&email=\'+document.getElementById(\'FMP-email\').value;\">{$_lang[\'send\']}</button>\nEOD;\n\n            return $form;\n        }\n\n        /* Get user info including a hash unique to this user, password, and day */\n        function getUser($user_id=false, $username=\'\', $email=\'\', $hash=\'\') {\n            global $modx, $_lang;\n\n            $user_id = $user_id == false ? false : $modx->db->escape($user_id);\n            $username = $modx->db->escape($username);\n            $email = $modx->db->escape($email);\n            $emaail = $modx->db->escape($hash);\n\n			$pre = $modx->db->config[\'table_prefix\'];\n			$site_id = $modx->config[\'site_id\'];\n			$today = date(\'Yz\'); // Year and day of the year\n			$wheres = array();\n			$where = \'\';\n			$user = null;\n  \n            if($user_id !== false) { $wheres[] = \"usr.id = \'{$user_id}\'\"; }\n            if(!empty($username)) { $wheres[] = \"usr.username = \'{$username}\'\"; }\n            if(!empty($email)) { $wheres[] = \"attr.email = \'{$email}\'\"; }\n            if(!empty($hash)) { $wheres[] = \"MD5(CONCAT(usr.username,usr.password,\'{$site_id}\',\'{$today}\')) = \'{$hash}\'\"; } \n\n            if($wheres) {\n                $where = \' WHERE \'.implode(\' AND \',$wheres);\n                $sql = \"SELECT usr.id, usr.username, attr.email, MD5(CONCAT(usr.username,usr.password,\'{$site_id}\',\'{$today}\')) AS hash\n                    FROM `{$pre}manager_users` usr\n                    INNER JOIN `{$pre}user_attributes` attr ON usr.id = attr.internalKey\n                    {$where}      \n                    LIMIT 1;\"; \n\n                if($result = $modx->db->query($sql)){\n                    if($modx->db->getRecordCount($result)==1) {\n                        $user = $modx->db->getRow($result);\n                    }\n                }\n            }\n\n            if($user == null) { $this->errors[] = $_lang[\'could_not_find_user\']; }\n\n            return $user;\n        }\n\n\n\n        /* Send an email with a link to login */\n        function sendEmail($to) {\n            global $modx, $_lang;\n\n            $subject = $_lang[\'password_change_request\'];\n            $headers  = \"MIME-Version: 1.0\\r\\n\".\n                \"Content-type: text/html; charset=\\\"{$modx->config[\'modx_charset\']}\\\"\\r\\n\".\n		\"From: MODx <{$modx->config[\'emailsender\']}>\\r\\n\".\n                \"Reply-To: no-reply@{$_SERVER[\'HTTP_HOST\']}\\r\\n\".\n                \"X-Mailer: PHP/\".phpversion();\n\n            $user = $this->getUser(0, \'\', $to);\n  \n            if($user[\'username\']) {\n                $body = <<<EOD\n<p>{$_lang[\'forgot_password_email_intro\']} <a href=\"{$modx->config[\'site_url\']}manager/processors/login.processor.php?username={$user[\'username\']}&hash={$user[\'hash\']}\">{$_lang[\'forgot_password_email_link\']}</a></p>\n<p>{$_lang[\'forgot_password_email_instructions\']}</p>\n<p><small>{$_lang[\'forgot_password_email_fine_print\']}</small></p>\nEOD;\n\n                $mail = mail($to, $subject, $body, $headers);\n                if(!$mail) { $this->errors[] = $_lang[\'error_sending_email\']; }\n   \n                return $mail;  \n            }\n        }\n\n        function unblockUser($user_id) {\n            global $modx, $_lang;\n\n            $pre = $modx->db->config[\'table_prefix\'];\n            $modx->db->update(array(\'blocked\' => 0, \'blockeduntil\' => 0, \'failedlogincount\' => 0), \"`{$pre}user_attributes`\", \"internalKey = \'{$user_id}\'\");\n\n            if(!$modx->db->getAffectedRows()) { $this->errors[] = $_lang[\'user_doesnt_exist\']; return; }\n\n            return true;\n        }\n\n        function checkLang() {\n            global $_lang;\n\n            $eng = array();\n            $eng[\'forgot_your_password\'] = \'Forgot your password?\';\n            $eng[\'account_email\'] = \'Account email\';\n            $eng[\'send\'] = \'Send\';\n            $eng[\'password_change_request\'] = \'Password change request\';\n            $eng[\'forgot_password_email_intro\'] = \'A request has been made to change the password on your account.\';\n            $eng[\'forgot_password_email_link\'] = \'Click here to complete the process.\';\n            $eng[\'forgot_password_email_instructions\'] = \'From there you will be able to change your password from the My Account menu.\';\n            $eng[\'forgot_password_email_fine_print\'] = \'* The URL above will expire once you change your password or after today.\';\n            $eng[\'error_sending_email\'] = \'Error sending email\';\n            $eng[\'could_not_find_user\'] = \'Could not find user\';\n            $eng[\'user_doesnt_exist\'] = \'User does not exist\';\n            $eng[\'email_sent\'] = \'Email sent\';\n\n            foreach($eng as $key=>$value) {\n                if(empty($_lang[$key])) { $_lang[$key] = $value; }\n            }  \n        }\n\n        function getErrorOutput() {\n            $output = \'\';\n\n            if($this->errors) {\n                $output = \'<span class=\"error\">\'.implode(\'</span><span class=\"errors\">\', $this->errors).\'</span>\';\n            }\n  \n            return $output;\n        }\n    }\n}\n\nglobal $_lang;\n\n$output = \'\';\n$event_name = $modx->Event->name;\n$action = (empty($_GET[\'action\']) ? \'\' : $_GET[\'action\']);\n$username = (empty($_GET[\'username\']) ? false : $_GET[\'username\']);\n$to = (empty($_GET[\'email\']) ? \'\' : $_GET[\'email\']);\n$hash = (empty($_GET[\'hash\']) ? false : $_GET[\'hash\']);\n$forgot = new ForgotManagerPassword();\n\nif($event_name == \'OnManagerLoginFormRender\') {\n    switch($action) {\n        case \'show_form\':\n            $output = $forgot->getForm();\n            break;\n        case \'send_email\':\n            if($forgot->sendEmail($to)) { $output = $_lang[\'email_sent\']; }\n            break;\n        default:\n            $output = $forgot->getLink();\n            break;\n    }\n\n    if($forgot->errors) { $output = $forgot->getErrorOutput() . $forgot->getLink(); }\n}\n\nif($event_name == \'OnBeforeManagerLogin\') {\n    $user = $forgot->getUser(false, $username, \'\', $hash);\n    if($user && is_array($user) && !$forgot->errors) {\n        $forgot->unblockUser($user[\'id\']);\n    }\n}\n\nif($event_name == \'OnManagerAuthentication\' && $hash && $username) {\n    $user = $forgot->getUser(false, $username, \'\', $hash);\n    $output = ($user !== null && count($forgot->errors) == 0) ? true : false;\n}\n\n$modx->Event->output($output);',0,'',0,''),(2,'TinyMCE Rich Text Editor','<strong>3.3.5.1</strong> Javascript WYSIWYG Editor',0,3,0,'// Set the name of the plugin folder\n$plugin_dir = \"tinymce\";\n\n// Set path and base setting variables\nif(!isset($mce_path))\n{ \n	$mce_path = MODX_BASE_PATH . \'assets/plugins/\'.$plugin_dir . \'/\'; \n	$mce_url  = MODX_BASE_URL  . \'assets/plugins/\'.$plugin_dir . \'/\'; \n}\n\n$params[\'customparams\']    = $customparams;\n$params[\'blockFormats\']    = $mce_formats;\n$params[\'entity_encoding\'] = $entity_encoding;\n$params[\'entities\']        = $entities;\n$params[\'pathoptions\']     = $mce_path_options;\n$params[\'resizing\']        = $mce_resizing;\n$params[\'disabledButtons\'] = $disabledButtons;\n$params[\'link_list\']       = $link_list;\n$params[\'theme\']           = $webtheme;\n$params[\'custom_plugins\']  = $webPlugins;\n$params[\'custom_buttons1\'] = $webButtons1;\n$params[\'custom_buttons2\'] = $webButtons2;\n$params[\'custom_buttons3\'] = $webButtons3;\n$params[\'custom_buttons4\'] = $webButtons4;\n$params[\'toolbar_align\']   = $webAlign;\n$params[\'width\']           = $width;\n$params[\'height\']          = $height;\n\n$params[\'mce_path\']        = $mce_path;\n$params[\'mce_url\']         = $mce_url;\n\ninclude_once $mce_path . \'lang/tinymce.lang.php\';\ninclude_once $mce_path . \'tinymce.functions.php\';\n\n$mce = new TinyMCE($params);\n\n// Handle event\n$e = &$modx->Event; \nswitch ($e->name)\n{\n	case \"OnRichTextEditorRegister\": // register only for backend\n		$e->output(\"TinyMCE\");\n		break;\n\n	case \"OnRichTextEditorInit\": \n		if($editor!==\"TinyMCE\") return;\n		\n		$params[\'elements\']        = $elements;\n		$params[\'css_selectors\']   = $modx->config[\'tinymce_css_selectors\'];\n		$params[\'use_browser\']     = $modx->config[\'use_browser\'];\n		$params[\'editor_css_path\'] = $modx->config[\'editor_css_path\'];\n		\n		if($modx->isBackend())\n		{\n			$params[\'theme\']           = $modx->config[\'tinymce_editor_theme\'];\n			$params[\'language\']        = getTinyMCELang($modx->config[\'manager_language\']);\n			$params[\'frontend\']        = false;\n			$params[\'custom_plugins\']  = $modx->config[\'tinymce_custom_plugins\'];\n			$params[\'custom_buttons1\'] = $modx->config[\'tinymce_custom_buttons1\'];\n			$params[\'custom_buttons2\'] = $modx->config[\'tinymce_custom_buttons2\'];\n			$params[\'custom_buttons3\'] = $modx->config[\'tinymce_custom_buttons3\'];\n			$params[\'custom_buttons4\'] = $modx->config[\'tinymce_custom_buttons4\'];\n			$params[\'toolbar_align\']   = $modx->config[\'manager_direction\'];\n			$params[\'webuser\']         = null;\n			\n			$html = $mce->get_mce_script($params);\n		}\n		else\n		{\n			$frontend_language = isset($modx->config[\'fe_editor_lang\']) ? $modx->config[\'fe_editor_lang\']:\'\';\n			$webuser = (isset($modx->config[\'rb_webuser\']) ? $modx->config[\'rb_webuser\'] : null);\n			\n			$params[\'webuser\']         = $webuser;\n			$params[\'language\']        = getTinyMCELang($frontend_language);\n			$params[\'frontend\']        = true;\n			\n			$html = $mce->get_mce_script($params);\n		}\n		$e->output($html);\n		break;\n\n	case \"OnInterfaceSettingsRender\":\n		global $usersettings,$settings;\n		$action = $modx->manager->action;\n		switch ($action)\n		{\n			case 11:\n				$mce_settings = \'\';\n				break;\n			case 12:\n				$mce_settings = $usersettings;\n				break;\n			case 17:\n				$mce_settings = $settings;\n				break;\n			default:\n				$mce_settings = $settings;\n				break;\n		}\n		\n		$params[\'use_editor\']       = $modx->config[\'base_url\'].$modx->config[\'use_editor\'];\n        $params[\'editor_css_path\']  = $modx->config[\'editor_css_path\'];\n		$params[\'theme\']            = $mce_settings[\'tinymce_editor_theme\'];\n		$params[\'css_selectors\']    = $mce_settings[\'tinymce_css_selectors\'];\n		$params[\'custom_plugins\']   = $mce_settings[\'tinymce_custom_plugins\'];\n		$params[\'custom_buttons1\']  = $mce_settings[\'tinymce_custom_buttons1\'];\n		$params[\'custom_buttons2\']  = $mce_settings[\'tinymce_custom_buttons2\'];\n		$params[\'custom_buttons3\']  = $mce_settings[\'tinymce_custom_buttons3\'];\n		$params[\'custom_buttons4\']  = $mce_settings[\'tinymce_custom_buttons4\'];\n		\n		$html = $mce->get_mce_settings($params);\n		$e->output($html);\n		break;\n		\n	default :\n		return; // stop here - this is very important. \n		break; \n}\n',0,'&customparams=Custom Parameters;textarea; &mce_formats=Block Formats;text;p,h1,h2,h3,h4,h5,h6,div,blockquote,code,pre &entity_encoding=Entity Encoding;list;named,numeric,raw;named &entities=Entities;text; &mce_path_options=Path Options;list;rootrelative,docrelative,fullpathurl;docrelative &mce_resizing=Advanced Resizing;list;true,false;true &disabledButtons=Disabled Buttons;text; &link_list=Link List;list;enabled,disabled;enabled &webtheme=Web Theme;list;simple,editor,creative,custom;simple &webPlugins=Web Plugins;text;style,advimage,advlink,searchreplace,contextmenu,paste,fullscreen,nonbreaking,xhtmlxtras,visualchars,media &webButtons1=Web Buttons 1;text;undo,redo,selectall,|,pastetext,pasteword,|,search,replace,|,nonbreaking,hr,charmap,|,image,link,unlink,anchor,media,|,cleanup,removeformat,|,fullscreen,code,help &webButtons2=Web Buttons 2;text;bold,italic,underline,strikethrough,sub,sup,|,|,blockquote,bullist,numlist,outdent,indent,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,|,styleprops &webButtons3=Web Buttons 3;text; &webButtons4=Web Buttons 4;text; &webAlign=Web Toolbar Alignment;list;ltr,rtl;ltr &width=Width;text;100% &height=Height;text;400',0,''),(3,'Inherit Parent Template','<strong>1.1</strong> Newly created Resources use the same template as their Parent or Sibling Containers',0,3,0,'/*\n * Inherit Parent Template\n *\n * Written By Raymond Irving - 12 Oct 2006\n *\n * Simply results in new documents inheriting the template \n * of their parent folder upon creating a new document\n *\n * Configuration:\n * check the OnDocFormPrerender event\n *\n * Version 1.1\n *\n */\n\nglobal $content;\n$e = &$modx->Event;\n\nswitch($e->name) {\n    case \'OnDocFormPrerender\':        \n        if ($inheritTemplate == \'From First Sibling\') {\n            if ($_REQUEST[\'pid\'] > 0 && $id == 0) {\n                if ($sibl = $modx->getDocumentChildren($_REQUEST[\'pid\'], 1, 0, \'template\', \'\', \'menuindex\', \'ASC\', 1)) {\n                    $content[\'template\'] = $sibl[0][\'template\'];\n                } else if ($sibl = $modx->getDocumentChildren($_REQUEST[\'pid\'], 0, 0, \'template\', \'\', \'menuindex\', \'ASC\', 1)) {\n                    $content[\'template\'] = $sibl[0][\'template\'];\n                } else if ($parent = $modx->getPageInfo($_REQUEST[\'pid\'], 0, \'template\')) {\n                    $content[\'template\'] = $parent[\'template\'];\n                }\n            }\n        } else {\n             if ($parent = $modx->getPageInfo($_REQUEST[\'pid\'],0,\'template\')) {\n                 $content[\'template\'] = $parent[\'template\'];\n             }\n        }\n        break;\n    default:\n        break;\n}',0,'&inheritTemplate=Inherit Template;list;From Parent,From First Sibling;From Parent',0,''),(4,'TransAlias','<strong>1.0.1</strong> Human readible URL translation supporting multiple languages and overrides',0,3,0,'/*\n * Initialize parameters\n */\nif (!isset ($alias)) { return ; }\nif (!isset ($plugin_dir) ) { $plugin_dir = \'transalias\'; }\nif (!isset ($plugin_path) ) { $plugin_path = $modx->config[\'base_path\'].\'assets/plugins/\'.$plugin_dir; }\nif (!isset ($table_name)) { $table_name = \'common\'; }\nif (!isset ($char_restrict)) { $char_restrict = \'lowercase alphanumeric\'; }\nif (!isset ($remove_periods)) { $remove_periods = \'No\'; }\nif (!isset ($word_separator)) { $word_separator = \'dash\'; }\nif (!isset ($override_tv)) { $override_tv = \'\'; }\n\nif (!class_exists(\'TransAlias\')) {\n    require_once $plugin_path.\'/transalias.class.php\';\n}\n$trans = new TransAlias($modx);\n\n/*\n * see if TV overrides the table name\n */\nif(!empty($override_tv)) {\n    $tvval = $trans->getTVValue($override_tv);\n    if(!empty($tvval)) {\n        $table_name = $tvval;\n    }\n}\n\n/*\n * Handle events\n */\n$e =& $modx->event;\nswitch ($e->name ) {\n    case \'OnStripAlias\':\n        if ($trans->loadTable($table_name, $remove_periods)) {\n            $output = $trans->stripAlias($alias,$char_restrict,$word_separator);\n            $e->output($output);\n            $e->stopPropagation();\n        }\n        break ;\n    default:\n        return ;\n}',0,'&table_name=Trans table;list;common,russian,utf8,utf8lowercase;utf8lowercase &char_restrict=Restrict alias to;list;lowercase alphanumeric,alphanumeric,legal characters;legal characters &remove_periods=Remove Periods;list;Yes,No;No &word_separator=Word Separator;list;dash,underscore,none;dash &override_tv=Override TV name;string;',0,''),(5,'ManagerManager','<strong>0.3.8</strong> Customize the MODx Manager to offer bespoke admin functions for end users.',0,3,0,'// You can put your ManagerManager rules EITHER in a chunk OR in an external file - whichever suits your development style the best\n\n// To use an external file, put your rules in /assets/plugins/managermanager/mm_rules.inc.php \n// (you can rename default.mm_rules.inc.php and use it as an example)\n// The chunk SHOULD have php opening tags at the beginning and end\n\n// If you want to put your rules in a chunk (so you can edit them through the Manager),\n// create the chunk, and enter its name in the configuration tab.\n// The chunk should NOT have php tags at the beginning or end\n\n// ManagerManager requires jQuery 1.3+\n// The URL to the jQuery library. Choose from the configuration tab whether you want to use \n// a local copy (which defaults to the jQuery library distributed with ModX 1.0.1)\n// a remote copy (which defaults to the Google Code hosted version)\n// or specify a URL to a custom location.\n// Here we set some default values, because this is a convenient place to change them if we need to,\n// but you should configure your preference via the Configuration tab.\n$js_default_url_local = $modx->config[\'site_url\']. \'/assets/js/jquery-1.3.2.min.js\';\n$js_default_url_remote = \'http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js\';\n\n// You don\'t need to change anything else from here onwards\n//-------------------------------------------------------\n\n// Run the main code\n$asset_path = $modx->config[\'base_path\'] . \'assets/plugins/managermanager/mm.inc.php\';\ninclude($asset_path);',0,'&config_chunk=Configuration Chunk;text;mm_demo_rules; &remove_deprecated_tv_types_pref=Remove deprecated TV types;list;yes,no;yes &which_jquery=jQuery source;list;local (assets/js),remote (google code),manual url (specify below);local (assets/js) &js_src_type=jQuery URL override;text;',0,''),(6,'Show Image TVs','<strong>1.0</strong> Preview images in the Manager from image Template Variables',0,0,0,'//    @author     Brett @ The Man Can!\n//                rewritten by Rachael Black, update by pixelchutes and rthrash\n//                now works with MooTools and finds the image tvs itself\n//\n\n/* ---------------------------------------------------------------\nInstructions:\n     Create a new Plugin and tick Documents > OnDocFormRender event.\n     Make sure it is set to execute after any other plugin that\n     could effect the template, like InheritParentTemplate. To edit\n     the plugin execution order, from the manager go to Resources >\n     Manage Resources > Plugins > Edit Plugin Execution Order by Event\n     link. That\'s it. It should now show images of all image TVs.\n\n     To configure image size, copy the following text (no leading spaces):\n       &w=Max width;int;300 &h=Max height;int;100\n     into the plugin configuration and change values to suit\n     This sets style=\"max-width: ; max-height: \" for the image\n     If you don\'t configure w or h, the image will be fullsize but\n     you can add a css rule rule div.tvimage img {...} to the Manager Theme\n------------------------------------------------------------------- */\n\nglobal $content;\n$template = $content[\'template\'];\n$e = &$modx->Event;\n\nif ($e->name == \'OnDocFormRender\' && ($template > 0)) {\n	$site = $modx->config[\'site_url\'];\n\n	if (isset($w) || isset($h)) {\n		$w = isset($w) ? $w : 300;\n		$h = isset($h) ? $h : 100;\n		$style = \"\'max-width:{$w}px; max-height:{$h}px\'\";\n	}\n	else\n		$style = \'\';\n\n	// get list of all image template vars using TV ids from Evo\n	$table = $modx->getFullTableName(\'site_tmplvars\');\n	$result = $modx->db->select(\'id\', $table, \"type=\'image\'\");\n	$tvs = \'\';\n	while ($row = $modx->db->getRow($result))\n		$tvs .= \",\'\" . $row[\'id\'] . \"\'\";\n	$tvs = substr($tvs, 1);		// remove leading \',\'\n\n	$output = <<< EOT\n<!-- ShowImageTVs Plugin :: Start -->\n\n<script type=\"text/javascript\" charset=\"utf-8\">\n  var imageNames = [$tvs];\n  var pageImages = [];\n\n  function full_url(url)\n  {\n	new_url = (url != \'\' && url.search(/http:\\/\\//i) == -1) ? (\'$site\' + url) : url;\n	return ( ( new_url.search(\'@INHERIT\') == -1 ) ? new_url : new_url.replace( new RegExp(/@INHERIT/ig), \'\' ) ); // Update by pixelchutes\n  }\n\n  function checkImages()\n  {\n    for (var i = 0; i < pageImages.length; i++) {\n    	var elem = pageImages[i];\n      var url = elem.value;\n      if (url != elem.oldUrl) {\n     	  elem.thumbnail.setProperty(\'src\', full_url(url));\n     	  elem.thumbnail.setStyle(\'display\', url==\'\' ? \'none\': \'inline\');\n        elem.oldUrl = url;\n      }\n    }\n  }\n\n  window.onDomReady(function() {\n    for (var i = 0; i < imageNames.length; i++) {\n    	var elem = $(\'tv\' + imageNames[i]);\n		if (elem) {\n		  var url = elem.value;\n\n		  // create div and img to show thumbnail\n		  var div = new Element(\'div\').addClass(\'tvimage\');\n		  var img = new Element(\'img\').setProperty(\'src\', full_url(url)).setStyles($style);\n		  if (url == \'\') img.setStyle(\'display\', \'none\');\n		  elem.getParent().adopt(div.adopt(img));\n\n		  elem.thumbnail = img;    // direct access for when need to update\n		  elem.oldUrl = url;   	   // oldUrl so change HTML only when necessary\n		  pageImages.push(elem);   // save so don\'t have to search each time\n		}\n    }\n    setInterval(checkImages, 1000);\n  })\n</script>\n\n<!-- ShowImageTVs Plugin :: End -->\nEOT;\n\n	$e->output($output);\n}\n\n// ?>\n',0,'',0,''),(7,'Quick Manager+','<strong>1.3.4.1</strong> Enables QuickManager front end content editing support',0,3,0,'$show = TRUE;\n\nif ($disabled  != \'\') {\n    $arr = explode(\",\", $disabled );\n    if (in_array($modx->documentIdentifier, $arr)) {\n        $show = FALSE;\n    }\n}\n\nif ($show) {\n    include_once($modx->config[\'base_path\'].\'assets/plugins/qm/qm.inc.php\');\n    $qm = new Qm($modx, $jqpath, $loadmanagerjq, $loadfrontendjq, $noconflictjq, $loadtb, $tbwidth, $tbheight, $hidefields, $hidetabs, $hidesections, $addbutton, $tpltype, $tplid, $custombutton, $managerbutton, $logout, $autohide);\n}',0,'&jqpath=Path to jQuery;text;assets/js/jquery-1.3.2.min.js &loadmanagerjq=Load jQuery in manager;list;true,false;true &loadfrontendjq=Load jQuery in front-end;list;true,false;true &noconflictjq=jQuery noConflict mode in front-end;list;true,false;true &loadtb=Load modal box in front-end;list;true,false;true &tbwidth=Modal box window width;text;80% &tbheight=Modal box window height;text;90% &hidefields=Hide document fields from front-end editors;text;parent &hidetabs=Hide document tabs from front-end editors;text; &hidesections=Hide document sections from front-end editors;text; &addbutton=Show add document here button;list;true,false;true &tpltype=New document template type;list;parent,id,selected;parent &tplid=New document template id;int;3  &custombutton=Custom buttons;textarea; &managerbutton=Show go to manager button;list;true,false;true &logout=Logout to;list;manager,front-end;manager &disabled=Plugin disabled on documents;text; &autohide=Autohide toolbar;list;true,false;true',0,''),(8,'Search Highlight','<strong>1.5</strong> Used with AjaxSearch to show search terms highlighted on page linked from search results',0,4,0,'/*\n  ------------------------------------------------------------------------\n  Plugin: Search_Highlight v1.5\n  ------------------------------------------------------------------------\n  Changes:\n  18/03/10 - Remove possibility of XSS attempts being passed in the URL\n           - look-behind assertion improved\n  29/03/09 - Removed urldecode calls;\n           - Added check for magic quotes - if set, remove slashes\n           - Highlights terms searched for when target is a HTML entity\n  18/07/08 - advSearch parameter and pcre modifier added\n  10/02/08 - Strip_tags added to avoid sql injection and XSS. Use of $_REQUEST\n  01/03/07 - Added fies/updates from forum from users mikkelwe/identity\n  (better highlight replacement, additional div around term/removal message)\n  ------------------------------------------------------------------------\n  Description: When a user clicks on the link from the AjaxSearch results\n    the target page will have the terms highlighted.\n  ------------------------------------------------------------------------\n  Created By:  Susan Ottwell (sottwell@sottwell.com)\n               Kyle Jaebker (kjaebker@muddydogpaws.com)\n\n  Refactored by Coroico (www.modx.wangba.fr) and TS\n  ------------------------------------------------------------------------\n  Based off the the code by Susan Ottwell (www.sottwell.com)\n    http://modxcms.com/forums/index.php/topic,1237.0.html\n  ------------------------------------------------------------------------\n  CSS:\n    The classes used for the highlighting are the same as the AjaxSearch\n  ------------------------------------------------------------------------\n  Notes:\n    To add a link to remove the highlighting and to show the searchterms\n    put the following on your page where you would like this to appear:\n\n      <!--search_terms-->\n\n    Example output for this:\n\n      Search Terms: the, template\n      Remove Highlighting\n\n    Set the following variables to change the text:\n\n      $termText - the text before the search terms\n      $removeText - the text for the remove link\n  ------------------------------------------------------------------------\n*/\nglobal $database_connection_charset;\n// Conversion code name between html page character encoding and Mysql character encoding\n// Some others conversions should be added if needed. Otherwise Page charset = Database charset\n$pageCharset = array(\n  \'utf8\' => \'UTF-8\',\n  \'latin1\' => \'ISO-8859-1\',\n  \'latin2\' => \'ISO-8859-2\'\n);\n\nif (isset($_REQUEST[\'searched\']) && isset($_REQUEST[\'highlight\'])) {\n\n  // Set these to customize the text for the highlighting key\n  // --------------------------------------------------------\n     $termText = \'<div class=\"searchTerms\">Search Terms: \';\n     $removeText = \'Remove Highlighting\';\n  // --------------------------------------------------------\n\n  $highlightText = $termText;\n  $advsearch = \'oneword\';\n\n  $dbCharset = $database_connection_charset;\n  $pgCharset = array_key_exists($dbCharset,$pageCharset) ? $pageCharset[$dbCharset] : $dbCharset;\n\n  // magic quotes check\n  if (get_magic_quotes_gpc()){\n    $searched = strip_tags(stripslashes($_REQUEST[\'searched\']));\n    $highlight = strip_tags(stripslashes($_REQUEST[\'highlight\']));\n    if (isset($_REQUEST[\'advsearch\'])) $advsearch = strip_tags(stripslashes($_REQUEST[\'advsearch\']));\n  }\n  else {\n    $searched = strip_tags($_REQUEST[\'searched\']);\n    $highlight = strip_tags($_REQUEST[\'highlight\']);\n    if (isset($_REQUEST[\'advsearch\'])) $advsearch = strip_tags($_REQUEST[\'advsearch\']);\n  }\n\n  if ($advsearch != \'nowords\') {\n\n    $searchArray = array();\n    if ($advsearch == \'exactphrase\') $searchArray[0] = $searched;\n    else $searchArray = explode(\' \', $searched);\n\n    $searchArray = array_unique($searchArray);\n    $nbterms = count($searchArray);\n    $searchTerms = array();\n    for($i=0;$i<$nbterms;$i++){\n      // Consider all possible combinations\n      $word_ents = array();\n      $word_ents[] = $searchArray[$i];\n      $word_ents[] = htmlentities($searchArray[$i], ENT_NOQUOTES, $pgCharset);\n      $word_ents[] = htmlentities($searchArray[$i], ENT_COMPAT, $pgCharset);\n      $word_ents[] = htmlentities($searchArray[$i], ENT_QUOTES, $pgCharset);\n      // Avoid duplication\n      $word_ents = array_unique($word_ents);\n      foreach($word_ents as $word) $searchTerms[]= array(\'term\' => $word, \'class\' => $i+1);\n    }\n\n    $output = $modx->documentOutput; // get the parsed document\n    $body = explode(\"<body\", $output); // break out the head\n\n    $highlightClass = explode(\' \',$highlight); // break out the highlight classes\n    /* remove possibility of XSS attempts being passed in URL */\n    foreach ($highlightClass as $key => $value) {\n       $highlightClass[$key] = preg_match(\'/[^A-Za-z0-9_-]/ms\', $value) == 1 ? \'\' : $value;\n    }\n\n    $pcreModifier = ($pgCharset == \'UTF-8\') ? \'iu\' : \'i\';\n    $lookBehind = \'/(?<!&|&[\\w#]|&[\\w#]\\w|&[\\w#]\\w\\w|&[\\w#]\\w\\w\\w|&[\\w#]\\w\\w\\w\\w|&[\\w#]\\w\\w\\w\\w\\w)\';  // avoid a match with a html entity\n    $lookAhead = \'(?=[^>]*<)/\'; // avoid a match with a html tag\n\n    $nbterms = count($searchTerms);\n    for($i=0;$i<$nbterms;$i++){\n      $word = $searchTerms[$i][\'term\'];\n      $class = $highlightClass[0].\' \'.$highlightClass[$searchTerms[$i][\'class\']];\n\n      $highlightText .= ($i > 0) ? \', \' : \'\';\n      $highlightText .= \'<span class=\"\'.$class.\'\">\'.$word.\'</span>\';\n\n      $pattern = $lookBehind . preg_quote($word, \'/\') . $lookAhead . $pcreModifier;\n      $replacement = \'<span class=\"\' . $class . \'\">${0}</span>\';\n      $body[1] = preg_replace($pattern, $replacement, $body[1]);\n    }\n\n    $output = implode(\"<body\", $body);\n\n    $removeUrl = $modx->makeUrl($modx->documentIdentifier);\n    $highlightText .= \'<br /><a href=\"\'.$removeUrl.\'\" class=\"ajaxSearch_removeHighlight\">\'.$removeText.\'</a></div>\';\n\n    $output = str_replace(\'<!--search_terms-->\',$highlightText,$output);\n    $modx->documentOutput = $output;\n  }\n}',0,'',0,'');

--
-- Table structure for table `modx_site_snippets`
--

CREATE TABLE `modx_site_snippets` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL DEFAULT '',
  `description` varchar(255) NOT NULL DEFAULT 'Snippet',
  `editor_type` int(11) NOT NULL DEFAULT '0' COMMENT '0-plain text,1-rich text,2-code editor',
  `category` int(11) NOT NULL DEFAULT '0' COMMENT 'category id',
  `cache_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Cache option',
  `snippet` mediumtext,
  `locked` tinyint(4) NOT NULL DEFAULT '0',
  `properties` text,
  `moduleguid` varchar(32) NOT NULL DEFAULT '' COMMENT 'GUID of module from which to import shared parameters',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=20 DEFAULT CHARSET=latin1 COMMENT='Contains the site snippets.';

--
-- Dumping data for table `modx_site_snippets`
--

INSERT INTO `modx_site_snippets` VALUES (1,'MemberCheck','<strong>1.1</strong> Show chunks based on a logged in Web User\'s group membership',0,2,0,'#::::::::::::::::::::::::::::::::::::::::\n# Version: 1.0\n# Created By Ryan Thrash (vertexworks.com)\n# Sanitized By Jason Coward (opengeek.com)\n#\n# Date: November 29, 2005\n#\n# Changelog: \n# Nov 29, 05 -- initial release\n# Jul 13, 06 -- adjusted Singleton to work under PHP4, added placeholder code (by: garryn)\n#\n#::::::::::::::::::::::::::::::::::::::::\n# Description: 	\n#	Checks to see if users belong to a certain group and \n#	displays the specified chunk if they do. Performs several\n#	sanity checks and allows to be used multiple times on a page.\n#\n# Params:\n#	&groups [array] (REQUIRED)\n#		array of webuser group-names to check against\n#\n#	&chunk [string] (REQUIRED)\n#		name of the chunk to use if passes the check\n#\n#	&ph [string] (optional)\n#		name of the placeholder to set instead of directly retuning chunk\n#\n#	&debug [boolean] (optional | false) \n#		turn on debug mode for extra troubleshooting\n#\n# Example Usage:\n#\n#	[[MemberCheck? &groups=`siteadmin, registered users` &chunk=`privateSiteNav` &ph=`MemberMenu` &debug=`true`]]\n#\n#	This would place the \'members-only\' navigation store in the chunk \'privateSiteNav\'\n#	into a placeholder (called \'MemberMenu\'). It will only do this as long as the user \n#	is logged in as a webuser and is a member of the \'siteadmin\' or the \'registered users\'\n#	groups. The optional debug parameter can be used to display informative error messages \n#	when configuring this snippet for your site. For example, if the developer had \n#	mistakenly typed \'siteowners\' for the first group, and none existed with debug mode on, \n#	it would have returned the error message: The group siteowners could not be found....\n#\n#::::::::::::::::::::::::::::::::::::::::\n\n# debug parameter\n$debug = isset ($debug) ? $debug : false;\n\n# check if inside manager\nif ($m = $modx->insideManager()) {\n	return \'\'; # don\'t go any further when inside manager\n}\n\nif (!isset ($groups)) {\n	return $debug ? \'<p>Error: No Group Specified</p>\' : \'\';\n}\n\nif (!isset ($chunk)) {\n	return $debug ? \'<p>Error: No Chunk Specified</p>\' : \'\';\n}\n\n# turn comma-delimited list of groups into an array\n$groups = explode(\',\', $groups);\n\nif (!class_exists(\'MemberCheck\')) {\n	class MemberCheck {\n		var $allGroups = NULL;\n		var $debug;\n\n		function getInstance($debug) {\n			static $instance;\n			if (!isset ($instance)) {\n				$instance = new MemberCheck($debug);\n			}\n			return $instance;\n		}\n\n		function MemberCheck($debug = false) {\n			global $modx;\n\n			$this->debug = $debug;\n			if ($debug) {\n				$this->allGroups = array ();\n				$tableName = $modx->getFullTableName(\'webgroup_names\');\n				$sql = \"SELECT name FROM $tableName\";\n				if ($rs = $modx->db->query($sql)) {\n					while ($row = $modx->db->getRow($rs)) {\n						array_push($this->allGroups, stripslashes($row[\'name\']));\n					}\n				}\n			}\n		}\n\n		function isValidGroup($groupName) {\n			$isValid = !(array_search($groupName, $this->allGroups) === false);\n			return $isValid;\n		}\n\n		function getMemberChunk(& $groups, $chunk) {\n			global $modx;\n			$o = \'\';\n			if (is_array($groups)) {\n				for ($i = 0; $i < count($groups); $i++) {\n					$groups[$i] = trim($groups[$i]);\n					if ($this->debug) {\n						if (!$this->isValidGroup($groups[$i])) {\n							return \"<p>The group <strong>\" . $groups[$i] . \"</strong> could not be found...</p>\";\n						}\n					}\n				}\n\n				$check = $modx->isMemberOfWebGroup($groups);\n\n				$chunkcheck = $modx->getChunk($chunk);\n\n				$o .= ($check && $chunkcheck) ? $chunkcheck : \'\';\n				if (!$chunkcheck)\n					$o .= $this->debug ? \"<p>The chunk <strong>$chunk</strong> not found...</p>\" : \'\';\n			} else {\n				$o .= \"<p>No valid group names were specified!</p>\";\n			}\n\n			return $o;\n		}\n	}\n}\n\n$memberCheck = MemberCheck :: getInstance($debug);\n\nif (!isset ($ph)) {\n	return $memberCheck->getMemberChunk($groups, $chunk);\n} else {\n	$modx->setPlaceholder($ph, $memberCheck->getMemberChunk($groups, $chunk));\n	return \'\';\n}',0,'',''),(2,'UltimateParent','<strong>2.0</strong> Travels up the document tree from a specified document and returns its \"ultimate\" non-root parent',0,5,0,'/*\n * @name UltimateParent\n * @version 2.0 beta (requires MODx 0.9.5+)\n * @author Jason Coward <modx@opengeek.com>\n * \n * @param &id The id of the document whose parent you want to find.\n * @param &top The top node for the search.\n * @param &topLevel The top level node for the search (root = level 1)\n * \n * @license Public Domain, use as you like.\n * \n * @example [[UltimateParent? &id=`45` &top=`6`]] \n * Will find the ultimate parent of document 45 if it is a child of document 6;\n * otherwise it will return 45.\n * \n * @example [[UltimateParent? &topLevel=`2`]]\n * Will find the ultimate parent of the current document at a depth of 2 levels\n * in the document hierarchy, with the root level being level 1.\n * \n * This snippet travels up the document tree from a specified document and\n * returns the \"ultimate\" parent.  Version 2.0 was rewritten to use the new\n * getParentIds function features available only in MODx 0.9.5 or later.\n * \n * Based on the original UltimateParent 1.x snippet by Susan Ottwell\n * <sottwell@sottwell.com>.  The topLevel parameter was introduced by staed and\n * adopted here.\n */\n$top= isset ($top) && intval($top) ? $top : 0;\n$id= isset ($id) && intval($id) ? intval($id) : $modx->documentIdentifier;\n$topLevel= isset ($topLevel) && intval($topLevel) ? intval($topLevel) : 0;\nif ($id && $id != $top) {\n    $pid= $id;\n    if (!$topLevel || count($modx->getParentIds($id)) >= $topLevel) {\n        while ($parentIds= $modx->getParentIds($id, 1)) {\n            $pid= array_pop($parentIds);\n            if ($pid == $top) {\n                break;\n            }\n            $id= $pid;\n            if ($topLevel && count($modx->getParentIds($id)) < $topLevel) {\n                break;\n            }\n        }\n    }\n}\nreturn $id;',0,'',''),(3,'Personalize','<strong>2.0</strong> Basic personalization for web users',0,2,0,'#::::::::::::::::::::::::::::::::::::::::\n# Created By:Ryan Thrash (modx@vertexworks.com), \n#	and then powered up by kudo (kudo@kudolink.com)\n#\n# Date: Aug 03, 2006\n#\n# Changelog: \n# Dec 01, 05 -- initial release\n# Jun 19, 06 -- updated description\n# Jul 19, 06 -- hacked by kudo to output chunks\n# Aug 03, 06 -- added placeholder for username\n#\n#::::::::::::::::::::::::::::::::::::::::\n# Description: 	\n#	Checks to see if webusers are logged in and displays yesChunk if the user\n#	is logged or noChunk if user is not logged. Insert only the chunk name as\n#	param, without {{}}. Can use a placeholder to output the username.\n#	TESTED: can be used more than once per page.\n#	TESTED: chunks can contain snippets.\n#	\n#	\n# Params:\n#	&yesChunk [string] [REQUIRED]\n#		Output for LOGGED users\n#\n#	&noChunk [string] [REQUIRED] \n#		Output for NOT logged users\n#\n#	&ph [string] (optional) \n#		Placeholder for placing the username\n#		ATTENTION!: place this ph only in yesChunk!\n#	\n#\n# Example Usage:\n#\n#	[[LoggedOrNot? &yesChunk=`Link` &noChunk=`Register` &ph=`name`]]\n#\n#	Having Chunks named {{Link}} and another {{Register}}, the first will be\n#	published to registered user, the second to non-registered users.\n#\n#::::::::::::::::::::::::::::::::::::::::\n\n# prepare params and variables\n$o = \'\';\n$yesChunk = (isset($yesChunk))? $yesChunk : \'\';\n$noChunk = (isset($noChunk))? $noChunk : \'\';\n\n# do the work\n$test = $modx->getLoginUserName();\nif ($test) {\n    $o = $modx->getChunk($yesChunk);\n  } else {\n    $o = $modx->getChunk($noChunk);\n}\n\nif (isset($ph)) {\n	$modx->setPlaceholder($ph,$test);\n	return $o;\n} else {\n	return $o;\n}\n',0,'',''),(4,'FirstChildRedirect','<strong>1.0</strong> Automatically redirects to the first child of a Container Resource',0,5,0,'/*\n * @name FirstChildRedirect\n * @author Jason Coward <jason@opengeek.com>\n * @modified-by Ryan Thrash <ryan@vertexworks.com>\n * @license Public Domain\n * @version 1.0\n * \n * This snippet redirects to the first child document of a folder in which this\n * snippet is included within the content (e.g. [!FirstChildRedirect!]).  This\n * allows MODx folders to emulate the behavior of real folders since MODx\n * usually treats folders as actual documents with their own content.\n * \n * Modified to make Doc ID a required parameter... now defaults to the current \n * Page/Folder you call the snippet from.\n * \n * &docid=`12` \n * Use the docid parameter to have this snippet redirect to the\n * first child document of the specified document.\n */\n\n$docid = (isset($docid))? $docid: $modx->documentIdentifier;\n\n$children= $modx->getActiveChildren($docid, \'menuindex\', \'ASC\');\nif (!$children === false) {\n    $firstChild= $children[0];\n    $firstChildUrl= $modx->makeUrl($firstChild[\'id\']);\n} else {\n    $firstChildUrl= $modx->makeUrl($modx->config[\'site_start\']);\n}\nreturn $modx->sendRedirect($firstChildUrl);\n',0,'',''),(5,'WebSignup','<strong>1.1</strong> Basic Web User account creation/signup system',0,2,0,'# Created By Raymond Irving April, 2005\n#::::::::::::::::::::::::::::::::::::::::\n# Usage:     \n#    Allows a web user to signup for a new web account from the website\n#    This snippet provides a basic set of form fields for the signup form\n#    You can customize this snippet to create your own signup form\n#\n# Params:    \n#\n#    &tpl        - (Optional) Chunk name or document id to use as a template\n#    &groups     - Web users groups to be assigned to users\n#    &useCaptcha - (Optional) Determine to use (1) or not to use (0) captcha\n#                  on signup form - if not defined, will default to system\n#                  setting. GD is required for this feature. If GD is not \n#                  available, useCaptcha will automatically be set to false;\n#                  \n#    Note: Templats design:\n#        section 1: signup template\n#        section 2: notification template \n#\n# Examples:\n#\n#    [[WebSignup? &tpl=`SignupForm` &groups=`NewsReaders,WebUsers`]] \n\n# Set Snippet Paths \n$snipPath = $modx->config[\'base_path\'] . \"assets/snippets/\";\n\n# check if inside manager\nif ($m = $modx->insideManager()) {\n    return \'\'; # don\'t go any further when inside manager\n}\n\n\n# Snippet customize settings\n$tpl = isset($tpl)? $tpl:\"\";\n$useCaptcha = isset($useCaptcha)? $useCaptcha : $modx->config[\'use_captcha\'] ;\n// Override captcha if no GD\nif ($useCaptcha && !gd_info()) $useCaptcha = 0;\n\n# setup web groups\n$groups = isset($groups) ? explode(\',\',$groups):array();\nfor($i=0;$i<count($groups);$i++) $groups[$i] = trim($groups[$i]);\n\n# System settings\n$isPostBack        = count($_POST) && isset($_POST[\'cmdwebsignup\']);\n\n$output = \'\';\n\n# Start processing\ninclude_once $snipPath.\"weblogin/weblogin.common.inc.php\";\ninclude_once $snipPath.\"weblogin/websignup.inc.php\";\n\n# Return\nreturn $output;',0,'&tpl=Template;string;',''),(6,'Ditto','<strong>2.1.0</strong> Summarizes and lists pages to create blogs, catalogs, PR archives, bio listings and more',0,6,0,'/* Description:\n *      Aggregates documents to create blogs, article/news\n *      collections, and more,with full support for templating.\n * \n * Author: \n *      Mark Kaplan for MODx CMF\n*/\n\n//---Core Settings---------------------------------------------------- //\n\n$ditto_version = \"2.1.0\";\n    // Ditto version being executed\n\n$ditto_base = isset($ditto_base) ? $modx->config[\'base_path\'].$ditto_base : $modx->config[\'base_path\'].\"assets/snippets/ditto/\";\n/*\n    Param: ditto_base\n    \n    Purpose:\n    Location of Ditto files\n\n    Options:\n    Any valid folder location containing the Ditto source code with a trailing slash\n\n    Default:\n    [(base_path)]assets/snippets/ditto/\n*/\n$dittoID = (!isset($id)) ? \"\" : $id.\"_\";\n$GLOBALS[\"dittoID\"] = $dittoID;\n/*\n    Param: id\n\n    Purpose:\n    Unique ID for this Ditto instance for connection with other scripts (like Reflect) and unique URL parameters\n\n    Options:\n    Any combination of characters a-z, underscores, and numbers 0-9\n    \n    Note:\n    This is case sensitive\n\n    Default:\n    \"\" - blank\n*/      \n$language = (isset($language))? $language : $modx->config[\'manager_language\'];\nif (!file_exists($ditto_base.\"lang/\".$language.\".inc.php\")) {\n    $language =\"english\";\n}\n/*\n    Param: language\n\n    Purpose:\n    language for defaults, debug, and error messages\n\n    Options:\n    Any language name with a corresponding file in the &ditto_base/lang folder\n\n    Default:\n    \"english\"\n*/\n$format = (isset($format)) ? strtolower($format) : \"html\" ;\n/*\n    Param: format\n\n    Purpose:\n    Output format to use\n\n    Options:\n    - \"html\"\n    - \"json\"\n    - \"xml\"\n    - \"atom\"\n    - \"rss\"\n\n    Default:\n    \"html\"\n*/\n$config = (isset($config)) ? $config : \"default\";\n/*\n    Param: config\n\n    Purpose:\n    Load a custom configuration\n\n    Options:\n    \"default\" - default blank config file\n    CONFIG_NAME - Other configs installed in the configs folder or in any folder within the MODx base path via @FILE\n\n    Default:\n    \"default\"\n    \n    Related:\n    - <extenders>\n*/\n$debug = isset($debug)? $debug : 0;\n/*\n    Param: debug\n\n    Purpose:\n    Output debugging information\n\n    Options:\n    0 - off\n    1 - on\n    \n    Default:\n    0 - off\n    \n    Related:\n    - <debug>\n*/\n$phx = (isset($phx))? $phx : 1;\n/*\n    Param: phx\n\n    Purpose:\n    Use PHx formatting\n\n    Options:\n    0 - off\n    1 - on\n    \n    Default:\n    1 - on\n*/      \n$extenders = isset($extenders) ? explode(\",\",$extenders) : array();\n/*\n    Param: extenders\n\n    Purpose:\n    Load an extender which adds functionality to Ditto\n\n    Options:\n    Any extender in the extenders folder or in any folder within the MODx base path via @FILE\n\n    Default:\n    [NULL]\n\n    Related:\n    - <config>\n*/\n    // Variable: extenders\n    // Array that can be added to by configs or formats to load that extender\n    \n$placeholders = array();\n    // Variable: placeholders\n    // Initialize custom placeholders array for configs or extenders to add to\n\n$filters = array(\"custom\"=>array(),\"parsed\"=>array());\n    // Variable: filters\n    // Holds both the custom filters array for configs or extenders to add to \n    // and the parsed filters array. To add to this array, use the following format\n    // (code)\n    // $filters[\"parsed\"][] = array(\"name\" => array(\"source\"=>$source,\"value\"=>$value,\"mode\"=>$mode));\n    // $filters[\"custom\"][] = array(\"source\",\"callback_function\");\n\n$orderBy = array(\'parsed\'=>array(),\'custom\'=>array(),\'unparsed\'=>$orderBy);\n    // Variable: orderBy\n    // An array that holds all criteria to sort the result set by. \n    // Note that using a custom sort will disable all other sorting.\n    // (code)\n    // $orderBy[\"parsed\"][] = array(\"sortBy\",\"sortDir\");\n    // $orderBy[\"custom\"][] = array(\"sortBy\",\"callback_function\");\n        \n//---Includes-------------------------------------------------------- //\n\n$files = array (\n    \"base_language\" => $ditto_base.\"lang/english.inc.php\",\n    \"language\" => $ditto_base.\"lang/$language.inc.php\",\n    \"main_class\" => $ditto_base.\"classes/ditto.class.inc.php\",\n    \"template_class\" => $ditto_base.\"classes/template.class.inc.php\",\n    \"filter_class\" => $ditto_base.\"classes/filter.class.inc.php\",\n    \"format\" => $ditto_base.\"formats/$format.format.inc.php\",\n    \"config\" => $ditto_base.\"configs/default.config.php\",\n    \"user_config\" => (substr($config, 0, 5) != \"@FILE\") ? $ditto_base.\"configs/$config.config.php\" : $modx->config[\'base_path\'].trim(substr($config, 5))\n);\n\nif ($phx == 1) {\n    $files[\"prePHx_class\"] = $ditto_base.\"classes/phx.pre.class.inc.php\";\n}\nif (isset($randomize)) {\n    $files[\"randomize_class\"] = $ditto_base.\"classes/random.class.inc.php\";\n}\nif ($debug == 1) {\n    $files[\"modx_debug_class\"] = $ditto_base.\"debug/modxDebugConsole.class.php\";\n    $files[\"debug_class\"] = $ditto_base.\"classes/debug.class.inc.php\";\n    $files[\"debug_templates\"] = $ditto_base.\"debug/debug.templates.php\";\n}\n\n$files = array_unique($files);\nforeach ($files as $filename => $filevalue) {\n    if (file_exists($filevalue) && strpos($filename,\"class\")) {\n        include_once($filevalue);\n    } else if (file_exists($filevalue)) {\n        include($filevalue);\n    } else if ($filename == \"language\") {\n        $modx->logEvent(1, 3, \"Language file does not exist Please check: \" . $filevalue, \"Ditto \" . $ditto_version);\n        return \"Language file does not exist Please check: \" . $filevalue;\n    } else {\n        $modx->logEvent(1, 3, $filevalue . \" \" . $_lang[\'file_does_not_exist\'], \"Ditto \" . $ditto_version);\n        return $filevalue . \" \" . $_lang[\'file_does_not_exist\'];\n    }\n}\n\n//---Initiate Class-------------------------------------------------- //\nif (class_exists(\'ditto\')) {\n    $ditto = new ditto($dittoID,$format,$_lang,$dbg_templates);\n        // create a new Ditto instance in the specified format and language with the requested debug level\n} else {\n    $modx->logEvent(1,3,$_lang[\'invalid_class\'],\"Ditto \".$ditto_version);\n    return $_lang[\'invalid_class\'];\n}\n\n//---Initiate Extenders---------------------------------------------- //\nif (isset($tagData)) {\n    $extenders[] = \"tagging\";\n}\nif(count($extenders) > 0) {\n    $extenders = array_unique($extenders);\n    foreach ($extenders as $extender) {\n            if(substr($extender, 0, 5) != \"@FILE\") {\n                $extender_path = $ditto_base.\"extenders/\".$extender.\".extender.inc.php\";                \n            } else {\n                $extender_path = $modx->config[\'base_path\'].trim(substr($extender, 5));\n            }\n            \n            if (file_exists($extender_path)){\n                include($extender_path);\n            } else {\n                $modx->logEvent(1, 3, $extender . \" \" . $_lang[\'extender_does_not_exist\'], \"Ditto \".$ditto_version);\n                return $extender . \" \" . $_lang[\'extender_does_not_exist\'];\n            }       \n    }   \n}\n\n//---Parameters------------------------------------------------------- /*\nif (isset($startID)) {$parents = $startID;}\nif (isset($summarize)) {$display = $summarize;}\nif (isset($limit)) {$queryLimit = $limit;}\nif (isset($sortBy) || isset($sortDir) || is_null($orderBy[\'unparsed\'])) {\n    $sortDir = isset($sortDir) ? strtoupper($sortDir) : \'DESC\';\n    $sortBy = isset($sortBy) ? $sortBy : \"createdon\";\n    $orderBy[\'parsed\'][]=array($sortBy,$sortDir);\n}\n    // Allow backwards compatibility\n\n$idType = isset($documents) ? \"documents\" : \"parents\";\n    // Variable: idType\n    // type of IDs provided; can be either parents or documents\n\n$parents = isset($parents) ? $ditto->cleanIDs($parents) : $modx->documentIdentifier;\n\n/*\n    Param: parents\n\n    Purpose:\n    IDs of containers for Ditto to retrieve their children to &depth depth\n\n    Options:\n    Any valid MODx document marked as a container\n\n    Default:\n    Current MODx Document\n\n    Related:\n    - <documents>\n    - <depth>\n*/\n$documents = isset($documents) ? $ditto->cleanIDs($documents) : false;\n/*\n    Param: documents\n\n    Purpose:\n    IDs of documents for Ditto to retrieve\n\n    Options:\n    Any valid MODx document marked as a container\n\n    Default:\n    None\n\n    Related:\n    - <parents>\n*/\n\n$IDs = ($idType == \"parents\") ? $parents : $documents;\n    // Variable: IDs\n    // Internal variable which holds the set of IDs for Ditto to fetch\n\n$depth = isset($depth) ? $depth : 1;\n/*\n    Param: depth\n\n    Purpose:\n    Number of levels deep to retrieve documents\n\n    Options:\n    Any number greater than or equal to 1\n    0 - infinite depth\n\n    Default:\n    1\n\n    Related:\n    - <seeThruUnpub>\n*/\n$paginate = isset($paginate)? $paginate : 0;\n/*\n    Param: paginate\n\n    Purpose:\n    Paginate the results set into pages of &display length.\n    Use &total to limit the number of documents retreived.\n\n    Options:\n    0 - off\n    1 - on\n    \n    Default:\n    0 - off\n    \n    Related:\n    - <paginateAlwaysShowLinks>\n    - <paginateSplitterCharacter>\n    - <display>\n*/\n$dateSource = isset($dateSource) ? $dateSource : \"createdon\";\n/*\n    Param: dateSource\n\n    Purpose:\n    Source of the [+date+] placeholder\n\n    Options:\n    # - Any UNIX timestamp from MODx fields or TVs such as createdon, pub_date, or editedon\n    \n    Default:\n    \"createdon\"\n    \n    Related:\n    - <dateFormat>\n*/\n$dateFormat = isset($dateFormat)? $dateFormat : $_lang[\"dateFormat\"];\n/*\n    Param: dateFormat\n\n    Purpose:\n    Format the [+date+] placeholder in human readable form\n\n    Options:\n    Any PHP valid strftime option\n\n    Default:\n    [LANG]\n    \n    Related:\n    - <dateSource>\n*/\n$display = isset($display) ? $display : \"all\";\n/*\n    Param: display\n\n    Purpose:\n    Number of documents to display in the results\n\n    Options:\n    # - Any number\n    \"all\" - All documents found\n\n    Default:\n    \"all\"\n    \n    Related:\n    - <queryLimit>\n    - <total>\n*/\n$total = isset($total) ? $total : \"all\";\n/*\n    Param: total\n\n    Purpose:\n    Number of documents to retrieve\n    \n    Options:\n    # - Any number\n    \"all\" - All documents found\n\n    Default:\n    \"all\" - All documents found\n    \n    Related:\n    - <display>\n    - <queryLimit>\n*/\n$showPublishedOnly = isset($showPublishedOnly) ? $showPublishedOnly : 1;\n/*\n    Param: showPublishedOnly\n\n    Purpose:\n    Show only published documents\n\n    Options:\n    0 - show only unpublished documents\n    1 - show both published and unpublished documents\n    \n    Default:\n    1 - show both published and unpublished documents\n    \n    Related:\n    - <seeThruUnpub>\n    - <hideFolders>\n    - <showPublishedOnly>\n    - <where>\n*/\n$showInMenuOnly = isset($showInMenuOnly) ? $showInMenuOnly : 0;\n/*\n    Param: showInMenuOnly\n\n    Purpose:\n    Show only documents visible in the menu\n\n    Options:\n    0 - show all documents\n    1 - show only documents with the show in menu flag checked\n    \n    Default:\n    0 - show all documents\n    \n    Related:\n    - <seeThruUnpub>\n    - <hideFolders>\n    - <where>\n*/\n$hideFolders = isset($hideFolders)? $hideFolders : 0;\n/*\n    Param: hideFolders\n\n    Purpose:\n    Don\'t show folders in the returned results\n\n    Options:\n    0 - keep folders\n    1 - remove folders\n    \n    Default:\n    0 - keep folders\n    \n    Related:\n    - <seeThruUnpub>\n    - <showInMenuOnly>\n    - <where>\n*/\n$hidePrivate = isset($hidePrivate)? $hidePrivate : 1;\n/*\n    Param: hidePrivate\n\n    Purpose:\n    Don\'t show documents the guest or user does not have permission to see\n\n    Options:\n    0 - show private documents\n    1 - hide private documents\n    \n    Default:\n    1 - hide private documents\n    \n    Related:\n    - <seeThruUnpub>\n    - <showInMenuOnly>\n    - <where>\n*/\n$seeThruUnpub = (isset($seeThruUnpub))? $seeThruUnpub : 1 ;\n/*\n    Param: seeThruUnpub\n\n    Purpose:\n    See through unpublished folders to retrive their children\n    Used when depth is greater than 1\n\n    Options:\n    0 - off\n    1 - on\n    \n    Default:\n    0 - off\n    \n    Related:\n    - <hideFolders>\n    - <showInMenuOnly>\n    - <where>\n*/\n$queryLimit = (isset($queryLimit))? $queryLimit : 0;\n/*\n    Param: queryLimit\n\n    Purpose:\n    Number of documents to retrieve from the database, same as MySQL LIMIT\n\n    Options:\n    # - Any number\n    0 - automatic\n\n    Default:\n    0 - automatic\n    \n    Related:\n    - <where>\n*/\n$where = (isset($where))? $where : \"\";\n/*\n    Param: where\n\n    Purpose:\n    Custom MySQL WHERE statement\n\n    Options:\n    A valid MySQL WHERE statement using only document object items (no TVs)\n\n    Default:\n    [NULL]\n    \n    Related:\n    - <queryLimit>\n*/\n$noResults = isset($noResults)? $ditto->getParam($noResults,\"no_documents\") : $_lang[\'no_documents\'];\n/*\n    Param: noResults\n\n    Purpose:\n    Text or chunk to display when there are no results\n\n    Options:\n    Any valid chunk name or text\n\n    Default:\n    [LANG]\n*/\n$removeChunk = isset($removeChunk) ? explode(\",\",$removeChunk) : false;\n/*\n    Param: removeChunk\n\n    Purpose:\n    Name of chunks to be stripped from content separated by commas\n    - Commonly used to remove comments\n\n    Options:\n    Any valid chunkname that appears in the output\n\n    Default:\n    [NULL]\n*/\n$hiddenFields = isset($hiddenFields) ? explode(\",\",$hiddenFields) : false;\n/*\n    Param: hiddenFields\n\n    Purpose:\n    Allow Ditto to retrieve fields its template parser cannot handle such as nested placeholders and [*fields*]\n\n    Options:\n    Any valid MODx fieldnames or TVs comma separated\n\n    Default:\n    [NULL]\n*/\n$offset = isset($start) ? $start : 0;\n$start = (isset($_GET[$dittoID.\'start\'])) ? intval($_GET[$dittoID.\'start\']) : 0;\n/*\n    Param: start\n\n    Purpose:\n    Number of documents to skip in the results\n    \n    Options:\n    Any number\n\n    Default:\n    0\n*/\n$globalFilterDelimiter = isset($globalFilterDelimiter) ? $globalFilterDelimiter : \"|\";\n/*\n    Param: globalFilterDelimiter\n\n    Purpose:\n    Filter delimiter used to separate filters in the filter string\n    \n    Options:\n    Any character not used in the filters\n\n    Default:\n    \"|\"\n    \n    Related:\n    - <localFilterDelimiter>\n    - <filter>\n    - <parseFilters>\n*/\n    \n$localFilterDelimiter = isset($localFilterDelimiter) ? $localFilterDelimiter : \",\";\n/*\n    Param: localFilterDelimiter\n\n    Purpose:\n    Delimiter used to separate individual parameters within each filter string\n    \n    Options:\n    Any character not used in the filter itself\n\n    Default:\n    \",\"\n    \n    Related:\n    - <globalFilterDelimiter>\n    - <filter>\n    - <parseFilters>\n*/\n$filters[\"custom\"] = isset($cFilters) ? array_merge($filters[\"custom\"],$cFilters) : $filters[\"custom\"];\n$filters[\"parsed\"] = isset($parsedFilters) ? array_merge($filters[\"parsed\"],$parsedFilters) : $filters[\"parsed\"];\n    // handle 2.0.0 compatibility\n$filter = (isset($filter) || ($filters[\"custom\"] != false) || ($filters[\"parsed\"] != false)) ? $ditto->parseFilters($filter,$filters[\"custom\"],$filters[\"parsed\"],$globalFilterDelimiter,$localFilterDelimiter) : false;\n/*\n    Param: filter\n\n    Purpose:\n    Removes items not meeting a critera. Thus, if pagetitle == joe then it will be removed.\n    Use in the format field,criteria,mode with the comma being the local delimiter\n\n    *Mode* *Meaning*\n    \n    1 - !=\n    2 - ==\n    3 - <\n    4 - >\n    5 - <=\n    6 - >=\n    7 - Text not in field value\n    8 - Text in field value\n    9 - case insenstive version of #7\n    10 - case insenstive version of #8\n    11 - checks leading character of the field\n    \n    @EVAL:\n        @EVAL in filters works the same as it does in MODx exect it can only be used \n        with basic filtering, not custom filtering (tagging, etc). Make sure that\n        you return the value you wish Ditto to filter by and that the code is valid PHP.\n\n    Default:\n    [NULL]\n    \n    Related:\n    - <localFilterDelimiter>\n    - <globalFilterDelimiter>\n    - <parseFilters>\n*/\n$keywords = (isset($keywords))? $keywords : 0;\n/*  \n    Param: keywords\n    \n    Purpose: \n    Enable fetching of associated keywords for each document\n    Can be used as [+keywords+] or as a tagData source\n    \n    Options:\n    0 - off\n    1 - on\n    \n    Default:\n    0 - off\n*/\n\n$randomize = (isset($randomize))? $randomize : 0;\n/*  \n    Param: randomize\n    \n    Purpose: \n    Randomize the order of the output\n    \n    Options:\n    0 - off\n    1 - on\n    Any MODx field or TV for weighted random\n    \n    Default:\n    0 - off\n*/\n$save = (isset($save))? $save : 0;\n/*\n    Param: save\n\n    Purpose:\n    Saves the ditto object and results set to placeholders\n    for use by other snippets\n\n    Options:\n    0 - off; returns output\n    1 - remaining; returns output\n    2 - all;\n    3 - all; returns ph only\n\n    Default:\n        0 - off; returns output\n*/\n$templates = array(\n    \"default\" => \"@CODE\".$_lang[\'default_template\'],\n    \"base\" => $tpl,\n    \"alt\" => $tplAlt,\n    \"first\" => $tplFirst,\n    \"last\" => $tplLast,\n    \"current\" => $tplCurrentDocument\n);\n/*\n    Param: tpl\n\n    Purpose:\n    User defined chunk to format the documents \n\n    Options:\n    - Any valid chunk name\n    - Code via @CODE\n    - File via @FILE\n\n    Default:\n    [LANG]\n*/\n/*\n    Param: tplAlt\n\n    Purpose:\n    User defined chunk to format every other document\n\n    Options:\n    - Any valid chunk name\n    - Code via @CODE\n    - File via @FILE\n\n    Default:\n    &tpl\n*/\n/*\n    Param: tplFirst\n\n    Purpose:\n    User defined chunk to format the first document \n\n    Options:\n    - Any valid chunk name\n    - Code via @CODE\n    - File via @FILE\n\n    Default:\n    &tpl\n*/\n/*\n    Param: tplLast\n\n    Purpose:\n    User defined chunk to format the last document \n\n    Options:\n    - Any valid chunk name\n    - Code via @CODE\n    - File via @FILE\n\n    Default:\n    &tpl\n*/\n/*\n    Param: tplCurrentDocument\n\n    Purpose:\n    User defined chunk to format the current document\n\n    Options:\n    - Any valid chunk name\n    - Code via @CODE\n    - File via @FILE\n\n    Default:\n    &tpl\n*/\n$orderBy = $ditto->parseOrderBy($orderBy,$randomize);\n/*\n    Param: orderBy\n\n    Purpose:\n    Sort the result set\n\n    Options:\n    Any valid MySQL style orderBy statement\n\n    Default:\n    createdon DESC\n*/\n//-------------------------------------------------------------------- */\n$templates = $ditto->template->process($templates);\n    // parse the templates for TV\'s and store them for later use\n\n$ditto->setDisplayFields($ditto->template->fields,$hiddenFields);\n    // parse hidden fields\n    \n$ditto->parseFields($placeholders,$seeThruUnpub,$dateSource,$randomize);\n    // parse the fields into the field array\n    \n$documentIDs = $ditto->determineIDs($IDs, $idType, $ditto->fields[\"backend\"][\"tv\"], $orderBy, $depth, $showPublishedOnly, $seeThruUnpub, $hideFolders, $hidePrivate, $showInMenuOnly, $where, $keywords, $dateSource, $queryLimit, $display, $filter,$paginate, $randomize);\n    // retrieves a list of document IDs that meet the criteria and populates the $resources array with them\n$count = count($documentIDs);\n    // count the number of documents to be retrieved\n$count = $count-$offset;\n    // handle the offset\n\nif ($count > 0) {\n    // if documents are returned continue with execution\n    \n    $total = ($total == \"all\") ? $count : min($total,$count);\n        // set total equal to count if all documents are to be included\n    \n    $display = ($display == \"all\") ? min($count,$total) : min($display,$total);\n        // allow show to use all option\n\n    $stop = ($save != \"1\") ? min($total-$start,$display) : min($count,$total);\n        // set initial stop count\n\n    if($paginate == 1) {\n        $paginateAlwaysShowLinks = isset($paginateAlwaysShowLinks)? $paginateAlwaysShowLinks : 0;\n        /*\n            Param: paginateAlwaysShowLinks\n\n            Purpose:\n            Determine whether or not to always show previous next links\n\n            Options:\n            0 - off\n            1 - on\n\n            Default:\n            0 - off\n        \n            Related:\n            - <paginate>\n            - <paginateSplitterCharacter>\n        */\n        $paginateSplitterCharacter = isset($paginateSplitterCharacter)? $paginateSplitterCharacter : $_lang[\'button_splitter\'];\n        /*\n            Param: paginateSplitterCharacter\n\n            Purpose:\n            Splitter to use if always show is disabled\n\n            Options:\n            Any valid character\n\n            Default:\n            [LANG]\n        \n            Related:\n            - <paginate>\n            - <paginateSplitterCharacter>\n        */\n        $tplPaginatePrevious = isset($tplPaginatePrevious)? $ditto->template->fetch($tplPaginatePrevious) : \"<a href=\'[+url+]\' class=\'ditto_previous_link\'>[+lang:previous+]</a>\";\n        /*\n            Param: tplPaginatePrevious\n\n            Purpose:\n            Template for the previous link\n\n            Options:\n            - Any valid chunk name\n            - Code via @CODE\n            - File via @FILE\n\n            Placeholders:\n            url - URL for the previous link\n            lang:previous - value of \'prev\' from the language file\n        \n            Related:\n            - <tplPaginateNext>\n            - <paginateSplitterCharacter>\n        */\n        $tplPaginateNext = isset($tplPaginateNext)? $ditto->template->fetch($tplPaginateNext) : \"<a href=\'[+url+]\' class=\'ditto_next_link\'>[+lang:next+]</a>\";\n        /*\n            Param: tplPaginateNext\n\n            Purpose:\n            Template for the next link\n\n            Options:\n            - Any valid chunk name\n            - Code via @CODE\n            - File via @FILE\n\n            Placeholders:\n            url - URL for the next link\n            lang:next - value of \'next\' from the language file\n        \n            Related:\n            - <tplPaginatePrevious>\n            - <paginateSplitterCharacter>\n        */\n        $tplPaginateNextOff = isset($tplPaginateNextOff)? $ditto->template->fetch($tplPaginateNextOff) : \"<span class=\'ditto_next_off ditto_off\'>[+lang:next+]</span>\";\n        /*\n            Param: tplPaginateNextOff\n\n            Purpose:\n            Template for the inside of the next link\n\n            Options:\n            - Any valid chunk name\n            - Code via @CODE\n            - File via @FILE\n\n            Placeholders:\n            lang:next - value of \'next\' from the language file\n        \n            Related:\n            - <tplPaginatePrevious>\n            - <paginateSplitterCharacter>\n        */\n        $tplPaginatePreviousOff = isset($tplPaginatePreviousOff)? $ditto->template->fetch($tplPaginatePreviousOff) : \"<span class=\'ditto_previous_off ditto_off\'>[+lang:previous+]</span>\";\n        /*\n            Param: tplPaginatePreviousOff\n\n            Purpose:\n            Template for the previous link when it is off\n\n            Options:\n            - Any valid chunk name\n            - Code via @CODE\n            - File via @FILE\n\n            Placeholders:\n            lang:previous - value of \'prev\' from the language file\n    \n            Related:\n            - <tplPaginatePrevious>\n            - <paginateSplitterCharacter>\n        */\n        $tplPaginatePage = isset($tplPaginatePage)? $ditto->template->fetch($tplPaginatePage) : \"<a class=\'ditto_page\' href=\'[+url+]\'>[+page+]</a>\";\n        /*\n            Param: tplPaginatePage\n\n            Purpose:\n            Template for the page link\n\n            Options:\n            - Any valid chunk name\n            - Code via @CODE\n            - File via @FILE\n\n            Placeholders:\n            url - url for the page\n            page - number of the page\n    \n            Related:\n            - <tplPaginatePrevious>\n            - <paginateSplitterCharacter>\n        */\n        $tplPaginateCurrentPage = isset($tplPaginateCurrentPage)? $ditto->template->fetch($tplPaginateCurrentPage) : \"<span class=\'ditto_currentpage\'>[+page+]</span>\";\n        /*\n            Param: tplPaginateCurrentPage\n\n            Purpose:\n            Template for the current page link\n\n            Options:\n            - Any valid chunk name\n            - Code via @CODE\n            - File via @FILE\n\n            Placeholders:\n            page - number of the page\n    \n            Related:\n            - <tplPaginatePrevious>\n            - <paginateSplitterCharacter>\n        */\n        \n        $ditto->paginate($start, $stop, $total, $display, $tplPaginateNext, $tplPaginatePrevious, $tplPaginateNextOff, $tplPaginatePreviousOff, $tplPaginatePage, $tplPaginateCurrentPage, $paginateAlwaysShowLinks, $paginateSplitterCharacter);\n            // generate the pagination placeholders\n    }\n\n    $dbFields = $ditto->fields[\"display\"][\"db\"];\n        // get the database fields\n    $TVs = $ditto->fields[\"display\"][\"tv\"];\n        // get the TVs\n    \n    switch($orderBy[\'parsed\'][0][1]) {\n        case \"DESC\":\n            $stop = ($ditto->prefetch === false) ? $stop + $start + $offset : $stop + $offset; \n            $start += $offset;\n        break;\n        case \"ASC\":\n            $start += $offset;\n            $stop += $start;\n        break;\n    }\n\n    if ($ditto->prefetch !== false) {\n        $documentIDs = array_slice($documentIDs,$start,$stop);\n            // set the document IDs equal to the trimmed array\n        $dbFields = array_diff($dbFields,$ditto->prefetch[\"fields\"][\"db\"]);\n            // calculate the difference between the database fields and those already prefetched\n        $dbFields[] = \"id\";\n            // append id to the db fields array\n        $TVs = array_diff($TVs,$ditto->prefetch[\"fields\"][\"tv\"]);\n            // calculate the difference between the tv fields and those already prefetched\n        $start = 0;\n        $stop = min($display,($queryLimit != 0) ? $queryLimit : $display,count($documentIDs));\n    } else {\n        $queryLimit = ($queryLimit == 0) ? \"\" : $queryLimit;\n    }\n    \n    $resource = $ditto->getDocuments($documentIDs, $dbFields, $TVs, $orderBy, $showPublishedOnly, 0, $hidePrivate, $where, $queryLimit, $keywords, $randomize, $dateSource);\n        // retrieves documents\n    $output = $header;\n        // initialize the output variable and send the header\n\n    if ($resource) {\n        if ($randomize != \"0\" && $randomize != \"1\") {\n            $resource = $ditto->weightedRandom($resource,$randomize,$stop);\n                // randomize the documents\n        }\n        \n        $resource = array_values($resource);\n\n        for ($x=$start;$x<$stop;$x++) {\n            $template = $ditto->template->determine($templates,$x,0,$stop,$resource[$x][\"id\"]);\n                // choose the template to use and set the code of that template to the template variable\n            $renderedOutput = $ditto->render($resource[$x], $template, $removeChunk, $dateSource, $dateFormat, $placeholders,$phx,abs($start-$x));\n                // render the output using the correct template, in the correct format and language\n            $modx->setPlaceholder($dittoID.\"item[\".abs($start-$x).\"]\",$renderedOutput);\n            /*\n                Placeholder: item[x]\n\n                Content:\n                Individual items rendered output\n            */\n            $output .= $renderedOutput;\n                // send the rendered output to the buffer\n        }\n    } else {\n        $output .= $ditto->noResults($noResults,$paginate);\n            // if no documents are found return a no documents found string\n    }\n    $output .= $footer;\n        // send the footer\n\n    // ---------------------------------------------------\n    // Save Object\n    // ---------------------------------------------------\n\n    if($save) {\n        $modx->setPlaceholder($dittoID.\"ditto_object\", $ditto);\n        $modx->setPlaceholder($dittoID.\"ditto_resource\", ($save == \"1\") ? array_slice($resource,$display) : $resource);\n    }\n} else {\n    $output = $header.$ditto->noResults($noResults,$paginate).$footer;\n}\n// ---------------------------------------------------\n// Handle Debugging\n// ---------------------------------------------------\n\nif ($debug == 1) {\n    $ditto_params =& $modx->event_params;\n    if (!isset($_GET[\"ditto_\".$dittoID.\"debug\"])) {\n    $_SESSION[\"ditto_debug_$dittoID\"] = $ditto->debug->render_popup($ditto, $ditto_base, $ditto_version, $ditto_params, $documentIDs, array(\"db\"=>$dbFields,\"tv\"=>$TVs), $display, $templates, $orderBy, $start, $stop, $total,$filter,$resource);\n    }\n    if (isset($_GET[\"ditto_\".$dittoID.\"debug\"])) {\n        switch ($_GET[\"ditto_\".$dittoID.\"debug\"]) {\n            case \"open\" :\n                exit($_SESSION[\"ditto_debug_$dittoID\"]);\n            break;\n            case \"save\" :\n                $ditto->debug->save($_SESSION[\"ditto_debug_$dittoID\"],\"ditto\".strtolower($ditto_version).\"_debug_doc\".$modx->documentIdentifier.\".html\");\n            break;\n        }\n    } else {\n        $output = $ditto->debug->render_link($dittoID,$ditto_base).$output;\n    }\n}\n\nreturn ($save != 3) ? $output : \"\";',0,'',''),(7,'Wayfinder','<strong>2.0</strong> Completely template-driven and highly flexible menu builder',0,5,0,'/*\n::::::::::::::::::::::::::::::::::::::::\n Snippet name: Wayfinder\n Short Desc: builds site navigation\n Version: 2.0\n Authors: \n	Kyle Jaebker (muddydogpaws.com)\n	Ryan Thrash (vertexworks.com)\n Date: February 27, 2006\n::::::::::::::::::::::::::::::::::::::::\nDescription:\n    Totally refactored from original DropMenu nav builder to make it easier to\n    create custom navigation by using chunks as output templates. By using templates,\n    many of the paramaters are no longer needed for flexible output including tables,\n    unordered- or ordered-lists (ULs or OLs), definition lists (DLs) or in any other\n    format you desire.\n::::::::::::::::::::::::::::::::::::::::\nExample Usage:\n    [[Wayfinder? &startId=`0`]]\n::::::::::::::::::::::::::::::::::::::::\n*/\n\n$wayfinder_base = $modx->config[\'base_path\'].\"assets/snippets/wayfinder/\";\n\n//Include a custom config file if specified\n$config = (isset($config)) ? \"{$wayfinder_base}configs/{$config}.config.php\" : \"{$wayfinder_base}configs/default.config.php\";\nif (file_exists($config)) {\n	include_once(\"$config\");\n}\n\ninclude_once(\"{$wayfinder_base}wayfinder.inc.php\");\n\nif (class_exists(\'Wayfinder\')) {\n   $wf = new Wayfinder();\n} else {\n    return \'error: Wayfinder class not found\';\n}\n\n$wf->_config = array(\n	\'id\' => isset($startId) ? $startId : $modx->documentIdentifier,\n	\'level\' => isset($level) ? $level : 0,\n	\'includeDocs\' => isset($includeDocs) ? $includeDocs : 0,\n	\'excludeDocs\' => isset($excludeDocs) ? $excludeDocs : 0,\n	\'ph\' => isset($ph) ? $ph : FALSE,\n	\'debug\' => isset($debug) ? TRUE : FALSE,\n	\'ignoreHidden\' => isset($ignoreHidden) ? $ignoreHidden : FALSE,\n	\'hideSubMenus\' => isset($hideSubMenus) ? $hideSubMenus : FALSE,\n	\'useWeblinkUrl\' => isset($useWeblinkUrl) ? $useWeblinkUrl : TRUE,\n	\'fullLink\' => isset($fullLink) ? $fullLink : FALSE,\n	\'nl\' => isset($removeNewLines) ? \'\' : \"\\n\",\n	\'sortOrder\' => isset($sortOrder) ? strtoupper($sortOrder) : \'ASC\',\n	\'sortBy\' => isset($sortBy) ? $sortBy : \'menuindex\',\n	\'limit\' => isset($limit) ? $limit : 0,\n	\'cssTpl\' => isset($cssTpl) ? $cssTpl : FALSE,\n	\'jsTpl\' => isset($jsTpl) ? $jsTpl : FALSE,\n	\'rowIdPrefix\' => isset($rowIdPrefix) ? $rowIdPrefix : FALSE,\n	\'textOfLinks\' => isset($textOfLinks) ? $textOfLinks : \'menutitle\',\n	\'titleOfLinks\' => isset($titleOfLinks) ? $titleOfLinks : \'pagetitle\',\n	\'displayStart\' => isset($displayStart) ? $displayStart : FALSE,\n);\n\n//get user class definitions\n$wf->_css = array(\n	\'first\' => isset($firstClass) ? $firstClass : \'\',\n	\'last\' => isset($lastClass) ? $lastClass : \'last\',\n	\'here\' => isset($hereClass) ? $hereClass : \'active\',\n	\'parent\' => isset($parentClass) ? $parentClass : \'\',\n	\'row\' => isset($rowClass) ? $rowClass : \'\',\n	\'outer\' => isset($outerClass) ? $outerClass : \'\',\n	\'inner\' => isset($innerClass) ? $innerClass : \'\',\n	\'level\' => isset($levelClass) ? $levelClass: \'\',\n	\'self\' => isset($selfClass) ? $selfClass : \'\',\n	\'weblink\' => isset($webLinkClass) ? $webLinkClass : \'\',\n);\n\n//get user templates\n$wf->_templates = array(\n	\'outerTpl\' => isset($outerTpl) ? $outerTpl : \'\',\n	\'rowTpl\' => isset($rowTpl) ? $rowTpl : \'\',\n	\'parentRowTpl\' => isset($parentRowTpl) ? $parentRowTpl : \'\',\n	\'parentRowHereTpl\' => isset($parentRowHereTpl) ? $parentRowHereTpl : \'\',\n	\'hereTpl\' => isset($hereTpl) ? $hereTpl : \'\',\n	\'innerTpl\' => isset($innerTpl) ? $innerTpl : \'\',\n	\'innerRowTpl\' => isset($innerRowTpl) ? $innerRowTpl : \'\',\n	\'innerHereTpl\' => isset($innerHereTpl) ? $innerHereTpl : \'\',\n	\'activeParentRowTpl\' => isset($activeParentRowTpl) ? $activeParentRowTpl : \'\',\n	\'categoryFoldersTpl\' => isset($categoryFoldersTpl) ? $categoryFoldersTpl : \'\',\n	\'startItemTpl\' => isset($startItemTpl) ? $startItemTpl : \'\',\n);\n\n//Process Wayfinder\n$output = $wf->run();\n\nif ($wf->_config[\'debug\']) {\n	$output .= $wf->renderDebugOutput();\n}\n\n//Ouput Results\nif ($wf->_config[\'ph\']) {\n    $modx->setPlaceholder($wf->_config[\'ph\'],$output);\n} else {\n    return $output;\n}',0,'',''),(8,'Breadcrumbs','<strong>1.0.2</strong> Configurable breadcrumb page-trail navigation',0,5,0,'/*\r\n * This snippet shows the path through the various levels of site structure. It\r\n * is NOT necessarily the path the user took to arrive at a given page.\r\n * Version: 1.0.2\r\n */\r\n\r\n/* -----------------------------------------------------------------------------\r\n * CONFIGURATION\r\n * -----------------------------------------------------------------------------\r\n * This section contains brief explanations of the available parameters.\r\n */\r\n\r\n/* General setup\r\n * -----------------------------------------------------------------------------\r\n */\r\n\r\n/* $maxCrumbs [ integer ]\r\n * Max number of elemetns to have in a breadcrumb path. The default 100 is an\r\n * arbitrarily high number that will essentially include everything. If you were\r\n * to set it to 2, and you were 5 levels deep, it would appear like:\r\n * HOME > ... > Level 3 > Level 4 > CURRENT PAGE\r\n * It should be noted that the \"home\" link, and the current page do not count as\r\n * they are managed by their own configuration settings.\r\n */\r\n( isset($maxCrumbs) ) ? $maxCrumbs : $maxCrumbs = 100;\r\n\r\n/* $pathThruUnPub [ 1 | 0 ]\r\n * When your path includes an unpublished folder, setting this to 1 (true) will\r\n * show all documents in path EXCEPT the unpublished. When set to 0 (false), the\r\n * path will not go \"through\" that unpublished folder and will stop there.\r\n */\r\n( isset($pathThruUnPub) ) ? $pathThruUnPub : $pathThruUnPub = 1;\r\n\r\n/* $respectHidemenu [ 0 | 1 ]\r\n * Setting this to 1 (true) will respect the hidemenu setting of the document\r\n * and not include it in trail.\r\n */\r\n( isset($respectHidemenu) ) ? (int)$respectHidemenu : $respectHidemenu = 1;\r\n\r\n/* $showCurrentCrumb [ 1 | 0 ]\r\n * Include the current page at the end of the trail. On by default.\r\n */\r\n( isset($showCurrentCrumb) ) ? $showCurrentCrumb : $showCurrentCrumb = 1;\r\n\r\n/* $currentAsLink [ 1 | 0 ]\r\n * If the current page is included, this parameter will show it as a link (1) or\r\n * just plain text (0).\r\n */\r\n( $currentAsLink ) ? $currentAsLink : $currentAsLink = 0;\r\n\r\n/* $linkTextField [ string ]\r\n * Prioritized list of fields to use as link text. Options are: pagetitle,\r\n * longtitle, description, menutitle. The first of these fields that has a value\r\n * will be the title.\r\n */\r\n( isset($linkTextField) ) ? $linkTextField : $linkTextField = \'menutitle,pagetitle,longtitle\';\r\n\r\n/* $linkDescField [ string ]\r\n * Prioritized list of fields to use as link title text. Options are: pagetitle,\r\n * longtitle, description, menutitle. The first of these fields that has a value\r\n * will be the title.\r\n */\r\n( isset($linkDescField) ) ? $linkDescField : $linkDescField = \'description,longtitle,pagetitle,menutitle\';\r\n\r\n/* $showCrumbsAsLinks [ 1 | 0 ]\r\n * If for some reason you want breadcrumbs to be text and not links, set to 0\r\n * (false).\r\n */\r\n( isset($showCrumbsAsLinks) ) ? $showCrumbsAsLinks : $showCrumbsAsLinks = 1;\r\n\r\n/* $templateSet [ string ]\r\n * The set of templates you\'d like to use. (Templates are defined below.) It\r\n * will default to defaultString which replicates the output of previous\r\n * versions.\r\n */\r\n( isset($templateSet) ) ? $templateSet : $templateSet = \'defaultString\';\r\n\r\n/* $crumbGap [ string ]\r\n * String to be shown to represent gap if there are more crumbs in trail than\r\n * can be shown. Note: if you would like to use an image, the entire image tag\r\n * must be provided. When making a snippet call, you cannot use \"=\", so use \"||\"\r\n * instead and it will be converted for you.\r\n */\r\n( isset($crumbGap) ) ? $crumbGap : $crumbGap = \'...\';\r\n\r\n/* $stylePrefix [ string ]\r\n * Breadcrumbs will add style classes to various parts of the trail. To avoid\r\n * class name conflicts, you can determine your own prefix. The following\r\n * classes will be attached:\r\n * crumbBox: Span that surrounds all crumb output\r\n * hideCrumb: Span that surrounds the \"...\" if there are more crumbs than will\r\n * be shown\r\n * currentCrumb: Span or A tag surrounding the current crumb\r\n * firstCrumb: Span that will be applied to first crumb, whether it is \"home\" or\r\n * not\r\n * lastCrumb: Span surrounding last crumb, whether it is the current page or\r\n * not\r\n * crumb: Class given to each A tag surrounding the intermediate crumbs (not\r\n * \"home\", \"current\", or \"hide\")\r\n * homeCrumb: Class given to the home crumb\r\n */\r\n( isset($stylePrefix) ) ? $stylePrefix : $stylePrefix = \'B_\';\r\n\r\n\r\n\r\n/* Home link parameters\r\n * -----------------------------------------------------------------------------\r\n * The home link is unique. It is a link that can be placed at the head of the\r\n * breadcrumb trail, even if it is not truly in the hierarchy.\r\n */\r\n\r\n/* $showHomeCrumb [ 1 | 0 ]\r\n * This toggles the \"home\" crumb to be added to the beginning of your trail.\r\n */\r\n( isset($showHomeCrumb) ) ? $showHomeCrumb : $showHomeCrumb = 1;\r\n\r\n/* $homeId [ integer ]\r\n * Usually the page designated as \"site start\" in MODx configuration is\r\n * considered the home page. But if you would like to use some other document,\r\n * you may explicitly define it.\r\n */\r\n( isset($homeId) ) ? (int)$homeId : $homeId = $modx->config[\'site_start\'];\r\n\r\n/* $homeCrumbTitle [ string ]\r\n * If you\'d like to use something other than the menutitle (or pagetitle) for\r\n * the home link.\r\n */\r\n( isset($homeCrumbTitle) ) ? $homeCrumbTitle : $homeCrumbTitle = \'\';\r\n\r\n/* $homeCrumbDescription [ string ]\r\n * If you\'d like to use a custom description (link title) on the home link. If\r\n * left blank, the title will follow the title order set in $titleField.\r\n */\r\n( isset($homeCrumbDescription) ) ? $homeCrumbDescription : $homeCrumbDescription = \'\';\r\n\r\n\r\n/* Custom behaviors\r\n * -----------------------------------------------------------------------------\r\n * The following parameters will alter the behavior of the Breadcrumbs based on\r\n * the page it is on.\r\n */\r\n\r\n/* $showCrumbsAtHome [ 1 | 0 ]\r\n * You can turn off Breadcrumbs all together on the home page by setting this to\r\n * 1 (true);\r\n */\r\n( isset($showCrumbsAtHome) ) ? $showCrumbsAtHome : $showCrumbsAtHome = 0;\r\n\r\n/* $hideOn [ string ]\r\n * Comma separated list of documents you don\'t want Breadcrumbs on at all. If\r\n * you have a LOT of pages like this, you might try $hideUnder or use another\r\n * template. This parameter is best for those rare odd balls - otherwise it will\r\n * become a pain to manage.\r\n */\r\n( isset($hideOn) ) ? $hideOn : $hideOn = \'\';\r\n\r\n/* $hideUnder [ string ]\r\n * Comma separated list of parent documents, whose CHILDREN you don\'t want\r\n * Breadcrumbs to appear on at all. This enables you to hide Breadcrumbs on a\r\n * whole folders worth of documents by specifying the parent only. The PARENT\r\n * will not have Breadcrumbs hidden however. If you wanted to hide the parent\r\n * and the children, put the parent ID in hideUnder AND hideOn.\r\n */\r\n( isset($hideUnder) ) ? $hideUnder : $hideUnder = \'\';\r\n\r\n/* $stopIds [ string ]\r\n * Comma separated list of document IDs that when reached, stops Breadcrumbs\r\n * from going any further. This is useful in situations like where you have\r\n * language branches, and you don\'t want the Breadcrumbs going past the \"home\"\r\n * of the language you\'re in.\r\n */\r\n( isset($stopIds) ) ? $stopIds : $stopIds = \'\';\r\n\r\n/* $ignoreIds [ string ]\r\n * Comma separated list of document IDs to explicitly ignore.\r\n */\r\n( isset($ignoreIds) ) ? $ignoreids : $ignoreids = \'\';\r\n\r\n/* Templates\r\n * -----------------------------------------------------------------------------\r\n * In an effort to keep the MODx chunks manager from getting mired down in lots\r\n * of templates, Breadcrumbs templates are included here. Two sets are provided\r\n * prefixed with defaultString, and defaultList. You can create as many more as\r\n * you like, each set with it\'s own prefix\r\n */\r\n$templates = array(\r\n    \'defaultString\' => array(\r\n        \'crumb\' => \'[+crumb+]\',\r\n        \'separator\' => \' &raquo; \',\r\n        \'crumbContainer\' => \'<span class=\"[+crumbBoxClass+]\">[+crumbs+]</span>\',\r\n        \'lastCrumbWrapper\' => \'<span class=\"[+lastCrumbClass+]\">[+lastCrumbSpanA+]</span>\',\r\n        \'firstCrumbWrapper\' => \'<span class=\"[+firstCrumbClass+]\">[+firstCrumbSpanA+]</span>\'\r\n    ),\r\n    \'defaultList\' => array(\r\n        \'crumb\' => \'<li>[+crumb+]</li>\',\r\n        \'separator\' => \'\',\r\n        \'crumbContainer\' => \'<ul class=\"[+crumbBoxClass+]\">[+crumbs+]</ul>\',\r\n        \'lastCrumbWrapper\' => \'<span class=\"[+lastCrumbClass+]\">[+lastCrumbSpanA+]</span>\',\r\n        \'firstCrumbWrapper\' => \'<span class=\"[+firstCrumbClass+]\">[+firstCrumbSpanA+]</span>\'\r\n    ),\r\n);\r\n\r\n\r\n/* -----------------------------------------------------------------------------\r\n * END CONFIGURATION\r\n * -----------------------------------------------------------------------------\r\n */\r\n\r\n// Return blank if necessary: on home page\r\nif ( !$showCrumbsAtHome && $homeId == $modx->documentObject[\'id\'] )\r\n{\r\n    return \'\';\r\n}\r\n// Return blank if necessary: specified pages\r\nif ( $hideOn || $hideUnder )\r\n{\r\n    // Create array of hide pages\r\n    $hideOn = str_replace(\' \',\'\',$hideOn);\r\n    $hideOn = explode(\',\',$hideOn);\r\n\r\n    // Get more hide pages based on parents if needed\r\n    if ( $hideUnder )\r\n    {\r\n        $hiddenKids = array();\r\n        // Get child pages to hide\r\n        $hideKidsQuery = $modx->db->select(\'id\',$modx->getFullTableName(\"site_content\"),\"parent IN ($hideUnder)\");\r\n        while ( $hideKid = $modx->db->getRow($hideKidsQuery) )\r\n        {\r\n            $hiddenKids[] = $hideKid[\'id\'];\r\n        }\r\n        // Merge with hideOn pages\r\n        $hideOn = array_merge($hideOn,$hiddenKids);\r\n    }\r\n\r\n    if ( in_array($modx->documentObject[\'id\'],$hideOn) )\r\n    {\r\n        return \'\';\r\n    }\r\n\r\n}\r\n\r\n\r\n// Initialize ------------------------------------------------------------------\r\n\r\n// Put certain parameters in arrays\r\n$stopIds = str_replace(\' \',\'\',$stopIds);\r\n$stopIds = explode(\',\',$stopIds);\r\n$linkTextField = str_replace(\' \',\'\',$linkTextField);\r\n$linkTextField = explode(\',\',$linkTextField);\r\n$linkDescField = str_replace(\' \',\'\',$linkDescField);\r\n$linkDescField = explode(\',\',$linkDescField);\r\n$ignoreIds = str_replace(\' \',\'\',$ignoreIds);\r\n$ignoreIds = explode(\',\',$ignoreIds);\r\n\r\n/* $crumbs\r\n * Crumb elements are: id, parent, pagetitle, longtitle, menutitle, description,\r\n * published, hidemenu\r\n */\r\n$crumbs = array();\r\n$parent = $modx->documentObject[\'parent\'];\r\n$output = \'\';\r\n$maxCrumbs += ($showCurrentCrumb) ? 1 : 0;\r\n\r\n// Replace || in snippet parameters that accept them with =\r\n$crumbGap = str_replace(\'||\',\'=\',$crumbGap);\r\n\r\n// Curent crumb ----------------------------------------------------------------\r\n\r\n// Decide if current page is to be a crumb\r\nif ( $showCurrentCrumb )\r\n{\r\n    $crumbs[] = array(\r\n        \'id\' => $modx->documentObject[\'id\'],\r\n        \'parent\' => $modx->documentObject[\'parent\'],\r\n        \'pagetitle\' => $modx->documentObject[\'pagetitle\'],\r\n        \'longtitle\' => $modx->documentObject[\'longtitle\'],\r\n        \'menutitle\' => $modx->documentObject[\'menutitle\'],\r\n        \'description\' => $modx->documentObject[\'description\']);\r\n}\r\n\r\n// Intermediate crumbs ---------------------------------------------------------\r\n\r\n\r\n// Iterate through parents till we hit root or a reason to stop\r\n$loopSafety = 0;\r\nwhile ( $parent && $loopSafety < 1000 )\r\n{\r\n    // Get next crumb\r\n    $tempCrumb = $modx->getPageInfo($parent,0,\"id,parent,pagetitle,longtitle,menutitle,description,published,hidemenu\");\r\n\r\n    // Check for include conditions & add to crumbs\r\n    if (\r\n        $tempCrumb[\'published\'] &&\r\n        ( !$tempCrumb[\'hidemenu\'] || !$respectHidemenu ) &&\r\n        !in_array($tempCrumb[\'id\'],$ignoreIds)\r\n    )\r\n    {\r\n        // Add crumb\r\n        $crumbs[] = array(\r\n        \'id\' => $tempCrumb[\'id\'],\r\n        \'parent\' => $tempCrumb[\'parent\'],\r\n        \'pagetitle\' => $tempCrumb[\'pagetitle\'],\r\n        \'longtitle\' => $tempCrumb[\'longtitle\'],\r\n        \'menutitle\' => $tempCrumb[\'menutitle\'],\r\n        \'description\' => $tempCrumb[\'description\']);\r\n    }\r\n\r\n    // Check stop conditions\r\n    if (\r\n        in_array($tempCrumb[\'id\'],$stopIds) ||  // Is one of the stop IDs\r\n        !$tempCrumb[\'parent\'] || // At root\r\n        ( !$tempCrumb[\'published\'] && !$pathThruUnPub ) // Unpublished\r\n    )\r\n    {\r\n        // Halt making crumbs\r\n        break;\r\n    }\r\n\r\n    // Reset parent\r\n    $parent = $tempCrumb[\'parent\'];\r\n\r\n    // Increment loop safety\r\n    $loopSafety++;\r\n}\r\n\r\n// Home crumb ------------------------------------------------------------------\r\n\r\nif ( $showHomeCrumb && $homeCrumb = $modx->getPageInfo($homeId,0,\"id,parent,pagetitle,longtitle,menutitle,description,published,hidemenu\") )\r\n{\r\n    $crumbs[] = array(\r\n    \'id\' => $homeCrumb[\'id\'],\r\n    \'parent\' => $homeCrumb[\'parent\'],\r\n    \'pagetitle\' => $homeCrumb[\'pagetitle\'],\r\n    \'longtitle\' => $homeCrumb[\'longtitle\'],\r\n    \'menutitle\' => $homeCrumb[\'menutitle\'],\r\n    \'description\' => $homeCrumb[\'description\']);\r\n}\r\n\r\n\r\n// Process each crumb ----------------------------------------------------------\r\n$pretemplateCrumbs = array();\r\n\r\nforeach ( $crumbs as $c )\r\n{\r\n\r\n    // Skip if we\'ve exceeded our crumb limit but we\'re waiting to get to home\r\n    if ( count($pretemplateCrumbs) > $maxCrumbs && $c[\'id\'] != $homeId )\r\n    {\r\n        continue;\r\n    }\r\n\r\n    $text = \'\';\r\n    $title = \'\';\r\n    $pretemplateCrumb = \'\';\r\n\r\n    // Determine appropriate span/link text: home link specified\r\n    if ( $c[\'id\'] == $homeId && $homeCrumbTitle )\r\n    {\r\n        $text = $homeCrumbTitle;\r\n    }\r\n    else\r\n    // Determine appropriate span/link text: home link not specified\r\n    {\r\n        for ($i = 0; !$text && $i < count($linkTextField); $i++)\r\n        {\r\n            if ( $c[$linkTextField[$i]] )\r\n            {\r\n                $text = $c[$linkTextField[$i]];\r\n            }\r\n        }\r\n    }\r\n\r\n    // Determine link/span class(es)\r\n    if ( $c[\'id\'] == $homeId )\r\n    {\r\n        $crumbClass = $stylePrefix.\'homeCrumb\';\r\n    }\r\n    else if ( $modx->documentObject[\'id\'] == $c[\'id\'] )\r\n    {\r\n        $crumbClass = $stylePrefix.\'currentCrumb\';\r\n    }\r\n    else\r\n    {\r\n        $crumbClass = $stylePrefix.\'crumb\';\r\n    }\r\n\r\n    // Make link\r\n    if (\r\n        ( $c[\'id\'] != $modx->documentObject[\'id\'] && $showCrumbsAsLinks ) ||\r\n        ( $c[\'id\'] == $modx->documentObject[\'id\'] && $currentAsLink )\r\n    )\r\n    {\r\n        // Determine appropriate title for link: home link specified\r\n        if ( $c[\'id\'] == $homeId && $homeCrumbDescription )\r\n        {\r\n            $title = htmlspecialchars($homeCrumbDescription);\r\n        }\r\n        else\r\n        // Determine appropriate title for link: home link not specified\r\n        {\r\n            for ($i = 0; !$title && $i < count($linkDescField); $i++)\r\n            {\r\n                if ( $c[$linkDescField[$i]] )\r\n                {\r\n                    $title = htmlspecialchars($c[$linkDescField[$i]]);\r\n                }\r\n            }\r\n        }\r\n\r\n\r\n        $pretemplateCrumb .= \'<a class=\"\'.$crumbClass.\'\" href=\"\'.$modx->makeUrl($c[\'id\']).\'\" title=\"\'.$title.\'\">\'.$text.\'</a>\';\r\n    }\r\n    else\r\n    // Make a span instead of a link\r\n    {\r\n       $pretemplateCrumb .= \'<span class=\"\'.$crumbClass.\'\">\'.$text.\'</span>\';\r\n    }\r\n\r\n    // Add crumb to pretemplate crumb array\r\n    $pretemplateCrumbs[] = $pretemplateCrumb;\r\n\r\n    // If we have hit the crumb limit\r\n    if ( count($pretemplateCrumbs) == $maxCrumbs )\r\n    {\r\n        if ( count($crumbs) > ($maxCrumbs + (($showHomeCrumb) ? 1 : 0)) )\r\n        {\r\n            // Add gap\r\n            $pretemplateCrumbs[] = \'<span class=\"\'.$stylePrefix.\'hideCrumb\'.\'\">\'.$crumbGap.\'</span>\';\r\n        }\r\n\r\n        // Stop here if we\'re not looking for the home crumb\r\n        if ( !$showHomeCrumb )\r\n        {\r\n            break;\r\n        }\r\n    }\r\n}\r\n\r\n// Put in correct order for output\r\n$pretemplateCrumbs = array_reverse($pretemplateCrumbs);\r\n\r\n// Wrap first/last spans\r\n$pretemplateCrumbs[0] = str_replace(\r\n    array(\'[+firstCrumbClass+]\',\'[+firstCrumbSpanA+]\'),\r\n    array($stylePrefix.\'firstCrumb\',$pretemplateCrumbs[0]),\r\n    $templates[$templateSet][\'firstCrumbWrapper\']\r\n);\r\n$pretemplateCrumbs[(count($pretemplateCrumbs)-1)] = str_replace(\r\n    array(\'[+lastCrumbClass+]\',\'[+lastCrumbSpanA+]\'),\r\n    array($stylePrefix.\'lastCrumb\',$pretemplateCrumbs[(count($pretemplateCrumbs)-1)]),\r\n    $templates[$templateSet][\'lastCrumbWrapper\']\r\n);\r\n\r\n// Insert crumbs into crumb template\r\n$processedCrumbs = array();\r\nforeach ( $pretemplateCrumbs as $pc )\r\n{\r\n    $processedCrumbs[] = str_replace(\'[+crumb+]\',$pc,$templates[$templateSet][\'crumb\']);\r\n}\r\n\r\n// Combine crumbs together into one string with separator\r\n$processedCrumbs = implode($templates[$templateSet][\'separator\'],$processedCrumbs);\r\n\r\n// Put crumbs into crumb container template\r\n$container = str_replace(\r\n    array(\'[+crumbBoxClass+]\',\'[+crumbs+]\'),\r\n    array($stylePrefix.\'crumbBox\',$processedCrumbs),\r\n    $templates[$templateSet][\'crumbContainer\']\r\n    );\r\n\r\n// Return crumbs\r\nreturn $container;',0,'',''),(9,'eForm','<strong>1.4.4.6</strong> Robust form parser/processor with validation, multiple sending options, chunk/page support for forms and reports, and file uploads',0,7,0,'# eForm 1.4.4.6 - Electronic Form Snippet\n# Original created by Raymond Irving 15-Dec-2004.\n# Version 1.3+ extended by Jelle Jager (TobyL) September 2006\n# -----------------------------------------------------\n# Captcha image support - thanks to Djamoer\n# Multi checkbox, radio, select support - thanks to Djamoer\n# Form Parser and extened validation - by Jelle Jager\n#\n# see eform/docs/eform.htm for history, usage and examples\n#\n\n# Set Snippet Paths\n$snipFolder = isset($snipFolder)?$snipFolder:\'eform\';\n$snipPath = $modx->config[\"base_path\"].\'assets/snippets/\'.$snipFolder.\'/\';\n\n\n# check if inside manager\nif ($modx->isBackend()) {\nreturn \'\'; # don\'t go any further when inside manager\n}\n\n//tidying up some casing errors in parameters\nif(isset($eformOnValidate)) $eFormOnValidate = $eformOnValidate;\nif(isset($eformOnBeforeMailSent)) $eFormOnBeforeMailSent = $eformOnBeforeMailSent;\nif(isset($eformOnMailSent)) $eFormOnMailSent = $eformOnMailSent;\nif(isset($eformOnValidate)) $eFormOnValidate = $eformOnValidate;\nif(isset($eformOnBeforeFormMerge)) $eFormOnBeforeFormMerge = $eformOnBeforeFormMerge;\nif(isset($eformOnBeforeFormParse)) $eFormOnBeforeFormParse = $eformOnBeforeFormParse;\n//for sottwell :)\nif(isset($eFormCSS)) $cssStyle = $eFormCSS;\n\n# Snippet customize settings\n$params = array (\n   // Snippet Path\n   \'snipPath\' => $snipPath, //includes $snipFolder\n	 \'snipFolder\' => $snipFolder,\n\n// eForm Params\n   \'vericode\' => isset($vericode)? $vericode:\"\",\n   \'formid\' => isset($formid)? $formid:\"\",\n   \'from\' => isset($from)? $from:$modx->config[\'emailsender\'],\n   \'fromname\' => isset($fromname)? $fromname:$modx->config[\'site_name\'],\n   \'to\' => isset($to)? $to:$modx->config[\'emailsender\'],\n   \'cc\' => isset($cc)? $cc:\"\",\n   \'bcc\' => isset($bcc)? $bcc:\"\",\n   \'subject\' => isset($subject)? $subject:\"\",\n   \'ccsender\' => isset($ccsender)?$ccsender:0,\n   \'sendirect\' => isset($sendirect)? $sendirect:0,\n   \'mselector\' => isset($mailselector)? $mailselector:0,\n   \'mobile\' => isset($mobile)? $mobile:\'\',\n   \'mobiletext\' => isset($mobiletext)? $mobiletext:\'\',\n   \'autosender\' => isset($autosender)? $autosender:$from,\n   \'autotext\' => isset($automessage)? $automessage:\"\",\n   \'category\' => isset($category)? $category:0,\n   \'keywords\' => isset($keywords)? $keywords:\"\",\n   \'gid\' => isset($gotoid)? $gotoid:$modx->documentIdentifier,\n   \'noemail\' => isset($noemail)? ($noemail):false,\n   \'saveform\' => isset($saveform)? ($saveform? true:false):true,\n   \'tpl\' => isset($tpl)? $tpl:\"\",\n   \'report\' => isset($report)? $report:\"\",\n   \'allowhtml\' => isset($allowhtml)? $allowhtml:0,\n   //Added by JJ\n   \'replyto\' => isset($replyto)? $replyto:\"\",\n   \'language\' => isset($language)? $language:$modx->config[\'manager_language\'],\n   \'thankyou\' => isset($thankyou)? $thankyou:\"\",\n   \'isDebug\' => isset($debug)? $debug:0,\n   \'reportAbuse\' => isset($reportAbuse)? $reportAbuse:false,\n   \'disclaimer\' => isset($disclaimer)?$disclaimer:\'\',\n   \'sendAsHtml\' => isset($sendAsHtml)?$sendAsHtml:false,\n   \'sendAsText\' => isset($sendAsText)?$sendAsText:false,\n   \'sessionVars\' => isset($sessionVars)?$sessionVars:false,\n   \'postOverides\' => isset($postOverides)?$postOverides:0,\n   \'eFormOnBeforeMailSent\' => isset($eFormOnBeforeMailSent)?$eFormOnBeforeMailSent:\'\',\n   \'eFormOnMailSent\' => isset($eFormOnMailSent)?$eFormOnMailSent:\'\',\n   \'eFormOnValidate\' => isset($eFormOnValidate)?$eFormOnValidate:\'\',\n   \'eFormOnBeforeFormMerge\' => isset($eFormOnBeforeFormMerge)?$eFormOnBeforeFormMerge:\'\',\n   \'eFormOnBeforeFormParse\' => isset($eFormOnBeforeFormParse)?$eFormOnBeforeFormParse:\'\',\n   \'cssStyle\' => isset($cssStyle)?$cssStyle:\'\',\n   \'jScript\' => isset($jScript)?$jScript:\'\',\n   \'submitLimit\' => (isset($submitLimit) &&  is_numeric($submitLimit))?$submitLimit*60:0,\n   \'protectSubmit\' => isset($protectSubmit)?$protectSubmit:1,\n   \'requiredClass\' => isset($requiredClass)?$requiredClass:\"required\",\n   \'invalidClass\' => isset($invalidClass)?$invalidClass:\"invalid\",\n   \'runSnippet\' => ( isset($runSnippet) && !is_numeric($runSnippet) )?$runSnippet:\'\',\n   \'autoSenderName\' => isset($autoSenderName)?$autoSenderName:\'\',\n   \'version\' => \'1.4.4\'\n);\n\n// pixelchutes PHx workaround\nforeach( $params as $key=>$val ) $params[ $key ] = str_replace( array(\'((\',\'))\'), array(\'[+\',\'+]\'), $val );\n\n# Start processing\n\ninclude_once ($snipPath.\"eform.inc.php\");\n\n$output = eForm($modx,$params);\n\n# Return\nreturn $output;',0,'',''),(10,'ListIndexer','<strong>1.0.1</strong> A flexible way to show the most recent Resources and other Resource lists',0,5,0,'// added in 1.0.1: hidePrivate (hide items from unauthorized users)\n//\n// Derived from ListIndex 0.6j by jaredc@honeydewdesign.com\n// Now supports Show In Menu\n//\n// This snippet was designed to be a VERY flexible way\n// of showing what has been recently added. You can use\n// this snippet to show news from one folder, or what has\n// been recently added site wide. You can even show what\'s\n// new in a \'section\' (everything under a defined folder)!\n\n// Configuration Settings\n\n   // Set the following snippet defaults the way you would normally\n   // use this snippet, then use snippet variables in other situations\n   // to override the default behaviors.\n\n   // GENERAL OPTIONS\n\n   // $rootFolder [ NULL | string (comma separated page id\'s) ]\n   // Decide which folder to pull recent documents from.\n   // If you want to specify a few folders, comma separate them.\n   // The default NULL will set current page as root. Using 0\n   // would search site wide. Can be set with snippet parameter\n   // $LIn_root like:\n   // [[ListIndexer?LIn_root=3,6,88]] \n   $rootFolder = NULL;\n\n   // $descendentDepth [ int ]\n   // How many levels below the root folder(s) do you want to\n   // include? Can be overridden in snippet call with LIn_depth:\n   // [[ListIndexer?LIn_depth=2]]\n   // Uncomment one of these common two or create your own:\n   // $descendentDepth = 1; // just children of root folder(s)\n   $descendentDepth = 0; // all decendents of root folder(s)\n\n   // $seeThruUnpub [ true | false ]\n   // When using descendents, do you want to consider files below\n   // an unpublished (hidden) folder? Usually no. But you decide.\n   // Snippet parameter: LIn_seeThru\n   // [[ListIndexer?LIn_seeThru=1]]\n   $seeThruUnpub = false;\n\n   // $seeShowInMenu [ true | false ]\n   // When using descendents, do you want to consider files flagged\n   // to be hidden from the menus? Usually no. But you decide.\n   // Snippet parameter: LIn_seeShowInMenu\n   // [[ListIndexer?LIn_seeShowInMenu=1]]\n   $seeShowInMenu = false;\n   \n   // $hidePrivate [ true | false ]\n   // Hide items from users that don\'t have appropriate\n   // rights to view. Usually true. But you decide.\n   // Snippet parameter: LIn_hidePrivate\n   // [[ListIndexer?LIn_hidePrivate=0]]\n   $hidePrivate = true;\n\n   // $mode [ \'short\' | \'full\' ]\n   // Defines whether this list should be a full, paged\n   // list of all documents, or a short list of the most\n   // recent few (how many will be defined next). Can be\n   // overridden in snippet call with $LIn_mode:\n   // [[ListIndexer?LIn_mode=full]]\n   $mode = \'short\';\n   \n   // $sortBy [ \'alpha\' | \'date\' | \'menuindex\' ]\n   // The default date will sort by most recent items first, but\n   // by using the \'alpha\' option, and using full mode, you could\n   // use this to create an index, or directory.\n   // Settable with snippet call $LIn_sort:\n   // [[ListIndexer?LIn_sort=alpha]]\n   $sortBy = \'date\';\n   \n   // $sortDir [ \'ASC\' | \'DESC\' ]\n   // Sort direction ascending or descending. Is applied to whatever $sortBy\n   // field you have chosen above. If left blank, menuindex and alpha will sort\n   // ASC and date DESC.\n   // $LIn_dir in snippet call:\n   // [[ListIndexer?LIn_dir=ASC&LIn_sortBy=menuindex]]\n   $sortDir = \'\';\n\n   // WHAT TO DISPLAY\n\n   // $defaultTitle [ string ]\n   // If you want a default title for your list\n   // you can declare it here. Or use an empty\n   // string to leave this off. This can be overridden\n   // in the snippet call with the variable $LIn_title:\n   // [[ListIndexer?LIn_title=Some new title]]\n   $defaultTitle = \'\';\n\n   // $shortDesc [ true | false ]\n   // Show the description on the short list, or not. Snippet\n   // parameter $LIn_sDesc:\n   // [[ListIndexer?LIn_sDesc=0]]\n   $shortDesc = true;\n\n   // $fullDesc [ true | false ]\n   // Show the description on the full list, or not. Snippet\n   // parameter $LIn_fDesc:\n   // [[ListIndexer?LIn_fDesc=0]]\n   $fullDesc = true;\n\n   // $linkToIndex [ int ]\n   // If you have a page set up as an \'index\' for all the \n   // documents in this list, you can link to it by specifying \n   // its id- can also be set in snippet call with LIn_link:\n   // [[ListIndexer?LIn_link=8]]\n   // The default 0 will eliminate this link\n   $linkToIndex = 0;\n\n   // $indexText [ string ]\n   // If you want a link to an index (probably a page running this\n   // snippet in \"full\" mode), you can declare what you want that\n   // link to say here. Or in the snippet call with LIn_indexText:\n   // [[ListIndexer?LIn_indexText=Financial News Index]]\n   $indexText = \'Index\';\n\n   // $showCreationDate [ true | false ]\n   // Decide to include date of creation in output or not. From\n   // snippet call $LIn_showDate use 1 (true) or 0 (false)\n   // [[ListIndexer?LIn_showDate=1]]\n   $showCreationDate = true;\n\n   // $dateFormat [ string ]\n   // Used to define how date will be displayed (if using date)\n   // Y = 4 digit year     y = 2 digit year\n   // M = Jan - Dec        m = 01 - 12\n   // D = Sun - Sat        d = 01 -31\n   // Other standard PHP characters may be used\n   $dateFormat = \'Y.m.d\';\n\n   // $shortQty [ int ]\n   // Number of entries to list in the short list. Can be\n   // overridden in snippet call with $LIn_sQty:\n   //[[ListIndexer?LIn_sQty=3]]\n   $shortQty = 3;\n\n   // PAGING\n\n   // $fullQty [ int ]\n   // Number of entries PER PAGE to list in the full list\n   // Can be overridden in snippet call with $LIn_fQty:\n   // [[ListIndexer?LIn_fQty=20]]\n   // To show all set to 0 here or in snippet call\n   $fullQty = 10;\n   \n   // $pageSeparator [ string ]\n   // What you want your page number links to be separated by.\n   // You NEED to include spaces if you want them. They are NOT\n   // created automatically to facilitate styling ability.\n   // For instance, \" | \" will render links like:\n   // 1 | 2 | 3 | 4\n   $pageSeparator = \" | \";\n   \n   // $pgPosition [ \'top\' | \'bottom\' | \'both\']\n   // Pick where you want your pagination links to appear.\n   $pgPosition = \'both\';\n\n   // PERFORMANCE\n\n   // $useFastUrls [ true | false ]\n   // IMPORTANT- using fast urls will reduce database queries\n   // and improve performance WHEN IN FULL MODE ONLY and \n   // should NOT be used when multiple instances of this snippet\n   // appear on the same page. With snippet call LIn_fast use 1\n   // (true) or 0 (false)\n   // [[ListIndexer?LIn_fast=0]]\n   $useFastUrls = false;\n\n   // $newLinesForLists [ true | false ]\n   // Depending on how you want to style your list, you may\n   // or may not want your <li>s on new lines. Generally, if you\n   // are displaying then inline (horizontal, you do not want new\n   // lines, but standard vertical block styling you do. This is\n   // for IE, real browsers don\'t care.\n   $newLinesForLists = true;\n\n// Styles\n//\n// The following are the styles included in this snippet. It is up\n// to you to include these styles in your stylesheet to get them to\n// look the way you want.\n\n   // div.LIn_title {}          List title div\n   // ul.LIn_fullMode {}        UL class\n   // ul.LIn_shortMode {}       UL class\n   // span.LIn_date {}          Span surrounding pub/created date\n   // span.LIn_desc {}          Span surrounding description\n   // div.LIn_pagination        Div surrounding pagination links\n   // span.LIn_currentPage {}   Span surrounding current page of\n   //                           pagination (which wouldn\'t be css-able\n   //                           by virtue of its <a> tag)\n\n\n// **********************************************************************\n// END CONFIG SETTINGS\n// THE REST SHOULD TAKE CARE OF ITSELF\n// **********************************************************************\n\n// Take care of IE list issue\n$ie = ($newLinesForLists)? \"\\n\" : \'\' ;\n\n// Use snippet call defined variables if set\n$activeTitle = (isset($LIn_title))? $LIn_title : $defaultTitle ;\n$mode = (isset($LIn_mode))? $LIn_mode : $mode ;\n$descendentDepth = (isset($LIn_depth))? $LIn_depth : $descendentDepth ;\n$seeThruUnpub = (isset($LIn_seeThru))? $LIn_seeThru : $seeThruUnpub ;\n$seeShowInMenu = (isset($LIn_seeShowInMenu))? $LIn_seeShowInMenu : $seeShowInMenu ;\n$hidePrivate = (isset($LIn_hidePrivate))? $LIn_hidePrivate : $hidePrivate;\n$linkToIndex = (isset($LIn_link))? $LIn_link : $linkToIndex ;\n$rootFolder = (isset($LIn_root))? $LIn_root : $rootFolder ;\n$shortQty = (isset($LIn_sQty))? $LIn_sQty : $shortQty ;\n$fullQty = (isset($LIn_fQty))? $LIn_fQty : $fullQty ;\n$showCreationDate = (isset($LIn_showDate))? $LIn_showDate : $showCreationDate ;\n$indexText = (isset($LIn_indexText))? $LIn_indexText : $indexText ;\n$useFastUrls = (isset($LIn_fast))? $LIn_fast : $useFastUrls ;\n$sortBy = (isset($LIn_sort))? $LIn_sort : $sortBy;\n$shortDesc = (isset($LIn_sDesc))? $LIn_sDesc : $shortDesc ;\n$fullDesc = (isset($LIn_fDesc))? $LIn_fDesc : $fullDesc ;\n$sortDir = (isset($LIn_dir))? $LIn_dir : $sortDir ;\nif ($sortDir == \'\') $sortDir = ($sortBy == \'date\')? \'DESC\' : \'ASC\' ;\n\n\n// Make useful variable shortcut for the content table\n//$tbl = $modx->dbConfig[\'dbase\'] . \".\" . $modx->dbConfig[\'table_prefix\'] . \"site_content\";\n$tblsc = $modx->getFullTableName(\"site_content\");\n$tbldg = $modx->getFullTableName(\"document_groups\");\n\n// Initialize output\n$output = \'\';\n\n// ---------------------------------------------------\n// ---------------------------------------------------\n// Query db for parent folders, or not. First check to\n// see if a querystring cheat has been provided- this\n// should speed things up considerably when using this\n// in full mode. (a.k.a. fastUrls)\n// ---------------------------------------------------\n// ---------------------------------------------------\n$inFolder= isset($_GET[\'LIn_f\'])? $_GET[\'LIn_f\']: 0;\nif ((!$inFolder && $useFastUrls) || !$useFastUrls ){\n  // Only run all the database queries if we don\'t already\n  // know the folders AND fastUrls are desired.\n\n  // ---------------------------------------------------\n  // Seed list of viable parents\n  // ---------------------------------------------------\n\n  if ($rootFolder == NULL){\n    $rootFolder = $modx->documentIdentifier;\n  }\n  // Set root level parent array\n  $seedArray = explode(\',\',$rootFolder);\n  $parentsArray = array();\n  foreach($seedArray AS $seed){\n    $parentsArray[\'level_0\'][] = $seed;\n  }\n\n  // ---------------------------------------------------\n  // Make array of all allowed parents\n  // ---------------------------------------------------\n\n  // Process valid parents\n  $levelCounter = 1;\n\n  while (((count($parentsArray) < $descendentDepth) || ($descendentDepth == 0)) && ($levelCounter <= count($parentsArray)) && ($levelCounter < 10)){\n\n    // Find all decendant parents for this level\n    $pLevel = \'level_\'.($levelCounter - 1);\n    $tempLevelArray = $parentsArray[$pLevel];\n\n    foreach($tempLevelArray AS $p){\n\n      // Get children who are parents (isfolder = 1)\n      $validParentSql = \"\";\n      $validParentSql .= \"SELECT id FROM $tblsc sc WHERE \";\n      $validParentSql .= \"isfolder = 1 AND parent = $p \";\n      $validParentSql .= \"AND sc.deleted=0 \";\n      $validParentSql .= ($seeThruUnpub)? \";\" : \"AND sc.published = 1;\";\n\n      // Run statement\n      $rsTempParents = $modx->dbQuery($validParentSql);\n      // Get number of results\n      $countTempParents = $modx->recordCount($rsTempParents);\n\n      // If there are results, put them in an array\n      $tempValidArray = false;\n      if ($countTempParents){\n        for ($i=0;$i<$countTempParents;$i++){\n          $tempId = $modx->fetchRow($rsTempParents);\n          $tempValidArray[] = $tempId[\'id\'];\n        } // end while\n      } // end if\n\n	  // populate next level of array \n	  if ($tempValidArray){\n	    foreach($tempValidArray AS $kid){\n	      $kidLevel = \'level_\'.$levelCounter;\n	      $parentsArray[$kidLevel][] = $kid;\n	    } // end foreach\n\n	  } // end if\n    } // end foreach\n\n    // Do next level\n    $levelCounter++;\n\n  } // end while\n\n  // Finalize list of parents\n  $validParents = \'\';\n  foreach ($parentsArray AS $level){\n    foreach ($level AS $validP){\n      $validParents .= $validP . \',\';\n    }\n  }\n\n  // Remove trailing comma\n  $validParents = substr($validParents,0,strlen($validParents)-1);\n\n} else {\n  $validParents = $_GET[\'LIn_f\'];\n}\n\n// ---------------------------------------------------\n// Make appropriate SQL statement to pull recent items\n// ---------------------------------------------------\n\n// get document groups for current user\nif($docgrp = $modx->getUserDocGroups()) $docgrp = implode(\",\",$docgrp);\n\n$access = \" (\".($modx->isFrontend() ? \"sc.privateweb=0\":\"1=\'\".$_SESSION[\'mgrRole\'].\"\' OR sc.privatemgr=0\").\n          (!$docgrp ? \"\":\" OR dg.document_group IN ($docgrp)\").\") AND \";\n\n// Initialize\n$recentSql = \"\";\n$recentSql .= \"SELECT sc.id, pagetitle, description\";\n// Include pub_date or createdon date if date is desired\n$recentSql .= ($showCreationDate)? \", IF(pub_date > 0, pub_date, createdon) AS pubDate \": \" \" ;\n$recentSql .= \"FROM $tblsc sc LEFT JOIN $tbldg dg on dg.document = sc.id \";\n$recentSql .= \"WHERE \";\n$recentSql .= ($hidePrivate)? $access:\"\";\n// Look everywhere, or just under valid parents\n$recentSql .= (($rootFolder == 0) && $seeThruUnpub && ($descendentDepth == 0))? \"\" : \"parent IN ($validParents) AND \" ;\n// Published\n$recentSql .= \"sc.published = 1 \";\n// Show In Menu\n$recentSql .= ($seeShowInMenu)? \" \" : \" AND sc.hidemenu=0 \" ;\n// Not deleted\n$recentSql .= \"AND sc.deleted=0 \";\n// Choose sort method\nswitch ($sortBy){\n  case \'alpha\':\n    $recentSql .= \"ORDER BY pagetitle \";\n    break;\n  case \'menuindex\':\n    $recentSql .= \"ORDER BY menuindex \";\n    break;\n  default:\n    $recentSql .= \"ORDER BY IF(pub_date>0, pub_date, createdon) \";\n    break;\n}\n// Provide a sort direction\n$recentSql .= $sortDir;\n\n// If this is a short list, just pull a limited number\n$recentSql .= ($mode == \'short\')? \" LIMIT $shortQty;\" : \";\" ;\n\n// Run statement\n$rsRecent = $modx->dbQuery($recentSql);\n// Count records\n$recentLimit = $modx->recordCount($rsRecent);\n\n// ---------------------------------------------------\n// Generate pagination string if needed\n// ---------------------------------------------------\n$offsetParam = isset($_GET[\'LIn_o\'])? $_GET[\'LIn_o\']: 0;\n$offset = ($offsetParam && ($mode == \'full\'))? $offsetParam : 0 ;\n$pagination = \'\';\n\n// Don\'t bother unless there are enough records to justify it\nif ( ($mode == \'full\') && ($recentLimit > $fullQty) && ($fullQty) ){\n  $fullUrl = $_SERVER[\'REQUEST_URI\'];\n  $urlPieces = parse_url($fullUrl);\n  $urlPath = $urlPieces[\'path\'];\n  $otherQs = \'\';\n\n  if ($urlPieces[\'query\']){\n    foreach($_GET AS $qsKey=>$qsValue){\n	  if (($qsKey != \'LIn_o\') && ($qsKey != \'LIn_f\')){\n	    $otherQs .= \'&\'.$qsKey.\'=\'.$qsValue;\n	  }\n	}\n  } \n  \n  $fastUrl = $urlPath.\'?LIn_f=\'.$validParents.$otherQs;\n\n  // Determine number of pages needed to show results\n  $totalPages = ceil($recentLimit/$fullQty);\n  \n  // Make links\n  for ($j = 0 ; $j < $totalPages; $j++){\n    // only include links to OTHER pages, not current page\n    if($offset == $j*$fullQty){\n	  $pagination .= \'<span class=\"LIn_currentPage\">\'.($j+1) .\'</span>\';\n	} else {\n      $pagination .= \'<a href=\"\'.$fastUrl.\'&LIn_o=\'.($j*$fullQty).\'\" title=\"\'.($j+1).\'\">\'.($j+1) .\'</a>\';\n	}\n	if ($j < $totalPages-1){\n	  $pagination .= $pageSeparator;\n	}\n  }\n  \n  // Make final pagination link set in it\'s own div\n  $pagination = \'<div class=\"LIn_pagination\">\'.\"\\n\".$pagination.\"\\n</div>\\n\";\n  \n}\n\n\n// ---------------------------------------------------\n// Create title if wanted\n// ---------------------------------------------------\n\nif ($activeTitle){\n  $output .= \'<div class=\"LIn_title\">\'.$activeTitle.\'</div>\'.\"\\n\";\n}\n\n// ---------------------------------------------------\n// Create list of recent items\n// ---------------------------------------------------\n\n// Include pagination\n$output .= ($pgPosition == \'top\' || $pgPosition == \'both\')? $pagination : \'\' ;\n\n$output .= \'<ul class=\"LIn_\'.$mode.\'Mode\">\' . $ie;\n\n$recentCounter = $offset;\nif ($mode == \'short\') {\n  $recentCounterLimit = min($shortQty,$recentLimit);\n} else {\n  $recentCounterLimit = ($fullQty)? min(($fullQty+$offset),$recentLimit) : $recentLimit ;\n}\n\nwhile (($recentCounter < $recentCounterLimit) && $rsRecent && ($recentLimit > 0)){\n  mysql_data_seek($rsRecent,$recentCounter);\n  $recentRecord = $modx->fetchRow($rsRecent);\n  $output .= \'<li>\';\n  // Link to page\n  $output .= \'<a href=\"[~\'.$recentRecord[\'id\'].\'~]\" title=\"\'.strip_tags($recentRecord[\'pagetitle\']).\'\">\'.$recentRecord[\'pagetitle\'].\'</a> \';\n  // Date if desired\n  if ($showCreationDate){\n    $output .= \'<span class=\"LIn_date\">\'.date($dateFormat,$recentRecord[\'pubDate\']).\'</span> \';\n  }\n  // Description if desired\n  if ((($mode == \'short\') && ($shortDesc)) || (($mode == \'full\') && ($fullDesc))){\n   $output .= \'<span class=\"LIn_desc\">\'.$recentRecord[\'description\'].\'</span>\';\n  }\n  // wrap it up\n  $output .= \'</li>\' . $ie;\n  $recentCounter ++;\n}\n\n$output .= \'</ul>\' . $ie;\n\n$output .= ($pgPosition == \'bottom\' || $pgPosition == \'both\')? $pagination : \'\' ;\n\n// ---------------------------------------------------\n// Link to index\n// ---------------------------------------------------\n\nif ($linkToIndex) {\n\n  $output .= \'<div class=\"LIn_index\">\';\n  $output .= \'<a href=\"[~\'.$linkToIndex.\'~]\" title=\"\'.$indexText.\'\">\'.$indexText.\'</a>\';\n  $output .= \'</div>\';\n\n}\n\n// ---------------------------------------------------\n// Send to browser\n// ---------------------------------------------------\n\nreturn $output;',0,'',''),(11,'Reflect','<strong>2.1.0</strong> Generates date-based archives using Ditto',0,6,0,'/*\n * Author: \n *      Mark Kaplan for MODx CMF\n * \n * Note: \n *      If Reflect is not retrieving its own documents, make sure that the\n *          Ditto call feeding it has all of the fields in it that you plan on\n *       calling in your Reflect template. Furthermore, Reflect will ONLY\n *          show what is currently in the Ditto result set.\n *       Thus, if pagination is on it will ONLY show that page\'s items.\n*/\n \n\n// ---------------------------------------------------\n//  Includes\n// ---------------------------------------------------\n\n$reflect_base = isset($reflect_base) ? $modx->config[\'base_path\'].$reflect_base : $modx->config[\'base_path\'].\"assets/snippets/reflect/\";\n/*\n    Param: ditto_base\n    \n    Purpose:\n    Location of Ditto files\n\n    Options:\n    Any valid folder location containing the Ditto source code with a trailing slash\n\n    Default:\n    [(base_path)]assets/snippets/ditto/\n*/\n\n$config = (isset($config)) ? $config : \"default\";\n/*\n    Param: config\n\n    Purpose:\n    Load a custom configuration\n\n    Options:\n    \"default\" - default blank config file\n    CONFIG_NAME - Other configs installed in the configs folder or in any folder within the MODx base path via @FILE\n\n    Default:\n    \"default\"\n    \n    Related:\n    - <extenders>\n*/\n\nrequire($reflect_base.\"configs/default.config.php\");\nrequire($reflect_base.\"default.templates.php\");\nif ($config != \"default\") {\n    require((substr($config, 0, 5) != \"@FILE\") ? $reflect_base.\"configs/$config.config.php\" : $modx->config[\'base_path\'].trim(substr($config, 5)));\n}\n\n// ---------------------------------------------------\n//  Parameters\n// ---------------------------------------------------\n\n$id = isset($id) ? $id.\"_\" : false;\n/*\n    Param: id\n\n    Purpose:\n    Unique ID for this Ditto instance for connection with other scripts (like Reflect) and unique URL parameters\n\n    Options:\n    Any valid folder location containing the Ditto source code with a trailing slash\n\n    Default:\n    \"\" - blank\n*/\n$getDocuments = isset($getDocuments) ? $getDocuments : 0;\n/*\n    Param: getDocuments\n\n    Purpose:\n    Force Reflect to get documents\n\n    Options:\n    0 - off\n    1 - on\n    \n    Default:\n    0 - off\n*/\n$showItems = isset($showItems) ? $showItems : 1;\n/*\n    Param: showItems\n\n    Purpose:\n    Show individual items in the archive\n\n    Options:\n    0 - off\n    1 - on\n    \n    Default:\n    1 - on\n*/\n$groupByYears = isset($groupByYears)? $groupByYears : 1;\n/*\n    Param: groupByYears\n\n    Purpose:\n    Group the archive by years\n\n    Options:\n    0 - off\n    1 - on\n    \n    Default:\n    1 - on\n*/\n$targetID = isset($targetID) ? $targetID : $modx->documentObject[\'id\'];\n/*\n    Param: targetID\n\n    Purpose:\n    ID for archive links to point to\n\n    Options:\n    Any MODx document with a Ditto call setup with extenders=`dateFilter`\n    \n    Default:\n    Current MODx Document\n*/\n$dateSource = isset($dateSource) ? $dateSource : \"createdon\";\n/*\n    Param: dateSource\n\n    Purpose:\n    Date source to display for archive items\n\n    Options:\n    # - Any UNIX timestamp from MODx fields or TVs such as createdon, pub_date, or editedon\n    \n    Default:\n    \"createdon\"\n    \n    Related:\n    - <dateFormat>\n*/\n$dateFormat = isset($dateFormat) ? $dateFormat : \"%d-%b-%y %H:%M\";  \n/*\n    Param: dateFormat\n\n    Purpose:\n    Format the [+date+] placeholder in human readable form\n\n    Options:\n    Any PHP valid strftime option\n\n    Default:\n    \"%d-%b-%y %H:%M\"\n    \n    Related:\n    - <dateSource>\n*/\n$yearSortDir = isset($yearSortDir) ? $yearSortDir : \"DESC\";\n/*\n    Param: yearSortDir\n\n    Purpose:\n    Direction to sort documents\n\n    Options:\n    ASC - ascending\n    DESC - descending\n\n    Default:\n    \"DESC\"\n    \n    Related:\n    - <monthSortDir>\n*/\n$monthSortDir = isset($monthSortDir) ? $monthSortDir : \"ASC\";\n/*\n    Param: monthSortDir\n\n    Purpose:\n    Direction to sort the months\n\n    Options:\n    ASC - ascending\n    DESC - descending\n\n    Default:\n    \"ASC\"\n    \n    Related:\n    - <yearSortDir>\n*/\n$start = isset($start)? intval($start) : 0;\n/*\n    Param: start\n\n    Purpose:\n    Number of documents to skip in the results\n    \n    Options:\n    Any number\n\n    Default:\n    0\n*/  \n$phx = (isset($phx))? $phx : 1;\n/*\n    Param: phx\n\n    Purpose:\n    Use PHx formatting\n\n    Options:\n    0 - off\n    1 - on\n    \n    Default:\n    1 - on\n*/\n\n// ---------------------------------------------------\n//  Initialize Ditto\n// ---------------------------------------------------\n$placeholder = ($id != false && $getDocuments == 0) ? true : false;\nif ($placeholder === false) {\n    $rID = \"reflect_\".rand(1,1000);\n    $itemTemplate = isset($tplItem) ? $tplItem: \"@CODE:\".$defaultTemplates[\'item\'];\n    $dParams = array(\n        \"id\" => \"$rID\",\n        \"save\" => \"3\",  \n        \"summarize\" => \"all\",\n        \"tpl\" => $itemTemplate,\n    );\n    \n    $source = $dittoSnippetName;\n    $params = $dittoSnippetParameters;\n        // TODO: Remove after 3.0\n        \n    if (isset($params)) {\n        $givenParams = explode(\"|\",$params);\n        foreach ($givenParams as $parameter) {\n            $p = explode(\":\",$parameter);\n            $dParams[$p[0]] = $p[1];\n        }\n    }\n    /*\n        Param: params\n\n        Purpose:\n        Pass parameters to the Ditto instance used to retreive the documents\n\n        Options:\n        Any valid ditto parameters in the format name:value \n        with multiple parameters separated by a pipe (|)\n        \n        Note:\n        This parameter is only needed for config, start, and phx as you can\n        now simply use the parameter as if Reflect was Ditto\n\n        Default:\n        [NULL]\n    */\n    \n    $reflectParameters = array(\'reflect_base\',\'config\',\'id\',\'getDocuments\',\'showItems\',\'groupByYears\',\'targetID\',\'yearSortDir\',\'monthSortDir\',\'start\',\'phx\',\'tplContainer\',\'tplYear\',\'tplMonth\',\'tplMonthInner\',\'tplItem\',\'save\');\n    $params =& $modx->event->params;\n    if(is_array($params)) {\n        foreach ($params as $param=>$value) {\n            if (!in_array($param,$reflectParameters) && substr($param,-3) != \'tpl\') {\n                $dParams[$param] = $value;\n            }\n        }\n    }\n\n    $source = isset($source) ? $source : \"Ditto\";\n    /*\n        Param: source\n\n        Purpose:\n        Name of the Ditto snippet to use\n\n        Options:\n        Any valid snippet name\n\n        Default:\n        \"Ditto\"\n    */\n    $snippetOutput = $modx->runSnippet($source,$dParams);\n    $ditto = $modx->getPlaceholder($rID.\"_ditto_object\");\n    $resource = $modx->getPlaceholder($rID.\"_ditto_resource\");\n} else {\n    $ditto = $modx->getPlaceholder($id.\"ditto_object\");\n    $resource = $modx->getPlaceholder($id.\"ditto_resource\");\n}\nif (!is_object($ditto) || !isset($ditto) || !isset($resource)) {\n    return !empty($snippetOutput) ? $snippetOutput : \"The Ditto object is invalid. Please check it.\";\n}\n\n// ---------------------------------------------------\n//  Templates\n// ---------------------------------------------------\n\n$templates[\'tpl\'] = isset($tplContainer) ? $ditto->template->fetch($tplContainer): $defaultTemplates[\'tpl\'];\n/*\n    Param: tplContainer\n\n    Purpose:\n    Container template for the archive\n\n    Options:\n    - Any valid chunk name\n    - Code via @CODE:\n    - File via @FILE:\n\n    Default:\n    See default.tempates.php\n*/\n$templates[\'year\'] = isset($tplYear) ? $ditto->template->fetch($tplYear): $defaultTemplates[\'year\'];\n/*\n    Param: tplYear\n\n    Purpose:\n    Template for the year item\n\n    Options:\n    - Any valid chunk name\n    - Code via @CODE:\n    - File via @FILE:\n\n    Default:\n    See default.tempates.php\n*/\n$templates[\'year_inner\'] = isset($tplYearInner) ? $ditto->template->fetch($tplYearInner): $defaultTemplates[\'year_inner\'];\n/*\n    Param: tplYearInner\n\n    Purpose:\n    Template for the year item (the ul to hold the year template)\n\n    Options:\n    - Any valid chunk name\n    - Code via @CODE:\n    - File via @FILE:\n\n    Default:\n    See default.tempates.php\n*/\n$templates[\'month\'] = isset($tplMonth) ? $ditto->template->fetch($tplMonth): $defaultTemplates[\'month\'];\n/*\n    Param: tplMonth\n\n    Purpose:\n    Template for the month item\n\n    Options:\n    - Any valid chunk name\n    - Code via @CODE:\n    - File via @FILE:\n\n    Default:\n    See default.tempates.php\n*/\n$templates[\'month_inner\'] = isset($tplMonthInner) ? $ditto->template->fetch($tplMonthInner): $defaultTemplates[\'month_inner\'];\n/*\n    Param: tplMonthInner\n\n    Purpose:\n    Template for the month item  (the ul to hold the month template)\n\n    Options:\n    - Any valid chunk name\n    - Code via @CODE:\n    - File via @FILE:\n\n    Default:\n    See default.tempates.php\n*/\n$templates[\'item\'] = isset($tplItem) ? $ditto->template->fetch($tplItem): $defaultTemplates[\'item\'];\n/*\n    Param: tplItem\n\n    Purpose:\n    Template for the individual item\n\n    Options:\n    - Any valid chunk name\n    - Code via @CODE:\n    - File via @FILE:\n\n    Default:\n    See default.tempates.php\n*/\n\n$ditto->addField(\"date\",\"display\",\"custom\");\n    // force add the date field if receiving data from a Ditto instance\n\n// ---------------------------------------------------\n//  Reflect\n// ---------------------------------------------------\n\nif (function_exists(\"reflect\") === FALSE) {\nfunction reflect($templatesDocumentID, $showItems, $groupByYears, $resource, $templatesDateSource, $dateFormat, $ditto, $templates,$id,$start,$yearSortDir,$monthSortDir) {\n    global $modx;\n    $cal = array();\n    $output = \'\';\n    $ph = array(\'year\'=>\'\',\'month\'=>\'\',\'item\'=>\'\',\'out\'=>\'\');\n    $build = array();\n    $stop = count($resource);\n\n    // loop and fetch all the results\n    for ($i = $start; $i < $stop; $i++) {\n        $date = getdate($resource[$i][$templatesDateSource]);\n        $year = $date[\"year\"];\n        $month = $date[\"mon\"];\n        $cal[$year][$month][] = $resource[$i];\n    }\n    if ($yearSortDir == \"DESC\") {\n        krsort($cal);\n    } else {\n        ksort($cal);\n    }\n    foreach ($cal as $year=>$months) {\n        if ($monthSortDir == \"ASC\") {\n            ksort($months);\n        } else {\n            krsort($months);\n        }\n        $build[$year] = $months;\n    }\n    \n    foreach ($build as $year=>$months) {\n        $r_year = \'\';\n        $r_month = \'\';\n        $r_month_2 = \'\';\n        $year_count = 0;\n        $items = array();\n        \n        foreach ($months as $mon=>$month) {\n            $month_text = strftime(\"%B\", mktime(10, 10, 10, $mon, 10, $year));\n            $month_url = $ditto->buildURL(\"month=\".$mon.\"&year=\".$year.\"&day=false&start=0\",$templatesDocumentID,$id);\n            $month_count = count($month);\n            $year_count += $month_count;\n            $r_month = $ditto->template->replace(array(\"year\"=>$year,\"month\"=>$month_text,\"url\"=>$month_url,\"count\"=>$month_count),$templates[\'month\']);\n            if ($showItems) {\n                foreach ($month as $item) {\n                    $items[$year][$mon][\'items\'][] = $ditto->render($item, $templates[\'item\'], false, $templatesDateSource, $dateFormat, array(),$phx);\n                }\n                $r_month_2 = $ditto->template->replace(array(\'wrapper\' => implode(\'\',$items[$year][$mon][\'items\'])),$templates[\'month_inner\']);\n                $items[$year][$mon] = $ditto->template->replace(array(\'wrapper\' => $r_month_2),$r_month);\n            } else {\n                $items[$year][$mon] = $r_month;\n            }\n        }\n        if ($groupByYears) {\n            $year_url = $ditto->buildURL(\"year=\".$year.\"&month=false&day=false&start=0\",$templatesDocumentID,$id);\n            $r_year =  $ditto->template->replace(array(\"year\"=>$year,\"url\"=>$year_url,\"count\"=>$year_count),$templates[\'year\']);\n            $var = $ditto->template->replace(array(\'wrapper\'=>implode(\'\',$items[$year])),$templates[\'year_inner\']);\n            $output .= $ditto->template->replace(array(\'wrapper\'=>$var),$r_year);\n        } else {\n            $output .= implode(\'\',$items[$year]);\n        }\n    }\n\n    $output = $ditto->template->replace(array(\'wrapper\'=>$output),$templates[\'tpl\']);\n    $modx->setPlaceholder($id.\'reset\',$ditto->buildURL(\'year=false&month=false&day=false\',$templatesDocumentID,$id));\n\nreturn $output;\n    \n}\n}\n\nreturn reflect($targetID, $showItems, $groupByYears, $resource, $dateSource, $dateFormat, $ditto, $templates,$id,$start,$yearSortDir,$monthSortDir);',0,'',''),(12,'WebLogin','<strong>1.1</strong> Allows webusers to login to protected pages in the website, supporting multiple user groups',0,2,0,'# Created By Raymond Irving 2004\n#::::::::::::::::::::::::::::::::::::::::\n# Params:	\n#\n#	&loginhomeid 	- (Optional)\n#		redirects the user to first authorized page in the list.\n#		If no id was specified then the login home page id or \n#		the current document id will be used\n#\n#	&logouthomeid 	- (Optional)\n#		document id to load when user logs out	\n#\n#	&pwdreqid 	- (Optional)\n#		document id to load after the user has submited\n#		a request for a new password\n#\n#	&pwdactid 	- (Optional)\n#		document id to load when the after the user has activated\n#		their new password\n#\n#	&logintext		- (Optional) \n#		Text to be displayed inside login button (for built-in form)\n#\n#	&logouttext 	- (Optional)\n#		Text to be displayed inside logout link (for built-in form)\n#	\n#	&tpl			- (Optional)\n#		Chunk name or document id to as a template\n#				  \n#	Note: Templats design:\n#			section 1: login template\n#			section 2: logout template \n#			section 3: password reminder template \n#\n#			See weblogin.tpl for more information\n#\n# Examples:\n#\n#	[[WebLogin? &loginhomeid=`8` &logouthomeid=`1`]] \n#\n#	[[WebLogin? &loginhomeid=`8,18,7,5` &tpl=`Login`]] \n\n# Set Snippet Paths \n$snipPath = $modx->config[\'base_path\'] . \"assets/snippets/\";\n\n# check if inside manager\nif ($m = $modx->insideManager()) {\n	return \'\'; # don\'t go any further when inside manager\n}\n\n# deprecated params - only for backward compatibility\nif(isset($loginid)) $loginhomeid=$loginid;\nif(isset($logoutid)) $logouthomeid = $logoutid;\nif(isset($template)) $tpl = $template;\n\n# Snippet customize settings\n$liHomeId	= isset($loginhomeid)? explode(\",\",$loginhomeid):array($modx->config[\'login_home\'],$modx->documentIdentifier);\n$loHomeId	= isset($logouthomeid)? $logouthomeid:$modx->documentIdentifier;\n$pwdReqId	= isset($pwdreqid)? $pwdreqid:0;\n$pwdActId	= isset($pwdactid)? $pwdactid:0;\n$loginText	= isset($logintext)? $logintext:\'Login\';\n$logoutText	= isset($logouttext)? $logouttext:\'Logout\';\n$tpl		= isset($tpl)? $tpl:\"\";\n\n# System settings\n$webLoginMode = isset($_REQUEST[\'webloginmode\'])? $_REQUEST[\'webloginmode\']: \'\';\n$isLogOut		= $webLoginMode==\'lo\' ? 1:0;\n$isPWDActivate	= $webLoginMode==\'actp\' ? 1:0;\n$isPostBack		= count($_POST) && (isset($_POST[\'cmdweblogin\']) || isset($_POST[\'cmdweblogin_x\']));\n$txtPwdRem 		= isset($_REQUEST[\'txtpwdrem\'])? $_REQUEST[\'txtpwdrem\']: 0;\n$isPWDReminder	= $isPostBack && $txtPwdRem==\'1\' ? 1:0;\n\n$site_id = isset($site_id)? $site_id: \'\';\n$cookieKey = substr(md5($site_id.\"Web-User\"),0,15);\n\n# Start processing\ninclude_once $snipPath.\"weblogin/weblogin.common.inc.php\";\ninclude_once ($modx->config[\'base_path\'] . \"manager/includes/crypt.class.inc.php\");\n\nif ($isPWDActivate || $isPWDReminder || $isLogOut || $isPostBack) {\n	# include the logger class\n	include_once $modx->config[\'base_path\'] . \"manager/includes/log.class.inc.php\";\n	include_once $snipPath.\"weblogin/weblogin.processor.inc.php\";\n}\n\ninclude_once $snipPath.\"weblogin/weblogin.inc.php\";\n\n# Return\nreturn $output;\n',0,'&loginhomeid=Login Home Id;string; &logouthomeid=Logout Home Id;string; &logintext=Login Button Text;string; &logouttext=Logout Button Text;string; &tpl=Template;string;',''),(13,'WebChangePwd','<strong>1.0</strong> Allows Web User to change their password from the front-end of the website',0,2,0,'# Created By Raymond Irving April, 2005\n#::::::::::::::::::::::::::::::::::::::::\n# Params:	\n#\n#	&tpl			- (Optional)\n#		Chunk name or document id to use as a template\n#				  \n#	Note: Templats design:\n#			section 1: change pwd template\n#			section 2: notification template \n#\n# Examples:\n#\n#	[[WebChangePwd? &tpl=`ChangePwd`]] \n\n# Set Snippet Paths \n$snipPath  = (($modx->insideManager())? \"../\":\"\");\n$snipPath .= \"assets/snippets/\";\n\n# check if inside manager\nif ($m = $modx->insideManager()) {\n	return \'\'; # don\'t go any further when inside manager\n}\n\n\n# Snippet customize settings\n$tpl		= isset($tpl)? $tpl:\"\";\n\n# System settings\n$isPostBack		= count($_POST) && isset($_POST[\'cmdwebchngpwd\']);\n\n# Start processing\ninclude_once $snipPath.\"weblogin/weblogin.common.inc.php\";\ninclude_once $snipPath.\"weblogin/webchangepwd.inc.php\";\n\n# Return\nreturn $output;\n\n\n\n',0,'',''),(14,'AjaxSearch','<strong>1.9.0</strong> Ajax and non-Ajax search that supports results highlighting',0,4,0,'/**\r\n--------------------------------------------------------------------------------\r\n:: Preamble\r\n--------------------------------------------------------------------------------\r\nThe release 1.9 looks like the previous release, but it is a completely\r\nrefactored development.\r\n\r\nIt is partially based on the previous releases of AjaxSearch written by the\r\nfollowing authors:\r\n\r\n Coroico <coroico@wangba.fr>\r\n Jason Coward <jason@opengeek.com>\r\n Kyle Jaebker <kjaebker@muddydogpaws.com>\r\n Ryan Thrash  <ryan@vertexworks.com>\r\n\r\n--------------------------------------------------------------------------------\r\n:: Description\r\n--------------------------------------------------------------------------------\r\n\r\n        Ajax and non-Ajax search that supports results highlighting.\r\n\r\nThis snippet adds AJAX functionality on top of the robust content searching.\r\n\r\nWhat AjaxSearch do:\r\n- search in fields of the content an TV MODx tables\r\n- several customizable input forms available\r\n- search in a subset of documents\r\n- highlighting of searchword in the results returned\r\n- allow a filtering of search results\r\n- displaying of search results customizable thru templates\r\n- group the search results by categories\r\n- filter features (allow to set up specific search forms)\r\n\r\nIt could works in two modes:\r\n\r\najax mode :\r\n- search results displayed in current page through AJAX request\r\n- multiple search options including live search\r\n- available link to view all results in a new page when only a subset is returned\r\n- customize the number of results returned\r\n- offer two types for paginating the results\r\n- uses the MooTools or JQuery js library for AJAX and visual effects\r\n\r\nnon-ajax mode :\r\n- search results displayed in a new page or below on the same page\r\n- offer two types for paginating the results\r\n- works without JS enabled\r\n\r\nWhat AjaxSearch don\'t :\r\n- search in dynamic content. AjaxSearch could retreive only data stored in\r\ndatabase. It can\'t find something stored in a chunk or generated by a snippet.\r\n\r\nMORE : See the ajaxSearch.readme.txt file for more informations. \r\n\r\n----------------------------------------------------------------------------- */\r\n\r\n// ajaxSearch version being executed\r\ndefine(\'AS_VERSION\', \'1.9.0\');\r\n// Path where ajaxSearch is installed\r\ndefine(\'AS_SPATH\', \'assets/snippets/ajaxSearch/\');\r\n//include snippet file\r\ndefine(\'AS_PATH\', MODX_BASE_PATH . AS_SPATH);\r\n\r\n//------------------------------------------------------------------------------\r\n// Configuration - general AjaxSearch snippet setup options\r\n//------------------------------------------------------------------------------\r\nglobal $modx;\r\n$tstart = $modx->getMicroTime();\r\n\r\n// Load the default configuration $dcfg to get the default values\r\n$default = AS_PATH . \'configs/default.config.php\';\r\nif (file_exists($default)) include $default;\r\nelse return \"<h3>AjaxSearch error: $default not found !<br />Check the existing of this file!</h3>\";\r\nif (!isset($dcfg)) return \"<h3>AjaxSearch error: default configuration array not defined in $default!<br /> Check the content of this file!</h3>\";\r\n$cfg = array(); // current configuration\r\n\r\n// Load a custom configuration file if required\r\n// config_name - Other config installed in the configs folder or in any folder within the MODx base path via @FILE\r\n// Configuration files should be named in the form: <config_name>.config.php\r\n// Default: \'\' - no custom config\r\n$cfg[\'config\'] = isset($config) ? $config : $dcfg[\'config\'];\r\nif ($cfg[\'config\']) {\r\n    $config = $cfg[\'config\'];\r\n    $lconfig = (substr($config, 0, 5) != \"@FILE\") ? AS_PATH . \"configs/$config.config.php\" : $modx->config[\'base_path\'] . trim(substr($config, 5));\r\n    if (file_exists($lconfig)) include $lconfig;\r\n    else return \"<h3>AjaxSearch error: \" . $lconfig . \" not found !<br />Check your config parameter or your config file name!</h3>\";\r\n}\r\n\r\n// &debug = [ 0 | 1 | 2 | 3 ]\r\n// 1,2,3 : File mode - Output logged into a file named ajaxSearch_log.txt in ajaxSearch/debug/ directory.\r\n// this directory should be writable.\r\n// Default: 0 - no logs\r\n$cfg[\'debug\'] = isset($debug) ? $debug : (isset($__debug) ? $__debug : $dcfg[\'debug\']);\r\n\r\n// &timeLimit = [ int | 60 ]\r\n// Max execution time in seconds for the AjaxSearch script\r\n// 0 - If set to zero, no time limit is imposed\r\n// Default: 60 - 1 minute.\r\n$cfg[\'timeLimit\'] = isset($timeLimit) ? $timeLimit : (isset($__timeLimit) ? $__timeLimit : $dcfg[\'timeLimit\']);\r\n\r\n// &language [ language_name | manager_language ] (optional)\r\n// Default: $modx->config[\'manager_language\'] - manager language used\r\n$cfg[\'language\'] = isset($language) ? $language : (isset($__language) ? $__language : $dcfg[\'language\']);\r\n\r\n// &ajaxSearch [1 | 0] (as passed in snippet variable ONLY)\r\n// Use this to display the search results using ajax You must include the Mootools library in your template\r\n// Default: 1 - ajax mode selected\r\n$cfg[\'ajaxSearch\'] = isset($ajaxSearch) ? $ajaxSearch : (isset($__ajaxSearch) ? $__ajaxSearch : $dcfg[\'ajaxSearch\']);\r\n\r\n// &advSearch [ \'exactphrase\' | \'allwords\' | \'nowords\' | \'oneword\' ]\r\n// Advanced search:\r\n// - exactphrase : provides the documents which contain the exact phrase\r\n// - allwords : provides the documents which contain all the words\r\n// - nowords : provides the documents which do not contain the words\r\n// - oneword : provides the document which contain at least one word\r\n// Default: \'oneword\'\r\n$cfg[\'advSearch\'] = isset($advSearch) ? $advSearch : (isset($__advSearch) ? $__advSearch : $dcfg[\'advSearch\']);\r\n\r\n// &asId - Unique id for AjaxSearch instance\r\n// this allows to distinguish several Ajaxsearch instances on the same page\r\n// Any combination of characters a-z, underscores, and numbers 0-9\r\n// This is case sensitive. Default = empty string\r\n// With ajax mode, the first snippet call of the page shouldn\'t use the asId parameter\r\n$cfg[\'asId\'] = isset($asId) ? $asId : (isset($__asId) ? $__asId : $dcfg[\'asId\']);\r\n\r\n// &whereSearch\r\n// Define where should occur the search\r\n// a separated list of keywords describing the tables where to search\r\n// keywords allowed :\r\n// \"content\" for site_content, \"tv\" for site_tmplvar_contentvalues, \"jot\" for jot_content, \"maxigallery\" for maxigallery\r\n// you could add your own keywords. But the keyword should be a user function which describes the tables to use\r\n// all the text fields are searchable but you could specify the fields like this:\r\n// whereSearch=`content:pagetitle,introtext,content|tv:tv_value|maxigallery:gal_title`\r\n// Default: \'content|tv\'\r\n$cfg[\'whereSearch\'] = isset($whereSearch) ? $whereSearch : (isset($__whereSearch) ? $__whereSearch : $dcfg[\'whereSearch\']);\r\n\r\n// &sites : [comma separated list of sites]\r\n// sites allow to define sites where to do the search\r\n$cfg[\'sites\'] = isset($sites) ? $sites : (isset($__sites) ? $__sites : $dcfg[\'sites\']);\r\n\r\n// &subSearch  [comma separated list of subsites]\r\n// subSearch allow to define sub-domains or subsites where to do the search\r\n$cfg[\'subSearch\'] = isset($subSearch) ? $subSearch : (isset($__subSearch) ? $__subSearch : $dcfg[\'subSearch\']);\r\n\r\n// &category  [ tv_name ]\r\n// Any combination of characters a-z, underscores, and numbers 0-9\r\n// This is case sensitive. Default = empty string\r\n// Name of a TV. The category of a MODx document is provided by this TV content\r\n$cfg[\'category\'] = isset($category) ? $category : (isset($__category) ? $__category : $dcfg[\'category\']);\r\n\r\n// &display [ \'mixed\' | \'unmixed\' ]\r\n// When results comes from differents sites, subsites or categories, you could choose to display the results mixed or unmixed.\r\n// Default: unmixed\r\n// Unmixed mode display the results grouped by site, subsite or category. Each group of results could be paginated.\r\n// Mixed mode mixe all the results coming from the differents area.\r\n// With unmixed mode, results are ordered by the field provided by the first field of the order parameter\r\n$cfg[\'display\'] = isset($display) ? $display : (isset($__display) ? $__display : $dcfg[\'display\']);\r\n\r\n// &init  [ \'none\' | \'all\' ]\r\n// init defines if the search display all the results or none when the search term is an empty string\r\n// Default: none\r\n$cfg[\'init\'] = isset($init) ? $init : (isset($__init) ? $__init : $dcfg[\'init\']);\r\n\r\n// &withTvs - Define which Tvs are used for the search in Tvs\r\n// a comma separated list of TV names\r\n// Default: \'\' - all TVs are used (empty list)\r\n$cfg[\'withTvs\'] = isset($withTvs) ? $withTvs : (isset($__withTvs) ? $__withTvs : $dcfg[\'withTvs\']);\r\n\r\n// &order - Define the sort order of results\r\n// Comma separated list of fields defined as searchable in the table definition\r\n// to suppress the sorting, use &order=``\r\n// Default: \'pub_date,pagetitle\'\r\n$cfg[\'order\'] = isset($order) ? $order : (isset($__order) ? $__order : $dcfg[\'order\']);\r\n\r\n// &rank - Define the rank of search results. Results are sorted by rank value\r\n// Comma separated list of fields with optionally user defined weight\r\n// Default: \'pagetitle:100,extract\'\r\n// to suppress the rank sorting, use &rank=``;\r\n// &rank sort occurs after the &order sort\r\n$cfg[\'rank\'] = isset($rank) ? $rank : (isset($__rank) ? $__rank : $dcfg[\'rank\']);\r\n\r\n// &maxWords [ 1 < int < 10 ]\r\n// Maximum number of words for searching\r\n// Default: 5\r\n$cfg[\'maxWords\'] = isset($maxWords) ? intval($maxWords) : (isset($__maxWords) ? intval($__maxWords) : $dcfg[\'maxWords\']);\r\n\r\n// &minChars [  2 < int < 100 ]\r\n// Minimum number of characters to require for a word to be valid for searching.\r\n// length of each word with $advSearch = \'allwords\', \'oneword\' or \'nowords\'\r\n// length of the search string with possible spaces with $advSearch = \'exactphrase\'\r\n// Default: 3\r\n$cfg[\'minChars\'] = isset($minChars) ? intval($minChars) : (isset($__minChars) ? intval($__minChars) : $dcfg[\'minChars\']);\r\n\r\n// &showInputForm [0 | 1]\r\n// If you would like to turn off the search form when showing results you can set this to false.(1=true, 0=false)\r\n// Default: 1\r\n$cfg[\'showInputForm\'] = isset($showInputForm) ? $showInputForm : (isset($__showInputForm) ? $__showInputForm : $dcfg[\'showInputForm\']);\r\n\r\n// &showIntro [0 | 1]\r\n// If you would like to turn off the intro message beyond the input form you can set this to false.(1=true, 0=false)\r\n// Default: 1\r\n$cfg[\'showIntro\'] = isset($showIntro) ? $showIntro : (isset($__showIntro) ? $__showIntro : $dcfg[\'showIntro\']);\r\n\r\n// &grabMax [ int ]\r\n// Set to the max number of records you would like on each page. Set to 0 if unlimited.\r\n// Default: 10\r\n$cfg[\'grabMax\'] = isset($grabMax) ? intval($grabMax) : (isset($__grabMax) ? intval($__grabMax) : $dcfg[\'grabMax\']);\r\n\r\n// &extract [ n:searchable fields list | 1:content,description,introtext,tv_content]\r\n// show the search terms highlighted in a little extract\r\n// n : maximum number of extracts displayed\r\n// ordered searchable fields list : separated list of fields define as searchable in the table definition\r\n// Default: \'1:content,description,introtext,tv_value\' - One extract from content then description,introtext,tv_value\r\n$cfg[\'extract\'] = isset($extract) ? $extract : (isset($__extract) ? $__extract : $dcfg[\'extract\']);\r\n\r\n// &extractLength [ 50 < int < 800]\r\n// Length of extract around the search words found - between 50 and 800 characters\r\n// Default: 200\r\n$cfg[\'extractLength\'] = isset($extractLength) ? intval($extractLength) : (isset($__extractLength) ? intval($__extractLength) : $dcfg[\'extractLength\']);\r\n\r\n// &extractEllips [ string ]\r\n// Ellipside to mark the star and the end of  an extract when the sentence is cutting\r\n// Default: \'...\'\r\n$cfg[\'extractEllips\'] = isset($extractEllips) ? $extractEllips : (isset($__extractEllips) ? $__extractEllips : $dcfg[\'extractEllips\']);\r\n\r\n// &extractSeparator [ string ]\r\n// Any html tag to mark the separation between extracts\r\n// Default: \'<br />\' - but you could also choose for instance \'<hr />\'\r\n$cfg[\'extractSeparator\'] = isset($extractSeparator) ? $extractSeparator : (isset($__extractSeparator) ? $__extractSeparator : $dcfg[\'extractSeparator\']);\r\n\r\n// &formatDate [ string ]\r\n// The format of outputted dates. See http://www.php.net/manual/en/function.date.php\r\n// Default: \'d/m/y : H:i:s\' - e.g: 21/01/08 : 23:09:22\r\n$cfg[\'formatDate\'] = isset($formatDate) ? $formatDate : (isset($__formatDate) ? $__formatDate : $dcfg[\'formatDate\']);\r\n\r\n// &highlightResult [1 | 0]\r\n// create links so that search terms will be highlighted when linked page clicked\r\n// Default: 1 - Results highlighted\r\n$cfg[\'highlightResult\'] = isset($highlightResult) ? $highlightResult : (isset($__highlightResult) ? $__highlightResult : $dcfg[\'highlightResult\']);\r\n\r\n// &pagingType[ 0 | 1 | 2 ]\r\n// Determine the pagination type used - Default 1 : Previous - X-Y/Z - Next\r\n$cfg[\'pagingType\'] = isset($pagingType) ? $pagingType : (isset($__pagingType) ? $__pagingType : $dcfg[\'pagingType\']);\r\n\r\n// &pageLinkSeparator [ string ]\r\n// What you want, if anything, between your page link numbers\r\n// Default: \' | \'\r\n$cfg[\'pageLinkSeparator\'] = isset($pageLinkSeparator) ? $pageLinkSeparator : (isset($__pageLinkSeparator) ? $__pageLinkSeparator : $dcfg[\'pageLinkSeparator\']);\r\n\r\n// &showPagingAlways[1 | 0]\r\n// Determine whether or not to always show paging\r\n$cfg[\'showPagingAlways\'] = isset($showPagingAlways) ? $showPagingAlways : (isset($__showPagingAlways) ? $__showPagingAlways : $dcfg[\'showPagingAlways\']);\r\n\r\n// &landingPage  [int] set the page to show the results page (non Ajax search)\r\n// Default: false\r\n$cfg[\'landingPage\'] = isset($landingPage) ? $landingPage : (isset($__landingPage) ? $__landingPage : $dcfg[\'landingPage\']);\r\n\r\n// &showResults  [1 | 0]  establish whether to show the results or not\r\n// Default: 1\r\n$cfg[\'showResults\'] = isset($showResults) ? $showResults : (isset($__showResults) ? $__showResults : $dcfg[\'showResults\']);\r\n\r\n// &parents [ [ in | not in ] : comma separated list of Ids | \'\' ]\r\n// Ids of documents to retrieve their children to &depth depth  where to do the search in or not in\r\n// Default: \'\' - empty list\r\n$cfg[\'parents\'] = isset($parents) ? $parents : (isset($__parents) ? $__parents : $dcfg[\'parents\']);\r\n\r\n// &documents [ [ in | not in ] : comma separated list of Ids | \'\' ]\r\n// Ids of documents where to do the search in or not in\r\n// Default: \'\' - empty list\r\n$cfg[\'documents\'] = isset($documents) ? $documents : (isset($__documents) ? $__documents : $dcfg[\'documents\']);\r\n\r\n// &depth [ 0 < int ] Number of levels deep to retrieve documents\r\n// Default: 10\r\n$cfg[\'depth\'] = isset($depth) ? intval($depth) : (isset($__depth) ? intval($__depth) : $dcfg[\'depth\']);\r\n\r\n// &hideMenu [0 | 1| 2]  Search in hidden documents from menu.\r\n// 0 - search only in documents visible from menu\r\n// 1 - search only in documents hidden from menu\r\n// 2 - search in hidden or visible documents from menu\r\n// Default: 2\r\n$cfg[\'hideMenu\'] = isset($hideMenu) ? $hideMenu : (isset($__hideMenu) ? $__hideMenu : $dcfg[\'hideMenu\']);\r\n\r\n// &hideLink [0 | 1 ]   Search in content of type reference (link)\r\n// 0 - search in content of type document AND reference\r\n// 1 - search only in content of type document\r\n// Default: 1\r\n$cfg[\'hideLink\'] = isset($hideLink) ? $hideLink : (isset($__hideLink) ? $__hideLink : $dcfg[\'hideLink\']);\r\n\r\n// &filter - Basic filtering : remove unwanted documents that meets the criteria of the filter\r\n// See Ditto 2 Basic filtering and the ajaxSearch demo site for more information\r\n// Default: \'\' - empty list\r\n$cfg[\'filter\'] = isset($filter) ? $filter : (isset($__filter) ? $__filter : $dcfg[\'filter\']);\r\n\r\n// &output [0 | 1 ]Custom layout\r\n// Default: 0 - Results are listed just under the input form\r\n// 1 - custom layout. put [+as.inputForm+] and [+as.results+] where you want to define the layout\r\n$cfg[\'output\'] = isset($output) ? $output : (isset($__output) ? $__output : $dcfg[\'output\']);\r\n\r\n// &tplInput - Chunk to style the ajaxSearch input form\r\n// Default: \'@FILE:\' . AS_SPATH . \'templates/input.tpl.html\'\r\n$cfg[\'tplInput\'] = isset($tplInput) ? $tplInput : (isset($__tplInput) ? $__tplInput : $dcfg[\'tplInput\']);\r\n\r\n// &tplResults - Chunk to style the non-ajax output results outer\r\n// Default: \'@FILE:\' . AS_SPATH . \'templates/results.tpl.html\'\r\n$cfg[\'tplResults\'] = isset($tplResults) ? $tplResults : (isset($__tplResults) ? $__tplResults : $dcfg[\'tplResults\']);\r\n\r\n// &tplGrpResult - Chunk to style the non-ajax output group result outer\r\n// Default: \'@FILE:\' . AS_SPATH . \'templates/grpResult.tpl.html\'\r\n$cfg[\'tplGrpResult\'] = isset($tplGrpResult) ? $tplGrpResult : (isset($__tplGrpResult) ? $__tplGrpResult : $dcfg[\'tplGrpResult\']);\r\n\r\n// &tplResult - Chunk to style each output result\r\n// Default: \"@FILE:\" . AS_SPATH . \'templates/result.tpl.html\'\r\n$cfg[\'tplResult\'] = isset($tplResult) ? $tplResult : (isset($__tplResult) ? $__tplResult : $dcfg[\'tplResult\']);\r\n\r\n// &tplComment - Chunk to style the comment form (Also used with the ajax mode)\r\n// Default: \'@FILE:\' . AS_SPATH . \'templates/comment.tpl.html\'\r\n$cfg[\'tplComment\'] = isset($tplComment) ? $tplComment : (isset($__tplComment) ? $__tplComment : $dcfg[\'tplComment\']);\r\n\r\n// &tplPaging0 - Chunk to style the paging links - type 0\r\n// Default: \'@FILE:\' . AS_SPATH . \'templates/paging0.tpl.html\'\r\n$cfg[\'tplPaging0\'] = isset($tplPaging0) ? $tplPaging0 : (isset($__tplPaging0) ? $__tplPaging0 : $dcfg[\'tplPaging0\']);\r\n\r\n// &tplPaging1 - Chunk to style the paging links - type 1\r\n// Default: \'@FILE:\' . AS_SPATH . \'templates/paging1.tpl.html\'\r\n$cfg[\'tplPaging1\'] = isset($tplPaging1) ? $tplPaging1 : (isset($__tplPaging1) ? $__tplPaging1 : $dcfg[\'tplPaging1\']);\r\n\r\n// &tplPaging2 - Chunk to style the paging links - type 2\r\n// Default: \'@FILE:\' . AS_SPATH . \'templates/paging2.tpl.html\'\r\n$cfg[\'tplPaging2\'] = isset($tplPaging2) ? $tplPaging2 : (isset($__tplPaging2) ? $__tplPaging2 : $dcfg[\'tplPaging2\']);\r\n\r\n// &stripInput - stripInput user function name\r\n// Default: \'defaultStripInput\'\r\n$cfg[\'stripInput\'] = isset($stripInput) ? $stripInput : (isset($__stripInput) ? $__stripInput : $dcfg[\'stripInput\']);\r\n\r\n// &stripOutput - stripOutput user function name\r\n// Default: \'defaultStripOutput\'\r\n$cfg[\'stripOutput\'] = isset($stripOutput) ? $stripOutput : (isset($__stripOutput) ? $__stripOutput : $dcfg[\'stripOutput\']);\r\n\r\n// &breadcrumbs\r\n// 0 : disallow the breadcrumbs link\r\n// Name of the breadcrumbs function : allow the breadcrumbs link\r\n// The function name could be followed by some parameter initialization\r\n// e.g: &breadcrumbs=`Breadcrumbs,showHomeCrumb:0,showCrumbsAtHome:1`\r\n// Default: \'\' - empty string\r\n$cfg[\'breadcrumbs\'] = isset($breadcrumbs) ? $breadcrumbs : (isset($__breadcrumbs) ? $__breadcrumbs : $dcfg[\'breadcrumbs\']);\r\n\r\n// &tvPhx - display and set placeHolders for TV (template variables)\r\n// 0 : disallow the feature\r\n// 1 : allow the display of all Modx TVs of the document found (default)\r\n// \'tb_alias:display_function_name[,[tb_alias:display_function_name]*]\' : set up placeholders for custom joined tables\r\n// Default: 1 - tvPhx allowed for TV only\r\n$cfg[\'tvPhx\'] = isset($tvPhx) ? $tvPhx : (isset($__tvPhx) ? $__tvPhx : $dcfg[\'tvPhx\']);\r\n\r\n// &clearDefault - Clearing default text\r\n// Set this to 1 if you would like to include the clear default js function\r\n// add the class \"cleardefault\" to your input text form and set this parameter\r\n// Default: 0\r\n$cfg[\'clearDefault\'] = isset($clearDefault) ? $clearDefault : (isset($__clearDefault) ? $__clearDefault : $dcfg[\'clearDefault\']);\r\n\r\n// &jsClearDefault - Location of the js library\r\n// Default: AS_SPATH . \'js/clearDefault.js\'\r\n$cfg[\'jsClearDefault\'] = $dcfg[\'jsClearDefault\'];\r\n\r\n// &mbstring - php_mbstring extension available [0 | 1]\r\n// Default: 1 - extension available\r\n$cfg[\'mbstring\'] = isset($mbstring) ? $mbstring : (isset($__mbstring) ? $__mbstring : $dcfg[\'mbstring\']);\r\n\r\n//  &asLog - ajaxSearch log [ level [: comment [: purge]]]\r\n//  level:\r\n//        0 : disallow the ajaxSearch log (Default)\r\n//        1 : failed search requests are logged\r\n//        2 : all ajaxSearch requests are logged\r\n//  comment:\r\n//        0 : user comment not allowed (Default)\r\n//        1 : user comment allowed\r\n//  purge: number of logs allowed before to do an automatic purge of the table\r\n//        Default: 200\r\n$cfg[\'asLog\'] = isset($asLog) ? $asLog : (isset($__asLog) ? $__asLog : $dcfg[\'asLog\']);\r\n\r\n\r\n//------------------------------------------------------------------------------\r\n// Configuration - Simple Ajax mode\r\n//------------------------------------------------------------------------------\r\n\r\nif ($cfg[\'ajaxSearch\']) {\r\n\r\n    // $liveSearch [1 | 0] (as passed in snippet variable ONLY)\r\n    // Set this to 1 if you would like to use the live search (i.e. results as you type)\r\n    // Default: 0 - livesearch mode inactivated\r\n    $cfg[\'liveSearch\'] = isset($liveSearch) ? $liveSearch : (isset($__liveSearch) ? $__liveSearch : $dcfg[\'liveSearch\']);\r\n\r\n    // &ajaxMax [int] - The maximum number of results to show for the ajaxsearch\r\n    // Default: 6\r\n    $cfg[\'ajaxMax\'] = isset($ajaxMax) ? $ajaxMax : (isset($__ajaxMax) ? $__ajaxMax : $dcfg[\'ajaxMax\']);\r\n\r\n    // &moreResultsPage [int]\r\n    // The document id of the page you want the more results link to point to\r\n    // Default: 0\r\n    $cfg[\'moreResultsPage\'] = isset($moreResultsPage) ? $moreResultsPage : (isset($__moreResultsPage) ? $__moreResultsPage : $dcfg[\'moreResultsPage\']);\r\n\r\n    // &opacity - set the opacity of the div ajaxSearch_output\r\n    // Should be a float value: [ 0. < float <= 1. ]\r\n    // Default: 1.\r\n    $cfg[\'opacity\'] = isset($opacity) ? $opacity : (isset($__opacity) ? $__opacity : $dcfg[\'opacity\']);\r\n\r\n    // &tplAjaxResults - Chunk to style the ajax output results outer\r\n    // Default: \'\' - empty string\r\n    $cfg[\'tplAjaxResults\'] = isset($tplAjaxResults) ? $tplAjaxResults : (isset($__tplAjaxResults) ? $__tplAjaxResults : $dcfg[\'tplAjaxResults\']);\r\n\r\n    // &tplAjaxGrpResult - Chunk to style each ajax output group result outer\r\n    // Default: \'\' - empty string\r\n    $cfg[\'tplAjaxGrpResult\'] = isset($tplAjaxGrpResult) ? $tplAjaxGrpResult : (isset($__tplAjaxGrpResult) ? $__tplAjaxGrpResult : $dcfg[\'tplAjaxGrpResult\']);\r\n\r\n    // &tplAjaxResult - Chunk to style each ajax output result\r\n    // Default: \'\' - empty string\r\n    $cfg[\'tplAjaxResult\'] = isset($tplAjaxResult) ? $tplAjaxResult : (isset($__tplAjaxResult) ? $__tplAjaxResult : $dcfg[\'tplAjaxResult\']);\r\n\r\n    // &jscript [\'jquery\'|\'mootools2\'|\'mootools\']\r\n    // Set this to jquery if you would like use the jquery library\r\n    // set mootools2 to use the version 1.2 of mootools (limited to JS functions used by AS)\r\n    // Default: \'mootools\' - use the version 1.11 of mootools provided with MODx\r\n    $cfg[\'jscript\'] = isset($jscript) ? $jscript : (isset($__jscript) ? $__jscript : $dcfg[\'jscript\']);\r\n\r\n    // &addJscript [1 | 0]\r\n    // Set this to 1 if you would like to include or not the mootool/jquery library in the header of your pages automatically\r\n    // Default: 1\r\n    $cfg[\'addJscript\'] = isset($addJscript) ? $addJscript : (isset($__addJscript) ? $__addJscript : $dcfg[\'addJscript\']);\r\n\r\n    // &jsMooTools - Location of the mootools javascript library (current version of MODx)\r\n    // Default: \'manager/media/script/mootools/mootools.js\'\r\n    $cfg[\'jsMooTools\'] = isset($jsMooTools) ? $jsMooTools : (isset($__jsMooTools) ? $__jsMooTools : $dcfg[\'jsMooTools\']);\r\n\r\n    // &jsMooTools2 - Location of an alternative mootools javascript library\r\n    // Default: AS_SPATH . \'js/mootools1.2/mootools.js\' - contains only the required functions for AS\r\n    // to use an another library, use this parameter and change the ajaxSearch/js/ajaxSearch1/ajaxSearch-mootools2.js file\r\n    $cfg[\'jsMooTools2\'] = isset($jsMooTools2) ? $jsMooTools2 : (isset($__jsMooTools2) ? $__jsMooTools2 : $dcfg[\'jsMooTools2\']);\r\n\r\n    // &jsQuery - Location of the jquery javascript library\r\n    // Default: AS_SPATH . \'js/jquery/jquery.js\'\r\n    $cfg[\'jsJquery\'] = isset($jsJquery) ? $jsJquery : (isset($__jsJquery) ? $__jsJquery : $dcfg[\'jsJquery\']);\r\n}\r\n\r\n\r\n// ========================================================== End of config\r\ninclude_once AS_PATH . \"classes/ajaxSearch.class.inc.php\";\r\nif (class_exists(\'AjaxSearch\')) {\r\n    $as = new AjaxSearch();\r\n    $output = $as->run($tstart, $dcfg, $cfg);\r\n} else {\r\n    $output = \"<h3>error: AjaxSearch class not found</h3>\";\r\n}\r\n$elapsedTime = $modx->getMicroTime() - $tstart;\r\n$etime = sprintf(\"%.4fs\",$elapsedTime);\r\n//$f=fopen(\'test.txt\',\'a+\');fwrite($f,\"etime=\".$etime.\"\\n\\n\");\r\nreturn $output;\r\n',0,'',''),(15,'Jot','<strong>1.1.4</strong> User comments with moderation and email subscription',0,6,0,'/*####\n#\n# Author: Armand \"bS\" Pondman (apondman@zerobarrier.nl)\n#\n# Latest Version: http://modxcms.com/Jot-998.html\n# Jot Demo Site: http://projects.zerobarrier.nl/modx/\n# Documentation: http://wiki.modxcms.com/index.php/Jot (wiki)\n#\n####*/\n\n$jotPath = $modx->config[\'base_path\'] . \'assets/snippets/jot/\';\ninclude_once($jotPath.\'jot.class.inc.php\');\n\n$Jot = new CJot;\n$Jot->VersionCheck(\"1.1.4\");\n$Jot->Set(\"path\",$jotPath);\n$Jot->Set(\"action\", $action);\n$Jot->Set(\"postdelay\", $postdelay);\n$Jot->Set(\"docid\", $docid);\n$Jot->Set(\"tagid\", $tagid);\n$Jot->Set(\"subscribe\", $subscribe);\n$Jot->Set(\"moderated\", $moderated);\n$Jot->Set(\"captcha\", $captcha);\n$Jot->Set(\"badwords\", $badwords);\n$Jot->Set(\"bw\", $bw);\n$Jot->Set(\"sortby\", $sortby);\n$Jot->Set(\"numdir\", $numdir);\n$Jot->Set(\"customfields\", $customfields);\n$Jot->Set(\"guestname\", $guestname);\n$Jot->Set(\"canpost\", $canpost);\n$Jot->Set(\"canview\", $canview);\n$Jot->Set(\"canedit\", $canedit);\n$Jot->Set(\"canmoderate\", $canmoderate);\n$Jot->Set(\"trusted\", $trusted);\n$Jot->Set(\"pagination\", $pagination);\n$Jot->Set(\"placeholders\", $placeholders);\n$Jot->Set(\"subjectSubscribe\", $subjectSubscribe);\n$Jot->Set(\"subjectModerate\", $subjectModerate);\n$Jot->Set(\"subjectAuthor\", $subjectAuthor);\n$Jot->Set(\"notify\", $notify);\n$Jot->Set(\"notifyAuthor\", $notifyAuthor);\n$Jot->Set(\"validate\", $validate);\n$Jot->Set(\"title\", $title);\n$Jot->Set(\"authorid\", $authorid);\n$Jot->Set(\"css\", $css);\n$Jot->Set(\"cssFile\", $cssFile);\n$Jot->Set(\"cssRowAlt\", $cssRowAlt);\n$Jot->Set(\"cssRowMe\", $cssRowMe);\n$Jot->Set(\"cssRowAuthor\", $cssRowAuthor);\n$Jot->Set(\"tplForm\", $tplForm);\n$Jot->Set(\"tplComments\", $tplComments);\n$Jot->Set(\"tplModerate\", $tplModerate);\n$Jot->Set(\"tplNav\", $tplNav);\n$Jot->Set(\"tplNotify\", $tplNotify);\n$Jot->Set(\"tplNotifyModerator\", $tplNotifyModerator);\n$Jot->Set(\"tplNotifyAuthor\", $tplNotifyAuthor);\n$Jot->Set(\"tplSubscribe\", $tplSubscribe);\n$Jot->Set(\"debug\", $debug);\n$Jot->Set(\"output\", $output);\nreturn $Jot->Run();',0,'',''),(16,'dealer_manager','',0,8,0,'\r\ninclude_once(\"assets/snippets/custom/dealer_manager.inc.php\");\r\n',0,'',' '),(17,'dealer_add','',0,8,0,'\r\ninclude_once(\"assets/snippets/custom/dealer_add.inc.php\");\r\n',0,'',' '),(18,'dealer_edit','',0,8,0,'\r\ninclude_once(\"assets/snippets/custom/dealer_edit.inc.php\");\r\n',0,'',' '),(19,'dealer_page','',0,8,0,'\r\ninclude_once(\"assets/snippets/custom/dealer_page.inc.php\");\r\n',0,'',' ');

--
-- Table structure for table `modx_site_templates`
--

CREATE TABLE `modx_site_templates` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `templatename` varchar(50) NOT NULL DEFAULT '',
  `description` varchar(255) NOT NULL DEFAULT 'Template',
  `editor_type` int(11) NOT NULL DEFAULT '0' COMMENT '0-plain text,1-rich text,2-code editor',
  `category` int(11) NOT NULL DEFAULT '0' COMMENT 'category id',
  `icon` varchar(255) NOT NULL DEFAULT '' COMMENT 'url to icon file',
  `template_type` int(11) NOT NULL DEFAULT '0' COMMENT '0-page,1-content',
  `content` mediumtext,
  `locked` tinyint(4) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 COMMENT='Contains the site templates.';

--
-- Dumping data for table `modx_site_templates`
--

INSERT INTO `modx_site_templates` VALUES (3,'Minimal Template','',0,0,'',0,'<!DOCTYPE html>\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n	<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n	<title>[(site_name)] | [*pagetitle*]</title>\r\n	 <base href=\"[(site_url)]\"></base>\r\n	<link rel=\"stylesheet\" href=\"assets/templates/quintex/css/style.css\" media=\"screen\" />\r\n</head>\r\n<body>\r\n	<div id=\"container\">\r\n		<div id=\"header\">\r\n			<a href=\"/\"><h1 id=\"logo\">quintex</h1></a>\r\n			<p class=\"clouds\">\r\n				2030 Auto Park Way, Suite. E Escondido Ca. 92029\r\n			</p>\r\n			<ul>\r\n				<li><a href=\"http://quintexmobileelectronics.com\">Home</a></li>\r\n				 <li><a href=\"/catalog/category/view/s/new-products/id/298/\">Products</a></li>\r\n<li><a href=\"http://quintexmobileelectronics.com/about\">About Quintex</a></li>\r\n				<!--<li><a href=\"\">Products</a></li>-->\r\n	                       \r\n				<li><a href=\"/directions\">directions</a></li>\r\n				<li><a href=\"/contact\">contact</a></li>\r\n			</ul>\r\n			<p class=\"callnow\">Call Now! 760-432-6333</p>\r\n			<a href=\"/dealer/\" class=\"login\">Dealer Login</a>\r\n		</div><!--/header-->\r\n		<div id=\"mainsection\">\r\n			<div id=\"content\">\r\n				<div class=\"banner\">\r\n					<img src=\"/dealer/assets/templates/quintex/images/dealers.gif\" alt=\"\" />\r\n				</div><!--/banner-->\r\n				<!--/dealerlogin-->\r\n<div class=\"leftcoldealers\">\r\n[*content*]\r\n				\r\n			  </div>\r\n				\r\n			</div><!--/content-->\r\n            \r\n			<div id=\"sidebar\" style=\"height:600px\">\r\n			  <div class=\"nav_block nopad\" id=\"subnav\">\r\n					<h3>Welcome</h3>\r\n					\r\n					<ul>\r\n					    <li>Welcome to the Quintex Dealer Login. Here you will find the latest pricing information. If you have any questions please contact us at 760.432.6333</li>\r\n<li> <a href=\"/dealer/dealer-page.html\">My Dealer Page</a></a>						\r\n<li>[[WebLogin? &loginhomeid=`4` &logouthomeid=`1` ]]</li>						\r\n					</ul>\r\n			  </div>\r\n				<br class=\"clear\" />\r\n		  </div><!--/mainsection-->\r\n<br class=\"clear\" />\r\n		<div id=\"sponsors\" style=\"position:relative;top\"1000px;\">\r\n			<p>Some of the Many Great Brands We Offer: </p>\r\n			<img src=\"assets/templates/quintex/images/sponsors.jpg\" alt=\"\" />\r\n		</div>\r\n		<div id=\"footer\">\r\n			<div class=\"legalnav\">\r\n				<p>&copy; 2010 Quintex Mobile Electronics. All Rights Reserved. <a href=\"/policies\">Policies</a> & <a href=\"/terms\">Terms</a></p>\r\n				<ul>\r\n					<li><a href=\"/\">Home</a></li>\r\n					<li><a href=\"/about\">About Quintex</a></li>\r\n					<!--<li><a href=\"\">Products</a></li>-->\r\n					<li><a href=\"/directions/\">directions</a></li>\r\n					<li><a href=\"/contact/\">contact</a></li>\r\n				</ul>\r\n				<br class=\"clear\" />\r\n			</div>\r\n			<a href=\"/\"><img src=\"assets/templates/quintex/images/quintex-bottom.jpg\" alt=\"\" class=\"alignleft\" /></a>\r\n<table>\r\n				<tr>\r\n					<td>\r\n						<p>Browse by make:</p>\r\n						<ul>\r\n							<li><a href=\"/toyota.html\">Toyota</a></li>\r\n							<li><a href=\"/honda.html\">Honda</a></li>\r\n							<li><a href=\"/chevrolet.html\">Chevrolet</a></li>\r\n							<li><a href=\"/chrysler.html\">Chrysler</a></li>\r\n						</ul>\r\n					</td>\r\n					<td>\r\n						<p>&nbsp;</p>\r\n						<ul>\r\n							<li><a href=\"/dodge.html\">Dodge</a></li>\r\n							<li><a href=\"/jeep.html\">Jeep</a></li>\r\n							<li><a href=\"/ford.html\">Ford</a></li>\r\n							<li><a href=\"/hyundai.html\">Hyundai</a></li>\r\n						</ul>\r\n					</td>\r\n					<td>\r\n						<p>Products we offer:</p>\r\n						<ul>\r\n							<li><a href=\"\">Bluetooth</a></li>\r\n							<li><a href=\"\">Navigation</a></li>\r\n							<li><a href=\"\">Rear Entertainment</a></li>\r\n							<li><a href=\"\">Radios</a></li>\r\n						</ul>\r\n					</td>\r\n					<td>\r\n						<p>&nbsp;</p>\r\n						<ul>\r\n							<li><a href=\"\">Indash A/V</a></li>\r\n							<li><a href=\"\">SAT/HD Radio</a></li>\r\n							<li><a href=\"\">iPod/USB</a></li>\r\n							<li><a href=\"\">Mirrors</a></li>\r\n						</ul>\r\n					</td>\r\n					<td>\r\n						<p>&nbsp;</p>\r\n						<ul>\r\n							<li><a href=\"\">Reverse Safety</a></li>\r\n							<li><a href=\"\">Radar</a></li>\r\n							<li><a href=\"\">Cruise</a></li>\r\n							<li><a href=\"\">Power Accessories</a></li>\r\n						</ul>\r\n					</td>\r\n					<td>\r\n						<p>&nbsp;</p>\r\n						<ul>\r\n							<li><a href=\"\">Security</a></li>\r\n							<li><a href=\"\">Remote Start</a></li>\r\n							<li><a href=\"\">Heated Seats</a></li>\r\n						</ul>\r\n					</td>\r\n				</tr>\r\n			</table>\r\n			<br class=\"clear\" />\r\n		</div><!--/footer-->\r\n	</div><!--/container-->\r\n<script type=\"text/javascript\">\r\n\r\n  var _gaq = _gaq || [];\r\n  _gaq.push([\'_setAccount\', \'UA-20043156-1\']);\r\n  _gaq.push([\'_trackPageview\']);\r\n\r\n  (function() {\r\n    var ga = document.createElement(\'script\'); ga.type = \'text/javascript\'; ga.async = true;\r\n    ga.src = (\'https:\' == document.location.protocol ? \'https://ssl\' : \'http://www\') + \'.google-analytics.com/ga.js\';\r\n    var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(ga, s);\r\n  })();\r\n\r\n</script>\r\n</body>\r\n</html>\r\n',0),(4,'MODxHost','<strong>1.0</strong> Legacy MODx Host template including dropdown menu',0,1,'',0,'<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n\n<head>\n  <title>[(site_name)] | [*pagetitle*]</title>\n  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=[(modx_charset)]\" />\n  <base href=\"[(site_url)]\"></base>\n  <link rel=\"stylesheet\" href=\"assets/templates/modxhost/layout.css\" type=\"text/css\" media=\"screen\" />\n  <link rel=\"stylesheet\" href=\"assets/templates/modxhost/modxmenu.css\" type=\"text/css\" media=\"screen\" />\n  <link rel=\"stylesheet\" href=\"assets/templates/modxhost/form.css\" type=\"text/css\" media=\"screen\" />\n  <link rel=\"stylesheet\" href=\"assets/templates/modxhost/modx.css\" type=\"text/css\" media=\"screen\" />\n  <link rel=\"stylesheet\" href=\"assets/templates/modxhost/print.css\" type=\"text/css\" media=\"print\" />\n  <link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS 2.0\" href=\"[(site_url)][~11~]\" />\n  <script src=\"manager/media/script/mootools/mootools.js\" type=\"text/javascript\"></script>\n  <script src=\"assets/templates/modxhost/drop_down_menu.js\" type=\"text/javascript\"></script>\n</head>\n<body>\n<div id=\"wrapper\">\n  <div id=\"minHeight\"></div>\n  <div id=\"outer\">\n    <div id=\"inner\">\n      <div id=\"right\">\n        <div id=\"right-inner\">\n          <h1 style=\"text-indent: -5000px;padding: 0px; margin:0px; font-size: 1px;\">[(site_name)]</h1>\n          <div id=\"sidebar\">\n            <h2>News:</h2>\n            [[Ditto? &parents=`2` &display=`2` &total=`20` &removeChunk=`Comments` &tpl=`nl_sidebar`]]\n            <div id=\"recentdocsctnr\">\n              <h2>Most Recent:</h2>\n              <a name=\"recentdocs\"></a>[[ListIndexer?LIn_root=0]] </div>\n            <h2>Login:</h2>\n            <div id=\"sidebarlogin\">[!WebLogin? &tpl=`FormLogin` &loginhomeid=`[(site_start)]`!]</div>\n            <h2>Meta:</h2>\n            <p><a href=\"http://validator.w3.org/check/referer\" title=\"This page validates as XHTML 1.0 Transitional\">Valid <abbr title=\"eXtensible HyperText Markup Language\">XHTML</abbr></a></p>\n            <p><a href=\"http://jigsaw.w3.org/css-validator/check/referer\" title=\"This page uses valid Cascading Stylesheets\" rel=\"external\">Valid <abbr title=\"W3C Cascading Stylesheets\">css</abbr></a></p>\n            <p><a href=\"http://modxcms.com\" title=\"Ajax CMS and PHP Application Framework\">MODx</a></p>\n          </div>\n          <!-- close #sidebar -->\n        </div>\n        <!-- end right inner-->\n      </div>\n      <!-- end right -->\n      <div id=\"left\">\n        <div id=\"left-inner\">\n          <div id=\"content\">\n            <div class=\"post\">\n              <h2>[*longtitle*]</h2>\n              [*#content*] </div>\n            <!-- close .post (main column content) -->\n          </div>\n          <!-- close #content -->\n        </div>\n        <!-- end left-inner -->\n      </div>\n      <!-- end left -->\n    </div>\n    <!-- end inner -->\n    <div id=\"clearfooter\"></div>\n    <div id=\"header\">\n      <h1><a id=\"logo\" href=\"[~[(site_start)]~]\" title=\"[(site_name)]\">[(site_name)]</a></h1>\n\n      <div id=\"search\"><!--search_terms--><span id=\"search-txt\">SEARCH</span><a name=\"search\"></a>[!AjaxSearch? &ajaxSearch=`1` &landingPage=`8` &moreResultsPage=`8` &addJscript=`0` &showIntro=`0` &ajaxMax=`5` &extract=`1`!]</div>\n      <div id=\"ajaxmenu\"> [[Wayfinder?startId=`0` &outerTpl=`mh.OuterTpl` &innerTpl=`mh.InnerTpl` &rowTpl=`mh.RowTpl` &innerRowTpl=`mh.InnerRowTpl` &firstClass=`first` &hereClass=``]] </div>\n      <!-- end topmenu -->\n    </div>\n    <!-- end header -->\n    <br style=\"clear:both;height:0;font-size: 1px\" />\n    <div id=\"footer\">\n      <p> <a href=\"http://modxcms.com\" title=\"Ajax CMS and PHP Application Framework\">Powered\n          by MODx</a> &nbsp;<a href=\"http://www.modxhost.com/\" title=\"Template Designed by modXhost.com\">Template &copy; 2006-2010\n          modXhost.com</a><br />\n        MySQL: [^qt^], [^q^] request(s), PHP: [^p^], total: [^t^], document retrieved\n        from [^s^]. </p>\n    </div>\n    <!-- end footer -->\n  </div>\n  <!-- end outer div -->\n</div>\n<!-- end wrapper -->\n</body>\n</html>',0);

--
-- Table structure for table `modx_site_tmplvar_access`
--

CREATE TABLE `modx_site_tmplvar_access` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `tmplvarid` int(10) NOT NULL DEFAULT '0',
  `documentgroup` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Contains data used for template variable access permissions.';

--
-- Dumping data for table `modx_site_tmplvar_access`
--


--
-- Table structure for table `modx_site_tmplvar_contentvalues`
--

CREATE TABLE `modx_site_tmplvar_contentvalues` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `tmplvarid` int(10) NOT NULL DEFAULT '0' COMMENT 'Template Variable id',
  `contentid` int(10) NOT NULL DEFAULT '0' COMMENT 'Site Content Id',
  `value` text,
  PRIMARY KEY (`id`),
  KEY `idx_tmplvarid` (`tmplvarid`),
  KEY `idx_id` (`contentid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Site Template Variables Content Values Link Table';

--
-- Dumping data for table `modx_site_tmplvar_contentvalues`
--


--
-- Table structure for table `modx_site_tmplvar_templates`
--

CREATE TABLE `modx_site_tmplvar_templates` (
  `tmplvarid` int(10) NOT NULL DEFAULT '0' COMMENT 'Template Variable id',
  `templateid` int(11) NOT NULL DEFAULT '0',
  `rank` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`tmplvarid`,`templateid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Site Template Variables Templates Link Table';

--
-- Dumping data for table `modx_site_tmplvar_templates`
--


--
-- Table structure for table `modx_site_tmplvars`
--

CREATE TABLE `modx_site_tmplvars` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` varchar(20) NOT NULL DEFAULT '',
  `name` varchar(50) NOT NULL DEFAULT '',
  `caption` varchar(80) NOT NULL DEFAULT '',
  `description` varchar(255) NOT NULL DEFAULT '',
  `editor_type` int(11) NOT NULL DEFAULT '0' COMMENT '0-plain text,1-rich text,2-code editor',
  `category` int(11) NOT NULL DEFAULT '0' COMMENT 'category id',
  `locked` tinyint(4) NOT NULL DEFAULT '0',
  `elements` text,
  `rank` int(11) NOT NULL DEFAULT '0',
  `display` varchar(20) NOT NULL DEFAULT '' COMMENT 'Display Control',
  `display_params` text COMMENT 'Display Control Properties',
  `default_text` text,
  PRIMARY KEY (`id`),
  KEY `indx_rank` (`rank`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Site Template Variables';

--
-- Dumping data for table `modx_site_tmplvars`
--


--
-- Table structure for table `modx_system_eventnames`
--

CREATE TABLE `modx_system_eventnames` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL DEFAULT '',
  `service` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'System Service number',
  `groupname` varchar(20) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=1001 DEFAULT CHARSET=latin1 COMMENT='System Event Names.';

--
-- Dumping data for table `modx_system_eventnames`
--

INSERT INTO `modx_system_eventnames` VALUES (1,'OnDocPublished',5,''),(2,'OnDocUnPublished',5,''),(3,'OnWebPagePrerender',5,''),(4,'OnWebLogin',3,''),(5,'OnBeforeWebLogout',3,''),(6,'OnWebLogout',3,''),(7,'OnWebSaveUser',3,''),(8,'OnWebDeleteUser',3,''),(9,'OnWebChangePassword ',3,''),(10,'OnWebCreateGroup',3,''),(11,'OnManagerLogin',2,''),(12,'OnBeforeManagerLogout',2,''),(13,'OnManagerLogout',2,''),(14,'OnManagerSaveUser ',2,''),(15,'OnManagerDeleteUser',2,''),(16,'OnManagerChangePassword ',2,''),(17,'OnManagerCreateGroup',2,''),(18,'OnBeforeCacheUpdate',4,''),(19,'OnCacheUpdate',4,''),(20,'OnLoadWebPageCache',4,''),(21,'OnBeforeSaveWebPageCache',4,''),(22,'OnChunkFormPrerender',1,'Chunks'),(23,'OnChunkFormRender',1,'Chunks'),(24,'OnBeforeChunkFormSave',1,'Chunks'),(25,'OnChunkFormSave',1,'Chunks'),(26,'OnBeforeChunkFormDelete',1,'Chunks'),(27,'OnChunkFormDelete',1,'Chunks'),(28,'OnDocFormPrerender',1,'Documents'),(29,'OnDocFormRender',1,'Documents'),(30,'OnBeforeDocFormSave',1,'Documents'),(31,'OnDocFormSave',1,'Documents'),(32,'OnBeforeDocFormDelete',1,'Documents'),(33,'OnDocFormDelete',1,'Documents'),(34,'OnPluginFormPrerender',1,'Plugins'),(35,'OnPluginFormRender',1,'Plugins'),(36,'OnBeforePluginFormSave',1,'Plugins'),(37,'OnPluginFormSave',1,'Plugins'),(38,'OnBeforePluginFormDelete',1,'Plugins'),(39,'OnPluginFormDelete',1,'Plugins'),(40,'OnSnipFormPrerender',1,'Snippets'),(41,'OnSnipFormRender',1,'Snippets'),(42,'OnBeforeSnipFormSave',1,'Snippets'),(43,'OnSnipFormSave',1,'Snippets'),(44,'OnBeforeSnipFormDelete',1,'Snippets'),(45,'OnSnipFormDelete',1,'Snippets'),(46,'OnTempFormPrerender',1,'Templates'),(47,'OnTempFormRender',1,'Templates'),(48,'OnBeforeTempFormSave',1,'Templates'),(49,'OnTempFormSave',1,'Templates'),(50,'OnBeforeTempFormDelete',1,'Templates'),(51,'OnTempFormDelete',1,'Templates'),(52,'OnTVFormPrerender',1,'Template Variables'),(53,'OnTVFormRender',1,'Template Variables'),(54,'OnBeforeTVFormSave',1,'Template Variables'),(55,'OnTVFormSave',1,'Template Variables'),(56,'OnBeforeTVFormDelete',1,'Template Variables'),(57,'OnTVFormDelete',1,'Template Variables'),(58,'OnUserFormPrerender',1,'Users'),(59,'OnUserFormRender',1,'Users'),(60,'OnBeforeUserFormSave',1,'Users'),(61,'OnUserFormSave',1,'Users'),(62,'OnBeforeUserFormDelete',1,'Users'),(63,'OnUserFormDelete',1,'Users'),(64,'OnWUsrFormPrerender',1,'Web Users'),(65,'OnWUsrFormRender',1,'Web Users'),(66,'OnBeforeWUsrFormSave',1,'Web Users'),(67,'OnWUsrFormSave',1,'Web Users'),(68,'OnBeforeWUsrFormDelete',1,'Web Users'),(69,'OnWUsrFormDelete',1,'Web Users'),(70,'OnSiteRefresh',1,''),(71,'OnFileManagerUpload',1,''),(72,'OnModFormPrerender',1,'Modules'),(73,'OnModFormRender',1,'Modules'),(74,'OnBeforeModFormDelete',1,'Modules'),(75,'OnModFormDelete',1,'Modules'),(76,'OnBeforeModFormSave',1,'Modules'),(77,'OnModFormSave',1,'Modules'),(78,'OnBeforeWebLogin',3,''),(79,'OnWebAuthentication',3,''),(80,'OnBeforeManagerLogin',2,''),(81,'OnManagerAuthentication',2,''),(82,'OnSiteSettingsRender',1,'System Settings'),(83,'OnFriendlyURLSettingsRender',1,'System Settings'),(84,'OnUserSettingsRender',1,'System Settings'),(85,'OnInterfaceSettingsRender',1,'System Settings'),(86,'OnMiscSettingsRender',1,'System Settings'),(87,'OnRichTextEditorRegister',1,'RichText Editor'),(88,'OnRichTextEditorInit',1,'RichText Editor'),(89,'OnManagerPageInit',2,''),(90,'OnWebPageInit',5,''),(91,'OnLoadWebDocument',5,''),(92,'OnParseDocument',5,''),(93,'OnManagerLoginFormRender',2,''),(94,'OnWebPageComplete',5,''),(95,'OnLogPageHit',5,''),(96,'OnBeforeManagerPageInit',2,''),(97,'OnBeforeEmptyTrash',1,'Documents'),(98,'OnEmptyTrash',1,'Documents'),(99,'OnManagerLoginFormPrerender',2,''),(100,'OnStripAlias',1,'Documents'),(200,'OnCreateDocGroup',1,'Documents'),(201,'OnManagerWelcomePrerender',2,''),(202,'OnManagerWelcomeHome',2,''),(203,'OnManagerWelcomeRender',2,''),(204,'OnBeforeDocDuplicate',1,'Documents'),(205,'OnDocDuplicate',1,'Documents'),(999,'OnPageUnauthorized',1,''),(1000,'OnPageNotFound',1,'');

--
-- Table structure for table `modx_system_settings`
--

CREATE TABLE `modx_system_settings` (
  `setting_name` varchar(50) NOT NULL DEFAULT '',
  `setting_value` text,
  UNIQUE KEY `setting_name` (`setting_name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Contains Content Manager settings.';

--
-- Dumping data for table `modx_system_settings`
--

INSERT INTO `modx_system_settings` VALUES ('manager_theme','MODxCarbon'),('settings_version','1.0.4'),('show_meta','0'),('server_offset_time','0'),('server_protocol','http'),('manager_language','english'),('modx_charset','UTF-8'),('site_name','My MODx Site'),('site_start','1'),('error_page','1'),('unauthorized_page','1'),('site_status','1'),('site_unavailable_message','The site is currently unavailable'),('track_visitors','0'),('resolve_hostnames','0'),('top_howmany','10'),('default_template','3'),('old_template','3'),('publish_default','1'),('cache_default','0'),('search_default','1'),('friendly_urls','1'),('friendly_url_prefix',''),('friendly_url_suffix','.html'),('friendly_alias_urls','1'),('use_alias_path','0'),('use_udperms','1'),('udperms_allowroot','0'),('failed_login_attempts','3'),('blocked_minutes','60'),('use_captcha','0'),('captcha_words','MODx,Access,Better,BitCode,Cache,Desc,Design,Excell,Enjoy,URLs,TechView,Gerald,Griff,Humphrey,Holiday,Intel,Integration,Joystick,Join(),Tattoo,Genetic,Light,Likeness,Marit,Maaike,Niche,Netherlands,Ordinance,Oscillo,Parser,Phusion,Query,Question,Regalia,Righteous,Snippet,Sentinel,Template,Thespian,Unity,Enterprise,Verily,Veri,Website,WideWeb,Yap,Yellow,Zebra,Zygote'),('emailsender','admin@quintexmobileelectronics.com'),('emailsubject','Your login details'),('number_of_logs','100'),('number_of_messages','30'),('number_of_results','20'),('use_editor','1'),('use_browser','1'),('rb_base_dir','/home/quintexn/public_html/dealer/assets/'),('rb_base_url','assets/'),('which_editor','none'),('fe_editor_lang','english'),('fck_editor_toolbar','standard'),('fck_editor_autolang','0'),('editor_css_path',''),('editor_css_selectors',''),('strip_image_paths','1'),('upload_images','bmp,ico,gif,jpeg,jpg,png,psd,tif,tiff'),('upload_media','au,avi,mp3,mp4,mpeg,mpg,wav,wmv'),('upload_flash','fla,flv,swf'),('upload_files','aac,au,avi,css,cache,doc,docx,gz,gzip,htaccess,htm,html,js,mp3,mp4,mpeg,mpg,ods,odp,odt,pdf,ppt,pptx,rar,tar,tgz,txt,wav,wmv,xls,xlsx,xml,z,zip'),('upload_maxsize','1048576'),('new_file_permissions','0644'),('new_folder_permissions','0755'),('filemanager_path','/home/quintexn/public_html/dealer/'),('theme_refresher',''),('manager_layout','4'),('custom_contenttype','application/rss+xml,application/pdf,application/vnd.ms-word,application/vnd.ms-excel,text/html,text/css,text/xml,text/javascript,text/plain'),('auto_menuindex','1'),('session.cookie.lifetime','604800'),('mail_check_timeperiod','60'),('manager_direction','ltr'),('tinymce_editor_theme','editor'),('tinymce_custom_plugins','style,advimage,advlink,searchreplace,print,contextmenu,paste,fullscreen,nonbreaking,xhtmlxtras,visualchars,media'),('tinymce_custom_buttons1','undo,redo,selectall,separator,pastetext,pasteword,separator,search,replace,separator,nonbreaking,hr,charmap,separator,image,link,unlink,anchor,media,separator,cleanup,removeformat,separator,fullscreen,print,code,help'),('tinymce_custom_buttons2','bold,italic,underline,strikethrough,sub,sup,separator,bullist,numlist,outdent,indent,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,styleselect,formatselect,separator,styleprops'),('tree_show_protected','0'),('rss_url_news','http://feeds.feedburner.com/modx-announce'),('rss_url_security','http://feeds.feedburner.com/modxsecurity'),('validate_referer','1'),('datepicker_offset','-10'),('xhtml_urls','1'),('allow_duplicate_alias','0'),('automatic_alias','1'),('datetime_format','dd-mm-YYYY'),('warning_visibility','1'),('remember_last_tab','0'),('site_id','4cdd7ac698965'),('site_unavailable_page',''),('reload_site_unavailable',''),('siteunavailable_message_default','The site is currently unavailable.'),('reload_captcha_words',''),('captcha_words_default','MODx,Access,Better,BitCode,Chunk,Cache,Desc,Design,Excell,Enjoy,URLs,TechView,Gerald,Griff,Humphrey,Holiday,Intel,Integration,Joystick,Join(),Oscope,Genetic,Light,Likeness,Marit,Maaike,Niche,Netherlands,Ordinance,Oscillo,Parser,Phusion,Query,Question,Regalia,Righteous,Snippet,Sentinel,Template,Thespian,Unity,Enterprise,Verily,Tattoo,Veri,Website,WideWeb,Yap,Yellow,Zebra,Zygote'),('reload_emailsubject',''),('emailsubject_default','Your login details'),('reload_signupemail_message',''),('signupemail_message','Hello [+uid+] \r\n\r\nHere are your login details for [+sname+] Content Manager:\r\n\r\nUsername: [+uid+]\r\nPassword: [+pwd+]\r\n\r\nOnce you log into the Content Manager ([+surl+]), you can change your password.\r\n\r\nRegards,\r\nSite Administrator'),('system_email_signup_default','Hello [+uid+] \r\n\r\nHere are your login details for [+sname+] Content Manager:\r\n\r\nUsername: [+uid+]\r\nPassword: [+pwd+]\r\n\r\nOnce you log into the Content Manager ([+surl+]), you can change your password.\r\n\r\nRegards,\r\nSite Administrator'),('reload_websignupemail_message',''),('websignupemail_message','Hello [+uid+]\r\n\r\nHere are your login details for [+sname+]:\r\n\r\nUsername: [+uid+]\r\nPassword: [+pwd+]\r\n\r\nOnce you log into [+sname+] ([+surl+]), you can change your password.\r\n\r\nRegards,\r\nSite Administrator'),('system_email_websignup_default','Hello [+uid+]\r\n\r\nHere are your login details for [+sname+]:\r\n\r\nUsername: [+uid+]\r\nPassword: [+pwd+]\r\n\r\nOnce you log into [+sname+] ([+surl+]), you can change your password.\r\n\r\nRegards,\r\nSite Administrator'),('reload_system_email_webreminder_message',''),('webpwdreminder_message','Hello [+uid+]\r\n\r\nTo activate your new password click the following link:\r\n\r\n[+surl+]\r\n\r\nIf successful you can use the following password to login:\r\n\r\nPassword:[+pwd+]\r\n\r\nIf you did not request this email then please ignore it.\r\n\r\nRegards,\r\nSite Administrator'),('system_email_webreminder_default','Hello [+uid+]\r\n\r\nTo activate your new password click the following link:\r\n\r\n[+surl+]\r\n\r\nIf successful you can use the following password to login:\r\n\r\nPassword:[+pwd+]\r\n\r\nIf you did not request this email then please ignore it.\r\n\r\nRegards,\r\nSite Administrator'),('tree_page_click','3'),('rb_webuser','0'),('tinymce_custom_buttons3',''),('tinymce_custom_buttons4',''),('tinymce_css_selectors','');

--
-- Table structure for table `modx_user_attributes`
--

CREATE TABLE `modx_user_attributes` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `internalKey` int(10) NOT NULL DEFAULT '0',
  `fullname` varchar(100) NOT NULL DEFAULT '',
  `role` int(10) NOT NULL DEFAULT '0',
  `email` varchar(100) NOT NULL DEFAULT '',
  `phone` varchar(100) NOT NULL DEFAULT '',
  `mobilephone` varchar(100) NOT NULL DEFAULT '',
  `blocked` int(1) NOT NULL DEFAULT '0',
  `blockeduntil` int(11) NOT NULL DEFAULT '0',
  `blockedafter` int(11) NOT NULL DEFAULT '0',
  `logincount` int(11) NOT NULL DEFAULT '0',
  `lastlogin` int(11) NOT NULL DEFAULT '0',
  `thislogin` int(11) NOT NULL DEFAULT '0',
  `failedlogincount` int(10) NOT NULL DEFAULT '0',
  `sessionid` varchar(100) NOT NULL DEFAULT '',
  `dob` int(10) NOT NULL DEFAULT '0',
  `gender` int(1) NOT NULL DEFAULT '0' COMMENT '0 - unknown, 1 - Male 2 - female',
  `country` varchar(5) NOT NULL DEFAULT '',
  `state` varchar(25) NOT NULL DEFAULT '',
  `zip` varchar(25) NOT NULL DEFAULT '',
  `fax` varchar(100) NOT NULL DEFAULT '',
  `photo` varchar(255) NOT NULL DEFAULT '' COMMENT 'link to photo',
  `comment` varchar(255) NOT NULL DEFAULT '' COMMENT 'short comment',
  PRIMARY KEY (`id`),
  KEY `userid` (`internalKey`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 COMMENT='Contains information about the backend users.';

--
-- Dumping data for table `modx_user_attributes`
--

INSERT INTO `modx_user_attributes` VALUES (1,1,'Default admin account',1,'admin@quintexmobileelectronics.com','','',0,1366586380,0,17,1317923724,1318621614,5,'5bb64d7330f4c24097c92aa6c9b59d11',0,0,'','','','','','');

--
-- Table structure for table `modx_user_messages`
--

CREATE TABLE `modx_user_messages` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `type` varchar(15) NOT NULL DEFAULT '',
  `subject` varchar(60) NOT NULL DEFAULT '',
  `message` text,
  `sender` int(10) NOT NULL DEFAULT '0',
  `recipient` int(10) NOT NULL DEFAULT '0',
  `private` tinyint(4) NOT NULL DEFAULT '0',
  `postdate` int(20) NOT NULL DEFAULT '0',
  `messageread` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Contains messages for the Content Manager messaging system.';

--
-- Dumping data for table `modx_user_messages`
--


--
-- Table structure for table `modx_user_roles`
--

CREATE TABLE `modx_user_roles` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL DEFAULT '',
  `description` varchar(255) NOT NULL DEFAULT '',
  `frames` int(1) NOT NULL DEFAULT '0',
  `home` int(1) NOT NULL DEFAULT '0',
  `view_document` int(1) NOT NULL DEFAULT '0',
  `new_document` int(1) NOT NULL DEFAULT '0',
  `save_document` int(1) NOT NULL DEFAULT '0',
  `publish_document` int(1) NOT NULL DEFAULT '0',
  `delete_document` int(1) NOT NULL DEFAULT '0',
  `empty_trash` int(1) NOT NULL DEFAULT '0',
  `action_ok` int(1) NOT NULL DEFAULT '0',
  `logout` int(1) NOT NULL DEFAULT '0',
  `help` int(1) NOT NULL DEFAULT '0',
  `messages` int(1) NOT NULL DEFAULT '0',
  `new_user` int(1) NOT NULL DEFAULT '0',
  `edit_user` int(1) NOT NULL DEFAULT '0',
  `logs` int(1) NOT NULL DEFAULT '0',
  `edit_parser` int(1) NOT NULL DEFAULT '0',
  `save_parser` int(1) NOT NULL DEFAULT '0',
  `edit_template` int(1) NOT NULL DEFAULT '0',
  `settings` int(1) NOT NULL DEFAULT '0',
  `credits` int(1) NOT NULL DEFAULT '0',
  `new_template` int(1) NOT NULL DEFAULT '0',
  `save_template` int(1) NOT NULL DEFAULT '0',
  `delete_template` int(1) NOT NULL DEFAULT '0',
  `edit_snippet` int(1) NOT NULL DEFAULT '0',
  `new_snippet` int(1) NOT NULL DEFAULT '0',
  `save_snippet` int(1) NOT NULL DEFAULT '0',
  `delete_snippet` int(1) NOT NULL DEFAULT '0',
  `edit_chunk` int(1) NOT NULL DEFAULT '0',
  `new_chunk` int(1) NOT NULL DEFAULT '0',
  `save_chunk` int(1) NOT NULL DEFAULT '0',
  `delete_chunk` int(1) NOT NULL DEFAULT '0',
  `empty_cache` int(1) NOT NULL DEFAULT '0',
  `edit_document` int(1) NOT NULL DEFAULT '0',
  `change_password` int(1) NOT NULL DEFAULT '0',
  `error_dialog` int(1) NOT NULL DEFAULT '0',
  `about` int(1) NOT NULL DEFAULT '0',
  `file_manager` int(1) NOT NULL DEFAULT '0',
  `save_user` int(1) NOT NULL DEFAULT '0',
  `delete_user` int(1) NOT NULL DEFAULT '0',
  `save_password` int(11) NOT NULL DEFAULT '0',
  `edit_role` int(1) NOT NULL DEFAULT '0',
  `save_role` int(1) NOT NULL DEFAULT '0',
  `delete_role` int(1) NOT NULL DEFAULT '0',
  `new_role` int(1) NOT NULL DEFAULT '0',
  `access_permissions` int(1) NOT NULL DEFAULT '0',
  `bk_manager` int(1) NOT NULL DEFAULT '0',
  `new_plugin` int(1) NOT NULL DEFAULT '0',
  `edit_plugin` int(1) NOT NULL DEFAULT '0',
  `save_plugin` int(1) NOT NULL DEFAULT '0',
  `delete_plugin` int(1) NOT NULL DEFAULT '0',
  `new_module` int(1) NOT NULL DEFAULT '0',
  `edit_module` int(1) NOT NULL DEFAULT '0',
  `save_module` int(1) NOT NULL DEFAULT '0',
  `delete_module` int(1) NOT NULL DEFAULT '0',
  `exec_module` int(1) NOT NULL DEFAULT '0',
  `view_eventlog` int(1) NOT NULL DEFAULT '0',
  `delete_eventlog` int(1) NOT NULL DEFAULT '0',
  `manage_metatags` int(1) NOT NULL DEFAULT '0' COMMENT 'manage site meta tags and keywords',
  `edit_doc_metatags` int(1) NOT NULL DEFAULT '0' COMMENT 'edit document meta tags and keywords',
  `new_web_user` int(1) NOT NULL DEFAULT '0',
  `edit_web_user` int(1) NOT NULL DEFAULT '0',
  `save_web_user` int(1) NOT NULL DEFAULT '0',
  `delete_web_user` int(1) NOT NULL DEFAULT '0',
  `web_access_permissions` int(1) NOT NULL DEFAULT '0',
  `view_unpublished` int(1) NOT NULL DEFAULT '0',
  `import_static` int(1) NOT NULL DEFAULT '0',
  `export_static` int(1) NOT NULL DEFAULT '0',
  `remove_locks` int(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 COMMENT='Contains information describing the user roles.';

--
-- Dumping data for table `modx_user_roles`
--

INSERT INTO `modx_user_roles` VALUES (2,'Editor','Limited to managing content',1,1,1,1,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,1,1,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,1),(3,'Publisher','Editor with expanded permissions including manage users, update Elements and site settings',1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,1,1,0,1,0,0,1),(1,'Administrator','Site administrators have full access to all functions',1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1);

--
-- Table structure for table `modx_user_settings`
--

CREATE TABLE `modx_user_settings` (
  `user` int(11) NOT NULL,
  `setting_name` varchar(50) NOT NULL DEFAULT '',
  `setting_value` text,
  KEY `setting_name` (`setting_name`),
  KEY `user` (`user`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Contains backend user settings.';

--
-- Dumping data for table `modx_user_settings`
--


--
-- Table structure for table `modx_web_groups`
--

CREATE TABLE `modx_web_groups` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `webgroup` int(10) NOT NULL DEFAULT '0',
  `webuser` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 COMMENT='Contains data used for web access permissions.';

--
-- Dumping data for table `modx_web_groups`
--

INSERT INTO `modx_web_groups` VALUES (2,1,1);

--
-- Table structure for table `modx_web_user_attributes`
--

CREATE TABLE `modx_web_user_attributes` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `internalKey` int(10) NOT NULL DEFAULT '0',
  `fullname` varchar(100) NOT NULL DEFAULT '',
  `role` int(10) NOT NULL DEFAULT '0',
  `email` varchar(100) NOT NULL DEFAULT '',
  `phone` varchar(100) NOT NULL DEFAULT '',
  `mobilephone` varchar(100) NOT NULL DEFAULT '',
  `blocked` int(1) NOT NULL DEFAULT '0',
  `blockeduntil` int(11) NOT NULL DEFAULT '0',
  `blockedafter` int(11) NOT NULL DEFAULT '0',
  `logincount` int(11) NOT NULL DEFAULT '0',
  `lastlogin` int(11) NOT NULL DEFAULT '0',
  `thislogin` int(11) NOT NULL DEFAULT '0',
  `failedlogincount` int(10) NOT NULL DEFAULT '0',
  `sessionid` varchar(100) NOT NULL DEFAULT '',
  `dob` int(10) NOT NULL DEFAULT '0',
  `gender` int(1) NOT NULL DEFAULT '0' COMMENT '0 - unknown, 1 - Male 2 - female',
  `country` varchar(5) NOT NULL DEFAULT '',
  `state` varchar(25) NOT NULL DEFAULT '',
  `zip` varchar(25) NOT NULL DEFAULT '',
  `fax` varchar(100) NOT NULL DEFAULT '',
  `photo` varchar(255) NOT NULL DEFAULT '' COMMENT 'link to photo',
  `comment` text NOT NULL COMMENT 'short comment',
  PRIMARY KEY (`id`),
  KEY `userid` (`internalKey`)
) ENGINE=MyISAM AUTO_INCREMENT=32 DEFAULT CHARSET=latin1 COMMENT='Contains information for web users.';

--
-- Dumping data for table `modx_web_user_attributes`
--

INSERT INTO `modx_web_user_attributes` VALUES (1,1,'dealer admin',0,'admin@quintexmobileelectronics.com','','',0,0,0,206,1377544561,1468153423,0,'740fee97c09c8193e37b0a297630a521',0,0,'','','','','',''),(31,31,'',0,'dealer@qtxmobile.com','dealer','',0,0,0,56,1410723589,1412386882,0,'5f7fa9e6ecc71bb701b91d044dd8c8f3',0,0,'','','','','','<p>&nbsp;</p>\r\n<p>&nbsp;</p>\r\n<p><a href=\"assets/files/Dealer_Price_Sheet_07-10-13.pdf\">Dealer Price Sheet</a></p>\r\n<p>If You Have Specific Pricing Questions Call 760-432-6333</p>'),(7,7,'',0,'toyec@qtxmobile.com','toyec','',0,0,0,68,1376938813,1377544686,0,'598bc781a5f96c358cee59cb356ee62c',0,0,'','','','','','<p>&nbsp;<a href=\"assets/files/Dealer_Price_Sheet_Toy_El_Cajon-Sales_08-25-13.pdf\">Dealer Cost Price Sheet&nbsp;</a></p>\r\n<p>If you have specific pricing questions call 760-432-6333</p>\r\n<p><span style=\"font-size: 120%;\"><br /></span></p>'),(15,15,'',0,'toyesc@qtxmobile.com','','',0,0,0,86,1364425400,1376938778,0,'a26c22b8b41f7da4fd9a639517d92a42',0,0,'','','','','','<p>&nbsp;</p>\r\n<p><a href=\"assets/files/Esc_Retail_Price_Toyota_8_2011.pdf\"></a></p>\r\n<p>&nbsp;</p>\r\n<p><a href=\"assets/files/Toy_Escondido_Dealer_Price_Sheet_07-10-13.pdf\">Dealer Wholesale Price Sheet&nbsp;</a></p>\r\n<p>If you have specific pricing questions call 760-432-6333</p>');

--
-- Table structure for table `modx_web_user_settings`
--

CREATE TABLE `modx_web_user_settings` (
  `webuser` int(11) NOT NULL,
  `setting_name` varchar(50) NOT NULL DEFAULT '',
  `setting_value` text,
  KEY `setting_name` (`setting_name`),
  KEY `webuserid` (`webuser`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Contains web user settings.';

--
-- Dumping data for table `modx_web_user_settings`
--


--
-- Table structure for table `modx_web_users`
--

CREATE TABLE `modx_web_users` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `username` varchar(100) NOT NULL DEFAULT '',
  `password` varchar(100) NOT NULL DEFAULT '',
  `cachepwd` varchar(100) NOT NULL DEFAULT '' COMMENT 'Store new unconfirmed password',
  PRIMARY KEY (`id`),
  UNIQUE KEY `username` (`username`)
) ENGINE=MyISAM AUTO_INCREMENT=32 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `modx_web_users`
--

INSERT INTO `modx_web_users` VALUES (1,'admin','2310f31d77b9e12d7ec957f932949148',''),(31,'dealer','040ec1ee950ffc53291f6df0ffc30325',''),(7,'toyec','23a5126781bee5b08984fba046aece2f',''),(15,'toyesc','412604be30f701b1b1e3124c252065e6','');

--
-- Table structure for table `modx_webgroup_access`
--

CREATE TABLE `modx_webgroup_access` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `webgroup` int(10) NOT NULL DEFAULT '0',
  `documentgroup` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 COMMENT='Contains data used for web access permissions.';

--
-- Dumping data for table `modx_webgroup_access`
--

INSERT INTO `modx_webgroup_access` VALUES (1,1,1);

--
-- Table structure for table `modx_webgroup_names`
--

CREATE TABLE `modx_webgroup_names` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 COMMENT='Contains data used for web access permissions.';

--
-- Dumping data for table `modx_webgroup_names`
--

INSERT INTO `modx_webgroup_names` VALUES (1,'admin');


