How to load custom "tools" index.php/tools/required/mytool.php
Permalink
How to load custom "tools"?
Not blocks, packages, single pages etc.
Tools. Like how on the dashboard the statistics flash thing is shown. I want to add my custom flashy thing and the only way I get it to work in placing it directly in the tools directory in the "core" concrete directory.
How to request it like this: index.php/tools/required/mytool
(or a similar url)
and have it place in this
concreteroot/tools/mytool.php
and not in
concreteroot/concrete/tools/mytool.php
I'm sure someone knows and if I get this too work I will be one step closer to making a sharable BASIC statistics thingy.
Not blocks, packages, single pages etc.
Tools. Like how on the dashboard the statistics flash thing is shown. I want to add my custom flashy thing and the only way I get it to work in placing it directly in the tools directory in the "core" concrete directory.
How to request it like this: index.php/tools/required/mytool
(or a similar url)
and have it place in this
concreteroot/tools/mytool.php
and not in
concreteroot/concrete/tools/mytool.php
I'm sure someone knows and if I get this too work I will be one step closer to making a sharable BASIC statistics thingy.
I believe your after the definition DIR_FILES_TOOLS, it'll return
concreteroot/tools
you then add /mytool.php
If your talking about website statistics. I have already developed a package that uses BBClone. It's just waiting for the core team to approve it for the marketplace. It'll be a free package.
concreteroot/tools
you then add /mytool.php
If your talking about website statistics. I have already developed a package that uses BBClone. It's just waiting for the core team to approve it for the marketplace. It'll be a free package.
No solution. I get a unix path which it, then returns nothing that works.
What I mean is this:
For build in tools C5 uses this constant: REL_DIR_FILES_TOOLS_REQUIRED = /concrete/index.php/tools/required/basicstats/chart_handler.php
So I thought... well mabye I need this one:
REL_DIR_FILES_TOOLS = /concrete/index.php/tools/basicstats/chart_handler.php
But.. nooo....
so.. it's not the required/ thing, but what then? Why is it not loading that tool from the root/tools/basicstats/ directory?
What I mean is this:
For build in tools C5 uses this constant: REL_DIR_FILES_TOOLS_REQUIRED = /concrete/index.php/tools/required/basicstats/chart_handler.php
So I thought... well mabye I need this one:
REL_DIR_FILES_TOOLS = /concrete/index.php/tools/basicstats/chart_handler.php
But.. nooo....
so.. it's not the required/ thing, but what then? Why is it not loading that tool from the root/tools/basicstats/ directory?
You're on the right track, but you just don't need the .php at the end of the path.
So if I create a file in c5root/tools/ called test.php, and I can access it via the path:
So if I create a file in c5root/tools/ called test.php, and I can access it via the path:
$url=REL_DIR_FILES_TOOLS.'/test/';
looks like the .php doesn't really matter. it should work with or without it.
I tried it with the php and without, but no luck. Even direct access to the tool doesn't work, look:http://www.ingrammicro.nl/concrete/index.php/tools/basicstats/chart...
You should get access denied, but nothing.. just nothing.
I'm using this code:
And when placing it in the tools dir in the concrete dir, I use this one:
And that works, but why not the other one?
You should get access denied, but nothing.. just nothing.
I'm using this code:
<?php echo "flashvars = { 'data': '".BASE_URL.REL_DIR_FILES_TOOLS_REQUIRED."/basicstats/chart_handler' }"; ?>
And when placing it in the tools dir in the concrete dir, I use this one:
<?php echo "flashvars = { 'data': '".BASE_URL.REL_DIR_FILES_TOOLS."/basicstats/chart_handler' }"; ?>
And that works, but why not the other one?
andrew just showed me this approach:
$uh = Loader::helper('concrete/urls');
$bt = BlockType::getByHandle('document_library');
$url = $uh->getBlockTypeToolsURL($bt, 'advanced_search.php');
$uh = Loader::helper('concrete/urls');
$bt = BlockType::getByHandle('document_library');
$url = $uh->getBlockTypeToolsURL($bt, 'advanced_search.php');
I really like to know how, as the documentation doesn't help me.