Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16
  1. #11
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,152
    Plugin Contributions
    11

    Default Re: [BETA] Admin Page Name Menu Override?

    Kuroi,
    That too was part of my concern. The mod I'm munging has many items to add to the configuration table as well.
    That could possibly mess with the LAST_INSERT_ID() as we then need to make sure the group ID is not confused with the configuration ID.
    Simpler to stick with the @t4

    BTW I tested three browsers on the iPad2. None would scroll the code in either mobile or regular view.
    Last edited by dbltoe; 5 Aug 2011 at 09:46 AM. Reason: added info

  2. #12
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,495
    Plugin Contributions
    88

    Default Re: [BETA] Admin Page Name Menu Override?

    Shouldn't the install SQL also take care of unregistering the previously-installed admin_pages entries as well?

    Code:
    # Clears out any pre-existing Links Manager configuration settings
    SET @t4=0;
    SELECT (@t4:=configuration_group_id) AS t4
    FROM configuration_group
    WHERE configuration_group_title= 'Links Manager';
    DELETE FROM configuration WHERE configuration_group_id = @t4;
    DELETE FROM configuration_group WHERE configuration_group_id = @t4;
    DELETE FROM configuration WHERE configuration_key = 'DEFINE_LINKS_STATUS';
    DELETE FROM admin_pages WHERE language_key = 'BOX_LINKS';
    DELETE FROM admin_pages WHERE language_key='BOX_LINK_CATEGORIES';
    DELETE FROM admin_pages WHERE language_key='BOX_LINKS_CONTACT';
    DELETE FROM admin_pages WHERE language_key='BOX_CONFIGURATION_LINKS_MANAGER';
    
    # Insert New Links Manager Configuration Group (will be indexed differently to any old one cleared out about)
    INSERT INTO configuration_group VALUES (NULL, 'Links Manager', 'Links Display Settings', '1', '1');
    UPDATE configuration_group SET sort_order = LAST_INSERT_ID() WHERE configuration_group_id = LAST_INSERT_ID();
    
    # Register the paghes for Admin Access Control
    INSERT INTO admin_pages (page_key,language_key,main_page,page_params,menu_key,display_on_menu,sort_order)
    VALUES ('links','BOX_LINKS','FILENAME_LINKS','','extras','Y',101),
           ('linkCategories','BOX_LINK_CATEGORIES','FILENAME_LINK_CATEGORIES','','extras','Y',102),
           ('linksContact','BOX_LINKS_CONTACT','FILENAME_LINKS_CONTACT','','extras','Y',103),
           ('linksConfig','BOX_CONFIGURATION_LINKS_MANAGER','FILENAME_CONFIGURATION',CONCAT('gID=',LAST_INSERT_ID()),'configuration','Y',LAST_INSERT_ID());

  3. #13
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: [BETA] Admin Page Name Menu Override?

    No and yes.

    No, because admin_pages was only introduced in this version of Zen Cart, so wouldn't be any prior entries to clear out.

    Yes, because it does no harm and may even help in a number of edge cases, e.g. somebody running the SQL twice, and possibly for users upgrading a cart with Admin Profiles installed (haven't looked at that in depth yet).

    Yes, for future updates if the settings have changed.

    So on balance I'd now use:

    Code:
    # Clears out any pre-existing Links Manager configuration settings
    SELECT @links_mgr:=configuration_group_id FROM configuration_group WHERE configuration_group_title= 'Links Manager';
    DELETE FROM configuration WHERE configuration_group_id = @links_mgr;
    DELETE FROM configuration_group WHERE configuration_group_id = @links_mgr;
    DELETE FROM configuration WHERE configuration_key = 'DEFINE_LINKS_STATUS';
    DELETE FROM admin_pages WHERE language_key = 'BOX_LINKS';
    DELETE FROM admin_pages WHERE language_key='BOX_LINK_CATEGORIES';
    DELETE FROM admin_pages WHERE language_key='BOX_LINKS_CONTACT';
    DELETE FROM admin_pages WHERE language_key='BOX_CONFIGURATION_LINKS_MANAGER';
    
    # Insert New Links Manager Configuration Group (will be indexed differently to any old one cleared out about)
    INSERT INTO configuration_group VALUES (NULL, 'Links Manager', 'Links Display Settings', '1', '1');
    SET @links_mgr = LAST_INSERT_ID();
    UPDATE configuration_group SET sort_order = @links_mgr WHERE configuration_group_id = @links_mgr;
    
    # Register the pages for Admin Access Control
    INSERT INTO admin_pages (page_key,language_key,main_page,page_params,menu_key,display_on_menu,sort_order)
    VALUES ('links','BOX_LINKS','FILENAME_LINKS','','extras','Y',101),
           ('linkCategories','BOX_LINK_CATEGORIES','FILENAME_LINK_CATEGORIES','','extras','Y',102),
           ('linksContact','BOX_LINKS_CONTACT','FILENAME_LINKS_CONTACT','','extras','Y',103),
           ('linksConfig','BOX_CONFIGURATION_LINKS_MANAGER','FILENAME_CONFIGURATION',CONCAT('gID=',@links_mgr),'configuration','Y',@links_mgr);
    
    INSERT INTO `configuration` VALUES (NULL, 'Links Box - Display View All Links', 'BOX_DISPLAY_VIEW_ALL_LINKS', 'true', 'Display View All Links on Links Sidebox', @links_mgr, 2, NULL, now(), NULL, 'zen_cfg_select_option(array(''true'', ''false''), ');
    .
    .
    .
    Last edited by kuroi; 15 Aug 2011 at 09:46 AM. Reason: Remove initialisation of @links_mgr var. Normally initialisation is good, here could be dangerous
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  4. #14
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,152
    Plugin Contributions
    11

    Default Re: [BETA] Admin Page Name Menu Override?

    Still playing with this, but the good news is safari for iOS5 now scrolls quotes and code left and right on the iPad2!

  5. #15
    Join Date
    Mar 2007
    Posts
    249
    Plugin Contributions
    6

    Default Re: [BETA] Admin Page Name Menu Override?

    don't suppose anyone has looked into the upgrade for 1.3.9h to 1.5 with admin profiles installed?? Caused me a few probs with blank admin login after upgrade, but after deleting the original profiles files mamanged to get in, but now having real difficulty trying to get all my installed mods back on the menus.

  6. #16
    Join Date
    Jul 2010
    Posts
    243
    Plugin Contributions
    5

    Default Re: [BETA] Admin Page Name Menu Override?

    personally, id run through the uninstall of Admin Profiles, then upgrade to 1.5

    Test site of course, see if it worked.

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. v155 BETA feedback for Responsive-Classic in v155-beta
    By picaflor-azul in forum Addon Templates
    Replies: 51
    Last Post: 5 Mar 2016, 09:14 PM
  2. Admin Page Alert after Admin Dir name change
    By shocker in forum Basic Configuration
    Replies: 3
    Last Post: 28 Oct 2011, 05:36 AM
  3. Admin menu override
    By tassoman in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 14 Mar 2008, 08:22 PM
  4. Replies: 11
    Last Post: 4 Oct 2007, 06:53 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR