<?php
if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__)
        .' is not allowed.' );
/**
 *
 * @package  MediaLibrary
 * @copyright 2021 Andrey Kvasnevskiy-OrdaSoft(akbet@mail.ru); Rob de Cleen(rob@decleen.com);
 * Homepage: https://ordasoft.com
 * @version: 4.6 Free
 * @license GNU General Public license version 2 or later; see LICENSE.txt
 *
 */



// include_once( dirname(__FILE__).'/compat.joomla1.5.php' );
require_once ( JPATH_ROOT."/components/com_medialibrary/functions.php" );

 //*** Get language files
global $mosConfig_absolute_path, $mosConfig_lang;
require_once $mosConfig_absolute_path . "/administrator/components/com_medialibrary/language.php";
$mosConfig_absolute_path = $GLOBALS['mosConfig_absolute_path'];
require_once($mosConfig_absolute_path."/administrator/components/com_medialibrary/menubar_ext.php");

class menucat {
    static function NEW_CATEGORY() {
        mosMenuBar_ext::startTable();
        mosMenuBar_ext::save();
        mosMenuBar_ext::cancel();
        mosMenuBar_ext::spacer();
        mosMenuBar_ext::endTable();
    }
    static function EDIT_CATEGORY() {
        mosMenuBar_ext::startTable();
        mosMenuBar_ext::save();
        mosMenuBar_ext::cancel();
        mosMenuBar_ext::spacer();
        mosMenuBar_ext::endTable();
    }
    static function SHOW_CATEGORIES() {
        mosMenuBar_ext::startTable();
        mosMenuBar_ext::publishList();
        mosMenuBar_ext::unpublishList();
        mosMenuBar_ext::addNew();
        mosMenuBar_ext::editList();
        mosMenuBar_ext::deleteList();
        mosMenuBar_ext::spacer();
        mosMenuBar_ext::endTable();
    }
      static function DEFAULT_CATEGORIES() {
            mosMenuBar_ext::startTable();
            mosMenuBar_ext::publishList();
            mosMenuBar_ext::unpublishList();
            mosMenuBar_ext::addNew('new', 'Add');
            mosMenuBar_ext::editList();
            mosMenuBar_ext::deleteList();
            mosMenuBar_ext::endTable();
  }

}
class menulanguagemanager
{

    static function EDIT_LANGUAGEMANAGER()
    {
        mosMenuBar_ext::startTable();
        mosMenuBar_ext::save();
        mosMenuBar_ext::cancel();
        mosMenuBar_ext::spacer();
        mosMenuBar_ext::endTable();
    }

    static function MENU_LANGUAGEMANAGER()
    {
        mosMenuBar_ext::startTable();
        mosMenuBar_ext::editList();
        mosMenuBar_ext::spacer();
        mosMenuBar_ext::endTable();
    }

}


class menumedialibrary
{

    static function MENU_NEW()
  {
        mosMenuBar_ext::startTable();
        mosMenuBar_ext::save();
        mosMenuBar_ext::cancel();
        //mosMenuBar::help(./components/com_medialibrary/help/1.html);
        mosMenuBar_ext::spacer();
        mosMenuBar_ext::endTable();
    }

    static function MENU_EDIT() {
        mosMenuBar_ext::startTable();
        mosMenuBar_ext::save();
        mosMenuBar_ext::apply('apply', 'apply');

        //*******************  begin add for review edit  **********************
        mosMenuBar_ext::editList('edit_review',_MEDIALIBRARY_TOOLBAR_ADMIN_EDIT_REVIEW);
        mosMenuBar_ext::deleteList('','delete_review',_MEDIALIBRARY_TOOLBAR_ADMIN_DELETE_REVIEW );
        //*******************  end add for review edit  ************************

        mosMenuBar_ext::cancel();
        //mosMenuBar::help();
        mosMenuBar_ext::spacer();
        mosMenuBar_ext::endTable();
    }

    static function MENU_DELETE_REVIEW() {
        mosMenuBar_ext::startTable();
        mosMenuBar_ext::save();
        mosMenuBar_ext::spacer();
        mosMenuBar_ext::apply('apply', 'apply');
        mosMenuBar_ext::spacer();

        //*******************  begin add for review edit  **********************
        mosMenuBar_ext::editList('edit_review',_MEDIALIBRARY_TOOLBAR_ADMIN_EDIT_REVIEW);
        mosMenuBar_ext::deleteList('','delete_review',_MEDIALIBRARY_TOOLBAR_ADMIN_DELETE_REVIEW );
        //*******************  end add for review edit  ************************

        mosMenuBar_ext::spacer();
        mosMenuBar_ext::cancel();
        //mosMenuBar::help();
        mosMenuBar_ext::spacer();
        mosMenuBar_ext::endTable();
    }

    static function MENU_EDIT_REVIEW() {
        mosMenuBar_ext::startTable();
        mosMenuBar_ext::save('update_review');
        mosMenuBar_ext::cancel('cancel_review_edit');
        mosMenuBar_ext::spacer();
        mosMenuBar_ext::endTable();

    }

    static function MENU_CANCEL() {
        mosMenuBar_ext::startTable();
        mosMenuBar_ext::back();  //old valid  mosMenuBar::cancel();
        //mosMenuBar::help();
        mosMenuBar_ext::spacer();
        mosMenuBar_ext::endTable();
    }

    static function MENU_CONFIG() {
        mosMenuBar_ext::startTable();
        mosMenuBar_ext::save('config_save');
        //mosMenuBar_ext::cancel();
        //mosMenuBar::help();
        mosMenuBar_ext::spacer();
        mosMenuBar_ext::endTable();
    }

//**************   begin for manage reviews   *********************
    static function MENU_MANAGE_REVIEW() {
        mosMenuBar_ext::startTable();
        mosMenuBar_ext::editList('edit_manage_review',_MEDIALIBRARY_TOOLBAR_ADMIN_EDIT_REVIEW);
        mosMenuBar_ext::spacer();
        mosMenuBar_ext::deleteList('','delete_manage_review',_MEDIALIBRARY_TOOLBAR_ADMIN_DELETE_REVIEW);
        mosMenuBar_ext::publishList('publish_manage_review');
        mosMenuBar_ext::unpublishList('unpublish_manage_review');
        mosMenuBar_ext::endTable();
    }

    static function MENU_MANAGE_REVIEW_DELETE() {
        mosMenuBar_ext::startTable();
        mosMenuBar_ext::editList('edit_manage_review',_MEDIALIBRARY_TOOLBAR_ADMIN_EDIT_REVIEW);
        mosMenuBar_ext::spacer();
        mosMenuBar_ext::deleteList('','delete_manage_review',_MEDIALIBRARY_TOOLBAR_ADMIN_DELETE_REVIEW);
        mosMenuBar_ext::endTable();
    }

    static function MENU_MANAGE_REVIEW_EDIT() {
        mosMenuBar_ext::startTable();
        mosMenuBar_ext::save('update_edit_manage_review');
        mosMenuBar_ext::spacer();
        mosMenuBar_ext::cancel('cancel_edit_manage_review');
        mosMenuBar_ext::endTable();
    }

    static function MENU_MANAGE_REVIEW_EDIT_EDIT() {
        mosMenuBar_ext::startTable();
        mosMenuBar_ext::editList('edit_manage_review',_MEDIALIBRARY_TOOLBAR_ADMIN_EDIT_REVIEW);
        mosMenuBar_ext::spacer();
        mosMenuBar_ext::deleteList('','delete_manage_review',_MEDIALIBRARY_TOOLBAR_ADMIN_DELETE_REVIEW);
        mosMenuBar_ext::endTable();
    }
//**************   end for manage reviews   ***********************


  static function MENU_MUSIC()
  {
        mosMenuBar_ext::startTable();
        mosMenuBar_ext::publishList();
        mosMenuBar_ext::unpublishList();
        mosMenuBar_ext::spacer();
    mosMenuBar_ext::NewCustom('refetchInfos','adminForm',
      '../administrator/components/com_medialibrary/images/dm_refetchInfos.png',
      '../administrator/components/com_medialibrary/images/dm_refetchInfos_32.png',
      _MEDIALIBRARY_TOOLBAR_REFETCH_INFORMATION,_MEDIALIBRARY_TOOLBAR_ADMIN_REFRESH,
      true, 'adminForm');

      mosMenuBar_ext::NewCustom('lend','adminForm',
      "../administrator/components/com_medialibrary/images/dm_lend.png",
      "../administrator/components/com_medialibrary/images/dm_lend_32.png",
      _MEDIALIBRARY_TOOLBAR_LEND_MEDIA,_MEDIALIBRARY_TOOLBAR_ADMIN_LEND,true,'adminForm');

    mosMenuBar_ext::NewCustom('lend_return','adminForm',
      "../administrator/components/com_medialibrary/images/dm_lend_return.png",
      "../administrator/components/com_medialibrary/images/dm_lend_return_32.png",
      _MEDIALIBRARY_TOOLBAR_RETURN_MEDIA,_MEDIALIBRARY_TOOLBAR_ADMIN_RETURN,true,'adminForm');

    mosMenuBar_ext::addNew("new_music");
        mosMenuBar_ext::deleteList();
        mosMenuBar_ext::spacer();
        mosMenuBar_ext::endTable();
  }

// Example for 1.6
// JToolBarHelper::apply('helloworld.apply', 'JTOOLBAR_APPLY');
// JToolBarHelper::save('helloworld.save', 'JTOOLBAR_SAVE');
// JToolBarHelper::cancel('helloworld.cancel', 'JTOOLBAR_CANCEL');
// JToolBarHelper::custom('helloworld.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
// JToolBarHelper::custom('helloworld.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', 
// false);


  static function MENU_DEFAULT() {
    
        addInfoAboutUpdate();
        mosMenuBar_ext::startTable();
        mosMenuBar_ext::publishList();
        mosMenuBar_ext::unpublishList();
        mosMenuBar_ext::spacer();
        mosMenuBar_ext::NewCustom('refetchInfos','adminForm',
        '../administrator/components/com_medialibrary/images/dm_refetchInfos.png',
        '../administrator/components/com_medialibrary/images/dm_refetchInfos_32.png',
        _MEDIALIBRARY_TOOLBAR_REFETCH_INFORMATION,_MEDIALIBRARY_TOOLBAR_ADMIN_REFRESH,
        true, 'adminForm');

        mosMenuBar_ext::NewCustom('lend','adminForm',
        "../administrator/components/com_medialibrary/images/dm_lend.png",
        "../administrator/components/com_medialibrary/images/dm_lend_32.png",
        _MEDIALIBRARY_TOOLBAR_LEND_MEDIA,_MEDIALIBRARY_TOOLBAR_ADMIN_LEND,
        true,'adminForm');

        mosMenuBar_ext::NewCustom('lend_return','adminForm',
        "../administrator/components/com_medialibrary/images/dm_lend_return.png",
        "../administrator/components/com_medialibrary/images/dm_lend_return_32.png",
        _MEDIALIBRARY_TOOLBAR_RETURN_MEDIA,_MEDIALIBRARY_TOOLBAR_ADMIN_RETURN,true,'adminForm');

        mosMenuBar_ext::addNew();
        mosMenuBar_ext::spacer();
        mosMenuBar_ext::deleteList();
        mosMenuBar_ext::spacer();
        mosMenuBar_ext::endTable();
    }

  static function MENU_SAVE_BACKEND()
  {
    mosMenuBar_ext::startTable();
    mosMenuBar_ext::spacer();
    mosMenuBar_ext::save();
    mosMenuBar_ext::apply('apply', 'apply');
    mosMenuBar_ext::spacer();
    mosMenuBar_ext::back();
    mosMenuBar_ext::spacer();
    mosMenuBar_ext::endTable();
  }


    static function MENU_LEND() {
        mosMenuBar_ext::startTable();

        mosMenuBar_ext::NewCustom('lend','adminForm',
      "../administrator/components/com_medialibrary/images/dm_lend.png",
      "../administrator/components/com_medialibrary/images/dm_lend_32.png",
      _MEDIALIBRARY_TOOLBAR_LEND_MEDIA,_MEDIALIBRARY_TOOLBAR_ADMIN_LEND,true,'adminForm');

    mosMenuBar_ext::cancel();
        mosMenuBar_ext::spacer();
        mosMenuBar_ext::endTable();
    }

    static function MENU_LENDREQUESTS()
  {
    global $mosConfig_absolute_path;
        mosMenuBar_ext::startTable();

    mosMenuBar_ext::NewCustom('accept_lend_requests','adminForm',
      '../administrator/components/com_medialibrary/images/dm_accept.png',
      '../administrator/components/com_medialibrary/images/dm_accept_32.png',
      _MEDIALIBRARY_TOOLBAR_ACCEPT_REQUEST,_MEDIALIBRARY_TOOLBAR_ADMIN_ACCEPT,
      true, 'adminForm');

    mosMenuBar_ext::NewCustom('decline_lend_requests','adminForm',
      '../administrator/components/com_medialibrary/images/dm_decline.png',
      '../administrator/components/com_medialibrary/images/dm_decline_32.png',
      _MEDIALIBRARY_TOOLBAR_EXPORT,_MEDIALIBRARY_TOOLBAR_ADMIN_DECLINE,true, 'adminForm');

    //mosMenuBar_ext::cancel();
        //mosMenuBar::help(./components/com_medialibrary/help/1.html);
        mosMenuBar_ext::spacer();
        mosMenuBar_ext::endTable();
    }

    static function MENU_LEND_RETURN() {
        mosMenuBar_ext::startTable();
       mosMenuBar_ext::NewCustom('lend_return','adminForm',
      "../administrator/components/com_medialibrary/images/dm_lend_return.png",
      "../administrator/components/com_medialibrary/images/dm_lend_return_32.png",
      _MEDIALIBRARY_TOOLBAR_RETURN_MEDIA,_MEDIALIBRARY_TOOLBAR_ADMIN_RETURN,true,'adminForm');
        mosMenuBar_ext::cancel();
        //mosMenuBar::help(./components/com_medialibrary/help/1.html);
        mosMenuBar_ext::spacer();
        mosMenuBar_ext::endTable();
    }

    static function MENU_REFETCH_INFOS(){
        mosMenuBar_ext::startTable();
    mosMenuBar_ext::NewCustom('refetchInfos','adminForm',
      '../administrator/components/com_medialibrary/images/dm_refetchInfos.png',
      '../administrator/components/com_medialibrary/images/dm_refetchInfos_32.png',
      _MEDIALIBRARY_TOOLBAR_REFETCH_INFORMATION,_MEDIALIBRARY_TOOLBAR_ADMIN_REFRESH,true,'adminForm');
    mosMenuBar_ext::cancel();
        //mosMenuBar::help(./components/com_medialibrary/help/1.html);
        mosMenuBar_ext::spacer();
        mosMenuBar_ext::endTable();
    }

   static function MENU_IMPORT_EXPORT()
  {
    mosMenuBar_ext::startTable();
    mosMenuBar_ext::NewCustom_I('import','adminForm',
      '../administrator/components/com_medialibrary/images/dm_import.png',
      '../administrator/components/com_medialibrary/images/dm_import_32.png',
      _MEDIALIBRARY_TOOLBAR_IMPORT,_MEDIALIBRARY_TOOLBAR_ADMIN_IMPORT,true,'adminForm');

    mosMenuBar_ext::NewCustom_E('export','adminForm',
      '../administrator/components/com_medialibrary/images/dm_export.png',
      '../administrator/components/com_medialibrary/images/dm_export_32.png',
      _MEDIALIBRARY_TOOLBAR_EXPORT,_MEDIALIBRARY_TOOLBAR_ADMIN_EXPORT,true,'adminForm');

    mosMenuBar_ext::back();
        mosMenuBar_ext::spacer();
        mosMenuBar_ext::endTable();
    }

    static function MENU_ABOUT(){
        mosMenuBar_ext::startTable();
        mosMenuBar_ext::back();
        mosMenuBar_ext::endTable();
    }
    static function MENU_MANAGE_AUTHOR(){
        mosMenuBar_ext::startTable();
        mosMenuBar_ext::addNew('add_author');
        mosMenuBar_ext::editList('clone_author',_MEDIALIBRARY_ADMIN_CLONE_PEOPLE);
        mosMenuBar_ext::editList('edit_author');
        mosMenuBar_ext::publishList('publish_author');
        mosMenuBar_ext::unpublishList('unpublish_author');
        mosMenuBar_ext::deleteList("Please confirm deletion.",'delete_author');
        mosMenuBar_ext::spacer();
        mosMenuBar_ext::endTable();
    }
   static function MENU_ADD_AUTHOR(){
        mosMenuBar_ext::startTable();
        mosMenuBar_ext::save('save_author');
        mosMenuBar_ext::apply('apply_author', 'apply');
        mosMenuBar_ext::cancel('manage_author');
        mosMenuBar_ext::spacer();
        mosMenuBar_ext::endTable();
    }
}

