PDA

View Full Version : [HOW TO - vB4 CMS] AdminCP add 2 options for the Section Manager


Coroner
23 Dec 2009, 14:28
I wrote this article, 'cause when I started with CMS, I didn't found were to change the layout.
After a long of searching, reading and asking, I found it in the frontend.
But ... there is a way to change it in the AdminCP.

This change will add two more options inside the section-menue. See images (before/after).

OK, let's start.
Open the file packages/vbcms/contentmanager.php
at the line 3416 you will found this code:
<td class=\"thead\">" . $vbphrase['viewcount'] . "</td>".
/* <td class=\"thead\">" . $vbphrase['layout'] . "</td>
<td class=\"thead\">" . $vbphrase['style'] . "</td> */
" </tr>";
change it into:
<td class=\"thead\">" . $vbphrase['viewcount'] . "</td>
<td class=\"thead\">" . $vbphrase['layout'] . "</td>
<td class=\"thead\">" . $vbphrase['style'] . "</td>
</tr>";
a few line later, at 3485 you will found the following code:
$result .= " <td class=\"$bgclass\" style=\"font-size:80%;\">" . $section['viewcount'] . "</td>\n";
/* $result .= " <td class=\"$bgclass\" style=\"font-size:80%;\"><select id=\"layout_" . $section['nodeid']. "\" name=\"layout_" . $section['nodeid']. "\"
onchange=\"setFormValue('do','saveonelayout');
setFormValue('nodeid', " . $section['nodeid']. ");
document.getElementById('cms_data').submit();\">" . self::getLayoutSelect($section['layoutid'],
$section['nodeid']) . "</select></td>\n";
$result .= " <td class=\"$bgclass\" style=\"font-size:80%;\"><select id=\"style_" . $section['nodeid']. "\" name=\"style_" . $section['nodeid']. "\"
onchange=\"setFormValue('do','saveonestyle');
setFormValue('nodeid'," . $section['nodeid']. ");
document.getElementById('cms_data').submit();\">" . self::getStyleSelect($section['styleid'],
$section['nodeid']) . "</select></td>\n"; */
$result .= "</tr>\n";
change those lines into:
$result .= " <td class=\"$bgclass\" style=\"font-size:80%;\">" . $section['viewcount'] . "</td>\n";
$result .= " <td class=\"$bgclass\" style=\"font-size:80%;\"><select id=\"layout_" . $section['nodeid']. "\" name=\"layout_" . $section['nodeid']. "\"
onchange=\"setFormValue('do','saveonelayout');
setFormValue('nodeid', " . $section['nodeid']. ");
document.getElementById('cms_data').submit();\">" . self::getLayoutSelect($section['layoutid'],
$section['nodeid']) . "</select></td>\n";
$result .= " <td class=\"$bgclass\" style=\"font-size:80%;\"><select id=\"style_" . $section['nodeid']. "\" name=\"style_" . $section['nodeid']. "\"
onchange=\"setFormValue('do','saveonestyle');
setFormValue('nodeid'," . $section['nodeid']. ");
document.getElementById('cms_data').submit();\">" . self::getStyleSelect($section['styleid'],
$section['nodeid']) . "</select></td>\n";
$result .= "</tr>\n";

All those changes were done in the RC4 (I don't know if it's disabled in the 4.0.0PL1, I can't get the suite at the moment).

Lynne
23 Dec 2009, 17:55
Thank you. I don't know why they don't have this in the Section Manager by default.

Coroner
23 Dec 2009, 18:46
I do not know it, too :confused:

This will also work in 4.0.0.PL1

beduino
24 Dec 2009, 21:18
Thanks a lot
very useful

all the best
joao barroca
aka beduino

Antivirus
25 Dec 2009, 00:57
Thank you. I don't know why they don't have this in the Section Manager by default.

I agree Lynne! Nice work Coroner :)

Hasanudin
25 Dec 2009, 19:19
finally.. great!

thank u..

Alfa1
25 Dec 2009, 22:05
I think its a bug that they have forgotten to include this. Thanks!

Cmangum
01 Feb 2010, 22:57
Thanks a bunch it worked perfect

ahmedipa
03 Feb 2010, 10:00
very good change in order to improve the CMS

Chickenpotpie
24 Feb 2010, 23:21
Worked very well in 4.0.2. Thanks for this!

-CP

as7apcool
24 Feb 2010, 23:27
Thanks 4 the good work

darren1981
25 Feb 2010, 17:06
Nice work mate :)

Has this been tested on 4.0.2 ? and if i install your mod / hack... will i need to re-install after the 4.0.3 release ?

Thanks

Coroner
26 Feb 2010, 05:20
No. Only of you overwrite the file itself by an upgrade.

bturaif
28 Feb 2010, 12:10
Great work, makes thing a lot easier.

crazyace
03 Mar 2010, 14:40
You may want to update the lines that it starts on. As of 4.0.2 PL1

1st Edit - Line: 3458

2nd Edit - Line: 3527

justasiam
10 Mar 2010, 00:11
Is there any way at all to do this without editing one of the php files. The problem I have with this is NOT editing the file, it is just that whenever an upgrade is performed, I have to remember to do this mod all over again. Very frustrating?

justasiam
12 Mar 2010, 02:51
Is there any answer to my question?

Mutt
06 Apr 2010, 00:15
thanks

Sadikb
07 Apr 2010, 12:13
Is there any way at all to do this without editing one of the php files. The problem I have with this is NOT editing the file, it is just that whenever an upgrade is performed, I have to remember to do this mod all over again. Very frustrating?

No, if there's no php hook there.

K4GAP
28 Apr 2010, 13:14
Thanks,
Works on 4.0.3 but the line numbers are slightly different than you have listed for the different vb version.

Great work, thanks'

khamchihoa
18 Apr 2011, 22:45
Thank so much.

inigo
09 Nov 2011, 20:35
Someone try this on 4.1.7?

I think this is very useful,...

Thanks,

rjerina
25 Apr 2012, 09:53
The 2nd edit seems to have been moved or removed, I can't find any code similar with lines commented out.

Just uncommenting the lines in the first edit makes the CMS admincp pages not load :(

Prorockz
21 Jan 2013, 20:08
can you please provide code for 4.2 latest