本文整理匯總了PHP中PageLayout::getSqueezePackages方法的典型用法代碼示例。如果您正苦於以下問題:PHP PageLayout::getSqueezePackages方法的具體用法?PHP PageLayout::getSqueezePackages怎麽用?PHP PageLayout::getSqueezePackages使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PageLayout
的用法示例。
在下文中一共展示了PageLayout::getSqueezePackages方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* Initialize a new instance of the plugin.
*/
function __construct()
{
parent::__construct();
if (Config::get()->WYSIWYG && is_object($GLOBALS['user'])) {
if (strpos($_SERVER['REQUEST_URI'], 'dispatch.php/settings/general') !== false) {
if (Request::submitted('forced_language')) {
$GLOBALS['user']->cfg->store('WYSIWYG_DISABLE', Request::submitted('wysiwyg_user_config'));
}
$snippet = '
<tr>
<td>
<label for="wysiwyg_user_config">
WYSIWYG Editor ausschalten<br>
<dfn id="cookie_auth_token_description">
Mit dieser Einstellung können Sie den Stud.IP WYSIWYG Editor ausschalten. Dadurch müssen Sie ggf. Texte in HTML schreiben.
</dfn>
</label>
</td>
<td>
<input type="checkbox" value="1" aria-describedby="wysiwyg_user_config" id="wysiwyg_user_config" name="wysiwyg_user_config" ' . ($GLOBALS['user']->cfg->WYSIWYG_DISABLE ? 'checked' : '') . '>
</td>
</tr>';
$snippet = jsready($snippet, 'script-double');
PageLayout::addHeadElement('script', array('type' => 'text/javascript'), "jQuery(function (\$) {\$('#main_content tbody tr').first().after('{$snippet}');});");
}
if (!(Config::get()->WYSIWYG = !$GLOBALS['user']->cfg->WYSIWYG_DISABLE)) {
$old_packages = array_flip(PageLayout::getSqueezePackages());
unset($old_packages['wysiwyg']);
call_user_func_array('PageLayout::setSqueezePackages', array_values(array_flip($old_packages)));
}
}
}
示例2: array_flip
<?php
/**
* WysiwygHtmlHeadBeforeJS.php -
* Include this file in HTML-files before ckeditor.js is loaded.
*/
if (\Studip\Wysiwyg\Settings::getInstance()->isDisabled()) {
$old_packages = array_flip(PageLayout::getSqueezePackages());
unset($old_packages['wysiwyg']);
call_user_func_array('PageLayout::setSqueezePackages', array_values(array_flip($old_packages)));
return;
}
?>
<script>
CKEDITOR_BASEPATH = '<?php
echo $GLOBALS['ABSOLUTE_URI_STUDIP'] . 'assets/javascripts/ckeditor/';
?>
';
</script>