ee2522a64d919fbccfe69a8fa1e5e623cb745be0
nas ! Added /team_mods/ back to...

nas authored 13 years ago

install2.0.xml   1) <?xml version="1.0"?>
install2.0.xml   2) <!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
install2.0.xml   3) <modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
install2.0.xml   4) 	<id>SimpleDesk:Topic_Solved_Mod</id>
install2.0.xml   5) 	<version>1.0</version>
install2.0.xml   6) 
install2.0.xml   7) 	<!-- Template files -->		
install2.0.xml   8) 	<file name="$themedir/MessageIndex.template.php">	
install2.0.xml   9) 		<operation>
gruffen [Topic solved] Some stuff I...

gruffen authored 12 years ago

install2.0.xml  10) 			<search position="before"><![CDATA[// Some columns require a different shade of the color class.]]></search>
install2.0.xml  11) 			<add><![CDATA[
install2.0.xml  12) 			if (!empty($topic['is_solved']))
install2.0.xml  13) 				$color_class .= ' solvedbg';]]></add>
nas ! Added /team_mods/ back to...

nas authored 13 years ago

install2.0.xml  14) 		</operation>
install2.0.xml  15) 	</file>
install2.0.xml  16) 
install2.0.xml  17) 	<!-- Source files -->		
gruffen [Topic solved] Some stuff I...

gruffen authored 12 years ago

install2.0.xml  18) 	<file name="$boarddir/index.php"><!-- Adding the action. While it would be nice to use a hook, I don't want to include a file every page load for the sake of this one change. -->	
nas ! Added /team_mods/ back to...

nas authored 13 years ago

install2.0.xml  19) 		<operation>
install2.0.xml  20) 			<search position="after"><![CDATA[// Get the function and file to include - if it's not there, do the board index.]]></search>
install2.0.xml  21) 			<add><![CDATA[$actionArray['solve'] = array('SolveTopic.php', 'SolveTopic');]]></add>
install2.0.xml  22) 		</operation>
install2.0.xml  23) 	</file>
gruffen [Topic solved] Some stuff I...

gruffen authored 12 years ago

install2.0.xml  24) 	<file name="$sourcedir/Display.php"><!-- Lots to change, notably figuring out the permission for adding the button, plus loading all sorts of other stuff. -->
nas ! Added /team_mods/ back to...

nas authored 13 years ago

install2.0.xml  25) 		<operation>
install2.0.xml  26) 			<search position="replace"><![CDATA[foreach ($anyown_permissions as $contextual => $perm)
install2.0.xml  27) 		$context[$contextual] = allowedTo($perm . '_any') || ($context['user']['started'] && allowedTo($perm . '_own'));]]></search>
install2.0.xml  28) 			<add><![CDATA[// Topic solved
install2.0.xml  29) 	$anyown_permissions['can_solve'] = 'solve_topic';
install2.0.xml  30) 	
install2.0.xml  31) 	foreach ($anyown_permissions as $contextual => $perm)
install2.0.xml  32) 		$context[$contextual] = allowedTo($perm . '_any') || ($context['user']['started'] && allowedTo($perm . '_own'));
install2.0.xml  33) 		
gruffen [Topic solved] Some stuff I...

gruffen authored 12 years ago

install2.0.xml  34) 	// Topic solved stuff. Is this one of THE boards?
install2.0.xml  35) 	loadTemplate('SolveTopic-Display');
nas ! Added /team_mods/ back to...

nas authored 13 years ago

install2.0.xml  36) 	$context['board_solve'] = !empty($modSettings['topicsolved_board_' . $board]);
install2.0.xml  37) 	$context['can_solve'] &= $context['board_solve'];
gruffen [Topic solved] Some stuff I...

gruffen authored 12 years ago

install2.0.xml  38) 	if (!empty($modSettings['topicsolved_display_notice']) && $context['is_solved'] && $context['board_solve'])
install2.0.xml  39) 		$context['template_layers'][] = 'topicsolved_header';
nas ! Added /team_mods/ back to...

nas authored 13 years ago

install2.0.xml  40) ]]></add>
install2.0.xml  41) 		</operation>
install2.0.xml  42) 		<operation>
install2.0.xml  43) 			<search position="before"><![CDATA[' . (!empty($modSettings['recycle_board']) && $modSettings['recycle_board'] == $board ? ', id_previous_board, id_previous_topic' : '') . ']]></search>
install2.0.xml  44) 			<add><![CDATA[, t.solved]]></add>
install2.0.xml  45) 		</operation>	
install2.0.xml  46) 		<operation>
install2.0.xml  47) 			<search position="after"><![CDATA[// We don't want to show the poll icon in the topic class here, so pretend it's not one.]]></search>
install2.0.xml  48) 			<add><![CDATA[// Topic solved
install2.0.xml  49) 	$context['is_solved'] = $topicinfo['solved'];]]></add>
install2.0.xml  50) 		</operation>		
install2.0.xml  51) 	</file>	
gruffen [Topic solved] Some stuff I...

gruffen authored 12 years ago

install2.0.xml  52) 	<file name="$sourcedir/Subs.php"><!-- Add the topic solved log to the list of possible log types we can handle. -->
nas ! Added /team_mods/ back to...

nas authored 13 years ago

install2.0.xml  53) 		<operation>
install2.0.xml  54) 			<search position="after"><![CDATA[if (!is_array($extra))]]></search>
install2.0.xml  55) 			<add><![CDATA[// Solved log
gruffen [Topic solved] Some stuff I...

gruffen authored 12 years ago

install2.0.xml  56) 	$log_types['solve'] = 4;]]></add>
nas ! Added /team_mods/ back to...

nas authored 13 years ago

install2.0.xml  57) 		</operation>	
install2.0.xml  58) 	</file>		
gruffen [Topic solved] Some stuff I...

gruffen authored 12 years ago

install2.0.xml  59) 	<file name="$sourcedir/Modlog.php"><!-- Extend the moderation log to support the topic solving too. -->
nas ! Added /team_mods/ back to...

nas authored 13 years ago

install2.0.xml  60) 		<operation>
install2.0.xml  61) 			<search position="before"><![CDATA[isAllowedTo('admin_forum');]]></search>
install2.0.xml  62) 			<add><![CDATA[// Topic solved log
install2.0.xml  63) 	$context['log_type'] = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'solvelog' ? 4 : $context['log_type'];
install2.0.xml  64) 	
install2.0.xml  65) 	// Make sure the solve log is enabled.
gruffen [Topic solved] Some stuff I...

gruffen authored 12 years ago

install2.0.xml  66) 	if ($context['log_type'] == 4 && empty($modSettings['enable_solved_log']))
nas ! Added /team_mods/ back to...

nas authored 13 years ago

install2.0.xml  67) 		redirectexit('action=moderate');]]></add>
install2.0.xml  68) 		</operation>
install2.0.xml  69) 		<operation>
install2.0.xml  70) 			<search position="after"><![CDATA[// The number of entries to show per page of log file.]]></search>
install2.0.xml  71) 			<add><![CDATA[// Topic solved log: Override page_title and url_starts if required.
gruffen [Topic solved] Some stuff I...

gruffen authored 12 years ago

install2.0.xml  72) 	if ($context['log_type'] == 4)
nas ! Added /team_mods/ back to...

nas authored 13 years ago

install2.0.xml  73) 	{
gruffen [Topic solved] Some stuff I...

gruffen authored 12 years ago

install2.0.xml  74) 		$context['page_title'] = $txt['modlog_solve_log'];	
nas ! Added /team_mods/ back to...

nas authored 13 years ago

install2.0.xml  75) 		$context['url_start'] = '?action=moderate;area=modlog;sa=solvelog;type=4';		
install2.0.xml  76) 	}]]></add>
install2.0.xml  77) 		</operation>	
install2.0.xml  78) 		<operation>
install2.0.xml  79) 			<search position="after"><![CDATA[// Create the watched user list.]]></search>
install2.0.xml  80) 			<add><![CDATA[// Topic solved log: Override some list data before we create it.
gruffen [Topic solved] Some stuff I...

gruffen authored 12 years ago

install2.0.xml  81) 	if ($context['log_type'] == 4)
nas ! Added /team_mods/ back to...

nas authored 13 years ago

install2.0.xml  82) 	{
install2.0.xml  83) 		$listOptions['title'] = '<a href="' . $scripturl . '?action=helpadmin;help=solve_log_help" onclick="return reqWin(this.href);" class="help"><img src="' . $settings['images_url'] . '/helptopics.gif" alt="' . $txt['help'] . '" align="top" /></a> ' . $txt['modlog_solve_log'];
install2.0.xml  84) 		$listOptions['additional_rows'][0]['value'] = $txt['modlog_solve_log_desc'];
install2.0.xml  85) 		$listOptions['no_items_label'] = $txt['modlog_solve_log_no_entries_found'];
install2.0.xml  86) 	}]]></add>
install2.0.xml  87) 		</operation>		
install2.0.xml  88) 	</file>	
gruffen [Topic solved] Some stuff I...

gruffen authored 12 years ago

install2.0.xml  89) 	<file name="$sourcedir/ModerationCenter.php"><!-- Provide access from the moderation center to the moderation log for topic solving. -->
nas ! Added /team_mods/ back to...

nas authored 13 years ago

install2.0.xml  90) 		<operation>
install2.0.xml  91) 			<search position="after"><![CDATA['notice' => array(]]></search>
install2.0.xml  92) 			<add><![CDATA['solvelog' => array(
gruffen [Topic solved] Some stuff I...

gruffen authored 12 years ago

install2.0.xml  93) 					'enabled' => !empty($modSettings['enable_solved_log']) && in_array('ml', $context['admin_features']),
nas ! Added /team_mods/ back to...

nas authored 13 years ago

install2.0.xml  94) 					'label' => $txt['modlog_solve_log'],
install2.0.xml  95) 					'file' => 'Modlog.php',
install2.0.xml  96) 					'function' => 'ViewModlog',
install2.0.xml  97) 					'custom_url' => $scripturl . '?action=moderate;area=modlog;sa=solvelog',
install2.0.xml  98) 				),]]></add>
install2.0.xml  99) 		</operation>	
install2.0.xml 100) 	</file>	
gruffen [Topic solved] Some stuff I...

gruffen authored 12 years ago

install2.0.xml 101) 	<file name="$sourcedir/MessageIndex.php"><!-- Be sure to get the topic data, to be able to display whether something is solved or not. -->
nas ! Added /team_mods/ back to...

nas authored 13 years ago

install2.0.xml 102) 		<operation>
install2.0.xml 103) 			<search position="after"><![CDATA[determineTopicClass($context['topics'][$row['id_topic']]);]]></search>
install2.0.xml 104) 			<add><![CDATA[// Topic solved highlighting, if enabled.
install2.0.xml 105) 			$context['topics'][$row['id_topic']]['is_solved'] = $context['board_solve'] && !empty($row['solved']);
install2.0.xml 106) 			]]></add>
install2.0.xml 107) 		</operation>
install2.0.xml 108) 		<operation>
gruffen [Topic solved] Some stuff I...

gruffen authored 12 years ago

install2.0.xml 109) 			<search position="before"><![CDATA[mf.smileys_enabled AS first_smileys]]></search>
nas ! Added /team_mods/ back to...

nas authored 13 years ago

install2.0.xml 110) 			<add><![CDATA[, t.solved]]></add>
install2.0.xml 111) 		</operation>
install2.0.xml 112) 		<operation>
install2.0.xml 113) 			<search position="after"><![CDATA[// Begin 'printing' the message index for current board.]]></search>
install2.0.xml 114) 			<add><![CDATA[// Is this board solvable?
install2.0.xml 115) 		$context['board_solve'] = !empty($modSettings['topicsolved_board_' . $board]);
gruffen [Topic solved] Some stuff I...

gruffen authored 12 years ago

install2.0.xml 116) 		if (!empty($modSettings['topicsolved_highlight']) && !empty($modSettings['topicsolved_highlight_col1']) && !empty($modSettings['topicsolved_highlight_col2']))
nas ! Added /team_mods/ back to...

nas authored 13 years ago

install2.0.xml 117) 		{
gruffen [Topic solved] Some stuff I...

gruffen authored 12 years ago

install2.0.xml 118) 			if (empty($context['html_headers']))
install2.0.xml 119) 				$context['html_headers'] = '';
install2.0.xml 120) 			$context['html_headers'] .= '<style type="text/css">/* Topic solved */ .solvedbg { background:' . $modSettings['topicsolved_highlight_col1'] . '; } .solvedbg2 { background:' . $modSettings['topicsolved_highlight_col2'] . '; }</style>';
nas ! Added /team_mods/ back to...

nas authored 13 years ago

install2.0.xml 121) 		}
install2.0.xml 122) 
install2.0.xml 123) 		]]></add>
install2.0.xml 124) 		</operation>
gruffen [Topic solved] Some stuff I...

gruffen authored 12 years ago

install2.0.xml 125) 	</file>
install2.0.xml 126) 	<file name="$boarddir/SSI.php"><!-- Make sure the topic solved icon is actually added to the SSI functions too. Same code, used twice. -->
install2.0.xml 127) 		<operation>
install2.0.xml 128) 			<search position="replace"><![CDATA[$stable_icons = array('xx']]></search>
install2.0.xml 129) 			<add><![CDATA[$stable_icons = array('solved', 'xx']]></add>
install2.0.xml 130) 		</operation>
install2.0.xml 131) 		<operation>
install2.0.xml 132) 			<search position="replace"><![CDATA[$stable_icons = array('xx']]></search>
install2.0.xml 133) 			<add><![CDATA[$stable_icons = array('solved', 'xx']]></add>
install2.0.xml 134) 		</operation>
install2.0.xml 135) 	</file>