SleePy Public Git Projects
Repositories
Main Site
GitHub Profile
SD-SimpleDesk
Code
Commits
Branches
Tags
Search
Tree:
96a844d
Branches
Tags
master
smf21
1.0.1
2.0.0
v.21/2.1.1
v2.1/2.1-RC1
v2.1/2.1-RC2
v2.1/2.1.0
v2.1/2.1.1
v2.1/2.1.2
v2.1/2.1.3
SD-SimpleDesk
install-xml
install.xml
! Move plugin languages to a folder rather than the main SMF languages (install.xml, Admin.php, Subs.php)
Jeremy D
commited
96a844d
at 2011-11-02 10:23:48
install.xml
Blame
History
Raw
<?xml version="1.0"?> <!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification"> <modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/"> <id>SimpleDeskTeam:SimpleDesk</id> <version>2.0</version> <file name="$sourcedir/Admin.php"><!-- adds the navbar links to the admin panel --> <operation><!-- prepend SimpleDesk's ACP helper functions to the list of places to search --> <search position="replace"><![CDATA[// This is a special array of functions that contain setting data - we query all these to simply pull all setting bits! $settings_search = array(]]></search> <add><![CDATA[// Add SimpleDesk functions $settings_search = array( array('shd_modify_display_options', 'area=helpdesk_options;sa=display'), array('shd_modify_posting_options', 'area=helpdesk_options;sa=posting'), array('shd_modify_admin_options', 'area=helpdesk_options;sa=admin'), array('shd_modify_standalone_options', 'area=helpdesk_options;sa=standalone'), array('shd_modify_actionlog_options', 'area=helpdesk_options;sa=actionlog'), array('shd_modify_notifications_options', 'area=helpdesk_options;sa=notifications'), ); call_integration_hook('shd_hook_hdadminoptssrch', array(&$settings_search)); $search_entries = count($settings_search); // This is a special array of functions that contain setting data - we query all these to simply pull all setting bits! $settings_search += array( $search_entries =>]]></add> </operation> </file> <file name="$sourcedir/Load.php"><!-- globally figure out if Helpdesk is enabled; note this doesn't get pushed into settings table :) --> <operation> <search position="after"><![CDATA[ // Build the list of boards they WANT to see.]]></search> <add><![CDATA[ // Are we helping people today? If so, bootstrap SimpleDesk. shd_init(); ]]></add> </operation> </file> <file name="$sourcedir/Profile.php"><!-- Add the profile section --> <operation><!-- Add the SimpleDesk section to the Profile menu --> <search position="after"><![CDATA[ // Is there an updated message to show?]]></search> <add><![CDATA[ // SimpleDesk sections. Added here after the initial cleaning is done, so that we can do our own permission checks without arguing with SMF's system (so much) if (!empty($modSettings['helpdesk_active'])) { shd_load_language('sd_language/SimpleDeskProfile'); // Put it here so we can reuse it for the left menu a bit $context['helpdesk_menu'] = array( 'title' => $txt['shd_profile_area'], 'areas' => array( 'helpdesk' => array( 'label' => $txt['shd_profile_main'], 'file' => 'sd_source/SimpleDesk-Profile.php', 'function' => 'shd_profile_main', 'enabled' => shd_allowed_to('shd_view_profile_any') || ($context['user']['is_owner'] && shd_allowed_to('shd_view_profile_own')), ), 'hd_prefs' => array( 'label' => $txt['shd_profile_preferences'], 'file' => 'sd_source/SimpleDesk-Profile.php', 'function' => 'shd_profile_main', 'enabled' => shd_allowed_to('shd_view_preferences_any') || ($context['user']['is_owner'] && shd_allowed_to('shd_view_preferences_own')), ), 'hd_showtickets' => array( 'label' => $txt['shd_profile_show_tickets'], 'file' => 'sd_source/SimpleDesk-Profile.php', 'function' => 'shd_profile_main', 'enabled' => ($context['user']['is_owner'] && shd_allowed_to('shd_view_ticket_own')) || shd_allowed_to('shd_view_ticket_any'), ), 'hd_permissions' => array( 'label' => $txt['shd_profile_permissions'], 'file' => 'sd_source/SimpleDesk-Profile.php', 'function' => 'shd_profile_main', 'enabled' => shd_allowed_to('admin_helpdesk'), ), 'hd_actionlog' => array( 'label' => $txt['shd_profile_actionlog'], 'file' => 'sd_source/SimpleDesk-Profile.php', 'function' => 'shd_profile_main', 'enabled' => empty($modSettings['shd_disable_action_log']) && (shd_allowed_to('shd_view_profile_log_any') || ($context['user']['is_owner'] && shd_allowed_to('shd_view_profile_log_own'))), ), ), ); // Kill the existing profile menu but save it in a temporary place first. $old_profile_areas = $profile_areas; $profile_areas = array(); // Now, where we add this depends very much on what mode we're in. In HD only mode, we want our menu first before anything else. if (!empty($modSettings['shd_helpdesk_only'])) { require_once($sourcedir . '/Profile-Modify.php'); // Move some stuff around. $context['helpdesk_menu']['areas']['permissions'] = array( 'label' => $txt['shd_show_forum_permissions'], 'file' => 'Profile-View.php', 'function' => 'showPermissions', 'enabled' => allowedTo('manage_permissions'), ); $context['helpdesk_menu']['areas']['tracking'] = array( 'label' => $txt['trackUser'], 'file' => 'Profile-View.php', 'function' => 'tracking', 'subsections' => array( 'activity' => array($txt['trackActivity'], 'moderate_forum'), 'ip' => array($txt['trackIP'], 'moderate_forum'), 'edits' => array($txt['trackEdits'], 'moderate_forum'), ), 'enabled' => allowedTo('moderate_forum'), ); $profile_areas['helpdesk'] = $context['helpdesk_menu']; $profile_areas += $old_profile_areas; unset($profile_areas['info']['areas']['permissions'], $profile_areas['info']['areas']['tracking']); $remove = array( 'info' => array( 'summary', 'statistics', 'showposts', 'viewwarning', ), 'edit_profile' => array( 'forumprofile', 'ignoreboards', 'lists', 'notification', ), 'profile_action' => array( 'issuewarning', ), ); if (!empty($modSettings['shd_disable_pm'])) { $remove['profile_action'][] = 'sendpm'; $remove['edit_profile'][] = 'pmprefs'; } foreach ($remove as $area => $items) foreach ($items as $item) if (!empty($profile_areas[$area]['areas'][$item])) $profile_areas[$area]['areas'][$item]['enabled'] = false; $profile_areas['edit_profile']['areas']['theme']['file'] = 'sd_source/SimpleDesk-Profile.php'; $profile_areas['edit_profile']['areas']['theme']['function'] = 'shd_profile_theme_wrapper'; } else // In non HD only, put it before the editing stuff menu { foreach ($old_profile_areas as $area => $details) { if ($area == 'edit_profile') $profile_areas['helpdesk'] = $context['helpdesk_menu']; $profile_areas[$area] = $details; } } // Now engage any hooks. call_integration_hook('shd_hook_profilemenu', array(&$profile_areas)); } ]]></add> </operation> </file> <file name="$sourcedir/Profile-Modify.php"><!-- Ensure things get uncached if we change groups (which means permissions) --> <operation> <search position="after"><![CDATA[ // The account page allows the change of your id_group - but not to a protected group!]]></search> <add><![CDATA[ // Ensure we uncache stuff that might change in the helpdesk shd_clear_active_tickets(); ]]></add> </operation> </file> <file name="$sourcedir/ManagePosts.php"><!-- at the same time we modify the post settings, make sure we check and update SD's if necessary --> <operation> <search position="before"><![CDATA[$smcFunc['db_change_column']('{db_prefix}messages', 'body', array('type' => 'mediumtext'));]]></search> <add><![CDATA[ $smcFunc['db_change_column']('{db_prefix}helpdesk_ticket_replies', 'body', array('type' => 'mediumtext'));]]></add> </operation> <operation> <search position="before"><![CDATA[$smcFunc['db_change_column']('{db_prefix}messages', 'body', array('type' => 'text'));]]></search> <add><![CDATA[ $smcFunc['db_change_column']('{db_prefix}helpdesk_ticket_replies', 'body', array('type' => 'text'));]]></add> </operation> </file> <file name="$sourcedir/Who.php"><!-- load the who's online strings... we don't use it much now, but maybe later... --> <operation> <search position="after"><![CDATA[ // Actions that require a specific permission level.]]></search> <add><![CDATA[ shd_load_language('sd_language/SimpleDeskWho'); shd_load_plugin_langfiles('who'); ]]></add> </operation> </file> <file name="$sourcedir/Errors.php"><!-- if an error occurs in an SD file, log it appropriately with the SD errortype --> <operation> <search position="after"><![CDATA[ // Make sure the category that was specified is a valid one]]></search> <add><![CDATA[ // Is this a SimpleDesk error? $known_error_types[] = 'simpledesk'; $known_error_types[] = 'sdplugin'; if (stripos($file, 'sdplugin') !== false || stripos($error_message, 'shdp_') !== false) $error_type = 'sdplugin'; elseif (stripos($file, 'simpledesk') !== false || stripos($error_message, 'shd_') !== false || stripos($error_message, 'simpledesk') !== false) $error_type = 'simpledesk'; ]]></add> </operation> </file> <file name="$boarddir/index.php"><!-- set up the relevant action stuff --> <operation><!-- add a master override if we haven't declared an action --> <search position="after"><![CDATA[ // Action and board are both empty... BoardIndex!]]></search> <add><![CDATA[ // If we're in HD-only mode, let's run with that! if (!empty($modSettings['shd_helpdesk_only']) && $modSettings['helpdesk_active']) { require_once($sourcedir . '/sd_source/SimpleDesk.php'); return 'shd_main'; } ]]></add> </operation> <operation><!-- add a catcher in case it's a function we don't have --> <search position="after"><![CDATA[ // Fall through to the board index then... require_once($sourcedir . '/BoardIndex.php'); return 'BoardIndex';]]></search> <add><![CDATA[ // If we're in HD-only mode, we can't let them go anywhere useless if (!empty($modSettings['shd_helpdesk_only']) && $modSettings['helpdesk_active']) { require_once($sourcedir . '/sd_source/SimpleDesk.php'); return 'shd_main'; } ]]></add> </operation> </file> <file name="$boarddir/SSI.php"><!-- Load SimpleDesk SSI functions --> <operation> <search position="before"><![CDATA[require_once($sourcedir . '/Security.php');]]></search> <add><![CDATA[ require_once($sourcedir . '/sd_source/SimpleDesk-SSI.php');]]></add> </operation> </file> <file name="$sourcedir/Subs-BoardIndex.php"><!-- Board integration --> <operation> <search position="before"><![CDATA[$smcFunc['db_free_result']($result_boards);]]></search> <add><![CDATA[ // Are we adding any SimpleDesk boards in? if (!empty($modSettings['helpdesk_active']) && empty($modSettings['shd_disable_boardint']) && shd_allowed_to('access_helpdesk')) { global $sourcedir; require_once($sourcedir . '/sd_source/Subs-SimpleDeskBoardIndex.php'); shd_add_to_boardindex($boardIndexOptions, $categories); }]]></add> </operation> </file> <file name="$sourcedir/ManageServer.php"><!-- Language file handling --> <operation> <search position="after"><![CDATA[ // Check we have themes with a path and a name - just in case - and add the path.]]></search> <add><![CDATA[ // Add SimpleDesk to the list of possible places to look. $themes['shd'] = array('name' => 'SimpleDesk', 'theme_dir' => $settings['default_theme_dir'] . '/languages/sd_language'); $lang_dirs['shd'] = $settings['default_theme_dir'] . '/languages/sd_language'; $themes['shd_plugins'] = array('name' => 'SimpleDesk Plugins', 'theme_dir' => $settings['default_theme_dir'] . '/languages/sd_plugins_lang'); $lang_dirs['shd_plugins'] = $settings['default_theme_dir'] . '/languages/sd_plugins_lang'; ]]></add> </operation> </file> </modification>