21
Dylian
Re: Template editor
  • 2010/2/16 14:03

  • Dylian

  • Friend of XOOPS

  • Posts: 237

  • Since: 2007/7/21


Ok, fixed it... The dom tree was changed after CodeMirror was loaded, so i moved the code from the jquery.php files to the js files (filemanager.js and templates.js).

Here is how to implemented the hacks.

Template manager hack:
Step 1: Add
$xoTheme->addScript('browse.php?modules/system/js/codemirror.js');
after
$xoTheme->addScript('browse.php?modules/system/js/templates.js');
in modules/system/admin/tplsets/main.php .

Step 2: Add
$xoTheme->addStylesheetXOOPS_URL '/modules/system/css/docs.css');
after
$xoTheme->addStylesheetXOOPS_URL '/modules/system/css/admin.css');
in modules/system/admin/tplsets/main.php .

Step 3: Change
function tpls_edit_file(path_filefile)
{
    $(
'#display_contenu').hide();
    $(
'#display_form').hide();
    $(
'#loading').show();
    $.
ajax({
        
type"POST",
        
url"./admin/tplsets/jquery.php",
        
data"op=tpls_edit_file&path_file="+path_file+"&file="+file,
        
success: function(msg){            
            $(
'#display_contenu').html(msg);
            $(
'#loading').hide();
            $(
'#display_contenu').fadeIn('fast');
        }
    });    
    return 
false;
}
to
function tpls_edit_file(path_filefile)
{
    $(
'#display_contenu').hide();
    $(
'#display_form').hide();
    $(
'#loading').show();
    $.
ajax({
        
type"POST",
        
url"./admin/tplsets/jquery.php",
        
data"op=tpls_edit_file&path_file="+path_file+"&file="+file,
        
success: function(msg){            
            $(
'#display_contenu').html(msg);
            $(
'#loading').hide();
            $(
'#display_contenu').fadeIn('fast');
            if(
path_file.slice(-3) == "css"){
                var 
editor CodeMirror.fromTextArea("template_code", {    
                    
height"350px",
                    
parserfile"parsecss.js",
                    
stylesheet"css/csscolors.css",                    
                    
lineNumberstrue,
                    
textWrappingfalse
                    
path"js/"                
                
});
            }else if(
path_file.slice(-3) == ".js"){
                var 
editor CodeMirror.fromTextArea("template_code", {
                    
height"350px",
                    
parserfile: ["tokenizejavascript.js""parsejavascript.js"],
                    
stylesheet"css/jscolors.css",
                    
autoMatchParenstrue,
                    
lineNumberstrue,
                    
textWrappingfalse
                    
path"js/"
                
});
            }else{
                var 
editor CodeMirror.fromTextArea("template_code", {
                    
height"350px",
                    
parserfile: ["parsexml.js""parsecss.js""tokenizejavascript.js""parsejavascript.js",
                                
"tokenizephp.js""parsephp.js",
                                
"parsephphtmlmixed.js"],
                    
stylesheet: ["css/xmlcolors.css""css/jscolors.css""css/csscolors.css""css/phpcolors.css"],
                    
lineNumberstrue,
                    
textWrappingfalse
                    
path"js/",
                    
continuousScanning500
                
});
            }
        }
    });    
    return 
false;
}
in modules/system/js/templates.js .

Step 4: Change
<textarea name="templates" rows=24 cols=110>'.$content.'</textarea>
to
<textarea id="template_code" name="templates" rows=24 cols=110>'.$content.'</textarea>
in modules/system/admin/tplsets/jquery.php.

That should do it for the template manager, the hack for the filemanager is almost the same but here's the guide for that ...

File manager hack:
Step 1: Add
$xoTheme->addScript('browse.php?modules/system/js/codemirror.js');
after
$xoTheme->addScript('browse.php?modules/system/js/templates.js');
in modules/system/admin/filemanager/main.php .

Step 2: Add
$xoTheme->addStylesheetXOOPS_URL '/modules/system/css/docs.css');
after
$xoTheme->addStylesheetXOOPS_URL '/modules/system/css/admin.css');
in modules/system/admin/filemanager/main.php .

Step 3: Change
function filemanager_edit_file(path_filepathfile)
{
    $(
'#display_file').hide();
    $(
'#edit_file').hide();
    $(
'#loading').show();
    $.
ajax({
        
type"POST",
        
url"./admin/filemanager/jquery.php",
        
data"op=filemanager_edit_file&path_file="+path_file+"&path="+path+"&file="+file,
        
success: function(msg){
            $(
'#edit_file').html(msg);
            $(
'#loading').hide();
            $(
'#edit_file').fadeIn('fast');
        }
    });    
    return 
false;
}
to
function filemanager_edit_file(path_filepathfile)
{
    $(
'#display_file').hide();
    $(
'#edit_file').hide();
    $(
'#loading').show();
    $.
ajax({
        
type"POST",
        
url"./admin/filemanager/jquery.php",
        
data"op=filemanager_edit_file&path_file="+path_file+"&path="+path+"&file="+file,
        
success: function(msg){
            $(
'#edit_file').html(msg);
            $(
'#loading').hide();
            $(
'#edit_file').fadeIn('fast');
            if(
path_file.slice(-3) == "css"){
                var 
editor CodeMirror.fromTextArea("filemanager_code", {    
                    
height"350px",
                    
parserfile"parsecss.js",
                    
stylesheet"css/csscolors.css",                    
                    
lineNumberstrue,
                    
textWrappingfalse
                    
path"js/"                
                
});
            }else if(
path_file.slice(-3) == ".js"){
                var 
editor CodeMirror.fromTextArea("filemanager_code", {
                    
height"350px",
                    
parserfile: ["tokenizejavascript.js""parsejavascript.js"],
                    
stylesheet"css/jscolors.css",
                    
autoMatchParenstrue,
                    
lineNumberstrue,
                    
textWrappingfalse
                    
path"js/"
                
});
            }else{
                var 
editor CodeMirror.fromTextArea("filemanager_code", {
                    
height"350px",
                    
parserfile: ["parsexml.js""parsecss.js""tokenizejavascript.js""parsejavascript.js",
                                
"tokenizephp.js""parsephp.js",
                                
"parsephphtmlmixed.js"],
                    
stylesheet: ["css/xmlcolors.css""css/jscolors.css""css/csscolors.css""css/phpcolors.css"],
                    
lineNumberstrue,
                    
textWrappingfalse
                    
path"js/",
                    
continuousScanning500
                
});
            }
        }
    });    
    return 
false;
}
in modules/system/js/filemanager.js .

Step 4: Change
<textarea name="filemanager" rows=24 cols=110>'.$content.'</textarea>
to
<textarea id="filemanager_code" name="filemanager" rows=24 cols=110>'.$content.'</textarea>
in modules/system/admin/filemanager/jquery.php.

The package is also updated (Still based on the code delivered with XOOPS 2.5 Alpha) :-p.

I hope it works and it will be included in the core.

Greets Dylian.

BTW, got the solution from this Google Groups post: http://groups.google.com/group/codemi ... &q=false#a5928c35dff3ef80



22
Dylian
Re: Template editor
  • 2010/2/13 12:12

  • Dylian

  • Friend of XOOPS

  • Posts: 237

  • Since: 2007/7/21


Ok, updated the package, template manager now also has the CodeMirror editor. And i changed the code to first check what kind of file is loaded, so the right parser can be loaded .

Quote:
Did you work on the latest version of SVN?

No i used the files from xo25a. But the hack is very easy to implement so i don't think it would be hard to add it to the latest version.

Greets Dylian.



23
Dylian
Re: Template editor
  • 2010/2/12 23:19

  • Dylian

  • Friend of XOOPS

  • Posts: 237

  • Since: 2007/7/21


Ok, as i promised in my previous post, i would do the hack myself if nonone else did it.

And i did... So for everyone interesed (CORE TEAM PLEASE???) the hack can be downloaded [HERE].

And my question to the core development team... PLEASE ADD THIS TO THE CORE....

[edit]
SCREENSHOT:
Resized Image
[/edit]

[edit2]
Haha, i was so impressed with the file manager that i added it there first, template manager comming soon...
[/edit2]

Greets Dylian.

BTW I used CodeMirror instead of Editarea, it has a lot more features.



24
Dylian
Re: xForms 1.0 (Rewritten)
  • 2010/2/2 21:42

  • Dylian

  • Friend of XOOPS

  • Posts: 237

  • Since: 2007/7/21


Ok, fixed the problem with "Add Question". (I hope )

And i decided to keep using PEAR MDB2, since changing the functions to their XOOPS equalivant is consuming more time than I wanted...

Does someone here have experience in porting PEAR MDB2 based code to XOOPS and willing to help me out? If not I'll leave it as it is, since it's not really necessary for the module to work properly .

Greets Dylian.

BTW Sorry that i didn't respond earlier but i was busy moving my personal website (from http://home.dylian.melgert.net to http://me.dylian.eu)



25
Dylian
Template editor
  • 2010/2/2 10:22

  • Dylian

  • Friend of XOOPS

  • Posts: 237

  • Since: 2007/7/21


First, I´d like to say: I realy LOVE the new template manager

But I think it would be even better if it included a syntax higlighting code editor like [EditArea] instead of just a plain textarea.

Just my opinion but I would realy realy like to have this feature in XOOPS .

Greets Dylian.

BTW If its not going to come in 2.5 i'll try to make a hack for it myself



26
Dylian
Re: xForms 1.0 (Rewritten)
  • 2010/1/29 20:05

  • Dylian

  • Friend of XOOPS

  • Posts: 237

  • Since: 2007/7/21


Mazarin, do you mean from the edit form page (admin) to formedit.php (user), or a link from the administration to view the form (in the userside). The last one is already present, it's the test form link . (But i gues you figured that one allready )

Thanks for testing, Dylian.

BTW, i'm currently working on an update notification system for my modules. But what should i use, iframes or js files. Iframes are more compatible, but changing the content of a (predefined) div with javascript would make multilanguage notification easyer.



27
Dylian
Re: xForms 1.0 (Rewritten)
  • 2010/1/29 11:26

  • Dylian

  • Friend of XOOPS

  • Posts: 237

  • Since: 2007/7/21


Did someone test?
And if so, did everyting work, do you have any suggestions etc..

Greets Dylian.



28
Dylian
Re: Column Layout in Smarty
  • 2010/1/28 17:10

  • Dylian

  • Friend of XOOPS

  • Posts: 237

  • Since: 2007/7/21


Try this:
<table cellpadding="5" cellspacing="5" class="outer">    
    <
tr
    <{foreach 
item=mytest from=$block.mytest}> 
        <
td class="even"
            <
div
                <{
$mytest.name}>
            </
div
        </
td
    <{/foreach}> 
    </
tr
</
table>


And please stop sending me pm's everytime you've got a problem. If noone reacted to your help request for a week or two then you can send me a pm, but not just a day after you posted you help request...

Greets Dylian.



29
Dylian
Re: Lets shrink XOOPS
  • 2010/1/25 16:58

  • Dylian

  • Friend of XOOPS

  • Posts: 237

  • Since: 2007/7/21


Maybe only the XOOPS dhtml editor should be delivered with the core...

Since the editors are the biggest folders in the whole core package, it could be better to create a separate editor package.

Thats just my opinion.

Greets Dylian.



30
Dylian
Re: xForms 1.0 (Rewritten)
  • 2010/1/22 15:15

  • Dylian

  • Friend of XOOPS

  • Posts: 237

  • Since: 2007/7/21


With the final/rtu release there will be an xForms plugin for xoBile. But it will take some time before the final/rtu version is released...

Greets Dylian.




TopTop
« 1 2 (3) 4 5 6 ... 11 »



Login

Username:
Password:

Lost Password? Register now!

Who's Online

67 user(s) are online (42 user(s) are browsing Support Forums)


Members: 0


Guests: 67


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits