function ocupload_install in One Click Upload 7.2
Same name and namespace in other branches
- 7 ocupload.install \ocupload_install()
Implements hook_install().
File
- ./
ocupload.install, line 134 - One Click Upload install file.
Code
function ocupload_install() {
module_load_include('inc', 'ocupload');
$templates = array(
array(
'mask' => 'jpg,jpeg,gif,png',
'path' => 'public://inline/images',
'template' => '<img src="!filepath" alt="" data-fid="!filefid" />',
'template_select' => module_exists('colorbox') ? '<a href="!filepath" class="colorbox" target="_blank" data-fid="!filefid">!text</a>' : '<a href="!filepath" target="_blank" data-fid="!filefid">!text</a>',
'link_template' => '<a href="!filepath" target="_blank">!image</a>',
),
array(
'mask' => 'rar,zip,doc,xls',
'path' => 'public://inline/files',
'template' => '<a href="!filepath" data-fid="!filefid">!filename</a>',
'template_select' => '<a href="!filepath" data-fid="!filefid">!text</a>',
),
array(
'mask' => 'webm,mp4,ogv',
'path' => 'public://inline/video',
'template' => '<video src="!filepath" width="480" height="390" controls data-fid="!filefid"></video>',
'template_select' => '<a href="!filepath" data-fid="!filefid">!text</a>',
),
);
foreach ($templates as $template) {
ocupload_template_save($template);
}
}