PEAK XOOPS - mymenu 1.00 for conventional modules in englishin japanese






Main : Etc. : 

Category: Etc.           php5
Download Now! mymenu 1.00 for conventional modules Popular Version: 1.00
Submitted Date:  2008/12/8
Description:
in englishin japanese
旧型モジュール用MyMenu

●要旨

mymenu.phpはモジュールの管理画面すべてにトップメニューをつけ、altsysとの親和性を高めるためのファイルです。
旧型モジュールおよびDuplicatable V2までのモジュール用です。
D3モジュール用のmymenuは別途用意していませんが、適宜、picoあたりからコピーしてください。


●背景

もともとのmymenuは、myblocksadmin・mytplsadminなどと一緒に使い、ブロック管理・テンプレート管理を各モジュール内に持たせるものでした。

現在は、myblocksadminもmytplsadminも開発を終了し、それらの主要ロジックはaltsys内に一つだけ持つ形になっており、mymenuはaltsysへのラッパーとしてのみ働くよう、大きく性質が変化しました。

mymenu-1.0時点では、ブロック・アクセス権限(いわゆるmyblocksadmin)・テンプレート管理(いわゆるmytplsadmin)・言語定数管理・一般設定へのラッパーを持っています。


●使い方:

1) mymenu.php を modules/(dirname)/admin/ にコピーする

2) 管理画面用のファイルを一通り編集し、include('./mymenu.php'); という行を、xoops_cp_header(); の直後に挿入する

3) admin/index.php のcp_header.php読込直後に、altsysへの分岐処理を挿入する

4) admin/index.php の先頭で、modinfo.php の二重読込回避用定数(_MYMENU_CONSTANT_IN_MODINFO)を定義する(最初からmodinfo.phpに二重読込回避策が仕込んであれば不要)

5) language/(lang)/admin.php で、_MD_A_MYMENU_MYTPLSADMIN , _MD_A_MYMENU_MYBLOCKSADMIN , _MD_A_MYMENU_MYLANGADMIN , _MD_A_MYMENU_MYPREFERENCES を定義する(しなくても良い)



管理画面用スクリプトのサンプルスケルトン:

require_once( '../../../include/cp_header.php' ) ;
define( '_MYMENU_CONSTANT_IN_MODINFO' , '(modinfo.phpの最初に定義されている定数)' ) ;

// branch for altsys
if( defined( 'XOOPS_TRUST_PATH' ) && ! empty( $_GET['lib'] ) ) {
	$mydirname = basename( dirname( dirname( __FILE__ ) ) ) ;
	$mydirpath = dirname( dirname( __FILE__ ) ) ;

	// common libs (eg. altsys)
	$lib = preg_replace( '/[^a-zA-Z0-9_-]/' , '' , $_GET['lib'] ) ;
	$page = preg_replace( '/[^a-zA-Z0-9_-]/' , '' , @$_GET['page'] ) ;
	
	if( file_exists( XOOPS_TRUST_PATH.'/libs/'.$lib.'/'.$page.'.php' ) ) {
		include XOOPS_TRUST_PATH.'/libs/'.$lib.'/'.$page.'.php' ;
	} else if( file_exists( XOOPS_TRUST_PATH.'/libs/'.$lib.'/index.php' ) ) {
		include XOOPS_TRUST_PATH.'/libs/'.$lib.'/index.php' ;
	} else {
		die( 'wrong request' ) ;
	}
	exit ;
}

(DB update section)

xoops_cp_header() ;
include(dirname(__FILE__).'/mymenu.php');

(output section)

xoops_cp_footer() ;


language/(lang)/admin.php のサンプル

// altsys
define('_MD_A_MYMENU_MYTPLSADMIN','テンプレート管理');
define('_MD_A_MYMENU_MYBLOCKSADMIN','アクセス権限');
define('_MD_A_MYMENU_MYLANGADMIN','言語定数管理');
define('_MD_A_MYMENU_MYPREFERENCES','一般設定');



お試しあれ!




CHANGELOG:

2008-12-08 1.00 modified altsys friendly radically
2007-03-22 0.20 added page title for breadcrumbs of "admin in theme"
2006-12-18 0.19 modified compatibility environment without XOOPS_TRUST_PATH
2006-10-31 0.18 modified compatibility with Cube 2.1
modified altsys friendly
2006-05-03 0.17 updated gticket2
2006-02-10 0.16 fixed compatibility problem with XoopsCube2.1alpha (thx nobunobu)
2005-11-13 0.15 modified the compatibility with PHP 5.0.5
modified some files from CR+LF into LF
fixed some Notices in saving preferences (0.15a)
2005-06-09 0.14 modified 'area' in preference.inc.php
2005-05-25 0.13 modified XoopsGTicket supports 'area' and 'referer'
2005-02-22 0.12 fixed a typo of HTML tag
2005-02-21 0.11 disable checking IP
modified not to display top menu against ORETEKI
modified HTML of menu
2005-01-13 0.10 modified ticket system (limit stubs max 10)
fixed the highlight and the link to configs
2005-01-04 0.08 modified the usage of XoopsForm (thx okuhiki)
2004-12-30 0.07 modified using $_SERVER instead of $_ENV (thx Marijuana)
2004-12-16 0.06 eliminated unsed codes from preferences.inc.php for the security
2004-12-10 0.05 modified ticket system
2004-12-06 0.04 modified ticket system
2004-12-05 0.03 modified ticket system
2004-12-03 0.02 modified to use $_GET or $_POST instead of $HTTP_*_VARS (mari)
added admin_refcheck() for security (mari)
added ticket system for security (mari)
eliminated foreach() extraction from $_POST (mari)
fixed a place to include language files (thx marcan)
2004-06-15 0.01 the first release



COPYRIGHT:

I do not insist on the right of these codes, and don't guarantee.


Downloaded 14610 times  14610  File Size 3.51 KB  Supported Platforms zip|php5  Home Page http://www.peak.ne.jp/
Modify | Report Broken File | Tell a Friend | Comments (0)


Comments list

Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!