本文整理匯總了PHP中Horde_Mime_Magic::extToMIME方法的典型用法代碼示例。如果您正苦於以下問題:PHP Horde_Mime_Magic::extToMIME方法的具體用法?PHP Horde_Mime_Magic::extToMIME怎麽用?PHP Horde_Mime_Magic::extToMIME使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Horde_Mime_Magic
的用法示例。
在下文中一共展示了Horde_Mime_Magic::extToMIME方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: sprintf
try {
$injector->getInstance('Gollem_Vfs')->writeData($vars->dir, $vars->file, $vars->content);
$message = sprintf(_("%s successfully saved."), $vars->file);
} catch (Horde_Vfs_Exception $e) {
$message = sprintf(_("Access denied to %s"), $vars->file);
}
echo Horde::wrapInlineScript(array('alert(' . Horde_Serialize::serialize($message, Horde_Serialize::JSON) . ')'));
break;
case 'edit_file':
try {
$data = $injector->getInstance('Gollem_Vfs')->read($vars->dir, $vars->file);
} catch (Horde_Vfs_Exception $e) {
echo Horde::wrapInlineScript(array('alert(' . Horde_Serialize::serialize(sprintf(_("Access denied to %s"), $vars->file), Horde_Serialize::JSON) . ')'));
break;
}
$mime_type = Horde_Mime_Magic::extToMIME($vars->type);
if (strpos($mime_type, 'text/') !== 0) {
break;
}
if ($mime_type == 'text/html') {
$injector->getInstance('Horde_Editor')->initialize(array('id' => 'content'));
}
$view = $injector->createInstance('Horde_View');
$view->self_url = Horde::url('edit.php');
$view->forminput = Horde_Util::formInput();
$view->vars = $vars;
$view->data = $data;
$page_output->addScriptFile('edit.js');
$page_output->topbar = $page_output->sidebar = false;
$page_output->header(array('title' => $title));
$notification->notify(array('listeners' => 'status'));