Seite 1 von 1

Optimiertes Admin-Panel

Verfasst: 02.07.2004 16:03
von andreasOymann
Beschreibung: Ersetzt das linke Frame des ACP´s mit aus- und einklappbaren Kategorien, so daß das lästige Scrollen entfällt oder zumindest minimiert wird.
phpBB Version: 2.0.x ( getestet mit 2.0.8 - 2.0.15 )

/admin/index.php:

suche

Code: Alles auswählen

	ksort($module);

	while( list($cat, $action_array) = each($module) )
	{
		$cat = ( !empty($lang[$cat]) ) ? $lang[$cat] : preg_replace("/_/", " ", $cat);

		$template->assign_block_vars("catrow", array(
			"ADMIN_CATEGORY" => $cat)
		);

		ksort($action_array);

		$row_count = 0;
		while( list($action, $file)	= each($action_array) )
		{
			$row_color = ( !($row_count%2) ) ? $theme['td_color1'] : $theme['td_color2'];
			$row_class = ( !($row_count%2) ) ? $theme['td_class1'] : $theme['td_class2'];

			$action = ( !empty($lang[$action]) ) ? $lang[$action] : preg_replace("/_/", " ", $action);

			$template->assign_block_vars("catrow.modulerow", array(
				"ROW_COLOR" => "#" . $row_color,
				"ROW_CLASS" => $row_class,

				"ADMIN_MODULE" => $action,
				"U_ADMIN_MODULE" => append_sid($file))
			);
			$row_count++;
		}
	}
ersetze durch

Code: Alles auswählen

	ksort($module);

	$select_id = $HTTP_GET_VARS['select_id'];
	$i = 1;

	while( list($cat, $action_array) = each($module) )
	{
		$cat = ( !empty($lang[$cat]) ) ? $lang[$cat] : preg_replace("/_/", " ", $cat);
		$cat_id = $i;

		$template->assign_block_vars("catrow", array(
			"CAT_ID" => ($select_id == $cat_id) ? append_sid("index.$phpEx?pane=left") : append_sid("index.$phpEx?pane=left&select_id=" . $cat_id),
			"ADMIN_CATEGORY" => $cat)
		);

		if ($select_id == $cat_id)
		{
			ksort($action_array);
			$row_count = 0;
			while( list($action, $file)	= each($action_array) )
			{
				$row_color = ( !($row_count%2) ) ? $theme['td_color1'] : $theme['td_color2'];
				$row_class = ( !($row_count%2) ) ? $theme['td_class1'] : $theme['td_class2'];

				$action = ( !empty($lang[$action]) ) ? $lang[$action] : preg_replace("/_/", " ", $action);

				$template->assign_block_vars("catrow.modulerow", array(
					"ROW_COLOR" => "#" . $row_color,
					"ROW_CLASS" => $row_class, 

					"ADMIN_MODULE" => $action,
					"U_ADMIN_MODULE" => append_sid($file))
				);
				$row_count++;
			}
		}
		$i++;
	}
/templates/xxx/admin/index_navigate.tpl:

suche

Code: Alles auswählen

		  <td height="28" class="catSides"><span class="cattitle">{catrow.ADMIN_CATEGORY}</span></td>
ersetze durch

Code: Alles auswählen

		  <td height="28" class="catSides"><span class="cattitle"><a href="{catrow.CAT_ID}">{catrow.ADMIN_CATEGORY}</a></span></td>

Verfasst: 22.08.2005 01:44
von andreasOymann
Hier das Snippet für Leute, die den Junior Admin Mod eingebaut haben:

/includes/functions_jr_admin.php
suche

Code: Alles auswählen

function jr_admin_make_left_pane()
{
   global $template, $lang, $module, $phpEx, $userdata;
   
   jr_admin_include_all_lang_files();
   
   @ksort($module);
   //Loop through and set up all the nice form names, etc
   foreach ($module as $cat => $module_array)
   {
      $template->assign_block_vars("catrow", array(
      'ADMIN_CATEGORY' => (isset($lang[$cat])) ? $lang[$cat] : preg_replace("/_/", ' ', $cat)
      ));
      @ksort($module_array);
      $i = 0;
      foreach ($module_array as $module_name => $data_array)
      {
         //Compile our module url with lots of options
         $module_url = $data_array['filename'];
         $module_url .= (preg_match("/^.*\.$phpEx\?/", $module_url)) ? '&' : '?';
         $module_url .= "sid=".$userdata['session_id']."&module=".$data_array['file_hash'];
         
         $template->assign_block_vars("catrow.modulerow", array(
         'ROW_CLASS' => (++$i % 2) ? 'row1' : 'row2',
         'ADMIN_MODULE' => (isset($lang[$module_name])) ? $lang[$module_name] : preg_replace("/_/", ' ', $module_name),
         'U_ADMIN_MODULE' => $module_url
         ));
      }
   }
}}
ersetze durch

Code: Alles auswählen

function jr_admin_make_left_pane()
{
   global $template, $lang, $module, $phpEx, $userdata, $HTTP_GET_VARS;
   
   jr_admin_include_all_lang_files();
   
   @ksort($module);
   //Loop through and set up all the nice form names, etc
   $select_id = ( isset($HTTP_GET_VARS['select_id']) ) ? $HTTP_GET_VARS['select_id'] : 0;
   $cat_id = 1;
   foreach ($module as $cat => $module_array)
   {
      $template->assign_block_vars("catrow", array(
      "CAT_ID" => ($select_id == $cat_id) ? append_sid("index.$phpEx?pane=left") : append_sid("index.$phpEx?pane=left&select_id=" . $cat_id),
      'ADMIN_CATEGORY' => (isset($lang[$cat])) ? $lang[$cat] : preg_replace("/_/", ' ', $cat)
      ));
      if ( $select_id == $cat_id )
      {
         @ksort($module_array);
         $i = 0;
         foreach ($module_array as $module_name => $data_array)
         {
            //Compile our module url with lots of options
            $module_url = $data_array['filename'];
            $module_url .= (preg_match("/^.*\.$phpEx\?/", $module_url)) ? '&' : '?';
            $module_url .= "sid=".$userdata['session_id']."&module=".$data_array['file_hash'];
         
            $template->assign_block_vars("catrow.modulerow", array(
            'ROW_CLASS' => (++$i % 2) ? 'row1' : 'row2',
            'ADMIN_MODULE' => (isset($lang[$module_name])) ? $lang[$module_name] : preg_replace("/_/", ' ', $module_name),
            'U_ADMIN_MODULE' => $module_url
            ));
         }
      }
   $cat_id++;
   }
}}
/templates/xxx/admin/index_navigate.tpl:

suche

Code: Alles auswählen

		  <td height="28" class="catSides"><span class="cattitle">{catrow.ADMIN_CATEGORY}</span></td>
ersetze durch

Code: Alles auswählen

		  <td height="28" class="catSides"><span class="cattitle"><a href="{catrow.CAT_ID}">{catrow.ADMIN_CATEGORY}</a></span></td>
Die Änderungen an der admin/index.php aus dem 1. Post entfallen natürlich!

Danke an cYbercOsmOnauT für das Snippet!