当前位置: 首页>>代码示例>>PHP>>正文


PHP WT_I18N::datatablesI18N方法代码示例

本文整理汇总了PHP中WT_I18N::datatablesI18N方法的典型用法代码示例。如果您正苦于以下问题:PHP WT_I18N::datatablesI18N方法的具体用法?PHP WT_I18N::datatablesI18N怎么用?PHP WT_I18N::datatablesI18N使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WT_I18N的用法示例。


在下文中一共展示了WT_I18N::datatablesI18N方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: foreach

    case 'cleanup2':
        foreach (User::all() as $user) {
            if (WT_Filter::post('del_' . $user->getUserId()) == '1') {
                Log::addAuthenticationLog('Deleted user: ' . $user->getUserName());
                echo WT_I18N::translate('Deleted user: '), $user->getUserName(), '<br>';
                $user->delete();
            }
        }
        break;
    case 'listusers':
    default:
        echo '<table id="list">', '<thead>', '<tr>', '<th style="margin:0 -2px 1px 1px; padding:6px 0 5px;"> </th>', '<th> user-id </th>', '<th>', WT_I18N::translate('Username'), '</th>', '<th>', WT_I18N::translate('Real name'), '</th>', '<th>', WT_I18N::translate('Email'), '</th>', '<th> </th>', '<th>', WT_I18N::translate('Language'), '</th>', '<th> date_registered </th>', '<th>', WT_I18N::translate('Date registered'), '</th>', '<th> last_login </th>', '<th>', WT_I18N::translate('Last logged in'), '</th>', '<th>', WT_I18N::translate('Verified'), '</th>', '<th>', WT_I18N::translate('Approved'), '</th>', '<th style="margin:0 -2px 1px 1px; padding:3px 0 4px;"> </th>', '</tr>', '</thead>', '<tbody>', '</tbody>', '</table>';
        $controller->addExternalJavascript(WT_JQUERY_DATATABLES_URL)->addExternalJavascript(WT_JQUERY_JEDITABLE_URL)->addInlineJavascript('
			var oTable = jQuery("#list").dataTable({
				dom: \'<"H"pf<"dt-clear">irl>t<"F"pl>\',
				' . WT_I18N::datatablesI18N() . ',
				processing: true,
				serverSide: true,
				ajax: "' . WT_SCRIPT_NAME . '?action=loadrows",
				jQueryUI: true,
				autoWidth: false,
				pageLength: ' . Auth::user()->getSetting('admin_users_page_size', 10) . ',
				pagingType: "full_numbers",
				sorting: [[2,"asc"]],
				columns: [
					/* details           */ { sortable: false, class: "icon-open" },
					/* user-id           */ { visible: false },
					/* user_name         */ null,
					/* real_name         */ null,
					/* email             */ null,
					/* email link        */ { sortable: false },
开发者ID:brambravo,项目名称:webtrees,代码行数:31,代码来源:admin_users.php

示例2: FOUND_ROWS

            $datum[2] = WT_Filter::escapeHtml($datum[2]);
        }
        // Total filtered/unfiltered rows
        $recordsFiltered = WT_DB::prepare("SELECT FOUND_ROWS()")->fetchColumn();
        $recordsTotal = WT_DB::prepare($SELECT2 . $WHERE)->execute($args)->fetchColumn();
        header('Content-type: application/json');
        echo json_encode(array('sEcho' => WT_Filter::getInteger('sEcho'), 'recordsTotal' => $recordsTotal, 'recordsFiltered' => $recordsFiltered, 'data' => $data));
        exit;
}
$controller->pageHeader()->addExternalJavascript(WT_JQUERY_DATATABLES_URL)->addInlineJavascript('
		jQuery("#log_list").dataTable( {
			dom: \'<"H"pf<"dt-clear">irl>t<"F"pl>\',
			processing: true,
			serverSide: true,
			ajax: "' . WT_SERVER_NAME . WT_SCRIPT_PATH . WT_SCRIPT_NAME . '?action=load_json&from=' . $from . '&to=' . $to . '&type=' . $type . '&text=' . rawurlencode($text) . '&ip=' . rawurlencode($ip) . '&user=' . rawurlencode($user) . '&gedc=' . rawurlencode($gedc) . '",
			' . WT_I18N::datatablesI18N(array(10, 20, 50, 100, 500, 1000, -1)) . ',
			jQueryUI: true,
			autoWidth: false,
			sorting: [[ 0, "desc" ]],
			pageLength: ' . Auth::user()->getSetting('admin_site_log_page_size', 20) . ',
			pagingType: "full_numbers"
		});
	');
$url = WT_SCRIPT_NAME . '?from=' . rawurlencode($from) . '&amp;to=' . rawurlencode($to) . '&amp;type=' . rawurlencode($type) . '&amp;text=' . rawurlencode($text) . '&amp;ip=' . rawurlencode($ip) . '&amp;user=' . rawurlencode($user) . '&amp;gedc=' . rawurlencode($gedc);
$users_array = array();
foreach (User::all() as $tmp_user) {
    $users_array[$tmp_user->getUserName()] = $tmp_user->getUserName();
}
echo '<form name="logs" method="get" action="' . WT_SCRIPT_NAME . '">', '<input type="hidden" name="action", value="show">', '<table class="site_logs">', '<tr>', '<td colspan="6">', WT_I18N::translate('From %s to %s', '<input class="log-date" name="from" value="' . WT_Filter::escapeHtml($from) . '">', '<input class="log-date" name="to" value="' . WT_Filter::escapeHtml($to) . '">'), '</td>', '</tr><tr>', '<td>', WT_I18N::translate('Type'), '<br>', select_edit_control('type', array('' => '', 'auth' => 'auth', 'config' => 'config', 'debug' => 'debug', 'edit' => 'edit', 'error' => 'error', 'media' => 'media', 'search' => 'search'), null, $type, ''), '</td>', '<td>', WT_I18N::translate('Message'), '<br><input class="log-filter" name="text" value="', WT_Filter::escapeHtml($text), '"> ', '</td>', '<td>', WT_I18N::translate('IP address'), '<br><input class="log-filter" name="ip" value="', WT_Filter::escapeHtml($ip), '"> ', '</td>', '<td>', WT_I18N::translate('User'), '<br>', select_edit_control('user', $users_array, '', $user, ''), '</td>', '<td>', WT_I18N::translate('Family tree'), '<br>', select_edit_control('gedc', WT_Tree::getNameList(), '', $gedc, Auth::isAdmin() ? '' : 'disabled'), '</td>', '</tr><tr>', '<td colspan="6">', '<input type="submit" value="', WT_I18N::translate('Filter'), '">', '<input type="submit" value="', WT_I18N::translate('Export'), '" onclick="document.logs.action.value=\'export\';return true;" ', $action == 'show' ? '' : 'disabled="disabled"', '>', '<input type="submit" value="', WT_I18N::translate('Delete'), '" onclick="if (confirm(\'', WT_Filter::escapeHtml(WT_I18N::translate('Permanently delete these records?')), '\')) {document.logs.action.value=\'delete\';return true;} else {return false;}" ', $action == 'show' ? '' : 'disabled="disabled"', '>', '</td>', '</tr>', '</table>', '</form>';
if ($action) {
    echo '<br>', '<table id="log_list">', '<thead>', '<tr>', '<th>', WT_I18N::translate('Timestamp'), '</th>', '<th>', WT_I18N::translate('Type'), '</th>', '<th>', WT_I18N::translate('Message'), '</th>', '<th>', WT_I18N::translate('IP address'), '</th>', '<th>', WT_I18N::translate('User'), '</th>', '<th>', WT_I18N::translate('Family tree'), '</th>', '</tr>', '</thead>', '<tbody>', '</tbody>', '</table>';
开发者ID:brambravo,项目名称:webtrees,代码行数:31,代码来源:admin_site_logs.php

示例3: getBlock

    public function getBlock($block_id, $template = true, $cfg = null)
    {
        global $ctype, $controller;
        $show_unassigned = get_block_setting($block_id, 'show_unassigned', true);
        $show_other = get_block_setting($block_id, 'show_other', true);
        $show_future = get_block_setting($block_id, 'show_future', true);
        $block = get_block_setting($block_id, 'block', true);
        if ($cfg) {
            foreach (array('show_unassigned', 'show_other', 'show_future', 'block') as $name) {
                if (array_key_exists($name, $cfg)) {
                    ${$name} = $cfg[$name];
                }
            }
        }
        $id = $this->getName() . $block_id;
        $class = $this->getName() . '_block';
        if ($ctype == 'gedcom' && WT_USER_GEDCOM_ADMIN || $ctype == 'user' && WT_USER_ID) {
            $title = '<i class="icon-admin" title="' . WT_I18N::translate('Configure') . '" onclick="modalDialog(\'block_edit.php?block_id=' . $block_id . '\', \'' . $this->getTitle() . '\');"></i>';
        } else {
            $title = '';
        }
        $title .= $this->getTitle() . help_link('todo', $this->getName());
        $table_id = Uuid::uuid4();
        // create a unique ID
        $controller->addExternalJavascript(WT_JQUERY_DATATABLES_URL)->addInlineJavascript('
				jQuery("#' . $table_id . '").dataTable({
					dom: \'t\',
					' . WT_I18N::datatablesI18N() . ',
					autoWidth: false,
					paginate: false,
					lengthChange: false,
					filter: false,
					info: true,
					jQueryUI: true,
					columns: [
						/* 0-DATE */   		{ visible: false },
						/* 1-Date */		{ dataSort: 0 },
						/* 1-Record */ 		null,
						/* 2-Username */	null,
						/* 3-Text */		null
					]
				});
			jQuery("#' . $table_id . '").css("visibility", "visible");
			jQuery(".loading-image").css("display", "none");
			');
        $content = '';
        $content .= '<div class="loading-image">&nbsp;</div>';
        $content .= '<table id="' . $table_id . '" style="visibility:hidden;">';
        $content .= '<thead><tr>';
        $content .= '<th>DATE</th>';
        //hidden by datables code
        $content .= '<th>' . WT_Gedcom_Tag::getLabel('DATE') . '</th>';
        $content .= '<th>' . WT_I18N::translate('Record') . '</th>';
        if ($show_unassigned || $show_other) {
            $content .= '<th>' . WT_I18N::translate('Username') . '</th>';
        }
        $content .= '<th>' . WT_Gedcom_Tag::getLabel('TEXT') . '</th>';
        $content .= '</tr></thead><tbody>';
        $found = false;
        $end_jd = $show_future ? 99999999 : WT_CLIENT_JD;
        foreach (get_calendar_events(0, $end_jd, '_TODO', WT_GED_ID) as $fact) {
            $record = $fact->getParent();
            $user_name = $fact->getAttribute('_WT_USER');
            if ($user_name == WT_USER_NAME || !$user_name && $show_unassigned || $user_name && $show_other) {
                $content .= '<tr>';
                //-- Event date (sortable)
                $content .= '<td>';
                //hidden by datables code
                $content .= $fact->getDate()->JD();
                $content .= '</td>';
                $content .= '<td class="wrap">' . $fact->getDate()->Display(empty($SEARCH_SPIDER)) . '</td>';
                $content .= '<td class="wrap"><a href="' . $record->getHtmlUrl() . '">' . $record->getFullName() . '</a></td>';
                if ($show_unassigned || $show_other) {
                    $content .= '<td class="wrap">' . $user_name . '</td>';
                }
                $text = $fact->getValue();
                $content .= '<td class="wrap">' . $text . '</td>';
                $content .= '</tr>';
                $found = true;
            }
        }
        $content .= '</tbody></table>';
        if (!$found) {
            $content .= '<p>' . WT_I18N::translate('There are no research tasks in this family tree.') . '</p>';
        }
        if ($template) {
            if ($block) {
                require WT_THEME_DIR . 'templates/block_small_temp.php';
            } else {
                require WT_THEME_DIR . 'templates/block_main_temp.php';
            }
        } else {
            return $content;
        }
    }
开发者ID:brambravo,项目名称:webtrees,代码行数:95,代码来源:module.php

示例4: print_events_table

function print_events_table($startjd, $endjd, $events = 'BIRT MARR DEAT', $only_living = false, $sort_by = 'anniv')
{
    global $controller;
    $html = '';
    $table_id = 'table-even-' . Uuid::uuid4();
    // lists requires a unique ID in case there are multiple lists per page
    $controller->addExternalJavascript(WT_JQUERY_DATATABLES_URL)->addInlineJavascript('
			jQuery("#' . $table_id . '").dataTable({
				dom: \'t\',
				' . WT_I18N::datatablesI18N() . ',
				autoWidth: false,
				paging: false,
				lengthChange: false,
				filter: false,
				info: true,
				jQueryUI: true,
				sorting: [[ ' . ($sort_by == 'alpha' ? 1 : 3) . ', "asc"]],
				columns: [
					/* 0-Record */ { dataSort: 1 },
					/* 1-NAME */   { visible: false },
					/* 2-Date */   { dataSort: 3 },
					/* 3-DATE */   { visible: false },
					/* 4-Anniv. */ { dataSort: 5, class: "center" },
					/* 5-ANNIV  */ { type: "num", visible: false },
					/* 6-Event */  { class: "center" }
				]
			});
		');
    // Did we have any output?  Did we skip anything?
    $output = 0;
    $filter = 0;
    $filtered_events = array();
    foreach (get_events_list($startjd, $endjd, $events) as $fact) {
        $record = $fact->getParent();
        //-- only living people ?
        if ($only_living) {
            if ($record instanceof WT_Individual && $record->isDead()) {
                $filter++;
                continue;
            }
            if ($record instanceof WT_Family) {
                $husb = $record->getHusband();
                if (is_null($husb) || $husb->isDead()) {
                    $filter++;
                    continue;
                }
                $wife = $record->getWife();
                if (is_null($wife) || $wife->isDead()) {
                    $filter++;
                    continue;
                }
            }
        }
        //-- Counter
        $output++;
        if ($output == 1) {
            //-- table body
            $html .= '<table id="' . $table_id . '" class="width100">';
            $html .= '<thead><tr>';
            $html .= '<th>' . WT_I18N::translate('Record') . '</th>';
            $html .= '<th>NAME</th>';
            //hidden by datatables code
            $html .= '<th>' . WT_Gedcom_Tag::getLabel('DATE') . '</th>';
            $html .= '<th>DATE</th>';
            //hidden by datatables code
            $html .= '<th><i class="icon-reminder" title="' . WT_I18N::translate('Anniversary') . '"></i></th>';
            $html .= '<th>ANNIV</th>';
            $html .= '<th>' . WT_Gedcom_Tag::getLabel('EVEN') . '</th>';
            $html .= '</tr></thead><tbody>';
        }
        $filtered_events[] = $fact;
    }
    foreach ($filtered_events as $n => $fact) {
        $record = $fact->getParent();
        $html .= '<tr>';
        $html .= '<td>';
        $html .= '<a href="' . $record->getHtmlUrl() . '">' . $record->getFullName() . '</a>';
        if ($record instanceof WT_Individual) {
            $html .= $record->getSexImage();
        }
        $html .= '</td>';
        $html .= '<td>' . $record->getSortName() . '</td>';
        $html .= '<td>' . $fact->getDate()->Display(empty($SEARCH_SPIDER)) . '</td>';
        $html .= '<td>' . $n . '</td>';
        $html .= '<td>' . WT_I18N::number($fact->anniv) . '</td>';
        $html .= '<td>' . $fact->anniv . '</td>';
        $html .= '<td>' . $fact->getLabel() . '</td>';
        $html .= '</tr>';
    }
    if ($output != 0) {
        $html .= '</tbody></table>';
    }
    // Print a final summary message about restricted/filtered facts
    $summary = '';
    if ($endjd == WT_CLIENT_JD) {
        // We're dealing with the Today’s Events block
        if ($output == 0) {
            if ($filter == 0) {
                $summary = WT_I18N::translate('No events exist for today.');
            } else {
//.........这里部分代码省略.........
开发者ID:brambravo,项目名称:webtrees,代码行数:101,代码来源:functions_print_lists.php

示例5: show_list

    private function show_list()
    {
        global $controller;
        $controller = new WT_Controller_Page();
        $controller->setPageTitle($this->getTitle())->pageHeader()->addExternalJavascript(WT_JQUERY_DATATABLES_URL)->addInlineJavascript('
				jQuery("#story_table").dataTable({
					dom: \'<"H"pf<"dt-clear">irl>t<"F"pl>\',
					' . WT_I18N::datatablesI18N() . ',
					autoWidth: false,
					paging: true,
					pagingType: "full_numbers",
					lengthChange: true,
					filter: true,
					info: true,
					jQueryUI: true,
					sorting: [[0,"asc"]],
					columns: [
						/* 0-name */ null,
						/* 1-NAME */ null
					]
				});
			');
        $stories = WT_DB::prepare("SELECT block_id, xref" . " FROM `##block` b" . " WHERE module_name=?" . " AND gedcom_id=?" . " ORDER BY xref")->execute(array($this->getName(), WT_GED_ID))->fetchAll();
        echo '<h2 class="center">', WT_I18N::translate('Stories'), '</h2>';
        if (count($stories) > 0) {
            echo '<table id="story_table" class="width100">';
            echo '<thead><tr>
				<th>', WT_I18N::translate('Story title'), '</th>
				<th>', WT_I18N::translate('Individual'), '</th>
				</tr></thead>
				<tbody>';
            foreach ($stories as $story) {
                $indi = WT_Individual::getInstance($story->xref);
                $story_title = get_block_setting($story->block_id, 'title');
                $languages = get_block_setting($story->block_id, 'languages');
                if (!$languages || in_array(WT_LOCALE, explode(',', $languages))) {
                    if ($indi) {
                        if ($indi->canShow()) {
                            echo '<tr><td><a href="' . $indi->getHtmlUrl() . '#stories">' . $story_title . '</a></td><td><a href="' . $indi->getHtmlUrl() . '#stories">' . $indi->getFullName() . '</a></td></tr>';
                        }
                    } else {
                        echo '<tr><td>', $story_title, '</td><td class="error">', $story->xref, '</td></tr>';
                    }
                }
            }
            echo '</tbody></table>';
        }
    }
开发者ID:brambravo,项目名称:webtrees,代码行数:48,代码来源:module.php


注:本文中的WT_I18N::datatablesI18N方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。