Example #1
0
 /**
  * Gets called when custom data is to be added for a file custom data can for example be
  * plugin specific name value items that should get added into a file listning.
  *
  * @param MCManager $man MCManager reference that the plugin is assigned to.
  * @param BaseFile $file File reference to add custom info/data to.
  * @param string $type Where is the info needed for example list or info.
  * @param Array $custom Name/Value array to add custom items to.
  * @return bool true/false if the execution of the event chain should continue.
  */
 function onCustomInfo(&$man, &$file, $type, &$input)
 {
     switch ($type) {
         // When the file is selected/inserted
         case "insert":
             // Can be used by the insert_templates like this {$custom.mycustomfield}
             $input['mycustomfield'] = strtoupper($file->getName());
             // Will be used as title/alt in TinyMCE link/image dialogs
             $input['description'] = $file->getName() . " (" . $this->_getSizeStr($file->getLength()) . ")";
             break;
             // When the file is displayed in a more info dialog
         // When the file is displayed in a more info dialog
         case "info":
             //$input['mycustomfield'] = strtoupper($file->getName());
             break;
             // When the file is listed
         // When the file is listed
         case "list":
             //$input['mycustomfield'] = strtoupper($file->getName());
             break;
     }
     // Chain to next
     return true;
 }