コード例 #1
0
    exit;
}
if (isset($_GET["EnableDNSMASQ"])) {
    EnableDNSMASQSave();
    exit;
}
if (isset($_POST["EnableDNSMASQOCSDB"])) {
    EnableDNSMASQOCSDB();
    exit;
}
if (isset($_GET["get-status"])) {
    status();
    exit;
}
if (isset($_GET["sub-status"])) {
    page_status();
    exit;
}
if (isset($_GET["sub-settings"])) {
    page_settings();
    exit;
}
if (isset($_GET["sub-events"])) {
    page_events();
    exit;
}
if (isset($_GET["localdomain-popup"])) {
    page_localdomains_popup();
    exit;
}
if (isset($_GET["localdomain-js"])) {
コード例 #2
0
ファイル: amavis.index.php プロジェクト: brucewu16899/artica
function main_page()
{
    $tpl = new templates();
    switch ($_GET["section"]) {
        case "smtp-domain-rule":
            echo main_domain_rule_single();
            break;
        case "events":
            echo main_events();
            break;
        case "config-file":
            echo main_config_amavisfile();
            break;
        case "global-settings":
            echo main_settings();
            break;
        case "events":
            echo main_events();
            break;
        case "global-status":
            echo page_status(1);
            break;
        default:
            echo main_settings();
            break;
    }
}
コード例 #3
0
</p>
	
	<?php 
echo article_html();
?>

	<?php 
if (user_authed()) {
    ?>
	<p class="edit">
		<a href="<?php 
    echo admin_url('posts/edit/' . article_id());
    ?>
">Edit this article</a>
		<?php 
    if (page_status() != 'published') {
        ?>
		<br>Your curretly viewing this post as <strong><?php 
        echo article_status();
        ?>
</strong>
		<?php 
    }
    ?>
	</p>
	<?php 
}
?>

</section>
コード例 #4
0
function status_table($title, $rows, $tracker, $config = null, $sections_breakdown, $milestone = null)
{
    ?>
	<div class="panel panel-default">
	<table class="dashboard table table-striped table-hover table-bordered">
		<tr class="dashboard-meta-heading">
			<td><?php 
    echo $title;
    ?>
</td>

			<?php 
    $colspan = $milestone->selected_milestone < '2014-11-30' ? '5' : '6';
    ?>
			<td colspan="<?php 
    echo $colspan;
    ?>
">
				Leading Indicators Strategy 
                <a href="<?php 
    echo site_url('docs') . '#leading_indicators_strategy';
    ?>
">
                    <span class="glyphicon glyphicon-info-sign"></span>
                </a>			
			</td>
			
			<td colspan="2" class="pdl-heading">
				Public Data Listing Metrics
                <a href="<?php 
    echo site_url('docs') . '#automated_metrics';
    ?>
">
                    <span class="glyphicon glyphicon-info-sign"></span>
                </a>				
			</td>
		</tr>
		<tr class="dashboard-heading">
			<th class="col-sm-3">		<div class="sr-only">Agency			</div></th>

			<?php 
    foreach ($sections_breakdown as $section_name => $section_title) {
        ?>
				<?php 
        if ($milestone->selected_milestone < '2014-11-30' && $section_name == 'ui') {
            continue;
        }
        ?>
				<th class="tilt"><div><?php 
        echo $section_title;
        ?>
</div></th>
			<?php 
    }
    reset($sections_breakdown);
    ?>

			<th class="tilt pdl-heading"><div>Public Datasets</div></th>
			<th class="tilt pdl-heading"><div>Valid Metadata</div></th>

		</tr>

		<?php 
    if ($milestone && !empty($milestone->selected_milestone)) {
        $milestone_url = '/' . $milestone->selected_milestone;
    }
    ?>



		<?php 
    foreach ($rows as $office) {
        ?>

		<?php 
        if (!empty($office->datajson_status)) {
            $office->datajson_status = json_decode($office->datajson_status);
        }
        if (!empty($office->datapage_status)) {
            $office->datapage_status = json_decode($office->datapage_status);
        }
        if (!empty($office->tracker_fields)) {
            $office->tracker_fields = json_decode($office->tracker_fields);
        }
        $json_http_code = !empty($office->datajson_status->http_code) ? $office->datajson_status->http_code : 0;
        $html_http_code = !empty($office->datapage_status->http_code) ? $office->datapage_status->http_code : 0;
        $status_color = http_status_color($json_http_code);
        $valid_json = !empty($office->datajson_status->valid_json) ? $office->datajson_status->valid_json : null;
        if ($valid_json !== true && $status_color == 'success') {
            $status_color = 'danger';
        }
        $valid_schema = !empty($office->datajson_status->valid_schema) ? $office->datajson_status->valid_schema : false;
        if ($valid_schema !== true && $valid_json === true) {
            $status_color = 'warning';
        }
        $html_status = http_status_color($html_http_code);
        $icon = null;
        if (isset($office->datajson_status->valid_json)) {
            $json_status = $office->datajson_status->valid_json == true ? 'success' : 'warning';
        } else {
            $json_status = '';
        }
        $error_count = !empty($office->datajson_status->error_count) ? $office->datajson_status->error_count : 0;
        $total_records = !empty($office->datajson_status->total_records) ? $office->datajson_status->total_records : '';
        $percent_valid = '';
        $percent_valid = !empty($total_records) ? ($total_records - $error_count) / $total_records : '';
        if ($percent_valid) {
            if ($percent_valid == 1 && $valid_schema === true) {
                $percent_valid = "100%";
                $schema_status = 'success';
            } else {
                if (!empty($error_count) && $valid_schema === false) {
                    if ($percent_valid < 0) {
                        $percent_valid = '0%';
                    } else {
                        $percent_valid = sprintf("%.1f%%", $percent_valid * 100);
                    }
                    $schema_status = 'warning';
                } else {
                    $percent_valid = '';
                    $schema_status = '';
                }
            }
        }
        if ($percent_valid === 0) {
            $percent_valid = "0%";
            $status_color = 'danger';
        }
        if (empty($percent_valid)) {
            if (!empty($office->tracker_fields->pdl_valid_metadata)) {
                $percent_valid = $office->tracker_fields->pdl_valid_metadata;
                $schema_status = $percent_valid == '100%' ? 'success' : 'warning';
            } else {
                $schema_status = '';
            }
        }
        if (empty($total_records)) {
            if (!empty($office->tracker_fields->pdl_datasets)) {
                $json_status = 'success';
                $total_records = $office->tracker_fields->pdl_datasets;
            } else {
                $json_status = '';
                $total_records = page_status('unknown');
            }
        }
        $json_icon = page_status($json_status);
        $schema_icon = page_status($schema_status);
        $page_icon = page_status($html_status);
        ?>

		<tr class="metrics-row">
			<th><a href="<?php 
        echo site_url('offices/detail');
        ?>
/<?php 
        echo $office->id . $milestone_url;
        ?>
"><?php 
        echo $office->name;
        ?>
</a></th>

			<?php 
        foreach ($sections_breakdown as $section_name => $section_title) {
            ?>

				<?php 
            if ($milestone->selected_milestone < '2014-11-30' && $section_name == 'ui') {
                continue;
            }
            $column = $section_name . '_aggregate_score';
            $highlight = $section_name . '_selected_best_practice';
            if (!empty($office->tracker_fields->{$highlight}) && $office->tracker_fields->{$highlight} == 'yes') {
                $cell_icon = 'highlight';
            } else {
                $cell_icon = !empty($office->tracker_fields->{$column}) ? $office->tracker_fields->{$column} : '';
            }
            $column_anchor = $section_name . '_tab';
            $section_selection = $section_name == 'pdl' ? '' : '?highlight=' . $section_name;
            ?>

				<td class="boolean-metric <?php 
            if (!empty($office->tracker_fields->{$column})) {
                echo status_color($office->tracker_fields->{$column});
            }
            ?>
 <?php 
            if ($cell_icon) {
                echo $cell_icon;
            }
            ?>
">
					<a href="<?php 
            echo site_url('offices/detail');
            ?>
/<?php 
            echo $office->id . $milestone_url;
            echo $section_selection . '#' . $column_anchor;
            ?>
">
						<span>
							<?php 
            if (!empty($office->tracker_fields->{$column})) {
                echo page_status($cell_icon);
            }
            ?>
&nbsp;
						</span>
					</a>
				</td>

			<?php 
        }
        reset($sections_breakdown);
        ?>

			<?php 
        if ($milestone->selected_milestone > '2014-11-30' && !empty($office->datajson_status->schema_version) && $office->datajson_status->schema_version == 'federal') {
            $version_flag = '<sup>&#10013;</sup>';
        } else {
            $version_flag = '';
        }
        ?>


			<td class="content-metric <?php 
        echo $json_status;
        ?>
"><a href="<?php 
        echo site_url('offices/detail');
        ?>
/<?php 
        echo $office->id . $milestone_url;
        ?>
#pdl_datasets"><span><?php 
        echo $total_records;
        ?>
&nbsp;</span></a></td>
			<td class="content-metric" style="<?php 
        echo metric_status_color($percent_valid, 'high', 20);
        ?>
"><a href="<?php 
        echo site_url('offices/detail');
        ?>
/<?php 
        echo $office->id . $milestone_url;
        ?>
#pdl_valid_metadata"><span><?php 
        echo !empty($percent_valid) ? $percent_valid : page_status('unknown');
        echo $version_flag;
        ?>
&nbsp;</span></a> </td>

		</tr>
		<?php 
    }
    ?>
	</table>
	</div>

<?php 
}
function status_table($title, $rows, $tracker, $config = null, $sections_breakdown, $subsections_breakdown, $milestone = null)
{
    ?>
	<div class="panel panel-default panel-dashboard">
	<table class="dashboard table table-striped table-hover table-bordered">

            <tr class="dashboard-meta-heading">
                <td scope="col"><?php 
    echo $title;
    ?>
</td>
                <?php 
    foreach ($sections_breakdown as $key => $name) {
        ?>
                    <td scope="colgroup" colspan="<?php 
        echo count($subsections_breakdown[$key]);
        ?>
" class="section-<?php 
        echo $key;
        ?>
">
                        <span><?php 
        echo $name;
        ?>
                        </span>
                        <?php 
        //only display for third milestone and onwards
        $milestone_index = 0;
        if (isset($milestone) && strtotime($milestone->selected_milestone)) {
            $milestone_index = intval(array_search($milestone->selected_milestone, array_keys($milestone->milestones))) + 1;
        }
        ?>
</td>
                <?php 
    }
    ?>

            </tr>
            <tr class="dashboard-heading">

                    <th scope="col" class="col-sm-3"><div class="sr-only">Agency</div></th>

                    <?php 
    foreach ($subsections_breakdown as $section_name => $subsections) {
        ?>
                        <?php 
        foreach ($subsections as $subsection) {
            ?>
                            <th scope="col" class="tilt <?php 
            if ($subsection->label == 'Submission Status') {
                echo 'ss_custom_width';
            }
            ?>
">
                              <div>
                                <?php 
            echo $subsection->label;
            ?>
                                <?php 
            if ($subsection->due_date) {
                echo "<span>{$subsection->due_date}</span>";
            }
            ?>
                              </div>
                            </th>
                        <?php 
        }
        ?>
                    <?php 
    }
    reset($subsections_breakdown);
    ?>

            </tr>

            <?php 
    if ($milestone && !empty($milestone->selected_milestone)) {
        $milestone_url = '/';
        $ci = get_instance();
        //get code igniter instance
        if ($ci->session->userdata('permissions') === 'admin') {
            $milestone_url = '/' . $milestone->selected_milestone;
        }
        unset($ci);
    }
    ?>

            <?php 
    foreach ($rows as $office) {
        ?>

		<?php 
        if (!empty($office->tracker_fields)) {
            $office->tracker_fields = json_decode($office->tracker_fields);
        }
        ?>

		<tr class="metrics-row">

                    <th scope="row"><a href="<?php 
        echo site_url('offices/detail');
        ?>
/<?php 
        echo $office->id . $milestone_url;
        ?>
" title="Link to <?php 
        echo $office->name;
        ?>
 detail"><?php 
        echo $office->name;
        ?>
</a></th>

                    <?php 
        foreach ($subsections_breakdown as $section_name => $subsections) {
            ?>
                        <?php 
            foreach ($subsections as $subsection) {
                ?>

                            <?php 
                $status = '';
                if ($subsection->label === 'Self-Assessment') {
                    $status = @$office->tracker_fields->cb_self_assessment;
                } elseif ($subsection->label === 'Implementation Plan') {
                    $status = @$office->tracker_fields->cb_implementation_plan;
                } else {
                    if ($subsection->label === 'CIO Assignment Plan (If Applicable)') {
                        $status = @$office->tracker_fields->cb_cio_assignment_plan;
                    } elseif ($subsection->label === 'Bureau IT Leadership') {
                        $status = @$office->tracker_fields->pa_bureau_it_leadership;
                    } elseif ($subsection->label === 'CIO Governance Board List') {
                        $status = @$office->tracker_fields->pa_cio_governance_board;
                    } else {
                        if ($subsection->label === 'IT Policy Archive') {
                            $status = @$office->tracker_fields->pa_it_policy_archive;
                        } else {
                            if ($subsection->label === '# of Listserv Members') {
                                $status = @$office->tracker_fields->ci_listserv_members;
                            } else {
                                if ($subsection->label === 'Submission Status') {
                                    $status = @$office->tracker_fields->ss_submission_status;
                                }
                            }
                        }
                    }
                }
                $column_anchor = $section_name . '_tab';
                $subsection_selection = $section_name == 'pdl' ? '' : '?highlight=' . $section_name;
                if ($subsection->label === 'GAO Recommendations' || $subsection->label === '# of Listserv Members') {
                    $metric_type = 'number-metric';
                } else {
                    $metric_type = 'boolean-metric';
                }
                ?>

                            <td class="<?php 
                echo $metric_type;
                ?>
 <?php 
                if (!empty($status) && !is_numeric($status)) {
                    echo status_color($status);
                }
                ?>
 <?php 
                if ($status) {
                    echo $status;
                }
                ?>
">
                                <a href="<?php 
                echo site_url('offices/detail');
                ?>
/<?php 
                echo $office->id . $milestone_url;
                echo $subsection_selection . '#' . $column_anchor;
                ?>
" title="Link to <?php 
                echo $subsection->label;
                ?>
">
                                    <span class="<?php 
                echo $status;
                ?>
">
                                        <?php 
                // TO DO - once the gr_open_gao_recommendations value is set correctly
                // in tracker_fields, use that instead.
                $rec_status = json_decode($office->recommendation_status);
                if ($subsection->label === 'GAO Recommendations') {
                    echo isset($rec_status->tracker_fields->gr_open_gao_recommendations) ? $rec_status->tracker_fields->gr_open_gao_recommendations : '';
                } elseif ($subsection->label === '# of Listserv Members') {
                    echo $status;
                } elseif (!empty($status)) {
                    echo page_status($status);
                }
                ?>
&nbsp;
                                    </span>
                                </a>
                            </td>

                        <?php 
            }
            ?>
                    <?php 
        }
        reset($subsections_breakdown);
        ?>

		</tr>
            <?php 
    }
    ?>
	</table>
	</div>

    <?php 
}
コード例 #6
0
ファイル: page.php プロジェクト: rubenvincenten/anchor-site
<section class="content">
	<?php 
echo page_content();
?>

	<?php 
if (user_authed()) {
    ?>
	<p class="edit">
		<a href="<?php 
    echo admin_url('pages/edit/' . page_id());
    ?>
">Edit this page</a>
		<?php 
    if (page_status() != 'published') {
        ?>
		<br>Your curretly viewing this page as <strong><?php 
        echo page_status();
        ?>
</strong>
		<?php 
    }
    ?>
	</p>
	<?php 
}
?>
</section>