Can't grab a file through my dashboard page

Permalink
The following code (taken from the core "file" block) works perfectly on front end of the website:

$includeAssetLibrary = true;
$al = Loader::helper('concrete/asset_library');

<?php echo $al->file('fileId', 'fID', t('Choose File')); ?>

---

However, when I drop this code into my dashboard page, the "Choose File" button renders properly, but nothing happens upon clicking it.

Any ideas as to what I'm doing wrong?

torchmedia
 
jbx replied on at Permalink Reply
jbx
Could be missing the javascript you need to make the link work. I ran into a similar sounding problem on a custom dashboard page and it turned out there was a javascript call which needed to be placed at the bottom of the page. Can't remeber what it was, but check the source for the page it works on for any relevant looking javascript...
torchmedia replied on at Permalink Reply
torchmedia
It looks like the most relevant js code is on both the front and back ends:

/c5/concrete/js/ccm.filemanager.js

I've been looking through the API but it doesn't mention anything that I can see about loading JS files along with the asset_library.

Any other ideas?
jbx replied on at Permalink Reply
jbx
<script>
ccm_activateFileSelectors();
ccm_activateFileManager('DASHBOARD');
</script>
torchmedia replied on at Permalink Reply
torchmedia
Ahh.. thank you so much.

Now please, tell me where you found that little bit so I can look in the right places next time.
jbx replied on at Permalink Reply
jbx
http://www.concrete5.org/community/forums/customizing_c5/trying_to_get_the_and039add_image__file__linkand/#18496