예제 #1
0
파일: draw.php 프로젝트: philum/cms
function plug_draw($w, $h)
{
    if (!$w) {
        $w = 400;
    }
    //currentwidth();
    Head::add('jslink', '/js/jquery.js');
    Head::add('jscode', draw_js());
    Head::add('csscode', draw_css());
    $ret = balc('canvas', '" id="canvas" width="' . $w . 'px" height="' . $h . 'px', '');
    $r = array('black', 'white', 'blue', 'green', 'yellow', 'orange', 'brown', 'red', 'indigo', 'violet', 'pink', 'cyan');
    $n = count($r);
    for ($i = 0; $i < $n; $i++) {
        $c = '" style="background: none repeat scroll 0% 0% ' . $r[$i] . ';" data-couleur="' . $r[$i];
        $cl .= balc('li', '', lka($c, $r[$i]));
    }
    $ret .= balc('ul', '" id="couleurs', $cl);
    $inp = label('largeur_pinceau', '', '', 'width');
    $inp .= input('range', 'largeur_pinceau', 5, '" min="2" max="20" size=1');
    //$inp.=balc('output','" id="output','pixels');
    $inp .= input('reset', 'reset', 'reset', '');
    $inp .= input('button', 'save', 'save', '');
    $ret .= '<form id="largeurs_pinceau">' . $inp . '</form>';
    return $ret;
}
예제 #2
0
function drawTop($headcontent = false)
{
    global $_josh, $page, $user;
    ob_start('browser_output');
    error_debug('starting top', __FILE__, __LINE__);
    if ($_josh['db']['language'] == 'mysql') {
        url_header_utf8();
    }
    if (empty($page['helptext'])) {
        $page['helptext'] = getString('help_empty');
    }
    $return = draw_doctype() . draw_container('head', ($_josh['db']['language'] == 'mysql' ? draw_meta_utf8() : '') . draw_container('title', $page['title']) . draw_favicon(DIRECTORY_WRITE . '/favicon.png') . draw_css_src('/css/global.css', 'screen') . draw_css_src('/css/print.css', 'print') . draw_css_src('/css/ie.css', 'ie') . draw_css_src(DIRECTORY_WRITE . '/screen.css', 'screen') . lib_get('jquery') . draw_javascript_src() . draw_javascript_src('/js/global.js') . draw_css('
				#left table.left td.head, #left div.display div.title { background-color:#' . $page['color'] . '; }
				#left table.table th.table_title, #left form fieldset legend span, #left table.navigation { background-color:#' . $page['color'] . '; }
				#left table.navigation tr, #left form fieldset div.admin, #left table td.hilite { background-color:#' . $page['hilite'] . '; }
			') . draw_javascript('
			function confirmDelete(id) {
				if (confirm("' . getString('are_you_sure') . '")) {
					var newloc = "' . url_query_add(array('action' => 'delete', 'delete_id' => 'replaceme'), false) . '";
					location.href = newloc.replace("replaceme", id);
				}
			}
			function changeDept(id, user_id) {
				location.href="' . $_josh['request']['path_query'] . '&newDeptID=" + id + "&contactID=" + user_id;
			}
			') . drawSyndicateLink('bb') . $headcontent);
    $return .= draw_body_open() . '
		<div id="container">
			' . draw_div('banner', draw_img(DIRECTORY_WRITE . '/banner' . langExt() . '.png', $_SESSION['homepage'])) . '
			<div id="left">
				<div id="help">
					<div id="help_buttons">' . draw_link($_SESSION['homepage'], getString('home'), false, 'left') . draw_link('javascript:helpShow(' . user() . ')', getString('help_show'), false, array('class' => 'right' . ($user['help'] ? ' hidden' : false), 'id' => 'show_help_btn')) . draw_link('javascript:helpHide(' . user() . ')', getString('help_hide'), false, array('class' => 'right' . (!$user['help'] ? ' hidden' : false), 'id' => 'hide_help_btn'));
    if ($_SESSION['is_admin']) {
        if ($page['id']) {
            $return .= draw_link('/a/admin/page.php?id=' . $page['id'], getString('page_edit_info'), false, 'right');
        } else {
            $return .= draw_link('/a/admin/page.php?module_id=' . $page['module_id'] . '&modulette_id=' . $page['modulette_id'] . '&url=' . urlencode($_josh['request']['page']), 'Create Page Here', false, 'right');
        }
    }
    $return .= '</div><div id="help_text"';
    if (!$user['help']) {
        $return .= ' class="hidden"';
    }
    $return .= '>' . $page['helptext'] . '</div></div>';
    if ($_josh['request']['folder'] == 'helpdesk') {
        $return .= drawNavigationHelpdesk();
    }
    $return .= drawNavigation();
    $_josh['drawn']['top'] = true;
    error_debug('finished drawing top', __FILE__, __LINE__);
    return $return;
}
예제 #3
0
function draw_page($title, $html, $severe = false, $keepalive = false)
{
    global $_josh;
    error_debug("drawing page");
    $_josh["drawn"]["css"] = false;
    if ($severe) {
        $title = "<font color='" . $_josh["colors"]["red2"] . "'>" . $title . "</font>";
    }
    $return = "<html>\n\t\t<head>\n\t\t\t<title>" . strip_tags($title) . "</title>\n\t\t\t" . draw_css($keepalive) . "\n\t\t\t<script language='javascript'>\n\t\t\t\t<!--\n\t\t\t\tfunction josh_confirm(action, message, id) {\n\t\t\t\t\tvar url = '/j/' + action + '/';\n\t\t\t\t\tif (id) url += '/' + id + '/';\n\t\t\t\t\tif (confirm('Are you sure you want to ' + message + '?')) location.href = url;\n\t\t\t\t}\n\t\t\t\t//-->\n\t\t\t</script>\n\t\t</head>\n\t\t<body class='josh_body' bgcolor='" . $_josh["colors"]["grey3"] . "'>\n\t\t\t<table width='100%' height='100%' cellpadding='0' cellspacing='0' border='0'>\n\t\t\t\t<tr height='90%'>\n\t\t\t\t\t<td align='center' height='350'>\n\t\t\t\t\t\t<table width='400' height='250' cellpadding='20' cellspacing='0' border='0' bgcolor='" . $_josh["colors"]["white"] . "'>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td valign='top'>\n\t\t\t\t\t\t\t\t<div class='josh_title'>" . $title . "</div>\n\t\t\t\t\t\t\t\t<br>\n\t\t\t\t\t\t\t\t<div class='josh_message'>" . $html . "</div>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t</body>\n\t</html>";
    if ($keepalive) {
        return $return;
    }
    echo $return;
    db_close();
}