⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Move default assets folder



Matt
  • profile picture
  • Member

Posted 10 July 2012 - 12:02 PM

I need to move where the default_javascript_path and default_css_path is located.

I've added this in the controller

$crud->set_default_javascript_path(SHARED_DIR.'plugins/');
$crud->set_default_css_path(SHARED_DIR.'plugins/');


and this to grocery_CRUD


public function set_default_javascript_path($path) { $this->default_javascript_path = $path; }
public function set_default_css_path($path) { $this->default_css_path = $path; }


But it dosent seem to change the default values?

Anyone see what I'm missing?

noskov.biz
  • profile picture
  • Member

Posted 10 July 2012 - 17:23 PM

Hi, Matt!
I can mistake, but it seems to me this is because of trailing slashes or your SHARED_DIR.

Matt
  • profile picture
  • Member

Posted 10 July 2012 - 19:12 PM

Hi Noskov

Thanks for the input - [color=#282828][font=helvetica, arial, sans-serif]SHARED_DIR has a trailing slash. I can see that the assets are being called as usual and are not referring to my value at all.[/font][/color]

noskov.biz
  • profile picture
  • Member

Posted 11 July 2012 - 05:17 AM

Ahhh, I thought that you want to change [b]only[/b] css and js paths. But there is the $default_theme_path that exist in Grocery, and this is apply many other css and js files to work. Look at the files in the ./assets/grocery_crud/themes/flexigrid/views/ for example.

In this case, if you want to change all paths, you have to write another one function set_default_theme_path:

public function set_default_theme_path($path)
{
$this->default_theme_path = $path;
}


and of cause add to the controller

$crud->set_default_theme_path('your/new/theme/path');


Probably you want to change other paths to texteditor and language files in your project. Look at the Grocery CRUD library near the line #2695.

P.S. When I tell about trailing slashes I meant the trailing slashes not after SHARED_DIR, but after "plugins[color=#ff0000][b]/[/b][/color]"

By the way for what do you change the paths? I'm just interesting.

Matt
  • profile picture
  • Member

Posted 12 July 2012 - 22:58 PM

That's great. Just what I needed. Thanks for that!

noskov.biz
  • profile picture
  • Member

Posted 13 July 2012 - 06:03 AM

You are welcome!