Part of the EllisLab Network
   
1 of 2
1
Language file editor interface
Posted: 28 September 2009 12:06 PM   [ Ignore ]  
Lab Assistant
RankRank
Total Posts:  141
Joined  11-10-2008

Language Editor v0.1 based on jEditable.

demo | source

This is my first contribution to the CodeIgniter community. I needed a way to easily edit the language file without having to open the file itself. So I thought I’d design a (very) simple non-obstrusive interface.

This is pretty simple with very little configuration to do. This actually consists in

edit in place script from http://www.appelsiini.net/projects/jeditable

/js/jquery.jeditable.mini.js 

a simple config file

/system/application/config/language_editor.php 

a controller

/system/application/controllers/editor.php 

the library

/system/application/libraries/language_editor.php 

a slightly modified version of the language helper

/system/helpers/language_helper.php 

At the moment, it doesn’t support adding new text element, but it’s on the to-do list. It’s in very beta stage, so if you come across bugs, report’em here.

Also, be aware that there is no security layer at all. Meaning, anyone can access this controller, unless you add your own security check. So be careful if you ever use it on a production site.

demo it here
download it here

Feedback are welcomed!

 Signature 

I
C I

Profile
 
 
Posted: 28 September 2009 12:06 PM   [ Ignore ]   [ # 1 ]  
Lab Assistant
RankRank
Total Posts:  141
Joined  11-10-2008

I modified the language helper so it implements the jEditable plugin. If you already use the helper in your page, it will not break anything thing.

// Added a third optional true/false parameter (default true) 
// It allows enableing/disableing of the edit in place feature
function lang($line$id ''$eip true)
{
    $index    
$line;
    
    
$CI =& get_instance();
    
$CI->config->load('language_editor');
    
    
$line $CI->lang->line($line);
    if (
$id != '')
    
{
        $line 
'<label for="'.$id.'">'.$line."</label>";
    
}
    
    
// Returns differs if Edit In Place is enabled or not
    
if($CI->config->item('enable_eip') && $eip !== false)
        return 
'<em><p class="eiplang" id="' $index '" lang="english">' $line '</p></em>';
    else
        return 
$line;
 Signature 

I
C I

Profile
 
 
Posted: 28 September 2009 12:07 PM   [ Ignore ]   [ # 2 ]  
Lab Assistant
RankRank
Total Posts:  141
Joined  11-10-2008

The config is pretty simple.

// This is the master switch to disabled edit in place system-wide.
$config['enable_eip']    true;

// This array contains the different languages.
$config['available_languages']    = array('english');

// This is the path to the language file (included in CI)
// Unless you have you language files somewhere else, do not edit these two params.
$config['path']            './system/language/';
$config['path_custom']    './system/application/language/';

// Unless you change the name of the controller, do not edit
$config['base_controller']        'index.php/editor/'
 Signature 

I
C I

Profile
 
 
Posted: 28 September 2009 04:49 PM   [ Ignore ]   [ # 3 ]  
Summer Student
Avatar
Total Posts:  16
Joined  08-20-2009

Syntax errors everywhere.

Like WTF smile

$link "<a >language_editor->_base_controller) . "\">Back to language list</a><br />"


May be just post bug. You should put your code in archive ready for download…

Profile
 
 
Posted: 28 September 2009 04:59 PM   [ Ignore ]   [ # 4 ]  
Lab Assistant
RankRank
Total Posts:  141
Joined  11-10-2008

[removed]

 Signature 

I
C I

Profile
 
 
Posted: 28 September 2009 05:52 PM   [ Ignore ]   [ # 5 ]  
Lab Assistant
RankRank
Total Posts:  166
Joined  01-30-2008

demo url?

Profile
 
 
Posted: 14 October 2009 10:23 AM   [ Ignore ]   [ # 6 ]  
Lab Assistant
RankRank
Total Posts:  141
Joined  11-10-2008

Demo is available here
FEEDBACK ARE WELCOMED!

 Signature 

I
C I

Profile
 
 
Posted: 06 November 2009 04:21 PM   [ Ignore ]   [ # 7 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  179
Joined  12-18-2007

Love it! I’ll apply it on a website I’m developing. Will notify my results!

Thank you,
Isern

Profile
 
 
Posted: 07 November 2009 06:46 AM   [ Ignore ]   [ # 8 ]  
Grad Student
Rank
Total Posts:  39
Joined  06-30-2008

SEEMS interesting smile .. thanks

 Signature 

My Blog: tohin.wordpress.com

Profile
 
 
Posted: 07 November 2009 10:41 AM   [ Ignore ]   [ # 9 ]  
Summer Student
Total Posts:  3
Joined  06-30-2009

Introducing the Kajona Language File Editor, we want to provide a graphical application to edit and manage the text-files of a Kajona installation. Kajona itself is a free Content Management Framework, @see http://www.kajona.de for more details.

Thanks
———————————————————————————————————————-

HVAC Baltimore | Home Remodeling Maryland | Lab Equipment

Profile
 
 
Posted: 09 November 2009 06:29 PM   [ Ignore ]   [ # 10 ]  
Lab Assistant
RankRank
Total Posts:  141
Joined  11-10-2008
rbcrssn36 - 07 November 2009 03:41 PM

Introducing the Kajona Language File Editor, we want to provide a graphical application to edit and manage the text-files of a Kajona installation. Kajona itself is a free Content Management Framework, @see http://www.kajona.de for more details.

Thanks

and what does that mean? Do you want to include this editor in your CMS or you are hijacking my thread?

 Signature 

I
C I

Profile
 
 
   
1 of 2
1