Beispiel #1
0
function display_title($title, $success_msg = NULL, $error_msg = NULL)
{
    echo <<<EOD
 <body>
  <div id="header"><h1>PHP & MySQL: The Missing Manual</h1></div>
  <div id="example">{$title}</div>
  <div id="menu">
    <ul>
      <li><a href="index.html">Home</a></li>
EOD;
    if (isset($_SESSION['user_id'])) {
        echo "<li><a href='show_user.php'>My Profile</a>";
        if (user_in_group($_SESSION['user_id'], "Administrators")) {
            echo "<li><a href='show_users.php'>Manage Users</a></li>";
        }
        echo "<li><a href='signout.php'>Sign Out</a></li>";
    } else {
        echo "<li><a href='signin.php'>Sign In</a></li>";
    }
    echo <<<EOD
    </ul>
  </div>
EOD;
    display_messages($success_msg, $error_msg);
}
Beispiel #2
0
function display_title($title, $success_msg = NULL, $error_msg = NULL)
{
    echo <<<EOD
 <body>
  <div id="header"><h1>PHP & MySQL: The Missing Manual</h1></div>
  <div id="example">{$title}</div>
EOD;
    display_messages($success_msg, $error_msg);
}
Beispiel #3
0
<?php

echo display_messages('', $this->session->flashdata('messages'));
if (empty($positions)) {
    ?>
<div class="content_left">
	<h2><?php 
    echo e('admin_candidates_label');
    ?>
</h2>
</div>
<div class="content_right">
	<p class="align_right">
		<?php 
    echo anchor('admin/candidates/add', e('admin_candidates_add'));
    ?>
		| View:
		<?php 
    echo form_dropdown('election_id', array('' => 'Choose Election') + $elections, $election_id, 'class="changeElections" style="width: 130px;"');
    ?>
		<?php 
    echo form_dropdown('position_id', array('' => 'All Positions') + $pos, $position_id, 'class="changePositions" style="width: 100px;"');
    ?>
	</p>
</div>
<div class="clear"></div>
<table cellpadding="0" cellspacing="0" class="table">
	<tr>
		<th scope="col" class="w5">#</th>
		<th scope="col"><?php 
    echo e('admin_candidates_candidate');
Beispiel #4
0
<?php

echo display_messages(validation_errors('<li>', '</li>'), $this->session->flashdata('messages'));
echo form_open_multipart('admin/voters/import', array('class' => 'selectChosen'));
?>
<h2><?php 
echo e('admin_import_label');
?>
</h2>
<table cellpadding="0" cellspacing="0" border="0" class="form_table" width="100%">
	<tr>
		<td class="w20" align="right">
			<?php 
echo form_label(e('admin_import_block') . ':', 'block_id');
?>
		</td>
		<td>
			<!-- form_dropdown and set_select don't work together :( -->
			<select name="block_id" id="block_id">
				<option value="">Select Block</option>
				<?php 
foreach ($blocks as $block) {
    ?>
				<?php 
    echo '<option value="' . $block['id'] . '"';
    echo set_select('block_id', $block['id']);
    echo '>' . $block['block'] . '</option>';
    ?>
				<?php 
}
?>
Beispiel #5
0
function page_header_old($page_title, $page_id = false, $options = array())
{
    define('PAGE_RENDER_START', microtime(true));
    header('Content-type: text/html; charset=utf-8');
    $html_classes = array();
    if (has_required_admin()) {
        $html_classes[] = "body_admin";
    }
    $html_classes[] = get_site_config('site_id');
    if (is_admin()) {
        $html_classes[] = "is_admin";
    }
    ?>
<!DOCTYPE HTML>
<html<?php 
    echo " class=\"" . implode(" ", $html_classes) . "\"";
    ?>
>
<head>
    <title><?php 
    echo htmlspecialchars($page_title);
    if (has_required_admin()) {
        echo " [admin]";
    }
    ?>
</title>
    <link rel="stylesheet" type="text/css" href="<?php 
    echo htmlspecialchars(url_for('styles/generated.css' . '?' . get_site_config('openclerk_version')));
    ?>
" />
    <link rel="stylesheet" type="text/css" href="<?php 
    echo htmlspecialchars(url_for(get_site_config('default_css') . '?' . get_site_config('openclerk_version')));
    ?>
" />
    <?php 
    if (get_site_config('custom_css')) {
        ?>
    <link rel="stylesheet" type="text/css" href="<?php 
        echo htmlspecialchars(url_for(get_site_config('custom_css') . '?' . get_site_config('openclerk_version')));
        ?>
" />
    <?php 
    }
    ?>
    <?php 
    if (has_required_admin()) {
        ?>
    <link rel="stylesheet" type="text/css" href="<?php 
        echo htmlspecialchars(url_for('admin.css' . '?' . get_site_config('openclerk_version')));
        ?>
" />
    <?php 
    }
    ?>
    <?php 
    if (isset($options["refresh"])) {
        ?>
    <meta http-equiv="refresh" content="<?php 
        echo htmlspecialchars($options['refresh']);
        ?>
">
    <?php 
    }
    ?>
    <script type="text/javascript" src="<?php 
    echo htmlspecialchars(url_for('js/jquery-1.9.1.min.js'));
    ?>
"></script>
    <script type="text/javascript" src="<?php 
    echo htmlspecialchars(url_for('js/common.js' . '?' . get_site_config('openclerk_version')));
    ?>
"></script>
    <script type="text/javascript" src="<?php 
    echo htmlspecialchars(url_for('js/locale/' . I18n::getCurrentLocale() . '.js?' . get_site_config('openclerk_version')));
    ?>
"></script>
    <?php 
    if (isset($options['jsapi']) && $options['jsapi']) {
        ?>
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">
    <?php 
        $user = user_logged_in() ? get_user(user_id()) : false;
        if ($user) {
            if ($user['disable_graph_refresh'] || isset($graph_type['no_refresh']) && $graph_type['no_refresh']) {
                $timeout = 0;
                // disable refresh
            } else {
                $timeout = get_premium_value(get_user(user_id()), 'graph_refresh');
            }
        } else {
            $timeout = get_site_config('graph_refresh_public');
        }
        // TODO move this into a more helpful location rather than in the template head
        ?>
window.UserGraphRefresh = <?php 
        echo $timeout * 1000 * 60;
        ?>
;  // ms
    </script>
    <?php 
    }
    ?>
    <?php 
    if (isset($options["js"]) && $options["js"]) {
        if (!is_array($options['js'])) {
            $options['js'] = array($options['js']);
        }
        foreach ($options['js'] as $js) {
            $js_hash = "";
            if (strpos($js, "?") !== false) {
                $js_hash = "&" . substr($js, strpos($js, "?") + 1);
                $js = substr($js, 0, strpos($js, "?"));
            }
            ?>
    <script type="text/javascript" src="<?php 
            echo htmlspecialchars(url_for('js/' . $js . '.js' . '?' . get_site_config('openclerk_version') . $js_hash));
            ?>
"></script>
    <?php 
        }
    }
    ?>
  <?php 
    require_template("templates_head");
    ?>
  <?php 
    $head_compiled = __DIR__ . "/../site/head-compiled.html";
    if (file_exists($head_compiled)) {
        require $head_compiled;
    } else {
        // fix relative paths
        $input = file_get_contents(__DIR__ . "/head.html");
        $input = str_replace("src=\"", "src=\"" . htmlspecialchars(calculate_relative_path()), $input);
        echo $input;
    }
    ?>
</head>
<body<?php 
    if ($page_id) {
        echo ' id="' . $page_id . '"';
    }
    if (isset($options['class'])) {
        echo " class=\"" . htmlspecialchars($options['class']) . "\"";
    }
    ?>
>
<div class="body_wrapper">

<?php 
    require_template("templates_header");
    ?>

<div id="navigation">
<ul>
  <li class="home"><a href="<?php 
    echo url_for('index');
    ?>
" title="<?php 
    echo htmlspecialchars(get_site_config('site_name'));
    ?>
"><span class="text"><?php 
    echo htmlspecialchars(get_site_config('site_name'));
    ?>
</span></a></li>
  <?php 
    if (user_logged_in()) {
        ?>
    <li class="profile"><a href="<?php 
        echo url_for('profile');
        ?>
" title="<?php 
        echo ht("Your Reports");
        ?>
"><span class="text"><?php 
        echo ht("Your Reports");
        ?>
</span><span class="responsive-text"><?php 
        echo ht("Reports");
        ?>
</span></a></li>
    <li class="finance"><a href="<?php 
        echo url_for('your_transactions');
        ?>
" title="<?php 
        echo ht("Finance");
        ?>
"><span class="text"><?php 
        echo ht("Finance");
        ?>
</span></a></li>
    <li class="accounts"><a href="<?php 
        echo url_for('wizard_currencies');
        ?>
" title="<?php 
        echo ht("Configure Accounts");
        ?>
"><span class="text"><?php 
        echo ht("Configure Accounts");
        ?>
</span><span class="responsive-text"><?php 
        echo ht("Configure");
        ?>
</span></a></li>
    <li class="user"><a href="<?php 
        echo url_for('user');
        ?>
" title="<?php 
        echo ht("User Profile");
        ?>
"><span class="text"><?php 
        echo ht("User Profile");
        ?>
</span></a></li>
    <li class="logout"><a href="<?php 
        echo url_for('login', array('logout' => 1));
        ?>
" title="<?php 
        echo ht("Logout");
        ?>
"><span class="text"><?php 
        echo ht("Logout");
        ?>
</span></a></li>
    <?php 
        if (is_admin()) {
            ?>
      <li class="admin"><a href="<?php 
            echo url_for('admin');
            ?>
" title="<?php 
            echo ht("Admin");
            ?>
"><span class="text"><?php 
            echo ht("Admin");
            ?>
</span></a></li>
    <?php 
        }
        ?>
  <?php 
    } else {
        ?>
    <li class="signup"><a href="<?php 
        echo url_for('signup');
        ?>
" title="<?php 
        echo ht("Signup");
        ?>
"><span class="text"><?php 
        echo ht("Signup");
        ?>
</span></a></li>
    <li class="login"><a href="<?php 
        echo url_for('login');
        ?>
" title="<?php 
        echo ht("Login");
        ?>
"><span class="text"><?php 
        echo ht("Login");
        ?>
</span></a></li>
  <?php 
    }
    ?>
  <li class="premium"><a href="<?php 
    echo url_for('premium');
    ?>
" title="<?php 
    echo ht("Premium");
    ?>
"><span class="text"><?php 
    echo ht("Premium");
    ?>
</span></a></li>
  <li class="help"><a href="<?php 
    echo url_for('help');
    ?>
" title="<?php 
    echo ht("Help");
    ?>
"><span class="text"><?php 
    echo ht("Help");
    ?>
</span></a></li>
</ul>
</div>

<?php 
    if (did_autologin()) {
        ?>
<div id="autologin">
  <?php 
        echo t("Automatically logged in. Hi, :user!", array(':user' => "<a href=\"" . url_for('user') . "\" class=\"disabled\">" . ($_SESSION["user_name"] ? htmlspecialchars($_SESSION["user_name"]) : "<i>" . t("anonymous") . "</i>") . "</a>"));
        ?>
  (<a href="<?php 
        echo url_for('login', array('logout' => 1));
        ?>
"><?php 
        echo ht("This isn't me.");
        ?>
</a>)
</div>
<?php 
    }
    ?>

  <div id="page_content">
<?php 
    // always display messages on every page as necessary
    display_messages();
}
Beispiel #6
0
    $login_result = bronto_agency_login($acct->id);
    if (!$login_result) {
        echo "<error text=\"INVALID ACCOUNT\"/>\n";
    } else {
        $binding = $login_result['binding'];
        if ($disp_lists) {
            display_lists($binding);
        }
        if ($disp_fields) {
            display_fields($binding);
        }
        if ($disp_contacts) {
            display_contacts($binding, $disp_contact_fields);
        }
        if ($disp_messages) {
            display_messages($binding);
        }
        if ($disp_deliveries) {
            display_deliveries($binding);
        }
    }
    echo "</account>\n";
    $acct_num++;
    if ($max_accounts > 0 && $acct_num >= $max_accounts) {
        break;
    }
}
echo "</accounts>\n";
echo "</bronto-data>\n";
exit(0);
function display_lists($binding)
?>

<h2><?php 
$this->e('Adjust Admin Categories Settings', 'Adjust Admin Categories 設定');
?>
</h2>
<?php 
/**
 * エラーメッセージ
 */
//保存成功
if ($messages = get_transient('post-updated')) {
    display_messages($messages, 'updated');
    //保存失敗
} elseif ($messages = get_transient('post-error')) {
    display_messages($messages, 'error');
}
?>
<p><?php 
$this->e("The posts screen category box can be adjusted.", '投稿画面のカテゴリーボックスの調整ができます。');
?>
</p>

<ul class="aac_tab">
<?php 
foreach ($post_types as $post_type) {
    ?>
	
    <li class="aac_tab-<?php 
    echo $post_type->name;
    ?>