Skip to content

Commit

Permalink
Merge pull request #81 from norv/directories_update
Browse files Browse the repository at this point in the history
Directories update (another part)
  • Loading branch information
norv committed Jan 19, 2013
2 parents 29800be + 0ebe024 commit cc2748e
Show file tree
Hide file tree
Showing 253 changed files with 1,024 additions and 1,000 deletions.
18 changes: 9 additions & 9 deletions SSI.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@
require_once($sourcedir . '/Errors.php');
require_once($sourcedir . '/Logging.php');
require_once($sourcedir . '/Load.php');
require_once($sourcedir . '/Subs-Cache.php');
require_once($sourcedir . '/subs/Cache.subs.php');
require_once($sourcedir . '/Security.php');
require_once($sourcedir . '/Class-BrowserDetect.php');
require_once($sourcedir . '/BrowserDetect.class.php');

// Create a variable to store some specific functions in.
$smcFunc = array();
Expand Down Expand Up @@ -159,7 +159,7 @@
// Do we allow guests in here?
if (empty($ssi_guest_access) && empty($modSettings['allow_guestAccess']) && $user_info['is_guest'] && basename($_SERVER['PHP_SELF']) != 'SSI.php')
{
require_once($sourcedir . '/Subs-Auth.php');
require_once($sourcedir . '/subs/Auth.subs.php');
KickGuest();
obExit(null, true);
}
Expand Down Expand Up @@ -956,7 +956,7 @@ function ssi_whosOnline($output_method = 'echo')
{
global $user_info, $txt, $sourcedir, $settings, $modSettings;

require_once($sourcedir . '/Subs-MembersOnline.php');
require_once($sourcedir . '/subs/MembersOnline.subs.php');
$membersOnlineOptions = array(
'show_hidden' => allowedTo('moderate_forum'),
);
Expand Down Expand Up @@ -1462,7 +1462,7 @@ function ssi_pollVote()
{
$_COOKIE['guest_poll_vote'] = !empty($_COOKIE['guest_poll_vote']) ? ($_COOKIE['guest_poll_vote'] . ',' . $row['id_poll']) : $row['id_poll'];

require_once($sourcedir . '/Subs-Auth.php');
require_once($sourcedir . '/subs/Auth.subs.php');
$cookie_url = url_parts(!empty($modSettings['localCookies']), !empty($modSettings['globalCookies']));
smf_setcookie('guest_poll_vote', $_COOKIE['guest_poll_vote'], time() + 2500000, $cookie_url[1], $cookie_url[0], false, false);
}
Expand Down Expand Up @@ -1510,7 +1510,7 @@ function ssi_todaysBirthdays($output_method = 'echo')
'include_birthdays' => true,
'num_days_shown' => empty($modSettings['cal_days_for_index']) || $modSettings['cal_days_for_index'] < 1 ? 1 : $modSettings['cal_days_for_index'],
);
$return = cache_quick_get('calendar_index_offset_' . ($user_info['time_offset'] + $modSettings['time_offset']), 'Subs-Calendar.php', 'cache_getRecentEvents', array($eventOptions));
$return = cache_quick_get('calendar_index_offset_' . ($user_info['time_offset'] + $modSettings['time_offset']), 'subs/Calendar.subs.php', 'cache_getRecentEvents', array($eventOptions));

if ($output_method != 'echo')
return $return['calendar_birthdays'];
Expand All @@ -1532,7 +1532,7 @@ function ssi_todaysHolidays($output_method = 'echo')
'include_holidays' => true,
'num_days_shown' => empty($modSettings['cal_days_for_index']) || $modSettings['cal_days_for_index'] < 1 ? 1 : $modSettings['cal_days_for_index'],
);
$return = cache_quick_get('calendar_index_offset_' . ($user_info['time_offset'] + $modSettings['time_offset']), 'Subs-Calendar.php', 'cache_getRecentEvents', array($eventOptions));
$return = cache_quick_get('calendar_index_offset_' . ($user_info['time_offset'] + $modSettings['time_offset']), 'subs/Calendar.subs.php', 'cache_getRecentEvents', array($eventOptions));

if ($output_method != 'echo')
return $return['calendar_holidays'];
Expand All @@ -1553,7 +1553,7 @@ function ssi_todaysEvents($output_method = 'echo')
'include_events' => true,
'num_days_shown' => empty($modSettings['cal_days_for_index']) || $modSettings['cal_days_for_index'] < 1 ? 1 : $modSettings['cal_days_for_index'],
);
$return = cache_quick_get('calendar_index_offset_' . ($user_info['time_offset'] + $modSettings['time_offset']), 'Subs-Calendar.php', 'cache_getRecentEvents', array($eventOptions));
$return = cache_quick_get('calendar_index_offset_' . ($user_info['time_offset'] + $modSettings['time_offset']), 'subs/Calendar.subs.php', 'cache_getRecentEvents', array($eventOptions));

if ($output_method != 'echo')
return $return['calendar_events'];
Expand Down Expand Up @@ -1582,7 +1582,7 @@ function ssi_todaysCalendar($output_method = 'echo')
'include_events' => true,
'num_days_shown' => empty($modSettings['cal_days_for_index']) || $modSettings['cal_days_for_index'] < 1 ? 1 : $modSettings['cal_days_for_index'],
);
$return = cache_quick_get('calendar_index_offset_' . ($user_info['time_offset'] + $modSettings['time_offset']), 'Subs-Calendar.php', 'cache_getRecentEvents', array($eventOptions));
$return = cache_quick_get('calendar_index_offset_' . ($user_info['time_offset'] + $modSettings['time_offset']), 'subs/Calendar.subs.php', 'cache_getRecentEvents', array($eventOptions));

if ($output_method != 'echo')
return $return;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
166 changes: 83 additions & 83 deletions Sources/Class-Dispatcher.php → Sources/Dispatcher.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function __construct()
// default action of the forum: board index
// everytime we don't know what to do, we'll do this :P
$default_action = array(
'file' => $sourcedir . '/BoardIndex.php',
'file' => $sourcedir . '/controllers/BoardIndex.controller.php',
'function' => 'action_boardindex'
);

Expand All @@ -58,20 +58,20 @@ public function __construct()
// You can only login
if (isset($_GET['action']) && ($_GET['action'] == 'login2' || $_GET['action'] == 'logout'))
{
$this->_file_name = $sourcedir . '/LogInOut.php';
$this->_file_name = $sourcedir . '/controllers/LogInOut.controller.php';
$this->_function_name = $_GET['action'] == 'login2' ? 'action_login2' : 'action_logout';
}
// "maintenance mode" page
else
{
$this->_file_name = $sourcedir . '/Subs-Auth.php';
$this->_file_name = $sourcedir . '/Auth.subs.php';
$this->_function_name = 'InMaintenance';
}
}
// If guest access is disallowed, a guest is kicked out... politely. :P
elseif (empty($modSettings['allow_guestAccess']) && $user_info['is_guest'] && (!isset($_GET['action']) || !in_array($_GET['action'], array('coppa', 'login', 'login2', 'register', 'register2', 'reminder', 'activate', 'help', 'mailq', 'verificationcode', 'openidreturn'))))
{
$this->_file_name = $sourcedir . '/Subs-Auth.php';
$this->_file_name = $sourcedir . '/Auth.subs.php';
$this->_function_name = 'KickGuest';
}
elseif (empty($_GET['action']))
Expand All @@ -91,13 +91,13 @@ public function __construct()
// ?board=b message index
elseif (empty($topic))
{
$this->_file_name = $sourcedir . '/MessageIndex.php';
$this->_file_name = $sourcedir . '/controllers/MessageIndex.controller.php';
$this->_function_name = 'MessageIndex';
}
// board=b;topic=t topic display
else
{
$this->_file_name = $sourcedir . '/Display.php';
$this->_file_name = $sourcedir . '/controllers/Display.controller.php';
$this->_function_name = 'Display';
}
}
Expand All @@ -111,81 +111,81 @@ public function __construct()
// $_GET['action'] => array($file, $function)
// $_GET['action'] => array($file, $class, $method)
$actionArray = array(
'activate' => array('Register.php', 'action_activate'),
'activate' => array('Register.controller.php', 'action_activate'),
'admin' => array('Admin.php', 'AdminMain'),
// 'announce' => array('Announce.php', 'action_announce'),
'attachapprove' => array('ModerateAttachments.php', 'action_attachapprove'),
'buddy' => array('Members.php', 'action_buddy'),
'calendar' => array('Calendar.php', 'action_calendar'),
'collapse' => array('BoardIndex.php', 'action_collapse'),
'contact' => array('Register.php', 'action_contact'),
'coppa' => array('Register.php', 'action_coppa'),
'credits' => array('Who.php', 'action_credits'),
'deletemsg' => array('RemoveTopic.php', 'action_deletemsg'),
'dlattach' => array('Attachment.php', 'action_dlattach'),
'disregardtopic' => array('Notify.php', 'action_disregardtopic'),
'editpoll' => array('Poll.php', 'action_editpoll'),
'editpoll2' => array('Poll.php', 'action_editpoll2'),
// 'emailuser' => array('Emailuser.php', 'action_emailuser'),
'findmember' => array('Members.php', 'action_findmember'),
'groups' => array('Groups.php', 'action_groups'),
'help' => array('Help.php', 'action_help'),
'quickhelp' => array('Help.php', 'action_quickhelp'),
'jsmodify' => array('Post.php', 'action_jsmodify'),
// 'announce' => array('Announce.controller.php', 'action_announce'),
'attachapprove' => array('ModerateAttachments.controller.php', 'action_attachapprove'),
'buddy' => array('Members.controller.php', 'action_buddy'),
'calendar' => array('Calendar.controller.php', 'action_calendar'),
'collapse' => array('BoardIndex.controller.php', 'action_collapse'),
'contact' => array('Register.controller.php', 'action_contact'),
'coppa' => array('Register.controller.php', 'action_coppa'),
'credits' => array('Who.controller.php', 'action_credits'),
'deletemsg' => array('RemoveTopic.controller.php', 'action_deletemsg'),
'dlattach' => array('Attachment.controller.php', 'action_dlattach'),
'disregardtopic' => array('Notify.controller.php', 'action_disregardtopic'),
'editpoll' => array('Poll.controller.php', 'action_editpoll'),
'editpoll2' => array('Poll.controller.php', 'action_editpoll2'),
// 'emailuser' => array('Emailuser.controller.php', 'action_emailuser'),
'findmember' => array('Members.controller.php', 'action_findmember'),
'groups' => array('Groups.controller.php', 'action_groups'),
'help' => array('Help.controller.php', 'action_help'),
'quickhelp' => array('Help.controller.php', 'action_quickhelp'),
'jsmodify' => array('Post.controller.php', 'action_jsmodify'),
'jsoption' => array('Themes.php', 'action_jsoption'),
'loadeditorlocale' => array('Subs-Editor.php', 'action_loadlocale'),
'lock' => array('Topic.php', 'action_lock'), // done
'lockvoting' => array('Poll.php', 'action_lockvoting'),
'login' => array('LogInOut.php', 'action_login'),
'login2' => array('LogInOut.php', 'action_login2'),
'logout' => array('LogInOut.php', 'action_logout'),
'markasread' => array('Markasread.php', 'markasread'),
'mergetopics' => array('SplitTopics.php', 'MergeTopics'),
'memberlist' => array('Memberlist.php', 'pre_memberlist'),
'moderate' => array('ModerationCenter.php', 'action_modcenter'),
'karma' => array('Karma.php', 'action_karma'),
'movetopic' => array('MoveTopic.php', 'action_movetopic'),
'movetopic2' => array('MoveTopic.php', 'action_movetopic2'),
'notify' => array('Notify.php', 'action_notify'),
'notifyboard' => array('Notify.php', 'action_notifyboard'),
'openidreturn' => array('Subs-OpenID.php', 'action_openidreturn'),
'pm' => array('PersonalMessage.php', 'action_pm'),
'post' => array('Post.php', 'action_post'),
'post2' => array('Post.php', 'action_post2'),
'printpage' => array('Topic.php', 'action_printpage'), // done
'profile' => array('Profile.php', 'ModifyProfile'),
'quotefast' => array('Post.php', 'action_quotefast'),
'quickmod' => array('MessageIndex.php', 'action_quickmod'),
'quickmod2' => array('Display.php', 'action_quickmod2'),
'recent' => array('Recent.php', 'action_recent'),
'register' => array('Register.php', 'action_register'),
'register2' => array('Register.php', 'action_register2'),
// 'reminder' => array('Reminder.php', ''),
'removepoll' => array('Poll.php', 'action_removepoll'),
'removetopic2' => array('RemoveTopic.php', 'action_removetopic2'),
'reporttm' => array('Emailuser.php', 'action_reporttm'),
'requestmembers' => array('Members.php', 'action_requestmembers'),
'restoretopic' => array('RemoveTopic.php', 'action_restoretopic'),
'search' => array('Search.php', 'action_plushsearch1'),
'search2' => array('Search.php', 'action_plushsearch2'),
// 'sendtopic' => array('Emailuser.php', 'action_sendtopic'),
'suggest' => array('Suggest.php', 'action_suggest'),
'spellcheck' => array('Subs-Post.php', 'action_spellcheck'),
'splittopics' => array('SplitTopics.php', 'action_splittopics'),
'stats' => array('Stats.php', 'action_stats'),
'sticky' => array('Topic.php', 'action_sticky'), // done
'loadeditorlocale' => array('subs/Editor.subs.php', 'action_loadlocale'),
'lock' => array('Topic.controller.php', 'action_lock'), // done
'lockvoting' => array('Poll.controller.php', 'action_lockvoting'),
'login' => array('LogInOut.controller.php', 'action_login'),
'login2' => array('LogInOut.controller.php', 'action_login2'),
'logout' => array('LogInOut.controller.php', 'action_logout'),
'markasread' => array('Markasread.controller.php', 'markasread'),
'mergetopics' => array('SplitTopics.controller.php', 'MergeTopics'),
'memberlist' => array('Memberlist.controller.php', 'pre_memberlist'),
'moderate' => array('ModerationCenter.controller.php', 'action_modcenter'),
'karma' => array('Karma.controller.php', 'action_karma'),
'movetopic' => array('MoveTopic.controller.php', 'action_movetopic'),
'movetopic2' => array('MoveTopic.controller.php', 'action_movetopic2'),
'notify' => array('Notify.controller.php', 'action_notify'),
'notifyboard' => array('Notify.controller.php', 'action_notifyboard'),
'openidreturn' => array('OpenID.subs.php', 'action_openidreturn'),
'pm' => array('PersonalMessage.controller.php', 'action_pm'),
'post' => array('Post.controller.php', 'action_post'),
'post2' => array('Post.controller.php', 'action_post2'),
'printpage' => array('Topic.controller.php', 'action_printpage'), // done
'profile' => array('Profile.controller.php', 'ModifyProfile'),
'quotefast' => array('Post.controller.php', 'action_quotefast'),
'quickmod' => array('MessageIndex.controller.php', 'action_quickmod'),
'quickmod2' => array('Display.controller.php', 'action_quickmod2'),
'recent' => array('Recent.controller.php', 'action_recent'),
'register' => array('Register.controller.php', 'action_register'),
'register2' => array('Register.controller.php', 'action_register2'),
// 'reminder' => array('Reminder.controller.php', ''),
'removepoll' => array('Poll.controller.php', 'action_removepoll'),
'removetopic2' => array('RemoveTopic.controller.php', 'action_removetopic2'),
'reporttm' => array('Emailuser.controller.php', 'action_reporttm'),
'requestmembers' => array('Members.controller.php', 'action_requestmembers'),
'restoretopic' => array('RemoveTopic.controller.php', 'action_restoretopic'),
'search' => array('Search.controller.php', 'action_plushsearch1'),
'search2' => array('Search.controller.php', 'action_plushsearch2'),
// 'sendtopic' => array('Emailuser.controller.php', 'action_sendtopic'),
'suggest' => array('Suggest.controller.php', 'action_suggest'),
'spellcheck' => array('Post.subs.php', 'action_spellcheck'),
'splittopics' => array('SplitTopics.controller.php', 'action_splittopics'),
'stats' => array('Stats.controller.php', 'action_stats'),
'sticky' => array('Topic.controller.php', 'action_sticky'), // done
'theme' => array('Themes.php', 'action_thememain'),
'trackip' => array('ProfileHistory.php', 'action_trackip'),
'unread' => array('Recent.php', 'action_unread'),
'unreadreplies' => array('Recent.php', 'action_unread'),
'verificationcode' => array('Register.php', 'action_verificationcode'),
'viewprofile' => array('Profile.php', 'ModifyProfile'),
'vote' => array('Poll.php', 'action_vote'),
'trackip' => array('ProfileHistory.controller.php', 'action_trackip'),
'unread' => array('Recent.controller.php', 'action_unread'),
'unreadreplies' => array('Recent.controller.php', 'action_unread'),
'verificationcode' => array('Register.controller.php', 'action_verificationcode'),
'viewprofile' => array('Profile.controller.php', 'ModifyProfile'),
'vote' => array('Poll.controller.php', 'action_vote'),
'viewquery' => array('ViewQuery.php', 'action_viewquery'),
'viewadminfile' => array('Admin.php', 'action_viewadminfile'),
'who' => array('Who.php', 'action_who'), // done
'.xml' => array('News.php', 'action_showfeed'),
'xmlhttp' => array('Xml.php', 'action_xmlhttp'),
'who' => array('Who.controller.php', 'action_who'), // done
'.xml' => array('News.controller.php', 'action_showfeed'),
'xmlhttp' => array('Xml.controller.php', 'action_xmlhttp'),
);

$adminActions = array ('admin', 'attachapprove', 'jsoption', 'theme', 'viewadminfile', 'viewquery');
Expand All @@ -197,7 +197,7 @@ public function __construct()
if (isset($actionArray[$_GET['action']]))
{
// admin files have their own place
$path = $sourcedir . (in_array($_GET['action'], $adminActions) ? '/admin' : '');
$path = $sourcedir . (in_array($_GET['action'], $adminActions) ? '/admin' : '/controllers');

// is it an object oriented controller?
if (isset($actionArray[$_GET['action']][2]))
Expand Down Expand Up @@ -225,11 +225,11 @@ public function __construct()
// add-ons can use any of them, and it should Just Work (tm).
elseif (preg_match('~^[a-zA-Z_\\-]+$~', $_GET['action']))
{
// i.e. action=help => Help.php...
// i.e. action=help => Help.controller.php...
// if the function name fits the pattern, that'd be 'show'...
if (file_exists($sourcedir . '/' . ucfirst($_GET['action']) . '.php'))
if (file_exists($sourcedir . '/controllers/' . ucfirst($_GET['action']) . '.php'))
{
$this->_file_name = $sourcedir . '/' . ucfirst($_GET['action']) . '.php';
$this->_file_name = $sourcedir . '/controllers/' . ucfirst($_GET['action']) . '.php';

// procedural controller... we might need to pre dispatch to its main function
// i.e. for action=mergetopics it was MergeTopics(), now it's mergetopics()
Expand All @@ -244,9 +244,9 @@ public function __construct()
// action=drafts => Drafts.controller.php
// sa=save, sa=load, or sa=savepm => action_save(), action_load()
// ... if it ain't there yet, no problem.
elseif (file_exists($sourcedir . '/' . ucfirst($_GET['action']) . '.controller.php'))
elseif (file_exists($sourcedir . '/controllers/' . ucfirst($_GET['action']) . '.controller.php'))
{
$this->_file_name = $sourcedir . '/' . ucfirst($_GET['action'] . '.controller.php');
$this->_file_name = $sourcedir . '/controllers/' . ucfirst($_GET['action'] . '.controller.php');
$this->_controller_name = ucfirst($_GET['action']) . '_Controller';
if (isset($_GET['sa']) && preg_match('~^\w+$~', $_GET['sa']))
$this->_function_name = 'action_' . $_GET['sa'];
Expand Down Expand Up @@ -313,7 +313,7 @@ public function dispatch()
{
// things went pretty bad, huh?
// board index :P
require_once($sourcedir . '/BoardIndex.php');
require_once($sourcedir . '/controllers/BoardIndex.controller.php');
return 'action_boardindex';
}
}
Expand Down
Loading

0 comments on commit cc2748e

Please sign in to comment.