Zen Cart Logo
Forums / Upgrading to 1.5.x / Admin page registration for updated mod

Admin page registration for updated mod

Views: 2,319

Results 1 to 10 of 10
8 Feb 2012, 9:01 AM
#1
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Admin page registration for updated mod

I am converting the Editable Centerboxes mod for v1.5.0 compatibility while improving it, and testing on my local XAMPP installation. I believe I have written the SQL correctly for admin page registration, but the new item is not appearing in the Configuration dropdown. All of the db fields are populated as expected (and matching related ones as I believe they should) in admin_pages, configuration and configuration_group tables. If I navigate directly to the configuration group, all of the new settings are there and work correctly.

Can anyone see anything in this SQL that would not work properly? Or is there yet something else that needs to be done for this to work?

# Clears out any pre-existing Middleboxes configuration settings
SELECT @middleboxesid:=configuration_group_id FROM configuration_group WHERE configuration_group_title= 'Editable Centerboxes';
DELETE FROM configuration WHERE configuration_group_id = @middleboxesid;
DELETE FROM configuration_group WHERE configuration_group_id = @middleboxesid;
DELETE FROM admin_pages WHERE language_key='BOX_CONFIGURATION_EDITABLE_CENTERBOXES';

# Insert New Middleboxes Configuration Group (will be indexed differently to any old one cleared out above)
INSERT INTO configuration_group VALUES (NULL, 'Editable Centerboxes', 'Settings for Editable Centerboxes', '100', '1');
SET @middleboxesid = LAST_INSERT_ID();
UPDATE configuration_group SET sort_order = @middleboxesid WHERE configuration_group_id = @middleboxesid;
# 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 ('configEditableCenterboxes','BOX_CONFIGURATION_EDITABLE_CENTERBOXES','FILENAME_CONFIGURATION',CONCAT('gID=',@middleboxesid),'configuration','Y',@middleboxesid);

INSERT INTO configuration VALUES (NULL, 'Middleboxes - Homepage Only', 'MIDDLEBOX_HOME', '1', 'Display middleboxes on homepage only, or allow to display on internal categories pages?<br /><br />0=All, 1=Home', @middleboxesid, 49, now(), now(), NULL, 'zen_cfg_select_option(array(''0'', ''1''), ');
INSERT INTO configuration VALUES (NULL, 'Middlebox 1 - Location', 'MIDDLEBOX_NUMBER_1', '0', 'Location to display middlebox 1.<br /><br /> 0=Off<br /><br />Above or Below the <strong>Main Page Define</strong> content.<br /><small><em>If the Main Page Define content is set to not display, the Above or Below Main Page Define options yield the same result.</em></small><br />1=Above Main Page Define content<br />2=Below Main Page Define content<br />3=Below <em>New, Specials, Featured</em> etc. centerboxes<br /><br />If you set <strong>Categories - Always Show on Main Page</strong> to <strong>Yes</strong>. <br /><small><em>If the Main Page Define content is set to not display, the Above or Below Main Page Define options yield the same result.</em></small><br />4=Above Main Page Define content and Categories<br />5=Between Main Page Define content and Categories<br />6=Below Categories<br />7=Below Categories and <em>New, Specials, Featured</em> etc. centerboxes', @middleboxesid, 51, now(), now(), NULL, 'zen_cfg_select_option(array(''0'', ''1'', ''2'', ''3'', ''4'', ''5'', ''6'', ''7''), ');
INSERT INTO configuration VALUES (NULL, 'Middlebox 2 - Location', 'MIDDLEBOX_NUMBER_2', '0', 'Location to display middlebox 2.<br /><br /> 0=Off<br /><br />Above or Below the <strong>Main Page Define</strong> content.<br /><small><em>If the Main Page Define content is set to not display, the Above or Below Main Page Define options yield the same result.</em></small><br />1=Above Main Page Define content<br />2=Below Main Page Define content<br />3=Below <em>New, Specials, Featured</em> etc. centerboxes<br /><br />If you set <strong>Categories - Always Show on Main Page</strong> to <strong>Yes</strong>. <br /><small><em>If the Main Page Define content is set to not display, the Above or Below Main Page Define options yield the same result.</em></small><br />4=Above Main Page Define content and Categories<br />5=Between Main Page Define content and Categories<br />6=Below Categories<br />7=Below Categories and <em>New, Specials, Featured</em> etc. centerboxes', @middleboxesid, 52, now(), now(), NULL, 'zen_cfg_select_option(array(''0'', ''1'', ''2'', ''3'', ''4'', ''5'', ''6'', ''7''), ');
INSERT INTO configuration VALUES (NULL, 'Middlebox 3 - Location', 'MIDDLEBOX_NUMBER_3', '0', 'Location to display middlebox 3.<br /><br /> 0=Off<br /><br />Above or Below the <strong>Main Page Define</strong> content.<br /><small><em>If the Main Page Define content is set to not display, the Above or Below Main Page Define options yield the same result.</em></small><br />1=Above Main Page Define content<br />2=Below Main Page Define content<br />3=Below <em>New, Specials, Featured</em> etc. centerboxes<br /><br />If you set <strong>Categories - Always Show on Main Page</strong> to <strong>Yes</strong>. <br /><small><em>If the Main Page Define content is set to not display, the Above or Below Main Page Define options yield the same result.</em></small><br />4=Above Main Page Define content and Categories<br />5=Between Main Page Define content and Categories<br />6=Below Categories<br />7=Below Categories and <em>New, Specials, Featured</em> etc. centerboxes', @middleboxesid, 53, now(), now(), NULL, 'zen_cfg_select_option(array(''0'', ''1'', ''2'', ''3'', ''4'', ''5'', ''6'', ''7''), ');
INSERT INTO configuration VALUES (NULL, 'Middlebox 4 - Location', 'MIDDLEBOX_NUMBER_4', '0', 'Location to display middlebox 4.<br /><br /> 0=Off<br /><br />Above or Below the <strong>Main Page Define</strong> content.<br /><small><em>If the Main Page Define content is set to not display, the Above or Below Main Page Define options yield the same result.</em></small><br />1=Above Main Page Define content<br />2=Below Main Page Define content<br />3=Below <em>New, Specials, Featured</em> etc. centerboxes<br /><br />If you set <strong>Categories - Always Show on Main Page</strong> to <strong>Yes</strong>. <br /><small><em>If the Main Page Define content is set to not display, the Above or Below Main Page Define options yield the same result.</em></small><br />4=Above Main Page Define content and Categories<br />5=Between Main Page Define content and Categories<br />6=Below Categories<br />7=Below Categories and <em>New, Specials, Featured</em> etc. centerboxes', @middleboxesid, 54, now(), now(), NULL, 'zen_cfg_select_option(array(''0'', ''1'', ''2'', ''3'', ''4'', ''5'', ''6'', ''7''), ');
INSERT INTO configuration VALUES (NULL, 'Middlebox 5 - Location', 'MIDDLEBOX_NUMBER_5', '0', 'Location to display middlebox 5.<br /><br /> 0=Off<br /><br />Above or Below the <strong>Main Page Define</strong> content.<br /><small><em>If the Main Page Define content is set to not display, the Above or Below Main Page Define options yield the same result.</em></small><br />1=Above Main Page Define content<br />2=Below Main Page Define content<br />3=Below <em>New, Specials, Featured</em> etc. centerboxes<br /><br />If you set <strong>Categories - Always Show on Main Page</strong> to <strong>Yes</strong>. <br /><small><em>If the Main Page Define content is set to not display, the Above or Below Main Page Define options yield the same result.</em></small><br />4=Above Main Page Define content and Categories<br />5=Between Main Page Define content and Categories<br />6=Below Categories<br />7=Below Categories and <em>New, Specials, Featured</em> etc. centerboxes', @middleboxesid, 55, now(), now(), NULL, 'zen_cfg_select_option(array(''0'', ''1'', ''2'', ''3'', ''4'', ''5'', ''6'', ''7''), ');
INSERT INTO configuration VALUES (NULL, 'Middlebox 6 - Location', 'MIDDLEBOX_NUMBER_6', '0', 'Location to display middlebox 6.<br /><br /> 0=Off<br /><br />Above or Below the <strong>Main Page Define</strong> content.<br /><small><em>If the Main Page Define content is set to not display, the Above or Below Main Page Define options yield the same result.</em></small><br />1=Above Main Page Define content<br />2=Below Main Page Define content<br />3=Below <em>New, Specials, Featured</em> etc. centerboxes<br /><br />If you set <strong>Categories - Always Show on Main Page</strong> to <strong>Yes</strong>. <br /><small><em>If the Main Page Define content is set to not display, the Above or Below Main Page Define options yield the same result.</em></small><br />4=Above Main Page Define content and Categories<br />5=Between Main Page Define content and Categories<br />6=Below Categories<br />7=Below Categories and <em>New, Specials, Featured</em> etc. centerboxes', @middleboxesid, 56, now(), now(), NULL, 'zen_cfg_select_option(array(''0'', ''1'', ''2'', ''3'', ''4'', ''5'', ''6'', ''7''), ');
INSERT INTO configuration VALUES (NULL, 'Middlebox 7 - Location', 'MIDDLEBOX_NUMBER_7', '0', 'Location to display middlebox 7.<br /><br /> 0=Off<br /><br />Above or Below the <strong>Main Page Define</strong> content.<br /><small><em>If the Main Page Define content is set to not display, the Above or Below Main Page Define options yield the same result.</em></small><br />1=Above Main Page Define content<br />2=Below Main Page Define content<br />3=Below <em>New, Specials, Featured</em> etc. centerboxes<br /><br />If you set <strong>Categories - Always Show on Main Page</strong> to <strong>Yes</strong>. <br /><small><em>If the Main Page Define content is set to not display, the Above or Below Main Page Define options yield the same result.</em></small><br />4=Above Main Page Define content and Categories<br />5=Between Main Page Define content and Categories<br />6=Below Categories<br />7=Below Categories and <em>New, Specials, Featured</em> etc. centerboxes', @middleboxesid, 57, now(), now(), NULL, 'zen_cfg_select_option(array(''0'', ''1'', ''2'', ''3'', ''4'', ''5'', ''6'', ''7''), ');
INSERT INTO configuration VALUES (NULL, 'Middlebox 8 - Location', 'MIDDLEBOX_NUMBER_8', '0', 'Location to display middlebox 8.<br /><br /> 0=Off<br /><br />Above or Below the <strong>Main Page Define</strong> content.<br /><small><em>If the Main Page Define content is set to not display, the Above or Below Main Page Define options yield the same result.</em></small><br />1=Above Main Page Define content<br />2=Below Main Page Define content<br />3=Below <em>New, Specials, Featured</em> etc. centerboxes<br /><br />If you set <strong>Categories - Always Show on Main Page</strong> to <strong>Yes</strong>. <br /><small><em>If the Main Page Define content is set to not display, the Above or Below Main Page Define options yield the same result.</em></small><br />4=Above Main Page Define content and Categories<br />5=Between Main Page Define content and Categories<br />6=Below Categories<br />7=Below Categories and <em>New, Specials, Featured</em> etc. centerboxes', @middleboxesid, 58, now(), now(), NULL, 'zen_cfg_select_option(array(''0'', ''1'', ''2'', ''3'', ''4'', ''5'', ''6'', ''7''), ');
INSERT INTO configuration VALUES (NULL, 'Middlebox 9 - Location', 'MIDDLEBOX_NUMBER_9', '0', 'Location to display middlebox 9.<br /><br /> 0=Off<br /><br />Above or Below the <strong>Main Page Define</strong> content.<br /><small><em>If the Main Page Define content is set to not display, the Above or Below Main Page Define options yield the same result.</em></small><br />1=Above Main Page Define content<br />2=Below Main Page Define content<br />3=Below <em>New, Specials, Featured</em> etc. centerboxes<br /><br />If you set <strong>Categories - Always Show on Main Page</strong> to <strong>Yes</strong>. <br /><small><em>If the Main Page Define content is set to not display, the Above or Below Main Page Define options yield the same result.</em></small><br />4=Above Main Page Define content and Categories<br />5=Between Main Page Define content and Categories<br />6=Below Categories<br />7=Below Categories and <em>New, Specials, Featured</em> etc. centerboxes', @middleboxesid, 59, now(), now(), NULL, 'zen_cfg_select_option(array(''0'', ''1'', ''2'', ''3'', ''4'', ''5'', ''6'', ''7''), ');

The last row in the admin_pages table looks like this: > configEditableCenterboxes BOX_CONFIGURATION_EDITABLE_CENTERBOXES FILENAME_CONFIGURATION gID=31 configuration Y 31

8 Feb 2012, 2:19 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Admin page registration for updated mod

I believe the problem would be the need to use something like:
zen_cfg_select_option(array('0', '1', '2')

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

8 Feb 2012, 3:47 PM
#3
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Admin page registration for updated mod

Hmm, yes, I recall seeing things like that in other SQL patches - I basically copied those insert statements from the existing version of this mod. But the configuration settings when I access them directly work fine. How would the configuration table inserts affect the admin_pages registration?

8 Feb 2012, 4:08 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Admin page registration for updated mod

Can you check if you have the define setup somewhere for:
BOX_CONFIGURATION_EDITABLE_CENTERBOXES

I ran your code and it appears to come up as written, don't know if it works as required, but I cannot see it until I add a define for the:
BOX_CONFIGURATION_EDITABLE_CENTERBOXES

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

8 Feb 2012, 4:20 PM
#5
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Admin page registration for updated mod

Aha! I didn't see any documentation anywhere that that needed to be defined. So this is a constant that is fed into and used by the db instead of one that is created by it. It should be defined in a language file like
define('BOX_CONFIGURATION_EDITABLE_CENTERBOXES', 'Editable Centerboxes');
Going off to try it.

8 Feb 2012, 4:33 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Admin page registration for updated mod

Just add it to a file in the:
/your_secret_admin/includes/extra_datafiles

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

8 Feb 2012, 4:51 PM
#7
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Admin page registration for updated mod

Still not working. Is there a particular place it needs to be defined? I tried it in /includes/extra_datafiles/middlebox_filenames.php,
/includes/languages/english/extra_definitions/YOUR_TEMPLATE/middlebox_defines.php
and
/includes/languages/english/extra_definitions/middlebox_definitions.php

Does it need to be defined before the SQL patch is run?

Ah yes, of course, define it in admin :)

8 Feb 2012, 5:58 PM
#9
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Admin page registration for updated mod

gjh42:

Worked like a charm!

It would be a good thing for this to be mentioned where page registration is explained...Nods in agreement.. :yes:

I had a devil of a time updating Ty Package Tracker because of this missing VITAL nugget of information in the page registration thread.. I finally downloaded another updated mod to figure out what the issue was..

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

17 Mar 2013, 2:14 PM
#10
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Admin page registration for updated mod

gjh42:

Still not working. Is there a particular place it needs to be defined? I tried it in /includes/extra_datafiles/middlebox_filenames.php,
/includes/languages/english/extra_definitions/YOUR_TEMPLATE/middlebox_defines.php
and
/includes/languages/english/extra_definitions/middlebox_definitions.php

Does it need to be defined before the SQL patch is run?

Ah yes, of course, define it in admin :)

Glenn, you saved me from jumping off the Sydney Harbour Bridge!

Been stuffing around with a smiliar problem for hours on end trying to get 'Category Specific Access Restriction' updated and working for v1.5.1 - and it's just a lousy simple language define that stopped me in my tracks!!

Thanks again / Frank

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.