本文整理汇总了PHP中PHPWS_Text::ezTable方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPWS_Text::ezTable方法的具体用法?PHP PHPWS_Text::ezTable怎么用?PHP PHPWS_Text::ezTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPWS_Text
的用法示例。
在下文中一共展示了PHPWS_Text::ezTable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: manageEditors
function manageEditors()
{
if ($_SESSION["OBJ_user"]->allow_access("xwysiwyg", "settings")) {
$this->content .= "<a href=\"" . $this->linkRef . "&action=admin" . "\">" . $_SESSION['translate']->it("Back to administration") . "</a>";
if (isset($_GET['updList'])) {
//to update, simply delete the existing file
@unlink(PHPWS_HOME_DIR . "files/xwysiwyg/editors/list.txt");
}
$editors = array();
$formTags = array();
$table = array();
$this->content .= "<br /><br /><b>" . $_SESSION['translate']->it("Available editors") . "</b>";
$table[] = array("<b>" . $_SESSION['translate']->it("Location") . "</b>", "<b>" . $_SESSION['translate']->it("Editor") . "</b>", "<b>" . $_SESSION['translate']->it("Status") . "</b>", "<b>" . $_SESSION['translate']->it("Action") . "</b>");
$dir = PHPWS_File::readDirectory(PHPWS_HOME_DIR . "files/xwysiwyg/editors/", FALSE, TRUE, FALSE, array('conf'));
if (is_array($dir)) {
$location = $_SESSION['translate']->it("local");
foreach ($dir as $file) {
include PHPWS_HOME_DIR . "files/xwysiwyg/editors/" . $file;
$editors[] = $cfg_editor;
$result = $GLOBALS['core']->quickFetch("SELECT editor FROM mod_xw_config WHERE editor = '{$cfg_editor}'", TRUE, TRUE);
if ($result) {
$status = $_SESSION['translate']->it("installed");
$action_link = $this->linkRef . "&action=delEditor&delEditor={$cfg_editor}";
$action_label = $_SESSION['translate']->it("Uninstall");
$action = "<a href=\"{$action_link}\">{$action_label}</a>";
$select = $GLOBALS['core']->quickFetch("SELECT editor FROM mod_xw_editor", TRUE, TRUE);
if ($select['editor'] == $cfg_editor) {
$editor = "<strong>{$cfg_editor}</strong>";
} else {
$action_link = $this->linkRef . "&action=toggle&editor={$cfg_editor}";
$action_label = $_SESSION['translate']->it("Select");
$action .= " || <a href=\"{$action_link}\">{$action_label}</a>";
$editor = $cfg_editor;
}
} else {
$status = $_SESSION['translate']->it("not installed");
$action_link = $this->linkRef . "&action=addEditor&addEditor={$cfg_editor}&fn={$file}";
$action_label = $_SESSION['translate']->it("Install");
$action = "<a href=\"{$action_link}\">{$action_label}</a>";
$action_link = $this->linkRef . "&action=delFile&delFile={$cfg_editor}&filetyp=ext";
$action_label = $_SESSION['translate']->it("Remove");
$action .= " || <a href=\"{$action_link}\">{$action_label}</a>";
$editor = $cfg_editor;
}
$table[] = array($location, $editor, $status, $action);
}
} else {
$this->content .= "<br />" . $_SESSION['translate']->it("No local editors found");
}
if (!$GLOBALS["core"]->isHub) {
$table[] = array("<b>" . $_SESSION['translate']->it("Location") . "</b>", "<b>" . $_SESSION['translate']->it("Editor") . "</b>", "<b>" . $_SESSION['translate']->it("Status") . "</b>", "<b>" . $_SESSION['translate']->it("Action") . "</b>");
if (!is_dir("{$GLOBALS['core']->home_dir}files/xwysiwyg/")) {
PHPWS_File::makeDir($GLOBALS['core']->home_dir . "files/xwysiwyg/");
}
if (!is_dir("{$GLOBALS['core']->home_dir}files/xwysiwyg/editors/")) {
PHPWS_File::makeDir($GLOBALS['core']->home_dir . "files/xwysiwyg/editors/");
}
$dir = PHPWS_File::readDirectory(PHPWS_SOURCE_DIR . "files/xwysiwyg/editors/", FALSE, TRUE, FALSE, array('conf'));
if (is_array($dir)) {
$location = $_SESSION['translate']->it("hub");
foreach ($dir as $file) {
include_once PHPWS_SOURCE_DIR . "files/xwysiwyg/editors/" . $file;
if (!in_array($cfg_editor, $editors)) {
$status = $_SESSION['translate']->it("not copied");
$action_link = $this->linkRef . "&action=cpyEditor&cpyEditor={$cfg_editor}";
$action_label = $_SESSION['translate']->it("Copy");
$action = "<a href=\"{$action_link}\">{$action_label}</a>";
$editor = $cfg_editor;
} else {
$status = $_SESSION['translate']->it("copied");
$action_link = $this->linkRef . "&action=remEditor&remEditor={$cfg_editor}";
$action_label = "";
$action = "na";
$editor = $cfg_editor;
}
$table[] = array($location, $editor, $status, $action);
}
} else {
$this->content .= "<br />" . $_SESSION['translate']->it("No editors found on hub");
}
}
$this->content .= PHPWS_Text::ezTable($table, 2, 2, 1, "", NULL, 1, "top");
$this->content .= "<br /><br /><b>" . $_SESSION['translate']->it("Available editor-packages") . "</b>";
$this->content .= " <a href=\"" . $this->linkRef . "&action=manageEditor&updList=1" . "\">" . $_SESSION['translate']->it("Update List") . "</a>";
$table = array();
$table[] = array("<b>" . $_SESSION['translate']->it("Location") . "</b>", "<b>" . $_SESSION['translate']->it("Editor") . "</b>", "<b>" . $_SESSION['translate']->it("Description") . "</b>", "<b>" . $_SESSION['translate']->it("Action") . "</b>");
$dir = PHPWS_File::readDirectory(PHPWS_HOME_DIR . "files/xwysiwyg/editors/", FALSE, TRUE, FALSE, array('tgz'));
if (is_array($dir)) {
$location = $_SESSION['translate']->it("local");
foreach ($dir as $file) {
$status = $_SESSION['translate']->it("Archive package");
$action_link = $this->linkRef . "&action=tarEditor&tarEditor={$file}&local=1";
$action_label = $_SESSION['translate']->it("Extract");
$action = "<a href=\"{$action_link}\">{$action_label}</a>";
$action_link = $this->linkRef . "&action=delFile&delFile={$file}&filetyp=tgz";
$action_label = $_SESSION['translate']->it("Delete");
$action .= " || <a href=\"{$action_link}\">{$action_label}</a>";
$editor = $file;
$table[] = array($location, $editor, $status, $action);
}
//.........这里部分代码省略.........