Ejemplo n.º 1
0
	public function getPluginBEToolbar( $function, $user, $plugin ) {
		if ( strstr( $function, 'auto' ) ) {
			switch ( $function ) {
				case 'auto_new':
				case 'auto_edit':
				case 'auto_save':
					CBtoolmenuBar::startTable();
					CBtoolmenuBar::save( 'savePlugin', CBTxt::T( 'Save' ) );
					CBtoolmenuBar::apply( 'applyPlugin', CBTxt::T( 'Apply' ) );
					CBtoolmenuBar::linkAction( 'cancel', cbgjClass::getPluginURL( array( 'plugin', 'auto' ) ), CBTxt::T( 'Cancel' ) );
					CBtoolmenuBar::endTable();
					break;
				case 'auto_show':
				case 'auto':
				default:
					CBtoolmenuBar::startTable();
					cbgjMenu::getDefaults( 'plugin', $function, $user, $plugin );
					CBtoolmenuBar::spacer( '50px' );
					CBtoolmenuBar::linkAction( 'publish', "javascript:cbDoListTask( this, 'editPlugin', 'action', 'plugin.auto_publish', 'id' )", CBTxt::T( 'Publish' ) );
					CBtoolmenuBar::linkAction( 'unpublish', "javascript:cbDoListTask( this, 'editPlugin', 'action', 'plugin.auto_unpublish', 'id' )", CBTxt::T( 'Unpublish' ) );
					CBtoolmenuBar::linkAction( 'copy', "javascript:cbDoListTask( this, 'editPlugin', 'action', 'plugin.auto_copy', 'id' )", CBTxt::T( 'Copy' ) );
					CBtoolmenuBar::linkAction( 'delete', "javascript:cbDoListTask( this, 'editPlugin', 'action', 'plugin.auto_delete', 'id' )", CBTxt::T( 'Delete' ) );
					CBtoolmenuBar::linkAction( 'edit', "javascript:cbDoListTask( this, 'editPlugin', 'action', 'plugin.auto_edit', 'id' )", CBTxt::T( 'Edit' ) );
					CBtoolmenuBar::linkAction( 'new', cbgjClass::getPluginURL( array( 'plugin', 'auto_new' ) ), CBTxt::T( 'New' ) );
					CBtoolmenuBar::back( CBTxt::T( 'Back' ), cbgjClass::getPluginURL() );
					CBtoolmenuBar::endTable();
					break;
			}
		}
	}
	/**
	 * render backend menus menu
	 */
	static public function showMenus( $function, $user, $plugin ) {
		CBtoolmenuBar::startTable();
		cbgjMenu::getDefaults( 'menus', $function, $user, $plugin );
		CBtoolmenuBar::spacer( '50px' );
		CBtoolmenuBar::save( 'savePlugin', CBTxt::T( 'Save' ) );
		CBtoolmenuBar::linkAction( 'cancel', cbgjClass::getPluginURL(), CBTxt::T( 'Cancel' ) );
		CBtoolmenuBar::endTable();
	}
 static function _PLUGIN_ACTION_EDIT()
 {
     CBtoolmenuBar::startTable();
     CBtoolmenuBar::save('savePlugin');
     CBtoolmenuBar::spacer();
     CBtoolmenuBar::apply('applyPlugin');
     CBtoolmenuBar::spacer();
     CBtoolmenuBar::cancel('cancelPluginAction', 'Close');
     CBtoolmenuBar::endTable();
 }
 static function _PLUGIN_ACTION_EDIT()
 {
     CBtoolmenuBar::startTable();
     CBtoolmenuBar::save('savePlugin');
     CBtoolmenuBar::spacer();
     CBtoolmenuBar::apply('applyPlugin');
     CBtoolmenuBar::spacer();
     CBtoolmenuBar::cancel('cancelPluginAction', 'Close');
     /*
     if ( $id ) {
     	// for existing content items the button is renamed `close`
     	CBtoolmenuBar::cancel( 'cancelPlugin', 'Close' );
     } else {
     	CBtoolmenuBar::cancel('showPlugins');
     }
     */
     CBtoolmenuBar::endTable();
 }