Welcome, Guest. Please login or register.
Did you miss your activation email?
February 13, 2012, 03:10:54 AM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
149700 Posts in 21103 Topics by 7538 Members
Latest Member: ionline
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Incorporating language files in Frontend Edit Module  (Read 471 times)
oeh

Offline Offline

Posts: 190



« on: February 26, 2010, 01:16:32 AM »

Hi all.

As I'm a complete idiot when it comes to coding, I've failed terribly at incorporating languages in to the Frontend Edit module.
So if anyone would feel like giving me a helping hand, I'm more than happy.
File with my modifications are attached.
;-}

OE
« Last Edit: February 26, 2010, 01:19:41 AM by oeh » Logged

Good bye ;-{(
oeh ;-}>
DarkViper
Development Team
*****
Offline Offline

Posts: 1053


« Reply #1 on: February 26, 2010, 03:31:31 AM »

You'll find the error in line 53 of include.php...

the object '$admin' witch you use is not available in the frontend (in backend only)
change $admin into $wb....   and it will work.... (i hope Wink )
Logged

Anleitungen lesen und selber nachdenken ist anstrengend...  Da lass ich doch lieber andere für mich denken...

In 1984:  Nineteen Eighty-Four is a unrealistic utopia!!
In 2012:  Nineteen Eighty-Four is a little piece only of our reality!!
oeh

Offline Offline

Posts: 190



« Reply #2 on: February 27, 2010, 12:09:35 AM »

Hi.
Well, the module it self works fine.
The only thing I need is to implement the use of language files in the module.

In include.php at the end where the text line that says "Edit Page"
i would like to insert the edit text from the EN.php.

OE
Logged

Good bye ;-{(
oeh ;-}>
DarkViper
Development Team
*****
Offline Offline

Posts: 1053


« Reply #3 on: February 27, 2010, 09:49:26 AM »

on sunday/monday a'm back home again, then i can send you this functionality as an droplet with included languagefile.
Logged

Anleitungen lesen und selber nachdenken ist anstrengend...  Da lass ich doch lieber andere für mich denken...

In 1984:  Nineteen Eighty-Four is a unrealistic utopia!!
In 2012:  Nineteen Eighty-Four is a little piece only of our reality!!
oeh

Offline Offline

Posts: 190



« Reply #4 on: February 27, 2010, 07:30:36 PM »

Thanks, this is very helpful indeed.

Logged

Good bye ;-{(
oeh ;-}>
DarkViper
Development Team
*****
Offline Offline

Posts: 1053


« Reply #5 on: February 28, 2010, 03:43:59 PM »

ok.. am back home...  hope this droplet will solve your needs...
Werner

Code:
<?php

//:Puts Edit-Buttons on every page you have rights for. Optional agument is ?show=...  ( 1=modify page, 2=modify pagesettings, 4=modify sections, or add values to combine buttons.)
//:Use: [[EditThisPage?show=7]]. You can format the appearance using CSS-class 'div.EditThisPage' in your basic-css file

global $wb$database$HEADING;
$returnvalue '';
if($wb->is_authenticated() )
{
$is_admin false;
$page_id PAGE_ID == $wb->default_page_id PAGE_ID;
$user_id $wb->get_user_id();
$sql 'SELECT `admin_users`, `admin_groups` FROM `'.TABLE_PREFIX.'pages` WHERE `page_id` = '.$page_id;
if($rset $database->query($sql))
{
if($rec $rset->fetchRow())
{
$user_groups $wb->get_groups_id();
$admin_groups explode(',',$rec['admin_groups']);
if($user_groups && $admin_groups)
{
foreach($user_groups as $gid)
{
if(in_array($gid$admin_groups))
{
$is_admin true;
break;
}
}
}
$admin_users explode(',',$rec['admin_users']);
if($admin_users)
{
if(in_array($user_id$admin_users))
{
$is_admin true;;
}
}
}
}
if($is_admin)
{
$tpl  "<a href=\"".ADMIN_URL."/pages/%1\$s.php?page_id=".$page_id."\" target=\"_blank\" title=\"%2\$s\">";
$tpl .= "<img src=\"".THEME_URL."/images/%3\$s_16.png\" alt=\"%2\$s\" /></a>";
$show = ((!isset($show) || $show == '') ? : (int)$show);
$show = ($show : (int)$show);
$show = ($show : (int)$show );
if($show 1)
{
$returnvalue .= sprintf($tpl'modify'$HEADING['MODIFY_PAGE'], 'edit');
}
$sys_perm $wb->get_session('SYSTEM_PERMISSIONS');
if(@is_array($sys_perm))
{
if(($show 2) && (array_search('pages_settings'$sys_perm)!==false))
{
$returnvalue .= sprintf($tpl'settings'$HEADING['MODIFY_PAGE_SETTINGS'], 'modify');
}
if(($show 4) && (array_search('pages_modify'$sys_perm)!==false))
{
$returnvalue .= sprintf($tpl'sections'$HEADING['MANAGE_SECTIONS'], 'sections');
}
}
if($returnvalue != '')
{
$returnvalue  "<div class=\"EditThisPage\">".$returnvalue."</div>";
}
}
}
return($returnvalue == '' true $returnvalue);

?>
Logged

Anleitungen lesen und selber nachdenken ist anstrengend...  Da lass ich doch lieber andere für mich denken...

In 1984:  Nineteen Eighty-Four is a unrealistic utopia!!
In 2012:  Nineteen Eighty-Four is a little piece only of our reality!!
oeh

Offline Offline

Posts: 190



« Reply #6 on: February 28, 2010, 04:07:53 PM »

Thanks, I'll give it a go to night.

Logged

Good bye ;-{(
oeh ;-}>
oeh

Offline Offline

Posts: 190



« Reply #7 on: March 01, 2010, 01:21:14 AM »

Thanks again. Works like charm.

Hopefully you'll submit it to AMASP as well.

Edit:

The img tag in line 39 is missing the closing tag wink

Made this corraction, not sure if it is right or not,but...

$tpl .= "<img src=\"".THEME_URL."/images/%3\$s_16.png\" alt=\"%2\$s\" /></img></a>"
« Last Edit: March 01, 2010, 04:22:40 PM by oeh » Logged

Good bye ;-{(
oeh ;-}>
DarkViper
Development Team
*****
Offline Offline

Posts: 1053


« Reply #8 on: March 01, 2010, 06:51:13 PM »

a explicite closing tag is not needed for img.

<img src="mypic.jpg" alt="another picture" />

is 100% valide xhtml code..
Logged

Anleitungen lesen und selber nachdenken ist anstrengend...  Da lass ich doch lieber andere für mich denken...

In 1984:  Nineteen Eighty-Four is a unrealistic utopia!!
In 2012:  Nineteen Eighty-Four is a little piece only of our reality!!
oeh

Offline Offline

Posts: 190



« Reply #9 on: March 01, 2010, 07:03:58 PM »

Sorry, my bad.  grin
Logged

Good bye ;-{(
oeh ;-}>
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!