本文整理汇总了PHP中dcPage::openPopup方法的典型用法代码示例。如果您正苦于以下问题:PHP dcPage::openPopup方法的具体用法?PHP dcPage::openPopup怎么用?PHP dcPage::openPopup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dcPage
的用法示例。
在下文中一共展示了dcPage::openPopup方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dirname
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
require dirname(__FILE__) . '/../inc/admin/prepend.php';
dcPage::check('usage,contentadmin');
$q = !empty($_GET['q']) ? $_GET['q'] : null;
$page = !empty($_GET['page']) ? (int) $_GET['page'] : 1;
$nb_per_page = 10;
$params = array();
$params['limit'] = array(($page - 1) * $nb_per_page, $nb_per_page);
$params['no_content'] = true;
$params['order'] = 'post_dt DESC';
if ($q) {
$params['search'] = $q;
}
dcPage::openPopup(__('Add a link to an entry'), dcPage::jsLoad('js/_posts_list.js') . dcPage::jsLoad('js/jsToolBar/popup_posts.js'));
echo '<h2>' . __('Add a link to an entry') . '</h2>';
echo '<form action="popup_posts.php" method="get">' . '<p><label class="classic">' . __('Search entry:') . ' ' . form::field('q', 30, 255, html::escapeHTML($q)) . '</label> ' . ' <input type="submit" value="' . __('ok') . '" /></p>' . '</form>';
try {
$posts = $core->blog->getPosts($params);
$counter = $core->blog->getPosts($params, true);
$post_list = new adminPostMiniList($core, $posts, $counter->f(0));
} catch (Exception $e) {
$core->error->add($e->getMessage());
}
echo '<div id="form-entries">';
# I know it's not a form but we just need the ID
$post_list->display($page, $nb_per_page);
echo '</div>';
echo '<p><a class="button" href="#" id="link-insert-cancel">' . __('cancel') . '</a></p>';
dcPage::closePopup();
示例2: Copyright
<?php
# -- BEGIN LICENSE BLOCK ---------------------------------------
#
# This file is part of Dotclear 2.
#
# Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear
# Licensed under the GPL version 2.0 license.
# See LICENSE file or
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK -----------------------------------------
require dirname(__FILE__) . '/../inc/admin/prepend.php';
dcPage::check('usage,contentadmin');
$href = !empty($_GET['href']) ? $_GET['href'] : '';
$hreflang = !empty($_GET['hreflang']) ? $_GET['hreflang'] : '';
$title = !empty($_GET['title']) ? $_GET['title'] : '';
$plugin_id = !empty($_GET['plugin_id']) ? html::sanitizeURL($_GET['plugin_id']) : '';
dcPage::openPopup(__('Add a link'), $core->callBehavior('adminPopupLink', $plugin_id));
echo '<h2 class="page-title">' . __('Add a link') . '</h2>';
# Languages combo
$rs = $core->blog->getLangs(array('order' => 'asc'));
$lang_combo = dcAdminCombos::getLangsCombo($rs, true);
echo '<form id="link-insert-form" action="#" method="get">' . '<p><label class="required" for="href"><abbr title="' . __('Required field') . '">*</abbr> ' . __('Link URL:') . '</label> ' . form::field('href', 35, 512, html::escapeHTML($href)) . '</p>' . '<p><label for="title">' . __('Link title:') . '</label> ' . form::field('title', 35, 512, html::escapeHTML($title)) . '</p>' . '<p><label for="hreflang">' . __('Link language:') . '</label> ' . form::combo('hreflang', $lang_combo, $hreflang) . '</p>' . '</form>' . '<p><a class="button reset" href="#" id="link-insert-cancel">' . __('Cancel') . '</a> - ' . '<strong><a class="button" href="#" id="link-insert-ok">' . __('Insert') . '</a></strong></p>' . "\n" . '<script type="text/javascript">' . "\n" . '//<![CDATA[' . "\n" . '$(\'input[name="href"]\').get(0).focus();' . "\n" . '//]]>' . "\n" . '</script>' . "\n";
dcPage::closePopup();
示例3: Copyright
# -- BEGIN LICENSE BLOCK ----------------------------------
#
# This file is part of Dotclear 2.
#
# Copyright (c) 2003-2009 Olivier Meunier and contributors
# Licensed under the GPL version 2.0 license.
# See LICENSE file or
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#
# -- END LICENSE BLOCK ------------------------------------
require dirname(__FILE__) . '/../inc/admin/prepend.php';
dcPage::check('usage,contentadmin');
$href = !empty($_GET['href']) ? $_GET['href'] : '';
$hreflang = !empty($_GET['hreflang']) ? $_GET['hreflang'] : '';
dcPage::openPopup(__('Add a link'), dcPage::jsLoad('js/jsToolBar/popup_link.js'));
echo '<h2>' . __('Add a link') . '</h2>';
# Languages combo
$rs = $core->blog->getLangs(array('order' => 'asc'));
$all_langs = l10n::getISOcodes(0, 1);
$lang_combo = array('' => '', __('Most used') => array(), __('Available') => l10n::getISOcodes(1, 1));
while ($rs->fetch()) {
if (isset($all_langs[$rs->post_lang])) {
$lang_combo[__('Most used')][$all_langs[$rs->post_lang]] = $rs->post_lang;
unset($lang_combo[__('Available')][$all_langs[$rs->post_lang]]);
} else {
$lang_combo[__('Most used')][$rs->post_lang] = $rs->post_lang;
}
}
unset($all_langs);
unset($rs);
示例4: array
$type_combo[__($k)] = (string) $k;
}
if (!in_array($type, $type_combo)) {
$type = null;
}
$params = array();
$params['limit'] = array(($page - 1) * $nb_per_page, $nb_per_page);
$params['no_content'] = true;
$params['order'] = 'post_dt DESC';
if ($q) {
$params['search'] = $q;
}
if ($type) {
$params['post_type'] = $type;
}
dcPage::openPopup(__('Add a link to an entry'), dcPage::jsLoad('js/_posts_list.js') . $core->callBehavior('adminPopupPosts', $plugin_id));
echo '<h2 class="page-title">' . __('Add a link to an entry') . '</h2>';
echo '<form action="popup_posts.php" method="get">' . '<p><label for="type" class="classic">' . __('Entry type:') . '</label> ' . form::combo('type', $type_combo, $type) . '' . '<noscript><div><input type="submit" value="' . __('Ok') . '" /></div></noscript>' . form::hidden('plugin_id', html::escapeHTML($plugin_id)) . '</p>' . '</form>';
echo '<form action="popup_posts.php" method="get">' . '<p><label for="q" class="classic">' . __('Search entry:') . '</label> ' . form::field('q', 30, 255, html::escapeHTML($q)) . ' <input type="submit" value="' . __('Search') . '" />' . form::hidden('plugin_id', html::escapeHTML($plugin_id)) . form::hidden('type', html::escapeHTML($type)) . '</p></form>';
try {
$posts = $core->blog->getPosts($params);
$counter = $core->blog->getPosts($params, true);
$post_list = new adminPostMiniList($core, $posts, $counter->f(0));
} catch (Exception $e) {
$core->error->add($e->getMessage());
}
echo '<div id="form-entries">';
# I know it's not a form but we just need the ID
$post_list->display($page, $nb_per_page);
echo '</div>';
echo '<p><a class="button" href="#" id="link-insert-cancel">' . __('cancel') . '</a></p>';