Part of the EllisLab Network
   
37 of 59
37
BackendPro 0.6.1
Posted: 16 June 2009 06:48 AM   [ Ignore ]   [ # 361 ]  
Summer Student
Avatar
Total Posts:  10
Joined  05-22-2009

@Adam: of course, that bit was a bit foolish of me, and I quickly realized my mistake. The language is now stored in the users preferences database and loaded into the session values upon login.

My only trouble is that I need the language setting to reload after the user sets a new language using the code above. What can I do to load the correct language files after changing the prefs (in a controller)?

 Signature 

New to PHP5, new to CI… but willing to learn! Thanks for your understanding.

Currently building a backend-only app, using BackEnd Pro, for a non-profit organization.

Profile
 
 
Posted: 16 June 2009 06:54 AM   [ Ignore ]   [ # 362 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  773
Joined  09-01-2007

I believe I had solved this before. When I get home I will fire up my old machine and hope the code is on there.

 Signature 

Kaydoo - A day in the life of a developer
BackendPro Control Panel

Profile
 
 
Posted: 16 June 2009 01:01 PM   [ Ignore ]   [ # 363 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  773
Joined  09-01-2007

God I love version control, I had a look and all the old language detection code I wrote can be found in the following changeset: http://code.assembla.com/backendpro/subversion/changesets/43

You will find it in root/trunk/system/modules/language.

It looks very like your way of doing it, so there is no guarantee it will work, but it may depend on where the library is called. It is one of the first things I call in the BackendPro.php class (http://code.assembla.com/backendpro/subversion/nodes/trunk/system/application/libraries/BackendPro.php?rev=47)

Have a look at it or try the code. Again no guarantees it will work.

 Signature 

Kaydoo - A day in the life of a developer
BackendPro Control Panel

Profile
 
 
Posted: 16 June 2009 01:10 PM   [ Ignore ]   [ # 364 ]  
Summer Student
Total Posts:  6
Joined  06-10-2009

@Adam Running on fresh install, default settings, so I don’t believe asset caching is on.  Also, I disabled javascript in my browser and the form wasn’t duplicated anymore, so it’s either javascript or something javascript brings in to the login form.

Profile
 
 
Posted: 16 June 2009 01:52 PM   [ Ignore ]   [ # 365 ]  
Summer Student
Avatar
Total Posts:  10
Joined  05-22-2009

Actually, in the mean time I (almost) solved it by extending the MY_language library with a reload function:

function reload($langfile = '', $idiom = '', $return = FALSE)
    
{
        $complete_langfile
= str_replace(EXT, '', str_replace('_lang.', '', $langfile)).'_lang'.EXT;
        
        if (
in_array($complete_langfile, $this->is_loaded, TRUE))
        
{
            
// Remove the language file to be unloaded from the is_loaded array (otherwise it won't reload)
            
$lang_index = array_search($complete_langfile,$this->is_loaded);
            unset(
$this->is_loaded[$lang_index]);
            
// Reshuffle the values inside is_loaded so that there is no "empty" key
            
$this->is_loaded = array_values($this->is_loaded);
            
log_message('debug', 'Language '.$complete_langfile. ' unloaded');
        
}
        
// Load the language
        
return $this->load($langfile, $idiom, $return);
        
    
}

After setting the language preferences, I simply run this function for each language file in use.

Now there’s still one glitch: reloading the language for the status and userlib isn’t working yet.

 Signature 

New to PHP5, new to CI… but willing to learn! Thanks for your understanding.

Currently building a backend-only app, using BackEnd Pro, for a non-profit organization.

Profile
 
 
Posted: 19 June 2009 02:25 AM   [ Ignore ]   [ # 366 ]  
Summer Student
Total Posts:  2
Joined  06-19-2009

Hi Adam,

BeP is a great tool - and I’ve been working through it.  Thanks for your contribution!

Once thing I did notice, now that I am putting more of my site’s code into it, is that all of a sudden I get logged out of BeP.

I realize that there is probably an inactivity timeout setting somewhere (perhaps this is the standard CI session timeout); but it seems to happen even if I had *just* accessed the system.  On the next click (sometimes within seconds), I’m being prompted for a login…

..is there some method I should be calling within my controllers to ‘refresh’ the session, or something?

..I’m new to BeP (and CI in general) - is there someplace I should be looking to troubleshoot further?

-Thanks in advance,
javaMonk();

Profile
 
 
Posted: 19 June 2009 03:22 AM   [ Ignore ]   [ # 367 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  773
Joined  09-01-2007

No theres no timeout other than the browser session ending that I know of, no refresh method. When you say your adding your own code, what kind of code. Are you doing stuff with the session class?

Does this happen on a blank install of BeP and CI?

 Signature 

Kaydoo - A day in the life of a developer
BackendPro Control Panel

Profile
 
 
Posted: 29 June 2009 12:42 AM   [ Ignore ]   [ # 368 ]  
Summer Student
Total Posts:  4
Joined  09-24-2008

Hi there adam ,

it’s nice to use this tools , but after a while i have this problem using the scaffolding for my development area. After i installed BEP i got this error when i want to use the scaffolding method.


An Error Was Encountered

Unable to load the requested file: view.php

could you lighten me up for this one…? cuz i think all the scaffolding BASEPATH in scaffolding.php are good.

 Signature 

//—————————————————————-
“The Greatest Pleasure in life is doing
what people say you can not do”
—————————————————————-//

Profile
 
 
Posted: 03 July 2009 03:43 AM   [ Ignore ]   [ # 369 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  773
Joined  09-01-2007

I have to say I have never used Scaffolding and never with BeP. Are you trying to load the scaffolding into a Public_Controller or an Admin_Controller??

I would also point out it is deprecated as of CI 1.6.

 Signature 

Kaydoo - A day in the life of a developer
BackendPro Control Panel

Profile
 
 
Posted: 04 July 2009 06:07 PM   [ Ignore ]   [ # 370 ]  
Summer Student
Total Posts:  6
Joined  06-10-2009

@Adam Back in post #360 I mentioned the login form being doubled in the login page and you said you were going to look into it.  I updated to firefox 3.5 and the problem is gone.  Might have just been my system.
Thanks.

Profile
 
 
   
37 of 59
37
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 819, on March 11, 2010 11:15 AM
Total Registered Members: 120514 Total Logged-in Users: 34
Total Topics: 126586 Total Anonymous Users: 5
Total Replies: 665479 Total Guests: 373
Total Posts: 792065    
Members ( View Memberlist )
Newest Members:  harry29512sarah123CasERispukgendaleOptimizaiofficeiEclipsekinkadebbbBenAbrams