Author
Message
eldorado Involved Joined: Sep 10, 2008 Posts: 414 Location: France,Translator
Posted:
Wed Jun 03, 2009 7:34 am
I'm trying to get gfx_admin working with some funny panes.
script demo is here.
eldorado wrote: my script:
in admin.php find GraphicAdmin()
Code: function GraphicAdmin() {
global $aid, $admingraphic, $language, $admin, $prefix, $db, $counter, $admin_file;
$newsubs = $db->sql_numrows($db->sql_query('SELECT qid FROM '.$prefix.'_queue'));
$row = $db->sql_fetchrow($db->sql_query('SELECT name, radminsuper FROM '.$prefix.'_authors WHERE aid=\''.$aid.'\''));
$radminsuper = intval($row['radminsuper']);
if ($radminsuper == 1) {
OpenTable();
// Begins some tabs here
echo '<div id="dhtmlgoodies_tabView1">';
echo '<div class="dhtmlgoodies_aTab">';
echo '<img src="/images/dhtmlgoodies_logo1.gif" style="float:left;margin-right:5px;margin-bottom:5px">';
echo '<center><a href="'.$admin_file.'.php"><font class="title">'._ADMINMENU.'</font></a>';
echo '<br /><br /></center>';
echo'<table align="center" border="0" width="100%" cellspacing="1"><tr>';
$linksdir = dir('admin/links');
$menulist = '';
while($func=$linksdir->read()) {
if(substr($func, 0, 6) == 'links.') {
if ('God'!==$row['name'] && substr($func, 6, 10) == 'editadmins') continue;
$menulist .= "$func ";
}
}
closedir($linksdir->handle);
$menulist = explode(' ', $menulist);
sort($menulist);
for ($i=0; $i < sizeof($menulist); $i++) {
if(!empty($menulist[$i])) {
$sucounter = 0;
include_once($linksdir->path."/$menulist[$i]");
}
}
adminmenu($admin_file.'.php?op=logout',_ADMINLOGOUT, 'logout.gif');
if ($counter==0) echo '<td></td>'; //Added by Raven 7/1/2007 to fix a warning in xhtml
echo'</tr></table>';
$counter = '';
//End DIV
echo '</div>';
}
//begins div and checks if $radmin_suepr
if ($radminsuper == 0) {
echo '<div class="dhtmlgoodies_aTab">';
echo 'You cannot view this page</div>';
}
echo '<div class="dhtmlgoodies_aTab">';
echo '<img src="/images/dhtmlgoodies_logo1.gif" style="float:left;margin-right:5px;margin-bottom:5px">';
echo '<center><a href="'.$admin_file.'.php"><font class="title">'._MODULESADMIN.'</font></a>';
echo '<br /><br />';
echo'<table border="0" width="100%" cellspacing="1"><tr>';
$result = $db->sql_query('SELECT title, admins FROM '.$prefix.'_modules ORDER BY title ASC');
$row2 = $db->sql_fetchrow($db->sql_query('SELECT name FROM '.$prefix.'_authors WHERE aid=\''.$aid.'\''));
while ($row = $db->sql_fetchrow($result)) {
$admins = explode(',', $row['admins']);
$auth_user = 0;
for ($i=0; $i < sizeof($admins); $i++) {
if ($row2['name'] == $admins[$i]) {
$auth_user = 1;
}
}
if ($radminsuper == 1 OR $auth_user == 1) {
if (file_exists('modules/'.$row['title'].'/admin/index.php') AND file_exists('modules/'.$row['title'].'/admin/links.php') AND file_exists('modules/'.$row['title'].'/admin/case.php')) {
include_once('modules/'.$row['title'].'/admin/links.php');
}
}
}
adminmenu($admin_file.'.php?op=logout', _ADMINLOGOUT, 'logout.gif');
if ($counter==0) echo '<td></td>'; //Added by Raven 7/1/2007 to fix a warning in xhtml
echo'</tr></table></center>';
echo '</div></div>';
echo '<script type="text/javascript">';
echo "initTabs('dhtmlgoodies_tabView1',Array('"._ADMINMENU."','"._MODULESADMIN."'),0,800,'',Array(true,true));";
echo '</script>';
CloseTable();
echo '<br />';
}
in themes/Your_Theme/
Code: /* For Admin Pannel */
.dhtmlgoodies_tabPane{
height:21px; /* Height of tabs */
border-bottom:1px solid #919b9c;
}
.dhtmlgoodies_aTab{
border-left:0px solid #919b9c;
border-right:0px solid #919b9c;
border-bottom:0px solid #919b9c;
font-family: Trebuchet MS, Lucida Sans Unicode, Arial, sans-serif;
padding:5px;
}
.dhtmlgoodies_tabPane DIV{
float:left;
height:100%; /* Height of tabs */
padding-left:3px;
vertical-align:middle;
background-repeat:no-repeat;
background-position:bottom left;
cursor:pointer;
position:relative;
bottom:-1px;
margin-left:0px;
margin-right:0px;
}
.dhtmlgoodies_tabPane .tabActive{
background-image:url('../images/tab_left_active.gif');
margin-left:0px;
margin-right:0px;
z-index:10;
}
.dhtmlgoodies_tabPane .tabInactive{
background-image:url('../images/tab_left_inactive.gif');
margin-left:0px;
margin-right:0px;
z-index:1;
}
.dhtmlgoodies_tabPane .inactiveTabOver{
background-image:url('../images/tab_left_over.gif');
margin-left:0px;
margin-right:0px;
}
.dhtmlgoodies_tabPane span{
font-family:arial;
vertical-align:top;
font-size:11px;
padding-left:3px;
padding-right:3px;
line-height:21px;
float:left;
}
.dhtmlgoodies_tabPane .tabActive span{
padding-bottom:1px;
line-height:20px;
}
.dhtmlgoodies_tabPane img{
float:left;
}
in includes/javascript.php
Code: if(defined('ADMIN_FILE')){
//echo "<link rel=\"stylesheet\" href=\"css/tab-view.css\" type=\"text/css\" media=\"screen\">";
echo "<script type=\"text/javascript\" src=\"includes/ajax.js\"></script>";
echo "<script type=\"text/javascript\" src=\"includes/tab-view.js\">";
/************************************************************************************************************
(C) October 2005
This is a script from You will find this and a lot of other scripts at our website.
Terms of use:
You are free to use this script as long as the copyright message is kept intact. However, you may not
redistribute, sell or repost it without our permission.
Updated:
March, 14th, 2006 - Create new tabs dynamically
Thank you!
www.dhtmlgoodies.com
Alf Magne Kalleland
************************************************************************************************************/
echo"</script>\n\n";
}
I suggest you download the zip from their website too , for images
here:
I will make the script more dynamic when I have time.
Last edited by eldorado on Fri Jun 05, 2009 6:13 pm; edited 2 times in total
Raven Site Admin/Owner Joined: Aug 27, 2002 Posts: 16987 Location: Kansas
Posted:
Wed Jun 03, 2009 8:08 am
Thanks for the information. However, we have standardized on using jQuery for all our effects like this. It will take some time to convert things but we would recommend that any useful additions that use JavaScript type widgets use jQuery. And it just so happens that there is already a jQuery Tabs Container plug-in -
eldorado Involved Joined: Sep 10, 2008 Posts: 414 Location: France,Translator
Posted:
Wed Jun 03, 2009 8:09 am
Thanks for the info about standard. I'll convert it right away for users reading this . I see the back button won't break here , cool.
However , I don't see how I can add tabs dynamically to the tab layout. As it was my intention.
Palbin Site Admin Joined: Mar 30, 2006 Posts: 2456 Location: Pittsburgh, Pennsylvania
Posted:
Wed Jun 03, 2009 4:12 pm
eldorado Involved Joined: Sep 10, 2008 Posts: 414 Location: France,Translator
Posted:
Wed Jun 03, 2009 4:45 pm
how can I miss something that obvious !
Thanks palbin
Palbin Site Admin Joined: Mar 30, 2006 Posts: 2456 Location: Pittsburgh, Pennsylvania
Posted:
Wed Jun 03, 2009 5:24 pm
Anytime
eldorado Involved Joined: Sep 10, 2008 Posts: 414 Location: France,Translator
Posted:
Fri Jun 05, 2009 6:10 pm
Ok I've updated the code to jquery; However I was wondering which version of jquery to use?And how you were going to organize the hierarchy between files.
Currently , I have installed these:
root wrote: includes\jquery\jquery1.3.2.js
includes\jquery\js
includes\jquery\ui
includes\jquery\css
includes\jquery\docs
includes\jquery\external
includes\jquery\themes
includes\jquery\images
The jquery wasn't empty , I assumed the version in the folder was deprecated and I didn't touch it to keep compatibility with other programs.
One possibility however is to refer to an external jquery.js based on the official website and updating our script accordingly.
Raven Site Admin/Owner Joined: Aug 27, 2002 Posts: 16987 Location: Kansas
Posted:
Fri Jun 05, 2009 6:33 pm
Our structure was created as we were testing jQuery functionality. We will be reorganizing as needed but I can't state anything at this point. As the v2.4 release draws closer we should be able to answer your questions. But, we will be including the latest production release when we do publish the next RN release.
View next topic
View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum