function _checkFor_browse_list($func_name, $list_type, $list_title, &$ary, $captured_length, $query = false)
 {
     global $bx, $t;
     // setup the database objects
     $cnt = count($ary);
     $q = $query ? $query : "SELECT COUNT(*) FROM tech_content " . "WHERE {$list_type}='%s' AND status='A'";
     $db_config = new mock_db_configure($cnt);
     $row = $this->_generate_records(array("COUNT(*)"), $cnt);
     for ($idx = 0; $idx < $cnt; $idx++) {
         $db_config->add_query(sprintf($q, $ary[$idx]), $idx);
         $row[$idx]['COUNT(*)'] = $idx;
         $db_config->add_record($row[$idx], $idx);
     }
     // create a box and call the function
     $bx = $this->_create_default_box();
     $this->capture_call($func_name, $captured_length);
     // check the contents of the output
     $this->_checkFor_a_box($list_title);
     $this->_checkFor_common_column_titles($list_title);
     $colors = array(0 => 'gold', 1 => '#FFFFFF');
     for ($idx = 0; $idx < $cnt; $idx++) {
         $bgc = $colors[$idx % 2];
         $num = sprintf('[%03d]', $row[$idx]['COUNT(*)']);
         $this->_testFor_box_column('right', '', $bgc, $idx + 1);
         if ($num != "[000]") {
             $this->_testFor_box_column('center', '', $bgc, html_link('browse.php3', array('through' => $list_type, $list_type => $ary[$idx]), $num));
         } else {
             $this->_testFor_box_column('center', '', $bgc, $num);
         }
         $this->_testFor_box_column('left', '', $bgc, $ary[$idx]);
     }
     $this->_check_db($db_config);
 }
Beispiel #2
0
 /**
  * @param Request $request
  * @return \Illuminate\Http\JsonResponse
  */
 public function postIndex(Request $request)
 {
     $status = [0 => trans('backend::common.non_active'), 1 => trans('backend::common.active')];
     $query = UserModel::query();
     $recordsTotal = $query->count();
     $filters = $request->input('filter', []);
     if (!empty($filters['id'])) {
         $query->where('id', '=', $filters['id']);
     }
     if (array_key_exists('active', $filters) && $filters['active'] !== '') {
         $query->where('active', '=', $filters['active']);
     }
     if (!empty($filters['email'])) {
         strpos($filters['email'], '%') !== false ? $query->where('email', 'like', $filters['email']) : $query->where('email', '=', strtolower($filters['email']));
     }
     $recordsFiltered = $query->count();
     $query->limit($request->input('length', 25))->offset($request->input('start', 0));
     $query->orderBy('id', 'desc');
     $collection = $query->get();
     $result = [];
     foreach ($collection as $item) {
         $edit_link = relative_route('backend.backend.users.edit', ['id' => $item->id]);
         $edit_link_html = html_link($edit_link, '<i class="fa fa-pencil"></i>', ['rel' => 'ajax-portlet', 'class' => 'btn btn-sm green', 'title' => trans('backend::common.buttons.edit')]);
         $destroy_link = relative_route('backend.backend.users.destroy', ['id' => $item->id]);
         $destroy_link_html = html_link($destroy_link, '<i class="fa fa-trash-o"></i>', ['rel' => 'destroy', 'class' => 'btn btn-sm red', 'title' => trans('backend::common.buttons.destroy')]);
         $result[] = [$item->id, $item->name, $item->email, array_key_exists($item->active, $status) ? $status[$item->active] : $item->active, $edit_link_html . $destroy_link_html];
     }
     $data = ['data' => $result, 'recordsTotal' => $recordsTotal, 'recordsFiltered' => $recordsFiltered, 'draw' => $request->input('draw')];
     return \Response::json($data, 200, [], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
 }
Beispiel #3
0
 /**
  * Loads the gateway form fields into tabs
  * @param  string $gateway Gateway identifier
  * @return array           Array for the checkbox to enable the gateway
  */
 function load_gateway_tabs($gateway)
 {
     $form_values = $gateway->form();
     $nicename = $gateway->identifier();
     if (array_key_exists('fields', $form_values)) {
         // Wrap values
         foreach ($form_values['fields'] as $key => $block) {
             $value = $block['name'];
             $form_values['fields'][$key]['name'] = array('gateways', $nicename, $value);
         }
         $this->tab_sections[$nicename]['general_settings'] = $form_values;
     } else {
         // Wrap values
         foreach ($form_values as $s_key => $section) {
             foreach ($section['fields'] as $key => $block) {
                 $value = $block['name'];
                 $form_values[$s_key]['fields'][$key]['name'] = array('gateways', $nicename, $value);
             }
         }
         $this->tab_sections[$nicename] = $form_values;
     }
     // Only add a tab for gateways with a form
     $title = $gateway->display_name('admin');
     if ($form_values) {
         $this->tabs->add($nicename, $title);
         $title = html_link(add_query_arg(array('page' => $this->args['page_slug'], 'tab' => $nicename), 'admin.php'), $title);
     }
     return array('title' => $title, 'type' => 'checkbox', 'desc' => __('Enable', APP_TD), 'name' => array('gateways', 'enabled', $nicename));
 }
Beispiel #4
0
 static function linked_names($name, $user)
 {
     if (!$user->user_id) {
         return $name;
     }
     return html_link(get_author_posts_url($user->user_id), $name);
 }
 protected function row($item)
 {
     if (!APP_Item_Registry::is_registered($item['type'])) {
         return html('tr', array(), html('td', array('colspan' => '3', 'style' => 'font-style: italic;'), __('This item could not be recognized. It might be from another theme or an uninstalled plugin.', APP_TD)));
     }
     $ptype_obj = get_post_type_object($item['post']->post_type);
     $item_link = $ptype_obj->public ? html_link(get_permalink($item['post_id']), $item['post']->post_title) : '';
     $cells = array(APP_Item_Registry::get_title($item['type']), appthemes_get_price($item['price'], $this->currency), $item_link);
     return html('tr', array(), $this->cells($cells));
 }
Beispiel #6
0
function module_top_referer($arguments)
{
    global $gDb, $gData;
    global $lvc_nb_top_referer;
    global $lvc_display_cache_delay;
    global $lvc_table_visitors;
    global $lvm_top_referer, $lvm_referer, $lvm_number;
    $is_archived = $arguments['archive'];
    if ($is_archived) {
        $values = explode("+", $gData['topRef']);
        $limit = sizeof($values) / 2;
        for ($cnt = 0; $cnt < $limit; $cnt++) {
            $row[$cnt]['referer'] = strip_tags($values[2 * $cnt]);
            $row[$cnt]['nb'] = $values[2 * $cnt + 1];
        }
    } else {
        $month = $arguments['month'];
        $year = $arguments['year'];
        $query = "SELECT REF_HOST, COUNT(*) AS C ";
        $query .= "FROM " . $lvc_table_visitors . " ";
        $query .= "WHERE REF_HOST <> '' AND REF_HOST <> '[unknown origin]' AND REF_HOST <> 'bookmarks' ";
        $query .= "AND DATE LIKE '" . $year . "/" . sprintf("%02d", $month) . "/%' ";
        $query .= "GROUP BY REF_HOST ";
        $query .= "ORDER BY C DESC, REF_HOST ";
        if ($gDb->DbQuery($query, 0, $lvc_nb_top_referer) && $gDb->DbNumRows() != 0) {
            $cnt = 0;
            while ($gDb->DbNextRow()) {
                $record = $gDb->Row;
                $row[$cnt]['referer'] = strip_tags($record['REF_HOST']);
                $row[$cnt]['nb'] = $record['C'];
                $cnt++;
            }
        }
    }
    $buffer = "<BR><CENTER><TABLE CELLSPACING=1 BORDER=0>\n";
    $buffer .= "<TR><TD COLSPAN=2><A CLASS='array'>";
    $buffer .= str_replace("{NB_TOP_REFERER}", $lvc_nb_top_referer, $lvm_top_referer) . "</A></TD></TR>\n";
    $buffer .= "<TR>";
    $buffer .= "<TH CLASS='vis'>" . $lvm_referer . "</TH>";
    $buffer .= "<TH CLASS='vis'>&nbsp;" . $lvm_number . "&nbsp;</TH></TR>\n";
    for ($cnt = 0; $cnt < $lvc_nb_top_referer; $cnt++) {
        $buffer .= "<TR>";
        $buffer .= "<TD CLASS='vis'>&nbsp;<A CLASS='host'>" . html_link($row[$cnt]['referer'], $row[$cnt]['referer'], '_blank') . "</A>&nbsp;</TD>";
        $buffer .= "<TD CLASS='vis' ALIGN='right'>&nbsp;" . ($row[$cnt]['nb'] != 0 ? number_format($row[$cnt]['nb'], 0, '', ' ') : '') . "&nbsp;</TD>";
        $buffer .= "</TR>\n";
    }
    // cache delay
    if ($lvc_display_cache_delay) {
        $buffer .= "<TR><TD ALIGN='center' COLSPAN='2'>";
        $buffer .= "<A CLASS='delay'>" . cache_delay($arguments['cache']) . "</A>";
    }
    $buffer .= "</TABLE></CENTER><BR>\n";
    return $buffer;
}
function html_horizontalnavigation($nav = '')
{
    debug_msg("FUNCTION: " . __FUNCTION__, 3);
    if ($nav !== '') {
        // Start the table
        echo '<table class="hnav"><tr>';
        foreach ($nav as $item) {
            echo '<td class="hnav">';
            html_link($item[0], $item[1], $item[2], $item[3]);
            echo '</td>';
        }
        // Finish off the table
        echo '</tr></table>';
    }
}
 function display_column($column, $post_id)
 {
     if ($this->ctype->name != $column) {
         return;
     }
     $opposite_direction = array('from' => 'to', 'to' => 'from', 'any' => 'any');
     echo '<ul>';
     foreach ($this->connected[$post_id] as $post) {
         $direction = $opposite_direction[$this->ctype->get_direction()];
         $args = array('post_type' => get_post_type($post_id), 'connected_type' => $this->ctype->name, 'connected_items' => $post->ID, 'connected_direction' => $direction);
         $url = add_query_arg($args, admin_url('edit.php'));
         echo html('li', html_link($url, $post->post_title));
     }
     echo '</ul>';
 }
Beispiel #9
0
 protected function render_column($column, $item_id)
 {
     if ($this->column_id != $column) {
         return;
     }
     if (!isset($this->connected[$item_id])) {
         return;
     }
     $out = '<ul>';
     foreach ($this->connected[$item_id] as $item) {
         $out .= html('li', html_link($this->get_admin_link($item), $item->get_title()));
     }
     $out .= '</ul>';
     return $out;
 }
Beispiel #10
0
 function page_content()
 {
     if (isset($_GET['step']) && 1 == $_GET['step']) {
         $this->import();
     }
     if (defined('WP_DEBUG') && isset($_GET['step']) && 'export' == $_GET['step']) {
         $wud = wp_upload_dir();
         $name = '/export-' . substr(md5(rand()), 0, 8) . '.csv';
         $this->export($wud['basedir'] . $name);
         echo scb_admin_notice('CSV Generated: ' . html_link($wud['baseurl'] . $name));
     }
     echo '<div class="narrow">';
     echo '<p>' . __("Howdy! Upload a CSV file containing your data and we'll import it into this site. The file must be in the correct format for the import to work.", APP_TD) . '</p>';
     $this->import_upload_form(add_query_arg(array('step' => '1')));
     echo '</div>';
 }
Beispiel #11
0
function account_header($title)
{
    global $PHP_SELF, $LOGIN_USER, $LOGIN_LEVEL;
    html_header("{$title}");
    html_start_links(1);
    html_link("{$LOGIN_USER}", "{$PHP_SELF}");
    html_link("Change Password", "{$PHP_SELF}?P");
    if ($LOGIN_LEVEL == AUTH_ADMIN) {
        html_link("Manage Accounts", "{$PHP_SELF}?A");
    }
    if ($LOGIN_LEVEL > AUTH_USER) {
        html_link("New/Pending", "{$PHP_SELF}?L");
    }
    html_link("Logout", "{$PHP_SELF}?X");
    html_end_links();
}
function appthemes_bank_transfer_pending_email($post)
{
    $content = '';
    $content .= html('p', __('A new order is waiting to be processed. Once you recieve payment, you should mark the order as completed.', APP_TD));
    $order_link = html_link(get_edit_post_link($post), __('Review this order', APP_TD));
    $all_orders = html_link(admin_url('edit.php?post_status=tr_pending&post_type=transaction'), __('review all pending orders', APP_TD));
    // translators: <Single Order Link> or <Link to All Orders>
    $content .= html('p', sprintf(__('%1$s or %2$s', APP_TD), $order_link, $all_orders));
    $subject = sprintf(__('[%1$s] Pending Order #%2$d', APP_TD), get_bloginfo('name'), $post->ID);
    if (!function_exists('appthemes_send_email')) {
        return false;
    }
    $email = array('to' => get_option('admin_email'), 'subject' => $subject, 'message' => $content);
    $email = apply_filters('appthemes_email_admin_bt_pending', $email, $post);
    appthemes_send_email($email['to'], $email['subject'], $email['message']);
}
Beispiel #13
0
 function page_content()
 {
     if (isset($_GET['step']) && 1 == $_GET['step']) {
         $this->import();
     }
     if (defined('WP_DEBUG') && isset($_GET['step']) && 'export' == $_GET['step']) {
         $wud = wp_upload_dir();
         $name = '/export-' . substr(md5(rand()), 0, 8) . '.csv';
         $this->export($wud['basedir'] . $name);
         echo scb_admin_notice('CSV Generated: ' . html_link($wud['baseurl'] . $name));
     }
     echo '<div class="narrow">';
     echo '<p>' . __('Below you will find a tool which allows you to import content from other systems via a CSV (comma-separated values) file, which can be edited using a program like Excel. Note that the file must be in the correct format for the import tool to work. You will find an example .csv file in the "examples" theme folder.', 'appthemes') . '</p>';
     echo '<p>' . __('Choose a CSV file to upload, then click "Upload file and import".', 'appthemes') . '</p>';
     wp_import_upload_form('admin.php?page=app-importer&amp;step=1');
     echo '</div>';
 }
Beispiel #14
0
function module_last_months($arguments)
{
    global $lvc_nb_last_months;
    global $lvc_site_opening_month;
    global $lvc_site_opening_year;
    global $lvm_month, $lvm_archived, $lvm_arr_months;
    $buffer = '';
    $month = date('n');
    $year = date('Y');
    $finished = false;
    $buffer .= "<TABLE CELLSPACING=0 BORDER=0>\n";
    for ($count = 1; $count <= $lvc_nb_last_months; $count++) {
        $buffer .= "<TR><TD>&nbsp;";
        if ($finished) {
            $archive = '';
        } else {
            $data = archive_month($month, $year, 'code');
            if ($data[0] == NO_ARCHIVE) {
                $archive = '';
            } elseif ($data[0] == DB_ERROR) {
                $archive = '<A CLASS="archived">[?]</A>';
            } else {
                $archive = '<A CLASS="archived">[' . $lvm_archived . ']</A>';
            }
        }
        if (!$finished) {
            $finished = $month == $lvc_site_opening_month && $year == $lvc_site_opening_year;
            $the_month = $month < 10 ? "0" . $month : $month;
            $link = "./?view=month&year=" . $year . "&month=" . $the_month;
            $buffer .= '&nbsp;' . html_link($link, html_image('images/' . ICON_PUCE)) . '&nbsp;';
            $buffer .= "<A HREF='" . $link . "'>";
            $buffer .= $lvm_arr_months[$month];
            $buffer .= " " . $year;
            $buffer .= "</A>";
            $month = $month == 1 ? 12 : $month - 1;
            $year = $month == 12 ? $year - 1 : $year;
        }
        $buffer .= "&nbsp;</TD><TD ALIGN='center'>&nbsp;";
        $buffer .= $archive;
        $buffer .= "&nbsp;</TD></TR>";
    }
    $buffer .= "</TABLE>";
    return $buffer;
}
Beispiel #15
0
function module_top_day_referer($arguments)
{
    global $gDb, $gData;
    global $lvc_nb_top_referer;
    global $lvc_display_cache_delay;
    global $lvc_table_visitors;
    global $lvm_top_referer, $lvm_referer, $lvm_number, $lvm_today;
    $date = !isset($arguments['date']) ? date('Y/m/d') : str_replace('-', '/', $arguments['date']);
    $query = "SELECT REF_HOST, COUNT(*) AS C ";
    $query .= "FROM " . $lvc_table_visitors . " ";
    $query .= "WHERE REF_HOST <> '' AND REF_HOST <> '[unknown origin]' AND REF_HOST <> 'bookmarks' ";
    $query .= "AND DATE LIKE '" . $date . "%' ";
    $query .= "GROUP BY REF_HOST ";
    $query .= "ORDER BY C DESC, REF_HOST ";
    if ($gDb->DbQuery($query, 0, $lvc_nb_top_referer) && $gDb->DbNumRows() != 0) {
        $cnt = 0;
        while ($gDb->DbNextRow()) {
            $record = $gDb->Row;
            $row[$cnt]['referer'] = strip_tags($record['REF_HOST']);
            $row[$cnt]['nb'] = $record['C'];
            $cnt++;
        }
    }
    $buffer = "<BR><CENTER><TABLE CELLSPACING=1 BORDER=0>\n";
    $buffer .= "<TR><TD COLSPAN=2><A CLASS='array'>";
    $buffer .= str_replace("{NB_TOP_REFERER}", $lvc_nb_top_referer, $lvm_top_referer) . " - " . $lvm_today . "</A></TD></TR>\n";
    $buffer .= "<TR>";
    $buffer .= "<TH CLASS='vis'>" . $lvm_referer . "</TH>";
    $buffer .= "<TH CLASS='vis'>&nbsp;" . $lvm_number . "&nbsp;</TH></TR>\n";
    for ($cnt = 0; $cnt < $lvc_nb_top_referer; $cnt++) {
        $buffer .= "<TR>";
        $buffer .= "<TD CLASS='vis'>&nbsp;<A CLASS='host'>" . html_link($row[$cnt]['referer'], $row[$cnt]['referer'], '_blank') . "</A>&nbsp;</TD>";
        $buffer .= "<TD CLASS='vis' ALIGN='right'>&nbsp;" . ($row[$cnt]['nb'] != 0 ? number_format($row[$cnt]['nb'], 0, '', ' ') : '') . "&nbsp;</TD>";
        $buffer .= "</TR>\n";
    }
    // cache delay
    if ($lvc_display_cache_delay) {
        $buffer .= "<TR><TD ALIGN='center' COLSPAN='2'>";
        $buffer .= "<A CLASS='delay'>" . cache_delay($arguments['cache']) . "</A>";
    }
    $buffer .= "</TABLE></CENTER><BR>\n";
    return $buffer;
}
 public static function duplicate($original)
 {
     $duplicate = self::make($original->get_description());
     $duplicate->set_gateway($original->get_gateway());
     $duplicate->set_currency($original->get_currency());
     $duplicate->set_author($original->get_author());
     if ($original->is_recurring()) {
         $duplicate->set_recurring_period($original->get_recurring_period());
     }
     foreach ($original->get_items() as $item) {
         $duplicate->add_item($item['type'], $item['price'], $item['post_id']);
     }
     if ($original->get_id() != 0) {
         $original->log('Order Duplicated. Created ' . html_link(get_edit_post_link($duplicate->get_id()), 'Order #' . $duplicate->get_id()), 'info');
         $duplicate->log('Order Duplicated from ' . html_link(get_edit_post_link($original->get_id()), 'Order #' . $original->get_id()), 'info');
     }
     do_action('appthemes_create_order_duplicate', $duplicate, $original);
     return $duplicate;
 }
Beispiel #17
0
 function redirect($uri = '', $method = 'location', $http_response_code = 302)
 {
     $V =& get_instance();
     if ($uri == '') {
         $uri = base_url();
     } else {
         if (!preg_match('#^https?://#i', $uri)) {
             $uri = html_link(str_replace($V->config->item('suff'), '', $uri));
         }
     }
     switch ($method) {
         case 'refresh':
             header("Refresh:0;url=" . $uri);
             break;
         default:
             header("Location: " . $uri, TRUE, $http_response_code);
             break;
     }
     exit;
 }
 function test_make_search_links()
 {
     // Defaults
     $this->assertTrue(is_array(make_search_links('', 'x:%s')));
     $this->assertEqual(make_search_links('', 'x:%s'), array(), 'empty: %s');
     // Scalar
     $this->assertEqual(make_search_links('foo', 'x:%s'), array(html_link('x:foo', 'foo')), 'scalar: %s');
     // Simple array
     $this->assertEqual(make_search_links(array('foo', 'bar'), 'x:%s'), array(html_link('x:foo', 'foo'), html_link('x:bar', 'bar')), 'simple array: %s');
     $this->assertEqual(make_search_links(array(), 'x:%s'), array(), 'empty array: %s');
     // 2D array
     $test = array(array('key' => 'F', 'title' => 'foo'), array('key' => 'B', 'title' => 'bar'));
     $expect = array(html_link('x:F', 'foo'), html_link('x:B', 'bar'));
     $this->assertEqual(make_search_links($test, 'x:%s'), $expect, '2D array: %s');
     // 2D with override
     $test = array(array('a' => 'F', 'b' => 'foo'), array('a' => 'B', 'b' => 'bar'));
     $this->assertEqual(make_search_links($test, 'x:%s', 'a', 'b'), $expect, '2D array with different keys: %s');
     // URLs are escaped
     $this->assertEqual(make_search_links('foo bar', 'x:%s'), array(html_link('x:foo+bar', 'foo bar')), 'escaping: %s');
     // Missing title defaults to key
     $this->assertEqual(make_search_links(array('key' => 'foo'), 'x:%s'), array(html_link('x:foo', 'foo')), 'missing title: %s');
 }
Beispiel #19
0
# This is the index file which shows the recent apps
#
# This program is free software. You can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 or later of the GPL.
######################################################################
require 'include/prepend.php3';
page_open(array("sess" => "SourceAgency_Session"));
if (isset($auth) && !empty($auth->auth["perm"])) {
    page_close();
    page_open(array("sess" => "SourceAgency_Session", "auth" => "SourceAgency_Auth", "perm" => "SourceAgency_Perm"));
}
require 'include/header.inc';
require 'include/contentlib.inc';
require 'include/developinglib.inc';
require 'include/decisionslib.inc';
$bx = new box('100%', $th_box_frame_color, $th_box_frame_width, $th_box_title_bgcolor, $th_box_title_font_color, $th_box_title_align, $th_box_body_bgcolor, $th_box_body_font_color, $th_box_body_align);
start_content();
$page = 'specifications';
if (check_proid($proid)) {
    top_bar($proid, $page);
    print $t->translate('Technical specification suggestions. They can ' . 'be made either by developers or by a sponsor ' . '(if the sponsor is owner of the project).') . "\n";
    print '<p align=right>[<b> ' . html_link('step2_edit.php', array('proid' => $proid), $t->translate('Suggest a Technical Specification')) . " </b>] &nbsp;<p>\n";
    show_content($proid, $show_proposals, $which_proposals);
    if (is_accepted_sponsor($proid)) {
        create_decision_link($proid);
    }
}
end_content();
require 'include/footer.inc';
@page_close();
    echo html_link('view all posts', 'browse');
    ?>
					&ensp;&middot;&ensp;
					<?php 
    echo html_link('search posts', 'search');
    ?>
					&ensp;&middot;&ensp;
					<?php 
    echo html_link('login', 'login');
    ?>
				<?php 
}
?>
				&ensp;&middot;&ensp;
				<?php 
echo html_link('<img src="rss.png" alt="RSS Feed" />', 'rss');
?>
			</p>
			
			<hr />

			<!-- Error messages -->
			<?php 
if (count($errors) > 0) {
    ?>
				<ul class="errors">
					<?php 
    foreach ($errors as $error) {
        ?>
						<li><?php 
        echo $error;
Beispiel #21
0
 private static function format_link($url, $title)
 {
     if (!empty($url)) {
         return '[' . html_link($url, $title) . ']';
     }
     return '';
 }
     $bx->box_body_end();
     $bx->box_end();
 } else {
     $db->next_record();
     $reqsubject = $db->f("reqsubject");
     //$bs->box_strip($t->translate("Show request"));
     $bx->box_begin();
     $bx->box_body_begin();
     $bx->box_columns_begin(2);
     $bx->box_colspan(2, "center", $th_strip_title_bgcolor, "<b>" . $reqsubject . "</b>", "");
     $bgcolor = "#FFFFFF";
     $bx->box_next_row_of_columns();
     $bx->box_column("left", "30%", $bgcolor, "<B>" . $t->translate("Developer") . ":</B> &nbsp; ");
     $reqdev = $db->f("username");
     $pquery["devname"] = $db->f("username");
     $bx->box_column("left", "70%", $bgcolor, html_link("showprofile.php", $pquery, $reqdev));
     $bx->box_next_row_of_columns();
     $bx->box_column("left", "", $bgcolor, "<B>" . $t->translate("Project") . ":</B> &nbsp; ");
     $projectname = $db->f("projectname");
     if ($projectname != "none") {
         $db2->query("SELECT * FROM os_projects WHERE username='******' AND projectname='{$projectname}'");
         $db2->next_record();
         if (ereg("://", $db2->f("url"))) {
             $bx->box_column("left", "", $bgcolor, "<A HREF=\"" . $db2->f("url") . "\">" . $db2->f("projectname") . "</A><BR> &nbsp; (" . $db2->f("comment") . ")");
         } else {
             $bx->box_column("left", "", $bgcolor, "<A HREF=\"http://" . $db2->f("url") . "\">" . $db2->f("projectname") . "</A><BR> &nbsp; (" . $db2->f("comment") . ")");
         }
     } else {
         $bx->box_column("left", "", $bgcolor, "none");
     }
     $bx->box_next_row_of_columns();
 function testShow_admprojects()
 {
     global $bx, $t, $sess;
     $db_config = new mock_db_configure(33);
     $qs = array(0 => "SELECT * FROM description,auth_user WHERE status='0' " . "AND description_user=username", 1 => "SELECT * FROM configure WHERE proid = '%s'", 2 => "SELECT perms FROM auth_user WHERE username='******'", 3 => "SELECT * FROM %s WHERE proid = '%s'");
     $d = $this->_generate_records(array('perms', 'project_title', 'proid', 'type', 'description', 'volume', 'description_user', 'description_creation'), 8);
     $d2 = $this->_generate_records(array('perms'), 8);
     $table = array(0 => 'sponsoring', 1 => 'developing');
     $bgc = array(0 => '#FEDCBA', 1 => '#ABCDEF');
     for ($idx = 0; $idx < count($d); $idx++) {
         // tests 2 to 5 involve the sponsor, 5 to 9 the developer
         $d[$idx]['perms'] = $idx < 4 ? 'sponsor' : 'devel';
         // user permission toggles between sponsor and developer
         $d2[$idx]['perms'] = $idx % 2 ? 'devel' : 'sponsor';
     }
     // for test one
     $db_config->add_query($qs[0], 0);
     $db_config->add_num_row(0, 0);
     // the following is code for defining the queries which in implicately
     // set the value of the configured variable. The first 4 are for the
     // sponsor, the next four for the developer.
     // configured==  3    2    1    0    1    0    2    3
     $nr_q2 = array(0 => 1, 1 => 0, 2 => 1, 3 => 0, 4 => 1, 5 => 0, 6 => 0, 7 => 1);
     $nr_q4 = array(0 => 1, 1 => 1, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 1, 7 => 1);
     for ($idx = 0; $idx < count($d); $idx++) {
         $inst_idx = $idx * 4;
         $db_config->add_query($qs[0], $inst_idx + 1);
         $db_config->add_record($d[$idx], $inst_idx + 1);
         $db_config->add_num_row(1, $inst_idx + 1);
         $db_config->add_query(sprintf($qs[1], $d[$idx]['proid']), $inst_idx + 2);
         $db_config->add_num_row($nr_q2[$idx], $inst_idx + 2);
         $db_config->add_query(sprintf($qs[2], $d[$idx]['description_user']), $inst_idx + 3);
         $db_config->add_record($d2[$idx], $inst_idx + 3);
         $db_config->add_query(sprintf($qs[3], $table[$idx % 2], $d[$idx]['proid']), $inst_idx + 4);
         $db_config->add_num_row($nr_q4[$idx], $inst_idx + 4);
     }
     // test one, no projects
     $bx = $this->_create_default_box();
     $this->capture_call('show_admprojects', 780);
     $this->_checkFor_box_full($t->translate('Pending Project Administration'), $t->translate('No pending projects'));
     // test two, test using the sponsor, configured == 3
     $this->_call_show_admprojects(4800 + strlen($sess->self_url()), $d[0], $bgc[0]);
     $co = '<b>' . $t->translate('Yes') . '</b><br>' . html_link($table[0] . '.php3', array('proid' => $d[0]['proid']), $t->translate($table[0])) . '<br>' . html_link('configure.php3', array('proid' => $d[0]['proid']), $t->translate('Configuration'));
     $this->_testFor_box_column('center', '', $bgc[0], $co);
     $this->_testFor_html_form_hidden('proid', $d[0]['proid']);
     $this->_testFor_html_form_submit($t->translate('Review'), 'review');
     $this->_testFor_html_form_submit($t->translate('Delete'), 'delete');
     // test three, test using the sponsor, configured == 2
     $this->_call_show_admprojects(4683 + strlen($sess->self_url()), $d[1], $bgc[0]);
     $co = '<b>' . $t->translate('Partially') . '</b><br>' . html_link($table[1] . '.php3', array('proid' => $d[1]['proid']), $t->translate($table[1]));
     $this->_testFor_box_column('center', '', $bgc[0], $co);
     $this->_testFor_html_form_hidden('proid', $d[1]['proid']);
     $this->_testFor_html_form_submit($t->translate('Delete'), 'delete');
     $this->reverse_next_test();
     $this->_testFor_html_form_submit($t->translate('Review'), 'review');
     // test four, test using the sponsor, configured == 1
     $this->_call_show_admprojects(4685 + strlen($sess->self_url()), $d[2], $bgc[0]);
     $co = '<b>' . $t->translate('Partially') . '</b><br>' . html_link('configure.php3', array('proid' => $d[2]['proid']), $t->translate('Configuration'));
     $this->_testFor_box_column('center', '', $bgc[0], $co);
     $this->_testFor_html_form_hidden('proid', $d[2]['proid']);
     $this->_testFor_html_form_submit($t->translate('Delete'), 'delete');
     $this->reverse_next_test();
     $this->_testFor_html_form_submit($t->translate('Review'), 'review');
     // test five, test using the sponsor, configured == 0
     $this->_call_show_admprojects(4613 + strlen($sess->self_url()), $d[3], $bgc[0]);
     $co = '<b>' . $t->translate('No') . '</b><br>';
     $this->_testFor_box_column('center', '', $bgc[0], $co);
     $this->_testFor_html_form_hidden('proid', $d[3]['proid']);
     $this->_testFor_html_form_submit($t->translate('Delete'), 'delete');
     $this->reverse_next_test();
     $this->_testFor_html_form_submit($t->translate('Review'), 'review');
     // test six: test using developer, configured == 1
     $this->_call_show_admprojects(4733 + strlen($sess->self_url()), $d[4], $bgc[1]);
     $co = '<b>' . $t->translate('Yes') . '</b><br>' . html_link('configure.php3', array('proid' => $d[4]['proid']), $t->translate('Configuration'));
     $this->_testFor_box_column('center', '', $bgc[1], $co);
     $this->_testFor_html_form_hidden('proid', $d[4]['proid']);
     $this->_testFor_html_form_submit($t->translate('Delete'), 'delete');
     $this->_testFor_html_form_submit($t->translate('Accept'), 'accept');
     $this->reverse_next_test();
     $this->_testFor_html_form_submit($t->translate('Review'), 'review');
     // test seven, eight, nine: test using developer, configured == {0,2,3}
     for ($idx = 5; $idx < 8; $idx++) {
         $this->_call_show_admprojects(4613 + strlen($sess->self_url()), $d[$idx], $bgc[1]);
         $co = '<b>' . $t->translate('No') . '</b><br>';
         $this->_testFor_box_column('center', '', $bgc[1], $co);
         $this->_testFor_html_form_hidden('proid', $d[$idx]['proid']);
         $this->_testFor_html_form_submit($t->translate('Delete'), 'delete');
         $this->reverse_next_test();
         $this->_testFor_html_form_submit($t->translate('Review'), 'review');
         $this->reverse_next_test();
         $this->_testFor_html_form_submit($t->translate('Accept'), 'accept');
     }
     $this->_check_db($db_config);
 }
        html_break(2);
        html_link_back();
        html_page_close();
    }
    $ls_array = $GLOBALS['phpgw']->vfs->ls(array('string' => $path . '/' . $createdir, 'relatives' => array(RELATIVE_NONE), 'checksubdirs' => False, 'nofiles' => True));
    $fileinfo = $ls_array[0];
    if ($fileinfo['name']) {
        if ($fileinfo['mime_type'] != 'Directory') {
            echo $GLOBALS['phpgw']->common->error_list(array(lang('%1 already exists as a file', $fileinfo['name'])));
            html_break(2);
            html_link_back();
            html_page_close();
        } else {
            echo $GLOBALS['phpgw']->common->error_list(array(lang('Directory %1 already exists', $fileinfo['name'])));
            html_break(2);
            html_link_back();
            html_page_close();
        }
    } else {
        if ($GLOBALS['phpgw']->vfs->mkdir(array('string' => $createdir))) {
            html_text_summary(lang('Created directory %1', $disppath . '/' . $createdir));
            html_break(2);
            html_link($GLOBALS['appname'] . '/index.php?path=' . $disppath . '/' . $createdir, lang('Go to %1', $disppath . '/' . $createdir));
        } else {
            echo $GLOBALS['phpgw']->common->error_list(array(lang('Could not create %1', $disppath . '/' . $createdir)));
        }
    }
    html_break(2);
    html_link_back();
}
html_page_close();
if (!($result = $db->query($query))) {
    die($db->error);
}
if ($row = $result->fetch_object()) {
    // Create the URL of this record at Nova Scotia Historical Vital Statistics
    $url = 'https://www.novascotiagenealogy.com/ItemView.aspx?ImageFile=' . $row->RegBook . '-' . $row->RegPage . '&Event=marriage&ID=' . $row->MarriageID;
    // Some dates have month and day set, others don't.
    $date = $row->Year;
    if ($row->Month != null) {
        $date = date('F', mktime(0, 0, 0, $row->Month)) . ' ' . $date;
        if ($row->Day != null) {
            $date = $row->Day . ' ' . $date;
        }
    }
    // Display the results
    echo html_link('NSHVS Record', $url) . '<br><br>' . PHP_EOL;
    echo $row->BrideFirstName . ' ' . $row->BrideLastName . ' and ';
    echo $row->GroomFirstName . ' ' . $row->GroomLastName . ', married ' . $date . ' in ';
    if ($row->Place != null) {
        echo $row->Place . ', ';
    }
    echo $row->County . ' County<br><br>';
} else {
    die('MarriageID ' . $id . ' is not in the database.<br>');
}
// Define the data field names.
$field[0] = 'groom';
$field[1] = 'groom_age';
$field[2] = 'groom_status';
$field[3] = 'groom_residence';
$field[4] = 'groom_birthplace';
Beispiel #26
0
	function _action_link( $links ) {
		$url = add_query_arg( 'page', $this->args['page_slug'], admin_url( $this->args['parent'] ) );

		$links[] = html_link( $url, $this->args['action_link'] );

		return $links;
	}
Beispiel #27
0
        echo '<p>Click ';
        html_link('./install/index.php', $text = 'here', $status = 'Install S9Y_Conf', $target = '');
        echo 'to installS9Y_Conf.</p>';
    }
    exit;
}
// Installed
if (!defined('S9YCONF_INSTALLED')) {
    // If no headers are sent, send one
    if (!headers_sent()) {
        header("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/install");
    } else {
        echo '<div class="error">ERROR!</div>';
        echo '<p>The main configuration file does NOT exist!</p>';
        echo '<p>Click ';
        html_link('./install/index.php', $text = 'here', $status = 'Install S9Y_Conf', $target = '');
        echo 'to installS9Y_Conf.</p>';
    }
    exit;
}
debug_msg("FILE: " . __FILE__, 3);
db_connect();
$action = '';
if (isset($_GET['action'])) {
    $action = $_GET['action'];
}
if (isset($_POST['action'])) {
    $action = $_POST['action'];
}
debug_msg("Action: " . $action, 5);
// Determine what action to take
        echo "<br>{$sequence_num} - getabsolutepath - {$cd} (shouldn't matter) - {$i} - {$relatives['0']} - {$o} - {$ao}";
    }
}
# end of getabsolutepath tests
###
###
# start of path_parts tests
/* Just for convienience
$io = array ("" => array ("fake_full_path" => "", "fake_leading_dirs" => "", "fake_extra_path" => "", "fake_name" => "", "real_full_path" => "", "real_leading_dirs" => "", "real_extra_path" => "", "real_name" => ""));
`~!@#$%^&*()-_=+/|[{]};:'\",<.>?
*/
$sequence_num = 12;
$cd = "test8/test10";
$relatives[0] = RELATIVE_USER;
$phpgw->vfs->cd(array('string' => $cd, 'relative' => False, 'relatives' => array($relatives[0])));
$subhome = substr($homedir, 1);
$io = array("" => array("fake_full_path" => "{$homedir}/{$cd}", "fake_leading_dirs" => "{$homedir}/test8", "fake_extra_path" => "{$subhome}/test8", "fake_name" => "test10", "real_full_path" => "{$filesdir}{$homedir}/{$cd}", "real_leading_dirs" => "{$filesdir}{$homedir}/test8", "real_extra_path" => "{$subhome}/test8", "real_name" => "test10"), "dir2/file" => array("fake_full_path" => "{$homedir}/{$cd}/dir2/file", "fake_leading_dirs" => "{$homedir}/{$cd}/dir2", "fake_extra_path" => "{$subhome}/{$cd}/dir2", "fake_name" => "file", "real_full_path" => "{$filesdir}{$homedir}/{$cd}/dir2/file", "real_leading_dirs" => "{$filesdir}{$homedir}/{$cd}/dir2", "real_extra_path" => "{$subhome}/{$cd}/dir2", "real_name" => "file"), "`~!@#\$%^&*()-_=+/|[{]};:'\",<.>?" => array("fake_full_path" => "{$homedir}/{$cd}/`~!@#\$%^&*()-_=+/|[{]};:'\",<.>?", "fake_leading_dirs" => "{$homedir}/{$cd}/`~!@#\$%^&*()-_=+", "fake_extra_path" => "{$subhome}/{$cd}/`~!@#\$%^&*()-_=+", "fake_name" => "|[{]};:'\",<.>?", "real_full_path" => "{$filesdir}{$homedir}/{$cd}/`~!@#\$%^&*()-_=+/|[{]};:'\",<.>?", "real_leading_dirs" => "{$filesdir}{$homedir}/{$cd}/`~!@#\$%^&*()-_=+", "real_extra_path" => "{$subhome}/{$cd}/`~!@#\$%^&*()-_=+", "real_name" => "|[{]};:'\",<.>?"));
while (list($i, $o) = each($io)) {
    $ao = $phpgw->vfs->path_parts(array('string' => $i));
    while (list($key, $value) = each($o)) {
        if ($ao->{$key} != $o[$key]) {
            echo "<br>{$sequence_num} - path_parts - {$cd} - {$i} - {$relatives['0']} - {$key} - {$o[$key]} - {$ao[$key]}";
        }
    }
}
# end of path_parts tests
###
$phpgw->vfs->cd();
html_break(2);
html_text_bold("The less output, the better.  Please file errors as a " . html_link("https://sourceforge.net/tracker/?group_id=7305&atid=107305", "bug report", True, False) . ". Be sure to include the system information line at the top, and anything special about your setup.  Thanks!");
html_page_close();
 private static function render_item($item)
 {
     return html_link($item->get_permalink(), $item->get_title());
 }
 function _checkFor_show_proposals($proid, &$row, $count_star_1, $count_star_2)
 {
     global $t, $sess;
     $strings = array('><b>' . $t->translate('Developing Proposal') . '</b><', '<b>' . lib_nick($row['username']) . ' - ' . timestr(mktimestamp($row['creation'])) . "</b>\n");
     foreach ($strings as $str) {
         $this->_testFor_pattern($this->_to_regexp($str));
     }
     $tv = array('Cost' => $row['cost'] . " euros", 'License' => $row['license'], 'Status' => show_status($row['status']), 'Valid' => timestr_middle(mktimestamp($row['valid'])), 'Start' => timestr_middle(mktimestamp($row['start'])), 'Duration' => $row['duration'] . " weeks");
     while (list($key, $val) = each($tv)) {
         $str = sprintf("<b>%s:</b> %s\n", $t->translate($key), $val);
         $this->_testFor_pattern("[<]..?[>]" . $this->_to_regexp($str));
     }
     /** check for a cooperation link or not .... **/
     $str1 = html_link('cooperation.php3', array('proid' => $proid, 'devid' => $row['devid']), 'Cooperation') . ' [' . $count_star_1 . ']';
     $str2 = 'Cooperation [' . $count_star_1 . ']';
     if ($row['cooperation'] != 'No') {
         if ($count_star_1) {
             $this->_testFor_pattern($this->_to_regexp($str1));
             $this->reverse_next_test();
             $this->_testFor_pattern($this->_to_regexp($str2));
         } else {
             $this->reverse_next_test();
             $this->_testFor_pattern($this->_to_regexp($str1));
             $this->_testFor_pattern($this->_to_regexp($str2));
         }
     } else {
         $this->reverse_next_test();
         $this->_testFor_pattern($this->_to_regexp($str1));
         $this->reverse_next_test();
         $this->_testFor_pattern($this->_to_regexp($str2));
     }
     /** check for a comments link **/
     $str1 = html_link('comments.php3', array('proid' => $proid, 'type' => 'proposals', 'number' => $row['devid']), 'Comments') . ' [' . $count_star_2 . "]\n";
     $str2 = 'Comments [0]';
     if ($count_star_2 > 0) {
         $this->_testFor_pattern($this->_to_regexp($str1));
         $this->reverse_next_test();
         $this->_testFor_pattern($this->_to_regexp($str2));
     } else {
         $this->reverse_next_test();
         $this->_testFor_pattern($this->_to_regexp($str1));
         $this->_testFor_pattern($this->_to_regexp($str2));
     }
     $str = "<FONT SIZE=-1>[ <a href=\"" . $sess->url("comments_edit.php3") . $sess->add_query(array("proid" => $proid, "type" => "proposal", "number" => $row["devid"])) . "\">Comment This Proposal</a> ]</FONT><p>\n";
     $this->_testFor_pattern($this->_to_regexp($str));
 }