repo_name
stringlengths
4
116
path
stringlengths
4
379
size
stringlengths
1
7
content
stringlengths
3
1.05M
license
stringclasses
15 values
mjschaefer/codesamples
Lowell.net/views/redevelopment.php
633
<h1 style="margin-bottom:10px;">Redevelopment Commission</h1> <div id="sub-menu"> <h1>Menu</h1> <ul> <?php foreach($page_list as $link): ?> <?php if($link->url == 'redevelopment_commission'): ?> <li><a href="<?=url::site('boards/redevelopment')?>">Home</a></li> <?php else: ?> <li><a href="<?=url::site('boards/redevelopment/' . $link->url)?>"><?=$link->title?></a></li> <?php endif; ?> <?php endforeach; ?> <li><a href="<?=url::site('boards/redevelopment/reports')?>">Minutes and Agendas</a></li> <li class="clear-item"> </li> </ul> </div> <div id="static-page"> <?=$page->body?> </div>
gpl-2.0
chenlian2015/gagablog
zenTao/module/todo/lang/zh-tw.php
3550
<?php /** * The todo module zh-tw file of ZenTaoPMS. * * @copyright Copyright 2009-2015 青島易軟天創網絡科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com) * @license ZPL (http://zpl.pub/page/zplv11.html) * @author Chunsheng Wang <chunsheng@cnezsoft.com> * @package todo * @version $Id: zh-tw.php 5022 2013-07-05 06:50:39Z chencongzhi520@gmail.com $ * @link http://www.zentao.net */ $lang->todo->common = '待辦'; $lang->todo->index = "待辦一覽"; $lang->todo->create = "新增"; $lang->todo->batchCreate = "批量添加"; $lang->todo->edit = "更新待辦"; $lang->todo->batchEdit = "批量編輯"; $lang->todo->view = "待辦詳情"; $lang->todo->viewAB = "詳情"; $lang->todo->finish = "完成"; $lang->todo->batchFinish = "批量完成"; $lang->todo->export = "導出"; $lang->todo->delete = "刪除待辦"; $lang->todo->browse = "瀏覽待辦"; $lang->todo->import2Today = "導入到今天"; $lang->todo->import = "導入"; $lang->todo->changeStatus = "更改"; $lang->todo->legendBasic = "基本信息"; $lang->todo->id = '編號'; $lang->todo->account = '所有者'; $lang->todo->date = '日期'; $lang->todo->begin = '開始時間'; $lang->todo->beginAB = '開始'; $lang->todo->end = '結束時間'; $lang->todo->endAB = '結束'; $lang->todo->beginAndEnd = '起止時間'; $lang->todo->type = '類型'; $lang->todo->pri = '優先順序'; $lang->todo->name = '名稱'; $lang->todo->status = '狀態'; $lang->todo->desc = '描述'; $lang->todo->private = '私人事務'; $lang->todo->idvalue = '任務或Bug'; $lang->todo->confirmBug = '該Todo關聯的是Bug #%s,需要修改它嗎?'; $lang->todo->confirmTask = '該Todo關聯的是Task #%s,需要修改它嗎?'; $lang->todo->statusList['wait'] = '未開始'; $lang->todo->statusList['doing'] = '進行中'; $lang->todo->statusList['done'] = '已完成'; //$lang->todo->statusList['cancel'] = '已取消'; //$lang->todo->statusList['postpone'] = '已延期'; $lang->todo->priList[3] = '一般'; $lang->todo->priList[1] = '最高'; $lang->todo->priList[2] = '較高'; $lang->todo->priList[4] = '最低'; $lang->todo->typeList['custom'] = '自定義'; $lang->todo->typeList['bug'] = 'Bug'; $lang->todo->typeList['task'] = $lang->projectcommon . '任務'; $lang->todo->confirmDelete = "您確定要刪除這條待辦嗎?"; $lang->todo->successMarked = "成功切換狀態!"; $lang->todo->thisIsPrivate = '這是一條私人事務。:)'; $lang->todo->lblDisableDate = '暫時不設定時間'; $lang->todo->periods['today'] = '今日'; $lang->todo->periods['yesterday'] = '昨日'; $lang->todo->periods['thisWeek'] = '本週'; $lang->todo->periods['lastWeek'] = '上周'; $lang->todo->periods['thisMonth'] = '本月'; $lang->todo->periods['lastmonth'] = '上月'; $lang->todo->periods['thisSeason'] = '本季'; $lang->todo->periods['thisYear'] = '本年'; $lang->todo->periods['future'] = '待定'; $lang->todo->periods['before'] = '未完'; $lang->todo->periods['all'] = '所有'; $lang->todo->action = new stdclass(); $lang->todo->action->finished = array('main' => '$date, 由 <strong>$actor</strong>完成'); $lang->todo->action->marked = array('main' => '$date, 由 <strong>$actor</strong> 標記為<strong>$extra</strong>。', 'extra' => $lang->todo->statusList);
gpl-2.0
aufau/jedi-outcast
CODE-mp/botlib/l_struct.cpp
11655
/***************************************************************************** * name: l_struct.c * * desc: structure reading / writing * * $Archive: /MissionPack/CODE/botlib/l_struct.c $ * $Author: Raduffy $ * $Revision: 1 $ * $Modtime: 12/20/99 8:43p $ * $Date: 3/08/00 11:28a $ * *****************************************************************************/ #ifdef BOTLIB #include "../qcommon/q_shared.h" #include "../game/botlib.h" //for the include of be_interface.h #include "l_script.h" #include "l_precomp.h" #include "l_struct.h" #include "l_utils.h" #include "be_interface.h" #endif //BOTLIB #ifdef BSPC //include files for usage in the BSP Converter #include "../bspc/qbsp.h" #include "../bspc/l_log.h" #include "../bspc/l_mem.h" #include "l_precomp.h" #include "l_struct.h" #define qtrue true #define qfalse false #endif //BSPC //=========================================================================== // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== fielddef_t *FindField(fielddef_t *defs, char *name) { int i; for (i = 0; defs[i].name; i++) { if (!strcmp(defs[i].name, name)) return &defs[i]; } //end for return NULL; } //end of the function FindField //=========================================================================== // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== qboolean ReadNumber(source_t *source, fielddef_t *fd, void *p) { token_t token; int negative = qfalse; long int intval, intmin = 0, intmax = 0; double floatval; if (!PC_ExpectAnyToken(source, &token)) return (qboolean)0; //check for minus sign if (token.type == TT_PUNCTUATION) { if (fd->type & FT_UNSIGNED) { SourceError(source, "expected unsigned value, found %s", token.string); return (qboolean)0; } //end if //if not a minus sign if (strcmp(token.string, "-")) { SourceError(source, "unexpected punctuation %s", token.string); return (qboolean)0; } //end if negative = qtrue; //read the number if (!PC_ExpectAnyToken(source, &token)) return (qboolean)0; } //end if //check if it is a number if (token.type != TT_NUMBER) { SourceError(source, "expected number, found %s", token.string); return (qboolean)0; } //end if //check for a float value if (token.subtype & TT_FLOAT) { if ((fd->type & FT_TYPE) != FT_FLOAT) { SourceError(source, "unexpected float"); return (qboolean)0; } //end if floatval = token.floatvalue; if (negative) floatval = -floatval; if (fd->type & FT_BOUNDED) { if (floatval < fd->floatmin || floatval > fd->floatmax) { SourceError(source, "float out of range [%f, %f]", fd->floatmin, fd->floatmax); return (qboolean)0; } //end if } //end if *(float *) p = (float) floatval; return (qboolean)1; } //end if // intval = token.intvalue; if (negative) intval = -intval; //check bounds if ((fd->type & FT_TYPE) == FT_CHAR) { if (fd->type & FT_UNSIGNED) {intmin = 0; intmax = 255;} else {intmin = -128; intmax = 127;} } //end if if ((fd->type & FT_TYPE) == FT_INT) { if (fd->type & FT_UNSIGNED) {intmin = 0; intmax = 65535;} else {intmin = -32768; intmax = 32767;} } //end else if if ((fd->type & FT_TYPE) == FT_CHAR || (fd->type & FT_TYPE) == FT_INT) { if (fd->type & FT_BOUNDED) { intmin = Maximum(intmin, fd->floatmin); intmax = Minimum(intmax, fd->floatmax); } //end if if (intval < intmin || intval > intmax) { SourceError(source, "value %d out of range [%d, %d]", intval, intmin, intmax); return (qboolean)0; } //end if } //end if else if ((fd->type & FT_TYPE) == FT_FLOAT) { if (fd->type & FT_BOUNDED) { if (intval < fd->floatmin || intval > fd->floatmax) { SourceError(source, "value %d out of range [%f, %f]", intval, fd->floatmin, fd->floatmax); return (qboolean)0; } //end if } //end if } //end else if //store the value if ((fd->type & FT_TYPE) == FT_CHAR) { if (fd->type & FT_UNSIGNED) *(unsigned char *) p = (unsigned char) intval; else *(char *) p = (char) intval; } //end if else if ((fd->type & FT_TYPE) == FT_INT) { if (fd->type & FT_UNSIGNED) *(unsigned int *) p = (unsigned int) intval; else *(int *) p = (int) intval; } //end else else if ((fd->type & FT_TYPE) == FT_FLOAT) { *(float *) p = (float) intval; } //end else return (qboolean)1; } //end of the function ReadNumber //=========================================================================== // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== qboolean ReadChar(source_t *source, fielddef_t *fd, void *p) { token_t token; if (!PC_ExpectAnyToken(source, &token)) return (qboolean)0; //take literals into account if (token.type == TT_LITERAL) { StripSingleQuotes(token.string); *(char *) p = token.string[0]; } //end if else { PC_UnreadLastToken(source); if (!ReadNumber(source, fd, p)) return (qboolean)0; } //end if return (qboolean)1; } //end of the function ReadChar //=========================================================================== // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== int ReadString(source_t *source, fielddef_t *fd, void *p) { token_t token; if (!PC_ExpectTokenType(source, TT_STRING, 0, &token)) return 0; //remove the double quotes StripDoubleQuotes(token.string); //copy the string strncpy((char *) p, token.string, MAX_STRINGFIELD); //make sure the string is closed with a zero ((char *)p)[MAX_STRINGFIELD-1] = '\0'; // return 1; } //end of the function ReadString //=========================================================================== // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== int ReadStructure(source_t *source, structdef_t *def, char *structure) { token_t token; fielddef_t *fd; void *p; int num; if (!PC_ExpectTokenString(source, "{")) return 0; while(1) { if (!PC_ExpectAnyToken(source, &token)) return qfalse; //if end of structure if (!strcmp(token.string, "}")) break; //find the field with the name fd = FindField(def->fields, token.string); if (!fd) { SourceError(source, "unknown structure field %s", token.string); return qfalse; } //end if if (fd->type & FT_ARRAY) { num = fd->maxarray; if (!PC_ExpectTokenString(source, "{")) return qfalse; } //end if else { num = 1; } //end else p = (void *)(structure + fd->offset); while (num-- > 0) { if (fd->type & FT_ARRAY) { if (PC_CheckTokenString(source, "}")) break; } //end if switch(fd->type & FT_TYPE) { case FT_CHAR: { if (!ReadChar(source, fd, p)) return qfalse; p = (char *) p + sizeof(char); break; } //end case case FT_INT: { if (!ReadNumber(source, fd, p)) return qfalse; p = (char *) p + sizeof(int); break; } //end case case FT_FLOAT: { if (!ReadNumber(source, fd, p)) return qfalse; p = (char *) p + sizeof(float); break; } //end case case FT_STRING: { if (!ReadString(source, fd, p)) return qfalse; p = (char *) p + MAX_STRINGFIELD; break; } //end case case FT_STRUCT: { if (!fd->substruct) { SourceError(source, "BUG: no sub structure defined"); return qfalse; } //end if ReadStructure(source, fd->substruct, (char *) p); p = (char *) p + fd->substruct->size; break; } //end case } //end switch if (fd->type & FT_ARRAY) { if (!PC_ExpectAnyToken(source, &token)) return qfalse; if (!strcmp(token.string, "}")) break; if (strcmp(token.string, ",")) { SourceError(source, "expected a comma, found %s", token.string); return qfalse; } //end if } //end if } //end while } //end while return qtrue; } //end of the function ReadStructure //=========================================================================== // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== int WriteIndent(FILE *fp, int indent) { while(indent-- > 0) { if (fprintf(fp, "\t") < 0) return qfalse; } //end while return qtrue; } //end of the function WriteIndent //=========================================================================== // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== int WriteFloat(FILE *fp, float value) { char buf[128]; int l; sprintf(buf, "%f", value); l = strlen(buf); //strip any trailing zeros while(l-- > 1) { if (buf[l] != '0' && buf[l] != '.') break; if (buf[l] == '.') { buf[l] = 0; break; } //end if buf[l] = 0; } //end while //write the float to file if (fprintf(fp, "%s", buf) < 0) return 0; return 1; } //end of the function WriteFloat //=========================================================================== // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== int WriteStructWithIndent(FILE *fp, structdef_t *def, char *structure, int indent) { int i, num; void *p; fielddef_t *fd; if (!WriteIndent(fp, indent)) return qfalse; if (fprintf(fp, "{\r\n") < 0) return qfalse; indent++; for (i = 0; def->fields[i].name; i++) { fd = &def->fields[i]; if (!WriteIndent(fp, indent)) return qfalse; if (fprintf(fp, "%s\t", fd->name) < 0) return qfalse; p = (void *)(structure + fd->offset); if (fd->type & FT_ARRAY) { num = fd->maxarray; if (fprintf(fp, "{") < 0) return qfalse; } //end if else { num = 1; } //end else while(num-- > 0) { switch(fd->type & FT_TYPE) { case FT_CHAR: { if (fprintf(fp, "%d", *(char *) p) < 0) return qfalse; p = (char *) p + sizeof(char); break; } //end case case FT_INT: { if (fprintf(fp, "%d", *(int *) p) < 0) return qfalse; p = (char *) p + sizeof(int); break; } //end case case FT_FLOAT: { if (!WriteFloat(fp, *(float *)p)) return qfalse; p = (char *) p + sizeof(float); break; } //end case case FT_STRING: { if (fprintf(fp, "\"%s\"", (char *) p) < 0) return qfalse; p = (char *) p + MAX_STRINGFIELD; break; } //end case case FT_STRUCT: { if (!WriteStructWithIndent(fp, fd->substruct, structure, indent)) return qfalse; p = (char *) p + fd->substruct->size; break; } //end case } //end switch if (fd->type & FT_ARRAY) { if (num > 0) { if (fprintf(fp, ",") < 0) return qfalse; } //end if else { if (fprintf(fp, "}") < 0) return qfalse; } //end else } //end if } //end while if (fprintf(fp, "\r\n") < 0) return qfalse; } //end for indent--; if (!WriteIndent(fp, indent)) return qfalse; if (fprintf(fp, "}\r\n") < 0) return qfalse; return qtrue; } //end of the function WriteStructWithIndent //=========================================================================== // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== int WriteStructure(FILE *fp, structdef_t *def, char *structure) { return WriteStructWithIndent(fp, def, structure, 0); } //end of the function WriteStructure
gpl-2.0
rymesaint/dimensi
application/modules/dashboard/views/header.php
5222
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); ?> <!DOCTYPE html> <html lang="en"> <meta charset="utf-8"> <meta name="description" content=""> <meta name="keyword" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <title><?php echo $title ?></title> <link rel="stylesheet" type="text/css" href="<?php echo base_url() ?>assets/css/materialize.min.css"> <link rel="stylesheet" type="text/css" href="<?php echo base_url() ?>assets/css/custom.dashboard.css"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <link rel="stylesheet" type="text/css" href="<?php echo base_url() ?>assets/css/plugins/datatables.bootstrap.min.css"> <link rel="stylesheet" type="text/css" href="<?php echo base_url() ?>assets/css/dataTables.custom.css"> <link rel="stylesheet" type="text/css" href="<?php echo base_url() ?>assets/css/select2.min.css"> <script src="<?php echo base_url() ?>assets/js/jquery.min.js"></script> <script src="<?php echo base_url() ?>assets/js/paging.min.js"></script> <script src="<?php echo base_url() ?>assets/js/select2.min.js"></script> </head> <body> <header> <nav> <div class="nav-wrapper blue darken-1"> <a href="<?php echo base_url() ?>" class="brand-logo" target="_BLANK"><?php echo $app_name ?></a> <ul class="right hide-on-med-and-down"> <li> <a class="dropdown-button" href="#!" data-activates="menuaccount"> <div class="chip"> <img src="<?php echo base_url() ?>assets/img/avatar.jpg" alt="Contact Person"> <?php echo $user->username ?> </div> </a> </li> </ul> </div> <ul id="menuaccount" class="dropdown-content blue darken-1"> <li><a href="<?php echo site_url('dashboard/') ?>" class="shades-text white-text">Dashboard</a></li> <li><a href="<?php echo site_url('dashboard/users/profile/') ?>" class="shades-text white-text">Akun Saya</a></li> <li class="divider"></li> <li><a href="#" class="shades-text white-text">Pengaturan</a></li> <li class="divider"></li> <li><a href="<?php echo site_url('dashboard/users/logout/') ?>" class="shades-text white-text">Keluar</a></li> </ul> </nav> </header> <main> <div class="row"> <div class="col s12 m4 l3"> <ul class="collapsible" data-collapsible="accordion"> <li> <div class="collapsible-header waves-effect"> <a href="<?php echo site_url('dashboard/') ?>"><i class="material-icons">dashboard</i>Dashboard</a> </div> </li> <li> <div class="collapsible-header waves-effect"> <i class="material-icons">subject</i>Animes </div> <div class="collapsible-body"> <ol class="blue accent-2"> <li class="waves-effect"><a href="<?php echo site_url('dashboard/animes/set-featured') ?>" class="shades-text text-white">Set Slider Anime</a></li> <li class="waves-effect"><a href="<?php echo site_url('dashboard/animes/tambah_anime/') ?>" class="shades-text text-white">Tambah Anime</a></li> <li class="waves-effect"><a href="<?php echo site_url('dashboard/animes/tambah_episode/') ?>" class="shades-text text-white">Tambah Episode</a></li> <li class="divider"></li> <li class="waves-effect"><a href="<?php echo site_url('dashboard/animes/') ?>" class="shades-text text-white">Semua Anime</a></li> </ol> </div> </li> <li> <div class="collapsible-header waves-effect"><a href="<?php echo site_url('dashboard/genres/') ?>"><i class="material-icons">album</i>Genre</a></div> </li> <li> <div class="collapsible-header waves-effect"><i class="material-icons">perm_identity</i>Akun</div> <div class="collapsible-body"> <ol class="blue accent-2"> <li class="waves-effect"><a href="#" class="shades-text text-white">Tambah Akun Baru</a></li> <li class="waves-effect"><a href="#" class="shades-text text-white">Tambah Grup Baru</a></li> <li class="divider"></li> <li class="waves-effect"><a href="#" class="shades-text text-white">Lihat Semua Akun</a></li> <li class="waves-effect"><a href="#" class="shades-text text-white">Lihat Semua Grup</a></li> </ol> </div> </li> <li> <div class="collapsible-header waves-effect"><i class="material-icons">description</i>Halaman</div> <div class="collapsible-body"> <ol class="blue accent-2"> <li class="waves-effect"><a href="#" class="shades-text text-white">Tambah Halaman Baru</a></li> <li class="divider"></li> <li class="waves-effect"><a href="#" class="shades-text text-white">Lihat Semua Halaman</a></li> </ol> </div> </li> <li> <div class="collapsible-header waves-effect"><a href="#"><i class="material-icons">settings_applications</i>Pengaturan Website</a></div> </li> <li> <div class="collapsible-header waves-effect"><a href="#"><i class="material-icons">info</i>Tentang</a></div> </li> </ul> </div> <div class="col s12 m8 l9">
gpl-2.0
MikeMangialardi/SirenOfShame-WithGoPlugin
UsbLib/UsbDeviceNotification.cs
651
using System; using System.Windows.Forms; namespace UsbLib { public class UsbDeviceNotification { private const int WM_DEVICECHANGE = 0x0219; public event EventHandler UsbDeviceArrived; public void WndProc(ref Message message) { switch (message.Msg) { case WM_DEVICECHANGE: OnUsbDeviceArrived(); break; } } private void OnUsbDeviceArrived() { if (UsbDeviceArrived != null) { UsbDeviceArrived(this, new EventArgs()); } } } }
gpl-2.0
bawelter/ijcsa
modules/mod_cck_form/mod_cck_form.php
2066
<?php /** * @version SEBLOD 3.x Core ~ $Id: mod_cck_form.php sebastienheraud $ * @package SEBLOD (App Builder & CCK) // SEBLOD nano (Form Builder) * @url http://www.seblod.com * @editor Octopoos - www.octopoos.com * @copyright Copyright (C) 2013 SEBLOD. All Rights Reserved. * @license GNU General Public License version 2 or later; see _LICENSE.php **/ defined( '_JEXEC' ) or die; $show = $params->get( 'url_show', '' ); $hide = $params->get( 'url_hide', '' ); if ( $show && JCckDevHelper::matchUrlVars( $show ) === false ) { return; } if ( $hide && JCckDevHelper::matchUrlVars( $hide ) !== false ) { return; } $app = JFactory::getApplication(); $data = ''; $uniqId = 'm'.$module->id; $formId = 'seblod_form_'.$uniqId; if ( ! defined ( 'JPATH_LIBRARIES_CCK' ) ) { define( 'JPATH_LIBRARIES_CCK', JPATH_SITE.'/libraries/cck' ); } if ( ! defined ( 'JROOT_MEDIA_CCK' ) ) { define( 'JROOT_MEDIA_CCK', JURI::root( true ).'/media/cck' ); } JCck::loadjQuery(); JFactory::getLanguage()->load( 'com_cck_default', JPATH_SITE ); require_once JPATH_SITE.'/components/com_cck/helpers/helper_include.php'; $option = $app->input->get( 'option', '' ); $view = ''; $preconfig = array(); $preconfig['action'] = ''; $preconfig['client'] = 'site'; $preconfig['formId'] = $formId; $preconfig['submit'] = 'JCck.Core.submit_'.$uniqId; $preconfig['task'] = $app->input->get( 'task', '' ); $preconfig['type'] = $params->get( 'type', '' ); $preconfig['url'] = ''; $live = $params->get( 'live' ); $variation = $params->get( 'variation' ); jimport( 'cck.base.form.form' ); include JPATH_LIBRARIES_CCK.'/base/form/form_inc.php'; JFactory::getSession()->set( 'cck_hash_'.$formId, JApplication::getHash( '0|'.$preconfig['type'].'|0' ) ); $moduleclass_sfx = htmlspecialchars( $params->get( 'moduleclass_sfx' ) ); $class_sfx = ( $params->get( 'force_moduleclass_sfx', 0 ) == 1 ) ? $moduleclass_sfx : ''; require JModuleHelper::getLayoutPath( 'mod_cck_form', $params->get( 'layout', 'default' ) ); ?>
gpl-2.0
ablyx/teammates
src/main/webapp/js/instructorFeedbacks.js
13669
// TODO: Move constants from Common.js into appropriate files if not shared. var TIMEZONE_SELECT_UNINITIALISED = '-9999'; $(document).ready(function() { var isEdit = typeof readyFeedbackEditPage === 'function'; if (typeof richTextEditorBuilder !== 'undefined') { /* eslint-disable camelcase */ // The property names are determined by external library (tinymce) richTextEditorBuilder.initEditor('#instructions', { inline: true, readonly: isEdit, fixed_toolbar_container: '#richtext-toolbar-container' }); /* eslint-enable camelcase */ } }); /** * Check whether the feedback question input is valid * @param form * @returns {Boolean} */ function checkFeedbackQuestion(form) { var recipientType = $(form).find('select[name|=' + FEEDBACK_QUESTION_RECIPIENTTYPE + ']') .find(':selected') .val(); if (recipientType === 'STUDENTS' || recipientType === 'TEAMS') { if ($(form).find('[name|=' + FEEDBACK_QUESTION_NUMBEROFENTITIESTYPE + ']:checked').val() === 'custom' && !$(form).find('.numberOfEntitiesBox').val()) { setStatusMessageToForm(DISPLAY_FEEDBACK_QUESTION_NUMBEROFENTITIESINVALID, StatusType.DANGER, form); return false; } } if (!$(form).find('[name=' + FEEDBACK_QUESTION_TEXT + ']').val()) { setStatusMessageToForm(DISPLAY_FEEDBACK_QUESTION_TEXTINVALID, StatusType.DANGER, form); return false; } if ($(form).find('[name=' + FEEDBACK_QUESTION_TYPE + ']').val() === 'NUMSCALE') { if (!$(form).find('[name=' + FEEDBACK_QUESTION_NUMSCALE_MIN + ']').val() || !$(form).find('[name=' + FEEDBACK_QUESTION_NUMSCALE_MAX + ']').val() || !$(form).find('[name=' + FEEDBACK_QUESTION_NUMSCALE_STEP + ']').val()) { setStatusMessageToForm(DISPLAY_FEEDBACK_QUESTION_NUMSCALE_OPTIONSINVALID, StatusType.DANGER, form); return false; } var qnNum = getQuestionNumFromEditForm(form); if (updateNumScalePossibleValues(qnNum)) { return true; } setStatusMessageToForm(DISPLAY_FEEDBACK_QUESTION_NUMSCALE_INTERVALINVALID, StatusType.DANGER, form); return false; } return true; } function getQuestionNumFromEditForm(form) { if ($(form).attr('name') === 'form_addquestions') { return -1; } return extractQuestionNumFromEditFormId($(form).attr('id')); } function extractQuestionNumFromEditFormId(id) { return parseInt(id.substring('form_editquestion-'.length, id.length)); } function checkEditFeedbackSession(form) { if (form.visibledate.getAttribute('disabled')) { if (!form.visibledate.value) { setStatusMessageToForm(DISPLAY_FEEDBACK_SESSION_VISIBLE_DATEINVALID, StatusType.DANGER, form); return false; } } if (form.publishdate.getAttribute('disabled')) { if (!form.publishdate.value) { setStatusMessageToForm(DISPLAY_FEEDBACK_SESSION_PUBLISH_DATEINVALID, StatusType.DANGER, form); return false; } } return true; } /** * To be run on page finish loading, this will select the input: start date, * start time, and timezone based on client's time. * * The default values will not be set if the form was submitted previously and * failed validation. */ function selectDefaultTimeOptions() { var now = new Date(); var currentDate = convertDateToDDMMYYYY(now); var hours = convertDateToHHMM(now).substring(0, 2); var currentTime = parseInt(hours) + 1; var timeZone = -now.getTimezoneOffset() / 60; if (!isTimeZoneIntialized()) { $('#' + FEEDBACK_SESSION_STARTDATE).val(currentDate); $('#' + FEEDBACK_SESSION_STARTTIME).val(currentTime); $('#' + FEEDBACK_SESSION_TIMEZONE).val(timeZone); } var uninitializedTimeZone = $('#timezone > option[value=\'' + TIMEZONE_SELECT_UNINITIALISED + '\']'); if (uninitializedTimeZone) { uninitializedTimeZone.remove(); } } function isTimeZoneIntialized() { return $('#timezone').val() !== TIMEZONE_SELECT_UNINITIALISED; } /** * Format a number to be two digits */ function formatDigit(num) { return (num < 10 ? '0' : '') + num; } /** * Format a date object into DD/MM/YYYY format * @param date * @returns {String} */ function convertDateToDDMMYYYY(date) { return formatDigit(date.getDate()) + '/' + formatDigit(date.getMonth() + 1) + '/' + date.getFullYear(); } /** * Format a date object into HHMM format * @param date * @returns {String} */ function convertDateToHHMM(date) { return formatDigit(date.getHours()) + formatDigit(date.getMinutes()); } function bindCopyButton() { $('#button_copy').on('click', function(e) { e.preventDefault(); var selectedCourseId = $('#' + COURSE_ID + ' option:selected').text(); var newFeedbackSessionName = $('#' + FEEDBACK_SESSION_NAME).val(); var isExistingSession = false; var $sessionsList = $('tr[id^="session"]'); if (!$sessionsList.length) { setStatusMessage(FEEDBACK_SESSION_COPY_INVALID, StatusType.DANGER); return false; } $sessionsList.each(function() { var $cells = $(this).find('td'); var courseId = $($cells[0]).text(); var feedbackSessionName = $($cells[1]).text(); if (selectedCourseId === courseId && newFeedbackSessionName === feedbackSessionName) { isExistingSession = true; return false; } }); if (isExistingSession) { setStatusMessage(DISPLAY_FEEDBACK_SESSION_NAME_DUPLICATE, StatusType.DANGER); } else { clearStatusMessages(); var $firstSession = $($sessionsList[0]).find('td'); var firstSessionCourseId = $($firstSession[0]).text(); var firstSessionName = $($firstSession[1]).text(); $('#copyModal').modal('show'); $('#modalCopiedSessionName').val(newFeedbackSessionName.trim()); $('#modalCopiedCourseId').val(selectedCourseId.trim()); var $modalCourseId = $('#modalCourseId'); if (!$modalCourseId.val().trim()) { $modalCourseId.val(firstSessionCourseId); } var $modalSessionName = $('#modalSessionName'); if (!$modalSessionName.val().trim()) { $modalSessionName.val(firstSessionName); } } return false; }); $('#button_copy_submit').on('click', function(e) { e.preventDefault(); var $newSessionName = $('#modalCopiedSessionName'); if ($newSessionName.val()) { addLoadingIndicator($('#button_copy_submit'), 'Copying '); $('#copyModalForm').submit(); } else { $newSessionName.addClass('text-box-error'); $('#copyModal').animate({ scrollTop: $newSessionName.offset().top }, 500); } return false; }); } function bindCopyEvents() { $('#copyTableModal > tbody > tr').on('click', function() { var $currentlySelectedRow = $(this); if ($currentlySelectedRow.hasClass('row-selected')) { return; } var $cells = $currentlySelectedRow.children('td'); var courseId = $($cells[1]).text().trim(); var feedbackSessionName = $($cells[2]).text().trim(); $('#modalCourseId').val(courseId); $('#modalSessionName').val(feedbackSessionName); var $previouslySelectedRadio = $currentlySelectedRow.parent().find('input:checked'); var $previouslySelectedRow = $previouslySelectedRadio.closest('tr'); $previouslySelectedRadio.prop('checked', false); $previouslySelectedRow.removeClass('row-selected'); var $currentlySelectedRadio = $currentlySelectedRow.children('td').children('input'); $currentlySelectedRadio.prop('checked', true); $currentlySelectedRow.addClass('row-selected'); $('#button_copy_submit').prop('disabled', false); }); } function readyFeedbackPage() { formatSessionVisibilityGroup(); formatResponsesVisibilityGroup(); collapseIfPrivateSession(); selectDefaultTimeOptions(); loadSessionsByAjax(); bindUncommonSettingsEvents(); bindDeleteButtons(); bindRemindButtons(); bindPublishButtons(); bindUnpublishButtons(); updateUncommonSettingsInfo(); showUncommonPanelsIfNotInDefaultValues(); } function loadSessionsByAjax() { $('#ajaxForSessions').trigger('submit'); } function bindEventsAfterAjax() { bindCopyButton(); bindCopyEvents(); linkAjaxForResponseRate(); setupFsCopyModal(); } function bindUncommonSettingsEvents() { $('#editUncommonSettingsSessionResponsesVisibleButton') .click(showUncommonPanelsForSessionResponsesVisible); $('#editUncommonSettingsSendEmailsButton') .click(showUncommonPanelsForSendEmails); } function updateUncommonSettingsInfo() { updateUncommonSettingsSessionVisibilityInfo(); updateUncommonSettingsEmailSendingInfo(); } function updateUncommonSettingsSessionVisibilityInfo() { var info = 'Session is visible at submission opening time, ' + 'responses are only visible when you publish the results.'; $('#uncommonSettingsSessionResponsesVisibleInfoText').html(info); } function updateUncommonSettingsEmailSendingInfo() { var info = 'Emails are sent when session opens (within 15 mins), ' + '24 hrs before session closes and when results are published.'; $('#uncommonSettingsSendEmailsInfoText').html(info); } function isDefaultSessionResponsesVisibleSetting() { return $('#sessionVisibleFromButton_atopen').prop('checked') && $('#resultsVisibleFromButton_later').prop('checked'); } function isDefaultSendEmailsSetting() { return $('#sendreminderemail_open').prop('checked') && $('#sendreminderemail_closing').prop('checked') && $('#sendreminderemail_published').prop('checked'); } function showUncommonPanels() { showUncommonPanelsForSessionResponsesVisible(); showUncommonPanelsForSendEmails(); } function showUncommonPanelsForSessionResponsesVisible() { var $sessionResponsesVisiblePanel = $('#sessionResponsesVisiblePanel'); $('#uncommonSettingsSessionResponsesVisible').after($sessionResponsesVisiblePanel); $sessionResponsesVisiblePanel.show(); $('#uncommonSettingsSessionResponsesVisibleInfoText').parent().hide(); } function showUncommonPanelsForSendEmails() { var $sendEmailsForPanel = $('#sendEmailsForPanel'); $('#uncommonSettingsSendEmails').after($sendEmailsForPanel); $sendEmailsForPanel.show(); $('#uncommonSettingsSendEmailsInfoText').parent().hide(); } function showUncommonPanelsIfNotInDefaultValues() { if (!isDefaultSessionResponsesVisibleSetting()) { showUncommonPanelsForSessionResponsesVisible(); } if (!isDefaultSendEmailsSetting()) { showUncommonPanelsForSendEmails(); } } /** * Hides / shows the 'Submissions Opening/Closing Time' and 'Grace Period' options * depending on whether a private session is selected.<br> * Toggles whether custom fields are enabled or not for session visible time based * on checkbox selection. * @param $privateBtn */ function formatSessionVisibilityGroup() { var $sessionVisibilityBtnGroup = $('[name=' + FEEDBACK_SESSION_SESSIONVISIBLEBUTTON + ']'); $sessionVisibilityBtnGroup.change(function() { collapseIfPrivateSession(); if ($sessionVisibilityBtnGroup.filter(':checked').val() === 'custom') { toggleDisabledAndStoreLast(FEEDBACK_SESSION_VISIBLEDATE, false); toggleDisabledAndStoreLast(FEEDBACK_SESSION_VISIBLETIME, false); } else { toggleDisabledAndStoreLast(FEEDBACK_SESSION_VISIBLEDATE, true); toggleDisabledAndStoreLast(FEEDBACK_SESSION_VISIBLETIME, true); } }); } /** * Toggles whether custom fields are enabled or not for session visible time based * on checkbox selection. * @param $privateBtn */ function formatResponsesVisibilityGroup() { var $responsesVisibilityBtnGroup = $('[name=' + FEEDBACK_SESSION_RESULTSVISIBLEBUTTON + ']'); $responsesVisibilityBtnGroup.change(function() { if ($responsesVisibilityBtnGroup.filter(':checked').val() === 'custom') { toggleDisabledAndStoreLast(FEEDBACK_SESSION_PUBLISHDATE, false); toggleDisabledAndStoreLast(FEEDBACK_SESSION_PUBLISHTIME, false); } else { toggleDisabledAndStoreLast(FEEDBACK_SESSION_PUBLISHDATE, true); toggleDisabledAndStoreLast(FEEDBACK_SESSION_PUBLISHTIME, true); } }); } /** * Saves the (disabled) state of the element in attribute data-last.<br> * Toggles whether the given element {@code id} is disabled or not based on * {@code bool}.<br> * Disabled if true, enabled if false. */ function toggleDisabledAndStoreLast(id, bool) { $('#' + id).prop('disabled', bool); $('#' + id).data('last', $('#' + id).prop('disabled')); } /** * Collapses/hides unnecessary fields/cells/tables if private session option is selected. */ function collapseIfPrivateSession() { if ($('[name=' + FEEDBACK_SESSION_SESSIONVISIBLEBUTTON + ']').filter(':checked').val() === 'never') { $('#timeFramePanel, #instructionsRow, #responsesVisibleFromColumn').hide(); } else { $('#timeFramePanel, #instructionsRow, #responsesVisibleFromColumn').show(); } }
gpl-2.0
alucardxlx/caoticamente-shards
Scripts/Spells/Seventh/GateTravel.cs
7056
using System; using Server.Network; using Server.Multis; using Server.Items; using Server.Targeting; using Server.Misc; using Server.Regions; using Server.Mobiles; namespace Server.Spells.Seventh { public class GateTravelSpell : MagerySpell { private static SpellInfo m_Info = new SpellInfo( "Gate Travel", "Vas Rel Por", 263, 9032, Reagent.BlackPearl, Reagent.MandrakeRoot, Reagent.SulfurousAsh ); public override SpellCircle Circle { get { return SpellCircle.Seventh; } } private RunebookEntry m_Entry; public GateTravelSpell( Mobile caster, Item scroll ) : this( caster, scroll, null ) { } public GateTravelSpell( Mobile caster, Item scroll, RunebookEntry entry ) : base( caster, scroll, m_Info ) { m_Entry = entry; } public override void OnCast() { if ( m_Entry == null ) Caster.Target = new InternalTarget( this ); else Effect( m_Entry.Location, m_Entry.Map, true ); } public override bool CheckCast() { if ( Factions.Sigil.ExistsOn( Caster ) ) { Caster.SendLocalizedMessage( 1061632 ); // You can't do that while carrying the sigil. return false; } else if ( Caster.Criminal ) { Caster.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily. return false; } else if ( SpellHelper.CheckCombat( Caster ) ) { Caster.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle?? return false; } return SpellHelper.CheckTravel( Caster, TravelCheckType.GateFrom ); } private bool GateExistsAt(Map map, Point3D loc ) { bool _gateFound = false; IPooledEnumerable eable = map.GetItemsInRange( loc, 0 ); foreach ( Item item in eable ) { if ( item is Moongate || item is PublicMoongate ) { _gateFound = true; break; } } eable.Free(); return _gateFound; } public void Effect( Point3D loc, Map map, bool checkMulti ) { if ( Factions.Sigil.ExistsOn( Caster ) ) { Caster.SendLocalizedMessage( 1061632 ); // You can't do that while carrying the sigil. } else if ( map == null || (!Core.AOS && Caster.Map != map) ) { Caster.SendLocalizedMessage( 1005570 ); // You can not gate to another facet. } else if ( !SpellHelper.CheckTravel( Caster, TravelCheckType.GateFrom ) ) { } else if ( !SpellHelper.CheckTravel( Caster, map, loc, TravelCheckType.GateTo ) ) { } else if ( map == Map.Felucca && Caster is PlayerMobile && ((PlayerMobile)Caster).Young ) { Caster.SendLocalizedMessage( 1049543 ); // You decide against traveling to Felucca while you are still young. } else if ( Caster.Kills >= 5 && map != Map.Felucca ) { Caster.SendLocalizedMessage( 1019004 ); // You are not allowed to travel there. } else if ( Caster.Criminal ) { Caster.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily. } else if ( SpellHelper.CheckCombat( Caster ) ) { Caster.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle?? } else if ( !map.CanSpawnMobile( loc.X, loc.Y, loc.Z ) ) { Caster.SendLocalizedMessage( 501942 ); // That location is blocked. } else if ( (checkMulti && SpellHelper.CheckMulti( loc, map )) ) { Caster.SendLocalizedMessage( 501942 ); // That location is blocked. } else if ( Core.SE && ( GateExistsAt( map, loc ) || GateExistsAt( Caster.Map, Caster.Location ) ) ) // SE restricted stacking gates { Caster.SendLocalizedMessage( 1071242 ); // There is already a gate there. } else if ( CheckSequence() ) { Caster.SendLocalizedMessage( 501024 ); // You open a magical gate to another location Effects.PlaySound( Caster.Location, Caster.Map, 0x20E ); InternalItem firstGate = new InternalItem( loc, map ); firstGate.MoveToWorld( Caster.Location, Caster.Map ); Effects.PlaySound( loc, map, 0x20E ); InternalItem secondGate = new InternalItem( Caster.Location, Caster.Map ); secondGate.MoveToWorld( loc, map ); } FinishSequence(); } [DispellableField] private class InternalItem : Moongate { public override bool ShowFeluccaWarning{ get{ return Core.AOS; } } public InternalItem( Point3D target, Map map ) : base( target, map ) { Map = map; if ( ShowFeluccaWarning && map == Map.Felucca ) ItemID = 0xDDA; Dispellable = true; InternalTimer t = new InternalTimer( this ); t.Start(); } public InternalItem( Serial serial ) : base( serial ) { } public override void Serialize( GenericWriter writer ) { base.Serialize( writer ); } public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); Delete(); } private class InternalTimer : Timer { private Item m_Item; public InternalTimer( Item item ) : base( TimeSpan.FromSeconds( 30.0 ) ) { Priority = TimerPriority.OneSecond; m_Item = item; } protected override void OnTick() { m_Item.Delete(); } } } private class InternalTarget : Target { private GateTravelSpell m_Owner; public InternalTarget( GateTravelSpell owner ) : base( 12, false, TargetFlags.None ) { m_Owner = owner; owner.Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 501029 ); // Select Marked item. } protected override void OnTarget( Mobile from, object o ) { if ( o is RecallRune ) { RecallRune rune = (RecallRune)o; if ( rune.Marked ) m_Owner.Effect( rune.Target, rune.TargetMap, true ); else from.SendLocalizedMessage( 501803 ); // That rune is not yet marked. } else if ( o is Runebook ) { RunebookEntry e = ((Runebook)o).Default; if ( e != null ) m_Owner.Effect( e.Location, e.Map, true ); else from.SendLocalizedMessage( 502354 ); // Target is not marked. } /*else if ( o is Key && ((Key)o).KeyValue != 0 && ((Key)o).Link is BaseBoat ) { BaseBoat boat = ((Key)o).Link as BaseBoat; if ( !boat.Deleted && boat.CheckKey( ((Key)o).KeyValue ) ) m_Owner.Effect( boat.GetMarkedLocation(), boat.Map, false ); else from.Send( new MessageLocalized( from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 501030, from.Name, "" ) ); // I can not gate travel from that object. }*/ else { from.Send( new MessageLocalized( from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 501030, from.Name, "" ) ); // I can not gate travel from that object. } } protected override void OnNonlocalTarget( Mobile from, object o ) { } protected override void OnTargetFinish( Mobile from ) { m_Owner.FinishSequence(); } } } }
gpl-2.0
zanderkyle/zandergraphics
administrator/components/com_rsseo/views/analytics/tmpl/general.php
800
<?php /** * @version 1.0.0 * @package RSSEO! 1.0.0 * @copyright (C) 2009-2012 www.rsjoomla.com * @license GPL, http://www.gnu.org/copyleft/gpl.html */ defined('_JEXEC') or die('Restricted access'); ?> <?php if (is_array($this->general)) { ?> <fieldset> <legend><?php echo JText::_('COM_RSSEO_GA_GENERAL'); ?></legend> <table class="table table-striped adminlist" style="width: 65%"> <tbody> <?php if (!empty($this->general)) { ?> <?php foreach ($this->general as $result) { ?> <tr class="hasTip" title="<?php echo $result->descr; ?>"> <td style="text-align:right;"><?php echo $result->title; ?></td> <td class="key" style="text-align:left;"><?php echo $result->value; ?></td> </tr> <?php } ?> <?php } ?> </tbody> </table> </fieldset> <?php } else echo $this->general; ?>
gpl-2.0
xebialabs/nio-overthere
src/test/java/com/xebialabs/overthere/nio/file/OvertherePathTest.java
12828
package com.xebialabs.overthere.nio.file; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.CoreMatchers.nullValue; import static org.hamcrest.MatcherAssert.assertThat; import static org.testng.Assert.fail; import java.io.IOException; import java.net.URI; import java.nio.file.FileSystem; import java.nio.file.FileSystems; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Collections; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class OvertherePathTest { FileSystem fileSystem; private FileSystem myFileSystem; private Path absolutePath; private Path relativePath; private Path root; private Path emptyPath; @BeforeClass public void createFileSystem() throws IOException { myFileSystem = FileSystems.getFileSystem(URI.create("file:///")); fileSystem = FileSystems.newFileSystem(URI.create("local:/"), Collections.<String, Object>emptyMap()); absolutePath = fileSystem.getPath("/first", "second", "third"); relativePath = fileSystem.getPath("first", "second", "third"); emptyPath = fileSystem.getPath(""); root = fileSystem.getPath("/"); } @AfterClass public void closeFileSystem() throws IOException { fileSystem.close(); } @Test public void shouldCreatePathsWithAbsoluteAndToStringChecks() { checkPath("", false, ""); checkPath("/", true, "/"); checkPath("first", false, "first"); checkPath("first/second/third", false, "first", "second", "third"); checkPath("first/second/third", false, "first/second", "third"); checkPath("first/second/third", false, "first", "second/third"); checkPath("/first", true, "/first"); checkPath("/first/second/third", true, "/first", "second", "third"); checkPath("/first/second/third", true, "/first/second", "third"); checkPath("/first/second/third", true, "/first", "second/third"); checkPath("/first/third", true, "/first", "", "third"); } private void checkPath(String expectedPath, boolean expectedAbsolute, String first, String... more) { Path p = fileSystem.getPath(first, more); assertThat(p.toString(), equalTo(expectedPath)); assertThat(p.isAbsolute(), equalTo(expectedAbsolute)); } @Test public void shouldCreatePath() { assertThat(absolutePath, notNullValue()); } @Test public void shouldCreateOvertherePath() { assertThat(absolutePath, instanceOf(OvertherePath.class)); } @Test public void shouldGetNameCount() { assertThat(absolutePath.getNameCount(), equalTo(3)); } @Test public void shouldGetParent() { assertThat(absolutePath.getParent().toString(), equalTo("/first/second")); } @Test public void shouldGetParentShouldEndUpAtRoot() { assertThat(absolutePath.getParent().getParent().getParent().toString(), equalTo("/")); } @Test public void shouldGetParentOfRoot() { assertThat(root.getParent(), nullValue()); } @Test public void shouldGetRootOfRelativePath() { assertThat(fileSystem.getPath("foo").getRoot(), nullValue()); } @Test public void shoulGetRootOfAbsolutePath() { assertThat(absolutePath.getRoot().toString(), equalTo("/")); } @Test public void shouldGetFileName() { assertThat(absolutePath.getFileName().toString(), equalTo("third")); } @Test public void shouldNotGetFileNameOfRoot() { assertThat(root.getFileName(), nullValue()); } @Test public void shouldGetNameOfPath() { assertThat(absolutePath.getName(0).toString(), equalTo("first")); assertThat(absolutePath.getName(1).toString(), equalTo("second")); assertThat(absolutePath.getName(2).toString(), equalTo("third")); } @Test(expectedExceptions = IllegalArgumentException.class) public void shouldNotGetNameForNegativeIndex() { absolutePath.getName(-1); fail(); } @Test(expectedExceptions = IllegalArgumentException.class) public void shouldNotGetNameForTooLargeIndex() { absolutePath.getName(3); fail(); } @Test(expectedExceptions = IllegalArgumentException.class) public void shouldNotGetNameOfRoot() { root.getName(0); fail(); } @Test(expectedExceptions = IllegalArgumentException.class) public void shouldNotGetSubpathForTooLowBeginIndex() { absolutePath.subpath(-1, 2); fail(); } @Test(expectedExceptions = IllegalArgumentException.class) public void shouldNotGetSubpathForTooHighEndIndex() { absolutePath.subpath(0, 4); fail(); } @Test(expectedExceptions = IllegalArgumentException.class) public void shouldNotGetSubpathForReversedBeginAndEndIndex() { absolutePath.subpath(3, 1); fail(); } @Test(expectedExceptions = IllegalArgumentException.class) public void shouldNotGetSubpathForEmptyRange() { absolutePath.subpath(1, 1); fail(); } @Test public void shouldGetSubpath() { assertThat(absolutePath.subpath(0, 3).toString(), equalTo("first/second/third")); assertThat(absolutePath.subpath(1, 3).toString(), equalTo("second/third")); assertThat(absolutePath.subpath(2, 3).toString(), equalTo("third")); assertThat(absolutePath.subpath(1, 2).toString(), equalTo("second")); } @Test public void shouldStartWithPath() { Path onMyFileSystem = myFileSystem.getPath("first", "second", "third"); Path twoComponents = fileSystem.getPath("first", "second"); Path twoComponentsAbsolute = fileSystem.getPath("/first", "second"); Path lastTwoComponents = fileSystem.getPath("second", "third"); assertThat(relativePath.startsWith(twoComponents), equalTo(true)); assertThat(absolutePath.startsWith(twoComponentsAbsolute), equalTo(true)); assertThat(relativePath.startsWith(relativePath), equalTo(true)); assertThat(absolutePath.startsWith(absolutePath), equalTo(true)); assertThat(onMyFileSystem.startsWith(relativePath), equalTo(false)); assertThat(relativePath.startsWith(onMyFileSystem), equalTo(false)); assertThat(twoComponents.startsWith(relativePath), equalTo(false)); assertThat(absolutePath.startsWith(relativePath), equalTo(false)); assertThat(relativePath.startsWith(lastTwoComponents), equalTo(false)); assertThat(absolutePath.startsWith(relativePath), equalTo(false)); } @Test public void shouldStartWithString() { Path twoComponents = fileSystem.getPath("first", "second"); assertThat(relativePath.startsWith("first/second"), equalTo(true)); assertThat(absolutePath.startsWith("/first/second"), equalTo(true)); assertThat(relativePath.startsWith("first/second/third"), equalTo(true)); assertThat(absolutePath.startsWith("/first/second/third"), equalTo(true)); assertThat(twoComponents.startsWith("first/second/third"), equalTo(false)); assertThat(absolutePath.startsWith("first/second/third"), equalTo(false)); assertThat(relativePath.startsWith("second/third"), equalTo(false)); assertThat(absolutePath.startsWith("first/second/third"), equalTo(false)); } @Test public void shouldEndWithPath() { Path lastTwoComponents = fileSystem.getPath("second", "third"); Path onMyFileSystem = myFileSystem.getPath("first", "second", "third"); assertThat(absolutePath.endsWith(lastTwoComponents), equalTo(true)); assertThat(relativePath.endsWith(lastTwoComponents), equalTo(true)); assertThat(absolutePath.endsWith(absolutePath), equalTo(true)); assertThat(relativePath.endsWith(relativePath), equalTo(true)); assertThat(absolutePath.endsWith(relativePath), equalTo(true)); assertThat(relativePath.endsWith(absolutePath), equalTo(false)); assertThat(onMyFileSystem.endsWith(relativePath), equalTo(false)); assertThat(relativePath.endsWith(onMyFileSystem), equalTo(false)); } @Test public void shouldEndWithString() { assertThat(absolutePath.endsWith("second/third"), equalTo(true)); assertThat(relativePath.endsWith("second/third"), equalTo(true)); assertThat(absolutePath.endsWith("/first/second/third"), equalTo(true)); assertThat(relativePath.endsWith("first/second/third"), equalTo(true)); assertThat(absolutePath.endsWith("first/second/third"), equalTo(true)); assertThat(relativePath.endsWith("/first/second/third"), equalTo(false)); } @Test public void shouldNormalize() { assertThat(fileSystem.getPath("/", "..").normalize().toString(), equalTo("/")); assertThat(fileSystem.getPath("/", "first", ".").normalize().toString(), equalTo("/first")); assertThat(fileSystem.getPath("/", "first", "second/..").normalize().toString(), equalTo("/first")); assertThat(fileSystem.getPath("/", "first", "..", "second").normalize().toString(), equalTo("/second")); assertThat(fileSystem.getPath("/", "first", ".", "second").normalize().toString(), equalTo("/first/second")); } @Test public void shouldResolvePaths() { assertThat(relativePath.resolve(absolutePath), equalTo(absolutePath)); assertThat(absolutePath.resolve(relativePath), equalTo(fileSystem.getPath("/first/second/third/first/second/third"))); assertThat(relativePath.resolve(relativePath), equalTo(fileSystem.getPath("first/second/third/first/second/third"))); assertThat(absolutePath.resolve(fileSystem.getPath("")), equalTo(absolutePath)); } @Test public void shouldResolveStrings() { assertThat(relativePath.resolve("/first/second/third"), equalTo(absolutePath)); assertThat(absolutePath.resolve("first/second/third"), equalTo(fileSystem.getPath("/first/second/third/first/second/third"))); assertThat(relativePath.resolve("first/second/third"), equalTo(fileSystem.getPath("first/second/third/first/second/third"))); assertThat(absolutePath.resolve(""), equalTo(absolutePath)); } @Test public void shouldResolveSiblingPaths() { assertThat(relativePath.resolveSibling(absolutePath), equalTo(absolutePath)); assertThat(absolutePath.resolveSibling(relativePath), equalTo(fileSystem.getPath("/first/second/first/second/third"))); assertThat(relativePath.resolveSibling(relativePath), equalTo(fileSystem.getPath("first/second/first/second/third"))); assertThat(absolutePath.resolveSibling(emptyPath), equalTo(absolutePath.getParent())); } @Test public void shouldResolveSiblingStrings() { assertThat(relativePath.resolveSibling("/first/second/third"), equalTo(absolutePath)); assertThat(absolutePath.resolveSibling("first/second/third"), equalTo(fileSystem.getPath("/first/second/first/second/third"))); assertThat(relativePath.resolveSibling("first/second/third"), equalTo(fileSystem.getPath("first/second/first/second/third"))); assertThat(absolutePath.resolveSibling(""), equalTo(absolutePath.getParent())); } @Test public void shouldOnlyRelativizeWhenBothAreAbsoluteOrNot() { try { absolutePath.relativize(relativePath); fail(); } catch (IllegalArgumentException ok) { // ok } try { relativePath.relativize(absolutePath); fail(); } catch (IllegalArgumentException ok) { // ok } } @Test public void shouldRelativizePaths() { assertThat(absolutePath.relativize(absolutePath), equalTo(emptyPath)); assertThat(relativePath.relativize(relativePath), equalTo(emptyPath)); assertThat(absolutePath.relativize(fileSystem.getPath("/first/fourth/fifth")), equalTo(fileSystem.getPath("../../fourth/fifth"))); assertThat(absolutePath.relativize(fileSystem.getPath("/first/fourth")), equalTo(fileSystem.getPath("../../fourth"))); assertThat(fileSystem.getPath("/first/second").relativize(fileSystem.getPath("/first/second/third/fourth")), equalTo(fileSystem.getPath("third/fourth"))); } @Test public void shouldConvertToUri() { URI uri = absolutePath.toUri(); assertThat(Paths.get(uri), equalTo(absolutePath)); Path path = fileSystem.getPath("/first/second"); URI uri1 = path.toUri(); assertThat(uri1.toString(), equalTo("local:/first/second")); } }
gpl-2.0
quakerntj/UsbAccessory
UsbTest/src/ch/serverbox/android/usbtest/UsbTest.java
6144
package ch.serverbox.android.usbtest; import java.io.FileDescriptor; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.util.ArrayList; import android.hardware.usb.UsbAccessory; import android.hardware.usb.UsbManager; import android.app.Activity; import android.app.PendingIntent; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.nfc.NfcManager; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; public class UsbTest extends Activity { private UsbAccessory mAccessory = null; private Button mBtSend = null; private FileOutputStream mFout = null; private PendingIntent mPermissionIntent = null; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); IntentFilter i = new IntentFilter(); i.addAction(UsbManager.ACTION_USB_ACCESSORY_ATTACHED); i.addAction(UsbManager.ACTION_USB_ACCESSORY_DETACHED); i.addAction("ch.serverbox.android.usbtest.USBPERMISSION"); registerReceiver(mUsbReceiver,i); UsbManager manager = (UsbManager) getSystemService(Context.USB_SERVICE); mBtSend = (Button)(findViewById(R.id.btSebd)); mBtSend.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String s = ((EditText)findViewById(R.id.editText1)).getText().toString(); queueWrite(s); } }); mBtSend.setEnabled(false); if (getIntent().getAction().equals("android.hardware.usb.action.USB_ACCESSORY_ATTACHED")){ Log.d("USB", "Action is usb"); UsbAccessory accessory = getAccessory(getIntent()); mAccessory = accessory; FileDescriptor fd = null; try { fd = manager.openAccessory(accessory).getFileDescriptor(); } catch (IllegalArgumentException e){ finish(); } catch (NullPointerException e){ finish(); } mFout = new FileOutputStream(fd); mBtSend.setEnabled(true); } else { UsbAccessory[] accessories = manager.getAccessoryList(); if (accessories != null) { for (UsbAccessory a : accessories) { l("accessory: "+a.getManufacturer()); if (a.getManufacturer().equals("Nexus-Computing GmbH")) { mPermissionIntent = PendingIntent.getBroadcast(this, 0, new Intent("ch.serverbox.android.usbtest.USBPERMISSION"),0); manager.requestPermission(a,mPermissionIntent); Log.d("USB", "permission requested"); break; } } mBtSend.setEnabled(true); } } } @Override protected void onDestroy() { unregisterReceiver(mUsbReceiver); super.onDestroy(); } public void queueWrite(final String data){ if(mAccessory == null){ return; } new Thread(new Runnable() { @Override public void run() { try { Log.d("USB", "Writing length "+data.length()); mFout.write(String.valueOf(data.length()).getBytes()); Log.d("USB", "Writing data: "+data); mFout.write(data.getBytes()); Log.d("USB","Done writing"); } catch (IOException e) { e.printStackTrace(); } } }).start(); } private final BroadcastReceiver mUsbReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); UsbManager manager = (UsbManager) getSystemService(Context.USB_SERVICE); if (UsbManager.ACTION_USB_ACCESSORY_ATTACHED.equals(action)) { UsbAccessory accessory = getAccessory(intent); Log.d("USB","Attached!"); if (intent.getBooleanExtra( UsbManager.EXTRA_PERMISSION_GRANTED, false)) { mAccessory = accessory; FileDescriptor fd = null; try { fd = manager.openAccessory(accessory).getFileDescriptor(); } catch (IllegalArgumentException e){ finish(); } catch (NullPointerException e){ finish(); } mFout = new FileOutputStream(fd); mBtSend.setEnabled(true); } else { Log.d("USB", "permission denied for accessory " + accessory); } } else if (UsbManager.ACTION_USB_ACCESSORY_DETACHED.equals(action)) { UsbAccessory accessory = getAccessory(intent); if (accessory != null && accessory.equals(mAccessory)) { if(mFout != null) try { mFout.close(); } catch (IOException e) { e.printStackTrace(); } mAccessory = null; mBtSend.setEnabled(false); } } else if ("ch.serverbox.android.usbtest.USBPERMISSION".equals(action)) { l("permission answered"); if (intent.getBooleanExtra(UsbManager.EXTRA_PERMISSION_GRANTED, false)) { UsbAccessory[] accessories = manager.getAccessoryList(); for (UsbAccessory a : accessories){ l("accessory: "+a.getManufacturer()); if (a.getManufacturer().equals("Nexus-Computing GmbH")) { mAccessory = a; FileDescriptor fd = null; try { fd = manager.openAccessory(a).getFileDescriptor(); } catch (IllegalArgumentException e){ finish(); } catch (NullPointerException e){ finish(); } mFout = new FileOutputStream(fd); l("added accessory"); break; } } } } } }; private void l(String l){ Log.d("USB", l); } private static UsbAccessory getAccessory(Intent intent) { UsbAccessory accessory = (UsbAccessory) intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY); return accessory; } }
gpl-2.0
Fareroo7/SmartRobot
SmartRobot/src/at/htl/smartbot/EnvironmentalParameter.java
1296
package at.htl.smartbot; /** * Defines and calculates environmental parameters * Primary the change of the acoustic velocity with the temperature. * * @author Jakob Ecker * @author Domink Simon * @version 1.0 */ public class EnvironmentalParameter { /** * Acoustic velocity in air for temperature is 0 Celius */ private static final double ACOUSTIC_VELOCITY_0 = 331.5; public static final double EXPANSION_COEFFICIENT = 1 / 273.15; // air temperature in Celius private static double air_temperature = 20; /** * Returns the acoustic velocity. * @return The acoustic velocity for the air temperature set in setAirTemperature(...) <br /> The default value for temperature is 20 Celius. */ public static double getAcousticVelocity() { return ACOUSTIC_VELOCITY_0 * Math.sqrt(1 + EXPANSION_COEFFICIENT * air_temperature); } /** * Returns the air temperature. * @return air_temperature Air temperature in Celius. */ public static double getAirTemperature() { return air_temperature; } /** * Sets the air temperature. * @param air_temperature Air temperature in Celius. */ public static void setAirTemperature(double air_temperature) { EnvironmentalParameter.air_temperature = air_temperature; } }
gpl-2.0
heqiaoliu/Viral-Dark-Matter
ivireons/server_ivireon_test/cgi-bin/Bioperl/toolbox/matlab/specgraph/private/src/3D.cpp
2814
/* Copyright 1993-2002 The MathWorks, Inc. */ /* Source file for reducep MEX file */ static char rcsid[] = "$Revision: 1.4 $"; #include "std.h" #include "random.h" #include "3D.h" Vec3 randomPoint(const Vec3& v1, const Vec3& v2) { real a = random1(); return a*v1 + (1-a)*v2; } Vec3 randomPoint(const Vec3& v1, const Vec3& v2, const Vec3& v3) { real b1 = 1 - sqrt( 1-random1() ); real b2 = (1-b1) * random1(); real b3 = 1 - b1 - b2; return b1*v1 + b2*v2 + b3*v3; } real triangleArea(const Vec3& v1, const Vec3& v2, const Vec3& v3) { Vec3 a = v2 - v1; Vec3 b = v3 - v1; return 0.5 * length(a ^ b); } #define ROOT3 1.732050807568877 #define FOUR_ROOT3 6.928203230275509 real triangleCompactness(const Vec3& v1, const Vec3& v2, const Vec3& v3) { real L1 = norm2(v2-v1); real L2 = norm2(v3-v2); real L3 = norm2(v1-v3); return FOUR_ROOT3 * triangleArea(v1,v2,v3) / (L1+L2+L3); } ////////////////////////////////////////////////////////////////////////. // // class: Bounds // void Bounds::reset() { min[X] = min[Y] = min[Z] = HUGE; max[X] = max[Y] = max[Z] = -HUGE; center[X] = center[Y] = center[Z] = 0.0; radius = 0.0; points = 0; } void Bounds::addPoint(const Vec3& v) { if( v[X] < min[X] ) min[X] = v[X]; if( v[Y] < min[Y] ) min[Y] = v[Y]; if( v[Z] < min[Z] ) min[Z] = v[Z]; if( v[X] > max[X] ) max[X] = v[X]; if( v[Y] > max[Y] ) max[Y] = v[Y]; if( v[Z] > max[Z] ) max[Z] = v[Z]; center += v; points++; } void Bounds::complete() { center /= (real)points; Vec3 R1 = max-center; Vec3 R2 = min-center; radius = MAX(length(R1), length(R2)); } //////////////////////////////////////////////////////////////////////// // // class: Plane // void Plane::calcFrom(const Vec3& p1, const Vec3& p2, const Vec3& p3) { Vec3 v1 = p2-p1; Vec3 v2 = p3-p1; n = v1 ^ v2; unitize(n); d = -n*p1; } void Plane::calcFrom(const array<Vec3>& verts) { n[X] = n[Y] = n[Z] = 0.0; int i; for(i=0; i<verts.length()-1; i++) { const Vec3& cur = verts[i]; const Vec3& next = verts[i+1]; n[X] += (cur[Y] - next[Y]) * (cur[Z] + next[Z]); n[Y] += (cur[Z] - next[Z]) * (cur[X] + next[X]); n[Z] += (cur[X] - next[X]) * (cur[Y] + next[Y]); } const Vec3& cur = verts[verts.length()-1]; const Vec3& next = verts[0]; n[X] += (cur[Y] - next[Y]) * (cur[Z] + next[Z]); n[Y] += (cur[Z] - next[Z]) * (cur[X] + next[X]); n[Z] += (cur[X] - next[X]) * (cur[Y] + next[Y]); unitize(n); d = -n*verts[0]; } //////////////////////////////////////////////////////////////////////// // // class: Face3 // real Face3::area() { return triangleArea(vertexPos(0),vertexPos(1),vertexPos(2)); }
gpl-2.0
fejoa/IVANWorldmapResearch
WorldBuild_Locations.py
6674
# -*- coding: utf-8 -*- """ IVAN Worldmap Research Copyright (C) Ryan van Herel Released under the GNU General Public License See LICENSING which should be included along with this file for more details @author: fejoa """ import matplotlib.pyplot as plt import numpy as np import matplotlib.cm as cm import random import math from PoissonDiskGeneratorIntegers import pds perm = range(256) random.shuffle(perm) perm += perm dirs = [(math.cos(a * 2.0 * math.pi / 256), math.sin(a * 2.0 * math.pi / 256)) for a in range(256)] def noise2(x, y, per): def surflet(gridX, gridY): distX, distY = abs(x-gridX), abs(y-gridY) polyX = 1 - 6*distX**5 + 15*distX**4 - 10*distX**3 polyY = 1 - 6*distY**5 + 15*distY**4 - 10*distY**3 #hashed = perm[perm[int(gridX)%per] + int(gridY)%per] hashed = perm[perm[int(gridX)] + int(gridY)%per] grad = (x-gridX)*dirs[hashed][0] + (y-gridY)*dirs[hashed][1] #grad = (y-gridY)*dirs[hashed][1] #grad = (x-gridX) + (y-gridY) return polyX * polyY * grad intX, intY = int(x), int(y) return (surflet(intX+0, intY+0) + surflet(intX+1, intY+0) + surflet(intX+0, intY+1) + surflet(intX+1, intY+1)) def non(x, y, per, octs): val = 0 for o in range(octs): val += 0.5**o * noise2(x*2**o, y*2**o, per*2**o) return val class worldmap: def __init__(self, length, width, smooth, steps, GENERATE_CONTINENTS): self.__length = length self.__width = width self.__area = length * width self.__AltitudeBuffer = np.zeros((width, length)) self.__OldAltitudeBuffer = np.zeros((width, length)) self.__DisplayMap = np.zeros((width, length)) self.__gen_initial_map(smooth, steps, GENERATE_CONTINENTS) def __gen_initial_map(self, smooth, steps, GENERATE_CONTINENTS): #create initial random map HYBRID = 2 if GENERATE_CONTINENTS == HYBRID or GENERATE_CONTINENTS == 1: size, freq, octs, data = 128, 1/16.0, 4, [] for y in range(self.__length): for x in range(self.__width): self.__AltitudeBuffer[x][y] = non(x*freq, y*freq, int(size*freq), octs) if smooth == 1: self.__smooth_altitude(steps) print "DONE" def __quantize_grid(self): LAND = 1 SEA = 0 for x in range(self.__width): for y in range(self.__length): if self.__AltitudeBuffer[x][y] > 0.0: self.__DisplayMap[x][y] = LAND else: self.__DisplayMap[x][y] = SEA def __smooth_altitude(self, steps): for c in range(steps): #self.show_world() self.__plot_landsea(c, steps) for y in range(self.__length): self.__safe_smooth(0, y) for x in range(1, self.__width - 1): self.__safe_smooth(x, 0) for y in range(1, self.__length - 1): self.__fast_smooth(x, y) self.__safe_smooth(x, self.__length - 1) for y in range(self.__length): self.__safe_smooth(self.__width - 1, y) def __safe_smooth(self, x, y): HeightNear = 0 SquaresNear = 0 DirX = [ -1, -1, -1, 0, 0, 1, 1, 1 ] DirY = [ -1, 0, 1, -1, 1, -1, 0, 1 ] for d in range(0, 4): X = x + DirX[d] Y = y + DirY[d] if self.__is_valid_position(X, Y): HeightNear += self.__OldAltitudeBuffer[X][Y] SquaresNear += 1 for d in range(4, 7): X = x + DirX[d] Y = y + DirY[d] if self.__is_valid_position(X, Y): HeightNear += self.__AltitudeBuffer[X][Y] SquaresNear += 1 self.__OldAltitudeBuffer[x][y] = self.__AltitudeBuffer[x][y] self.__AltitudeBuffer[x][y] = HeightNear / SquaresNear def __fast_smooth(self, x, y): HeightNear = 0 DirX = [ -1, -1, -1, 0, 0, 1, 1, 1 ] DirY = [ -1, 0, 1, -1, 1, -1, 0, 1 ] for d in range(0, 4): HeightNear += self.__OldAltitudeBuffer[x + DirX[d]][y + DirY[d]] for d in range(4, 7): HeightNear += self.__AltitudeBuffer[x + DirX[d]][y + DirY[d]] self.__OldAltitudeBuffer[x][y] = self.__AltitudeBuffer[x][y]; self.__AltitudeBuffer[x][y] = HeightNear / 8; def __is_valid_position(self, X, Y): return ((X >= 0) and (Y >= 0) and (X < self.__width) and (Y < self.__length)) def __plot_landsea(self, step, maxsteps): print "max altitude is %d", np.max(self.__AltitudeBuffer) print "min altitude is %d", np.min(self.__AltitudeBuffer) # destination = str(r'c:\\picts\\%d'% step) + str(r'.png') self.__quantize_grid() obj = pds( 128, 128, 6, 10 ) sample1 = obj.rvs() x1 = [int(p[0]) for p in sample1] y1 = [int(q[1]) for q in sample1] print "number of points in x1 is %d", len(x1) print "x1 is %d", x1 print "number of points in y1 is %d", len(y1) print "y1 is %d", y1 x2 = [] y2 = [] for aa in range(0, len(x1)): #print self.__DisplayMap[x1][y1] if (self.__DisplayMap[x1[aa]][y1[aa]] > 0): #print x1[a], y1[a] x2.append(x1[aa]) y2.append(y1[aa]) print aa print "number of points in y2 is %d", len(x2) print "x2 is %d", x2 print "number of points in y2 is %d", len(y2) print "y2 is %d", y2 fig, ax = plt.subplots() ax.imshow(self.__DisplayMap, interpolation='none', origin='upper', cmap=cm.winter) CS = ax.contour(self.__DisplayMap, [0, 1], cmap=cm.winter) CB = plt.colorbar(CS, shrink=0.8, extend='both') l,b,w,h = plt.gca().get_position().bounds ll,bb,ww,hh = CB.ax.get_position().bounds CB.ax.set_position([ll, b+0.1*h, ww, h*0.8]) ax.scatter(y1, x1, color='red', marker='s') #ax.scatter(y2, x2, color='yellow', marker='s') # plt.savefig(destination, bbox_inches='tight') plt.show() # useage: worldmap(XSize, YSize, use smoothing? [Y/n], number of steps in smoothing, 0=single island 1=lots of continents 2=continent with islands) world = worldmap(128, 128, 1, 1, 1)
gpl-2.0
Reality9/spiderfoot
modules/sfp_vuln.py
7300
#------------------------------------------------------------------------------- # Name: sfp_vuln # Purpose: Query external vulnerability sources to see if our target appears. # # Author: Steve Micallef <steve@binarypool.com> # # Created: 04/10/2015 # Copyright: (c) Steve Micallef # Licence: GPL #------------------------------------------------------------------------------- import sys import time import datetime import re import json from sflib import SpiderFoot, SpiderFootPlugin, SpiderFootEvent class sfp_vuln(SpiderFootPlugin): """Vulnerable:Footprint,Investigate:Check external vulnerability scanning services (XSSposed.org, punkspider.org) to see if the target is listed.""" # Default options opts = { "cutoff": 0 } # Option descriptions optdescs = { "cutoff": "The maximum age in days of a vulnerbility for it to be included. 0 = unlimited." } # Be sure to completely clear any class variables in setup() # or you run the risk of data persisting between scan runs. results = dict() def setup(self, sfc, userOpts=dict()): self.sf = sfc self.results = dict() # Clear / reset any other class member variables here # or you risk them persisting between threads. for opt in userOpts.keys(): self.opts[opt] = userOpts[opt] # What events is this module interested in for input def watchedEvents(self): return ["INTERNET_NAME"] # What events this module produces def producedEvents(self): ret = ["VULNERABILITY"] return ret # Query XSSposed.org def queryXss(self, qry): ret = list() base = "https://www.xssposed.org" url = "https://www.xssposed.org/search/?search=" + qry + "&type=host" res = self.sf.fetchUrl(url, timeout=self.opts['_fetchtimeout'], useragent="SpiderFoot") if res['content'] is None: self.sf.debug("No content returned from xssposed.org") return None try: if "XSS mirror(s) match" in res['content']: """ Expected: <td> <div class="cell1"><a href="/incidents/12345/">blah.com</a></div> </td> <td> <div class="cell2"> <i>xxxx</i></div> </td> <td> <div class="cell3">01/01/2010</div> </td> </tr> """ rx = re.compile("class=.cell1.><a href=\"(.[^>]+)\">(.[^<]+).*?cell3.>(.*?)</div>", re.IGNORECASE|re.DOTALL) for m in rx.findall(res['content']): if self.opts['cutoff'] == 0: # Report it if m[1] == qry or m[1].endswith("."+qry): ret.append("From XSSposed.org: <SFURL>" + base + m[0] + "</SFURL>") else: ts = time.strftime("%s", time.strptime(m[2], "%d/%m/%Y")) if int(ts) > int(time.time())-(86400*self.opts['cutoff']) and \ (m[1] == qry or m[1].endswith("."+qry)): # Report it #print "calc: " + str(ts) + " > " + str(int(time.time())-(86400*self.opts['cutoff'])) #print "MADE IT past cut-off " + str(self.opts['cutoff']) + ": " + str(m) ret.append("From XSSposed.org: <SFURL>" + base + m[0] + "</SFURL>") except Exception as e: self.sf.error("Error processing response from XSSposed.org: " + str(e), False) return None return ret # Query punkspider.org def queryPunk(self, qry): ret = list() base = "https://www.punkspider.org/#searchkey=url&searchvalue={0}&pagenumber=1&filterType=or&filters=bsqli,sqli,xss,trav,mxi,osci,xpathi" url = "https://www.punkspider.org/service/search/domain/" post = '{"searchKey":"url","searchValue":"' + qry + '","pageNumber":1,"filterType":"or","filters":["bsqli","mxi","osci","sqli","trav","xpathi","xss"]}\n\r' headers = { 'X-Requested-With': 'XMLHttpRequest', 'Content-Type': 'application/json; charset=UTF-8' } res = self.sf.fetchUrl(url, timeout=60, useragent="SpiderFoot", postData=post, headers=headers) if res['content'] is None: self.sf.debug("No content returned from punkspider.org") return None if "timestamp\":" in res['content']: """ Expected: {"input": {"searchKey": "url", "filterType": "or", "searchValue": "cnn.com", "pageNumber": 1, "filters": ["bsqli", "mxi", "osci", "sqli", "trav", "xpathi", "xss"]}, "output": {"domainSummaryDTOs": [{"xpathi": "0", "xss": "1", "domain": "www.domain.com", "osci": "0", "title": "Title not found", "url": "www.domain.com", "timestamp": "2014-05-18T12:30:55Z", "exploitabilityLevel": 1, "sqli": "0", "trav": "0", "mxi": "0", "id": "www.domain.com", "bsqli": "0"}], "qTime": 9745, "rowsFound": 1, "numberOfPages": 1}} """ try: data = json.loads(res['content']) for rec in data['output']['domainSummaryDTOs']: if self.opts['cutoff'] == 0: ret.append("From Punkspider.org: <SFURL>" + base.format(qry) + "</SFURL>") else: ts = rec['timestamp'] nts = time.strftime("%s", time.strptime(ts, "%Y-%m-%dT%H:%M:%SZ")) if int(nts) > int(time.time())-(86400*self.opts['cutoff']): # Report it #print "calc: " + str(nts) + " > " + str(int(time.time())-(86400*self.opts['cutoff'])) #print "MADE IT past cut-off " + str(self.opts['cutoff']) + ": " + str(ts) ret.append("From Punkspider.org: <SFURL>" + base.format(qry) + "</SFURL>") except Exception as e: self.sf.error("Error processing response from Punkspider.org: " + str(e), False) return None return ret # Handle events sent to this module def handleEvent(self, event): eventName = event.eventType srcModuleName = event.module eventData = event.data self.sf.debug("Received event, " + eventName + ", from " + srcModuleName) # Don't look up stuff twice if self.results.has_key(eventData): self.sf.debug("Skipping " + eventData + " as already mapped.") return None else: self.results[eventData] = True data = self.queryXss(eventData) + self.queryPunk(eventData) for n in data: # Notify other modules of what you've found e = SpiderFootEvent("VULNERABILITY", n, self.__name__, event) self.notifyListeners(e) # End of sfp_vuln class
gpl-2.0
langmo/youscope
distribution/cellx/mex/circularHoughTransform.cpp
12128
#include "mex.h" #include "matrix.h" #define _USE_MATH_DEFINES #include<cmath> #include<list> #include<stdio.h> #include<string.h> using namespace std; //int p2i(int x, int y, int rowCount){return x*rowCount+y;} /* void rasterCircle(int x0, int y0, int radius, double* accumulationImage, int rowCount, int columnCount); void accumulate(const double* image, double* accumulationImage, int rowCount, int columnCount, int radius, const double thr); bool isEdge(int x, int y, int rowCount, const double* image, const double thr); void accumulatePoint(int x, int y, int rowCount, int columnCount,double* accumulationImage); double edge(int i, int j, int rowCount, int columnCount, const double* image); void extractMaxima(double* image, int rowCount, int columnCount, int minDist, bool); */ class Cell{ public: int x,y,r; Cell(int x, int y, int r):x(x),y(y),r(r){} }; class GaussianSmoothingFilter{ public: double** filter; const int w; const int r; GaussianSmoothingFilter(int r):w(1+2*r),r(r){ filter = new double*[w]; for(int i=0; i<w; ++i){ filter[i] = new double[w]; } const double sigma = 2*(r/3.0); double sum=0.0; for(int i=0; i<w; ++i){ for( int j=0; j<w; ++j ){ const int x = i-r; const int y = j-r; const double f = exp(- (x*x/sigma + y*y/sigma) ); filter[i][j] = f; sum +=f; } } for(int i=0; i<w; ++i){ for( int j=0; j<w; ++j ){ filter[i][j]/=sum; } } } ~GaussianSmoothingFilter(){ for(int i=0; i<w; ++i){ delete [] filter[i]; } delete [] filter; } void print(){ mexPrintf("Smoothing filter: \n\n"); for(int i=0; i<w; ++i){ for( int j=0; j<w; ++j ){ mexPrintf("%6.5f ", filter[i][j]); } mexPrintf("\n"); } mexPrintf("\n"); } double computeSmoothedImage(const double* src, double* dest, int rows, int cols){ double val,norm; int startX,startY,endX,endY, srcX, srcY; double maxVal = 0.0; for(int i=0; i<cols; ++i){ startX = max(-i, -r); endX = min(cols-i, r); for(int j=0; j<rows; ++j){ val = 0.0; norm = 0.0; startY = max(-j, -r); endY = min(rows-j, r); for(int k=startX; k<endX; ++k){ srcX = i+k; for(int l=startY; l<endY; ++l){ srcY = j+l; val += src[srcX*rows+srcY] * filter[k+r][l+r]; norm += filter[k+r][l+r]; } } // val/=norm; dest[i*rows+j] = val; maxVal = max(maxVal, val); } } mexPrintf("max=%f\n", maxVal ); return maxVal; } }; class CircularHoughTransform{ public: const double *srcImage; /* * w : width of the image (= #columns) * h : height of the image (= #rows) */ const int w,h; CircularHoughTransform(const int h, const int w, const double *srcImage):h(h), w(w), srcImage(srcImage){ } void addHoughTransform(const int radius, const double gradientThreshold, double* dest){ /* * consider pixels [1..w-1][1..h-1] only to avoid special cases in * the computation of the gradient of pixels on the border. */ int c=0; //mexPrintf("Gradient threshold %f\n", gradientThreshold); for(int i=0; i<w; ++i){ for(int j=0; j<h; ++j){ const double gradient = computeGradientAt(i, j); if( gradient > gradientThreshold ){ ++c; rasterCircle(i, j, radius, dest, gradient); } } } //mexPrintf("Rastered %d circles\n",c); } /** * Circular bresenham (wikipedia) */ void rasterCircle(int x0, int y0, int radius, double* dest, double intensity){ int f = 1 - radius; int ddF_x = 1; int ddF_y = -2 * radius; int x = 0; int y = radius; accumulatePoint(x0, y0 + radius, dest, intensity); accumulatePoint(x0, y0 - radius, dest, intensity); accumulatePoint(x0 + radius, y0, dest, intensity); accumulatePoint(x0 - radius, y0, dest, intensity); while(x < y){ if(f >= 0) { --y; ddF_y += 2; f += ddF_y; } ++x; ddF_x += 2; f += ddF_x; accumulatePoint(x0 + x, y0 + y, dest, intensity); accumulatePoint(x0 - x, y0 + y, dest, intensity); accumulatePoint(x0 + x, y0 - y, dest, intensity); accumulatePoint(x0 - x, y0 - y, dest, intensity); accumulatePoint(x0 + y, y0 + x, dest, intensity); accumulatePoint(x0 - y, y0 + x, dest, intensity); accumulatePoint(x0 + y, y0 - x, dest, intensity); accumulatePoint(x0 - y, y0 - x, dest, intensity); } } void accumulatePoint(const int x, const int y, double* dest, double intensity){ if(x>=0 && x<w && y>=0 && y<h) dest[x*h+y]+=intensity; } double computeGradientAt(const int x, const int y){ const double c = srcImage[x*h+y]; double dx = 0.0; double norm = 0.0; if(x<w-1){ dx += c - srcImage[(x+1)*h+y]; ++norm; } if(x>0){ dx += srcImage[(x-1)*h+y] - c; ++norm; } dx/=norm; double dy = 0.0; norm = 0.0; if( y<h-1 ){ dy += c - srcImage[x*h+y+1]; ++norm; } if( y>0 ){ dy += srcImage[x*h+y-1] - c; ++norm; } dy/=norm; return sqrt(dx*dx + dy*dy); } }; class MaximaCollector{ public: double* maxima; const int w,h; MaximaCollector(const int h, const int w):h(h),w(w){ maxima = new double[h*w]; memset(maxima, 0.0, h*w*sizeof(double)); } ~MaximaCollector(){ delete [] maxima; } void registerMaxima(double* src, double minVotes, int minDist){ double *im = createMaximaImage(src, minVotes, minDist); registerMaxima(im); delete [] im; } void extractCenters(int minDist, list<Cell>& cells){ double *remainingMaxima = createMaximaImage(maxima, 0.0, minDist); for(int i=0; i<w; ++i){ for(int j=0; j<h; ++j){ if( remainingMaxima[i*h+j]!=0.0 ){ Cell c(i,j,1); cells.push_back(c); } } } delete [] remainingMaxima; } private: double* createMaximaImage(double* src, double minVotes, int minDist){ double* image = new double[h*w]; memcpy(image, src, h*w*sizeof(double)); double m, value; int x, y; bool foundLocalMax; for(int i=0; i<w-minDist+1; ++i){ for(int j=0; j<h-minDist+1; ++j){ //search for local maximum in minDist x minDist window m = minVotes; foundLocalMax = false; for(int k=i; k<i+minDist; ++k){ for(int l=j; l<j+minDist; ++l){ value = image[k*h+l]; if( value>m ){ m = value; x = k; y = l; foundLocalMax=true; } image[k*h+l] = 0.0; } } if( foundLocalMax ){ image[x*h+y] = m; } } } return image; } void registerMaxima(double* image){ //collect the remaining points for(int i=0; i<w; ++i){ for(int j=0; j<h; ++j){ if( image[i*h+j]!=0.0 ){ maxima[i*h+j] = image[i*h+j]; } } } } }; void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { // input arguments xWidth, yWidth, connectivity if (nrhs !=4) mexErrMsgTxt("4 arguments expected (image,radii,thr,smoothing)!"); if ( mxIsComplex(prhs[0])|| mxIsClass(prhs[0], "sparse") || mxIsChar(prhs[0]) ) mexErrMsgTxt("Argument 0 must be real, full, and nonstring"); if ( mxIsComplex(prhs[1])|| mxIsClass(prhs[1], "sparse") || mxIsChar(prhs[1]) ) mexErrMsgTxt("Argument 1 must be real, full, and nonstring"); const int rowCount = mxGetM(prhs[0]); const int columnCount = mxGetN(prhs[0]); mexPrintf("rows=%d columns=%d\n", rowCount, columnCount); if( rowCount==0 || columnCount==0 ){ mexErrMsgTxt("Matrix must be two dimensional!"); } const double* image = mxGetPr(prhs[0]); const double* radii = mxGetPr(prhs[1]); const int radiiCount = mxGetNumberOfElements(prhs[1]); const double thr = mxGetScalar(prhs[2]); mexPrintf("Edge detection threshold: %6.4f\n", thr); GaussianSmoothingFilter gf(radii[1]); gf.print(); CircularHoughTransform cht(rowCount, columnCount, image); const int size = rowCount*columnCount; double* accumulationArray = new double[size]; double* smoothedArray = new double[size]; // for each radius memset(accumulationArray, 0.0, sizeof(double)*size); for( int r=radii[0]; r<radii[1]; r+=2) cht.addHoughTransform(r, thr, accumulationArray); double maximum = gf.computeSmoothedImage(accumulationArray, smoothedArray, rowCount, columnCount); MaximaCollector mc(rowCount, columnCount); mc.registerMaxima(smoothedArray, 0.2*maximum, radii[0]); list<Cell> cells; mc.extractCenters(2*radii[0], cells); int seedCount=cells.size(); mxArray *seedCenters = mxCreateNumericMatrix(seedCount, 2, mxDOUBLE_CLASS, 0); mxArray *seedRadii = mxCreateNumericMatrix(seedCount, 1, mxDOUBLE_CLASS, 0); double *seedCentersData = mxGetPr(seedCenters); double *seedRadiiData = mxGetPr(seedRadii); list<Cell>::iterator it = cells.begin(); int i=0; while( it!=cells.end() ){ const Cell c = *it++; seedCentersData[i] = c.x+1; seedCentersData[i+seedCount] = c.y+1; seedRadiiData[i] = c.r; ++i; } plhs[0] = seedCenters; plhs[1] = seedRadii; plhs[2] = mxCreateNumericMatrix(rowCount, columnCount, mxDOUBLE_CLASS, 0); mxSetData(plhs[2], accumulationArray); plhs[3] = mxCreateNumericMatrix(rowCount, columnCount, mxDOUBLE_CLASS, 0); mxSetData(plhs[3], smoothedArray); //double* dest = mxGetPr(plhs[3]); //memcpy(dest, mc.maxima, sizeof(double)*rowCount*columnCount); mexPrintf("done.\n"); }
gpl-2.0
n3yang/n1
content/themes/ningone/page-contacts.php
883
<? get_header(); ?> <!-- Begin page content --> <div class="container page"> <div class="page-header"> <img src="<?=bloginfo('template_url')?>/images/page-title-contact.png" alt=""> <h1>我们的心扉为你而开</h1> </div> <div class="page-content"> <img class="case-space" src="<?=bloginfo('template_url')?>/images/contact-map.png" /> <p class="text-center">公司地址:北京市东城区新世界中心写字楼B座1516室</p> <p class="text-center">电话:(86)10-8105 6166</p> <p class="text-center">传真:(86)10-8105 6188</p> <p class="text-center">公司邮箱:info@ningone.com</p> <p class="text-center">微信:beijingningyi</p> <p class="text-center">微信二维码</p> <p class="text-center" src="<?=bloginfo('template_url')?>/images/qrcode.png" /></p> </div> </div> <? get_footer(); ?>
gpl-2.0
ph1l/halo_radio
HaloRadio/TopTable.py
3264
# # # Copyright (C) 2004 Philip J Freeman # # This file is part of halo_radio # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. import HaloRadio import string import MySQLdb import _mysql_exceptions class TopTable: """ - Song - A Class For Working with songs. """ def __init__(self): pass def fixconn( self ): HaloRadio.db = MySQLdb.connect( host=HaloRadio.conf['db.host'], db=HaloRadio.conf['db.name'], user=HaloRadio.conf['db.user'], passwd=HaloRadio.conf['db.pass'] ) try: self.do_my_query("select COUNT(*) from songs;") except: return 0 return 1 def do_my_query( self, query ): """ """ sel = HaloRadio.db.cursor() try: sel.execute(query) rows = sel.fetchall() except _mysql_exceptions.OperationalError, value: #: (2013, 'Lost connection to MySQL server during query') ( errno, desc ) = value print "query=%s, errno=%d, err=%s" % ( query, errno, desc ) if self.fixconn(): rows = do_my_query(self, query ) else : raise _mysql_exceptions.OperationalError, value if rows == None: raise "didn't get any results for query (%s)" % ( query ) sel.close() return rows def do_my_insert( self, query ): """ """ ins = HaloRadio.db.cursor() try: ins.execute(query) except _mysql_exceptions.OperationalError, value: #: (2013, 'Lost connection to MySQL server during query') ( errno, desc ) = value print "query=%s, errno=%d, err=%s" % ( query, errno, desc ) raise _mysql_exceptions.OperationalError, value aiid = ins.lastrowid ins.close return aiid def do_my_do( self, query ): """ """ upd = HaloRadio.db.cursor() try: upd.execute(query) except _mysql_exceptions.Warning: pass except _mysql_exceptions.OperationalError, value: #: (2013, 'Lost connection to MySQL server during query') ( errno, desc ) = value print "Content-type: text/html\n\nquery=%s, errno=%d, err=%s" % ( query, errno, desc ) raise _mysql_exceptions.OperationalError, value upd.close() return def escape( self, str ): """ """ if str == None: return "" str = string.replace(str, "\\", "\\\\") str = string.replace(str, "\"", "\\\"") return str def my_esc_like( self, str ): """ """ if str == None: return "" str = string.replace(str, "\\", "\\\\") str = string.replace(str, "\"", "\\\"") str = string.replace(str, "_", "\\_") str = string.replace(str, " ", "\\ ") str = string.replace(str, "%", "\\%") return str def Delete( self ): self.do_my_do( """DELETE FROM %s WHERE id=%d;""" % ( self.tablename, self.id ) ) return
gpl-2.0
sam-dupras/rubble-engine
src/Client/Scripts/Classes/Player.js
5753
define(function(){ var Player = function(x,y,rotation,nickname){ this.x = x || 10; this.y = y || 10; this.radius = 15; //this should be sent from server this.imageRadius = 20; // this should be sent from server this.rotation = rotation || 0; this.offset = (this.imageRadius - this.radius); // offset if image is different size than the hittest radius this.velocity = {x:0, y:0}; this.vx = 0; this.vy = 0; this.nickname = nickname || 'no player name entered'; this.items = {}; this.sector = null; this.dangerLevel = 0; //this should be sent from server this.floorItems = []; //list of items under the player this.stats = { level: null, exp : null, nextLevelXP: null, STR : null, // damage delt (adds damage) DEF : null, // minus damage received DEX : null, // increase rate of AP recovery STA : null, // increate rate of HP recovery SPD : null, // faster movement AGL : null, // increases acceleration VUL : null, // decrease vulnarability time LUK : null, // increases drop luck HP : null, AP : null, maxHP : null, maxAP : null, playersKilled:null, monstersKilled:null, deaths:null }; //CONSTANTS this.maxVelocity = {x:4, y:4}; this.accel ={x:0.7, y:0.7}; this.friction ={x:0, y:0}; }; Player.prototype.move = function(){ //move Player if (this.vx){ this.x += this.vx; //friction velocity var tempVX = this.vx; if(this.vx > 0){ this.vx -= this.friction.x; }else{ this.vx += this.friction.x; } if(tempVX * this.vx < 0){ this.vx = 0; } } if (this.vy){ this.y += this.vy; //friction velocity var tempVY = this.vy; if(this.vy > 0){ this.vy -= this.friction.y; }else{ this.vy += this.friction.y; } if(tempVY * this.vy < 0){ this.vy = 0; } } }; Player.prototype.onCollision = function(wall,direction){ //Default Collision behavior used with Player and Box var newlocation; switch(direction){ case 'x': this.vx = 0; break; case 'y': this.vy = 0; break; } }; Player.prototype.setRotation = function(angle){ this.rotation = Math.abs(this.rotation % 360); }; Player.prototype.doActions = function(keysPressed){ //if can move if(keysPressed.up){ //move Up if((this.vy - this.accel.y) >= -this.maxVelocity.y - Math.sqrt(this.stats.SPD/10)){ this.vy -= this.accel.y ; }else{ this.vy = -this.maxVelocity.y - Math.sqrt(this.stats.SPD/10); } this.friction.y = 0 }else if(keysPressed.down){ //move Down if((this.vy + this.accel.y ) <= this.maxVelocity.y + Math.sqrt(this.stats.SPD/10)){ this.vy += this.accel.y ; }else{ this.vy = this.maxVelocity.y + Math.sqrt(this.stats.SPD/10); } this.friction.y = 0 }else{ this.friction.y = 0.3 ; } if(keysPressed.left){ // move Left if((this.vx - this.accel.x ) >= -this.maxVelocity.x - Math.sqrt(this.stats.SPD/10)){ this.vx -= this.accel.x ; }else{ this.vx = -this.maxVelocity.x - Math.sqrt(this.stats.SPD/10); } this.friction.x = 0; }else if(keysPressed.right){ // move Right if((this.vx + this.accel.x) <= this.maxVelocity.x + Math.sqrt(this.stats.SPD/10)){ this.vx += this.accel.x; }else{ this.vx = this.maxVelocity.x + Math.sqrt(this.stats.SPD/10); } this.friction.x = 0; }else{ this.friction.x = 0.3; } if(!keysPressed.lockDirection &&( keysPressed.up || keysPressed.down || keysPressed.left || keysPressed.right)){ if (Math.abs(this.vx) > 0.01 || Math.abs(this.vy) > 0.01){ //calculate rotation var negativeOffset; // determine if rotated left or right if(this.vx < 0){ negativeOffset = Math.PI; }else{ negativeOffset = 0; } var imageOffset = (Math.PI/2);//because rotation 0 is on right and not on top like the player image this.rotation = Math.atan(this.vy/this.vx) + imageOffset + negativeOffset; } } }; Player.prototype.animate = function(screen){ screen.drawRelRotatedImage(this.x - this.radius - this.offset, this.y - this.radius- this.offset + 6, 'images/guy2Shadow.png', this.rotation); screen.drawRelCircle(this.x,this.y,this.radius + 1,'#996633'); screen.drawRelRotatedImage(this.x - this.radius- this.offset, this.y - this.radius- this.offset, 'images/guy2.png', this.rotation); }; return Player; });
gpl-2.0
alejob/mdanalysis
package/MDAnalysis/topology/tpr/obj.py
4924
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding: utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 # # MDAnalysis --- http://www.mdanalysis.org # Copyright (c) 2006-2016 The MDAnalysis Development Team and contributors # (see the file AUTHORS for the full list of names) # # Released under the GNU Public Licence, v2 or any higher version # # Please cite your use of MDAnalysis in published work: # # R. J. Gowers, M. Linke, J. Barnoud, T. J. E. Reddy, M. N. Melo, S. L. Seyler, # D. L. Dotson, J. Domanski, S. Buchoux, I. M. Kenney, and O. Beckstein. # MDAnalysis: A Python package for the rapid analysis of molecular dynamics # simulations. In S. Benthall and S. Rostrup editors, Proceedings of the 15th # Python in Science Conference, pages 102-109, Austin, TX, 2016. SciPy. # # N. Michaud-Agrawal, E. J. Denning, T. B. Woolf, and O. Beckstein. # MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. # J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 # # TPR parser and tpr support module # Copyright (c) 2011 Zhuyi Xue # Released under the GNU Public Licence, v2 """ Class definitions for the TPRParser =================================== """ from six.moves import range from collections import namedtuple TpxHeader = namedtuple( "TpxHeader", [ "ver_str", "precision", "fver", "fgen", "file_tag", "natoms", "ngtc", "fep_state", "lamb", "bIr", "bTop", "bX", "bV", "bF", "bBox"]) Box = namedtuple("Box", "size rel v") Mtop = namedtuple("Mtop", "nmoltype moltypes nmolblock") Params = namedtuple("Params", "atnr ntypes functype reppow fudgeQQ iparams") Atom = namedtuple("Atom", ["m", "q", "mB", "qB", "tp", "typeB", "ptype", "resind", "atomnumber"]) Atoms = namedtuple("Atoms", "atoms nr nres type typeB atomnames resnames") Ilist = namedtuple("Ilist", "nr ik, iatoms") Molblock = namedtuple("Molblock", [ "molb_type", "molb_nmol", "molb_natoms_mol", "molb_nposres_xA", "molb_nposres_xB"]) class MoleculeKind(object): def __init__(self, name, atomkinds, bonds=None, angles=None, dihe=None, impr=None, donors=None, acceptors=None): self.name = name # name of the molecule self.atomkinds = atomkinds self.bonds = bonds self.angles = angles self.dihe = dihe self.impr = impr self.donors = donors self.acceptors = acceptors def __repr__(self): return "Molecule: {0:<20s} #atoms: {1:<10d} #residues: {2:<10d}".format( self.name, self.number_of_atoms(), self.number_of_residues()) def number_of_atoms(self): return len(self.atomkinds) def number_of_residues(self): return len({a.resid for a in self.atomkinds}) # remap_ method returns [tuple(), tuple(), ..] or [] # Note: in MDAnalysis, bonds, angles, etc are represented as tuple and not as list def remap_bonds(self, atom_start_ndx): if self.bonds: return [tuple(i + atom_start_ndx for i in b) for b in self.bonds] else: return [] def remap_angles(self, atom_start_ndx): if self.angles: return [tuple(i + atom_start_ndx for i in a) for a in self.angles] else: return [] def remap_dihe(self, atom_start_ndx): if self.dihe: return [tuple(i + atom_start_ndx for i in a) for a in self.dihe] else: return [] def remap_impr(self, atom_start_ndx): # improper if self.impr: return [tuple(i + atom_start_ndx for i in a) for a in self.impr] else: return [] class AtomKind(object): def __init__(self, id, name, type, resid, resname, mass, charge): # id is only within the scope of a single molecule, not the whole system self.id = id self.name = name self.type = type self.resid = resid self.resname = resname self.mass = mass self.charge = charge def __repr__(self): return \ ("< AtomKind: id {0:6d}, name {1:5s}, type {2:10s}, resid {3:6d}, resname {4:4s}, mass {5:8.4f}, " "charge {6:12.3f} >".format(self.id, self.name, self.type, self.resid, self.resname, self.mass, self.charge)) class InteractionKind(object): def __init__(self, name, long_name, natoms): """natoms: number of atoms involved in this type of interaction""" self.name = name self.long_name = long_name self.natoms = natoms def process(self, atom_ndx): while atom_ndx: # format for all info: (type, [atom1, atom2, ...]) # yield atom_ndx.pop(0), [atom_ndx.pop(0) for i in range(self.natoms)] # but currently only [atom1, atom2, ...] is interested atom_ndx.pop(0) yield [atom_ndx.pop(0) for i in range(self.natoms)]
gpl-2.0
angryip/ipscan
test/net/azib/ipscan/core/net/UDPPingerTest.java
420
package net.azib.ipscan.core.net; import net.azib.ipscan.config.Platform; import org.junit.Test; import java.io.IOException; import static org.junit.Assume.assumeTrue; public class UDPPingerTest extends AbstractPingerTest { public UDPPingerTest() throws Exception { super(UDPPinger.class); } @Test @Override public void pingAlive() throws IOException { assumeTrue(Platform.LINUX); super.pingAlive(); } }
gpl-2.0
GiuseppeGorgoglione/mame
src/devices/video/ramdac.cpp
5514
// license:BSD-3-Clause // copyright-holders:Angelo Salese /*************************************************************************** Generic Palette RAMDAC device Written by Angelo Salese TODO: - masking register, almost likely it controls rollback on incrementing r/w palette access; - needs information about different models and what exactly they does ***************************************************************************/ #include "emu.h" #include "video/ramdac.h" // default address map static ADDRESS_MAP_START( ramdac_palram, AS_0, 8, ramdac_device ) AM_RANGE(0x000, 0x0ff) AM_RAM // R bank AM_RANGE(0x100, 0x1ff) AM_RAM // G bank AM_RANGE(0x200, 0x2ff) AM_RAM // B bank AM_RANGE(0x300, 0x3ff) AM_NOP ADDRESS_MAP_END //************************************************************************** // GLOBAL VARIABLES //************************************************************************** // device type definition const device_type RAMDAC = &device_creator<ramdac_device>; //************************************************************************** // LIVE DEVICE //************************************************************************** //------------------------------------------------- // ramdac_device - constructor //------------------------------------------------- ramdac_device::ramdac_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, RAMDAC, "RAMDAC", tag, owner, clock, "ramdac", __FILE__), device_memory_interface(mconfig, *this), m_space_config("videoram", ENDIANNESS_LITTLE, 8, 10, 0, nullptr, *ADDRESS_MAP_NAME(ramdac_palram)), m_palette(*this, finder_base::DUMMY_TAG), m_split_read_reg(0) { } //------------------------------------------------- // static_set_palette_tag: Set the tag of the // palette device //------------------------------------------------- void ramdac_device::static_set_palette_tag(device_t &device, const char *tag) { downcast<ramdac_device &>(device).m_palette.set_tag(tag); } //------------------------------------------------- // memory_space_config - return a description of // any address spaces owned by this device //------------------------------------------------- const address_space_config *ramdac_device::memory_space_config(address_spacenum spacenum) const { return (spacenum == AS_0) ? &m_space_config : nullptr; } //------------------------------------------------- // readbyte - read a byte at the given address //------------------------------------------------- inline UINT8 ramdac_device::readbyte(offs_t address) { return space().read_byte(address); } //------------------------------------------------- // writebyte - write a byte at the given address //------------------------------------------------- inline void ramdac_device::writebyte(offs_t address, UINT8 data) { space().write_byte(address, data); } //------------------------------------------------- // device_validity_check - perform validity checks // on this device //------------------------------------------------- void ramdac_device::device_validity_check(validity_checker &valid) const { } //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- void ramdac_device::device_start() { m_palram = make_unique_clear<UINT8[]>(1 << 10); } //------------------------------------------------- // device_reset - device-specific reset //------------------------------------------------- void ramdac_device::device_reset() { m_pal_index[0] = 0; m_int_index[0] = 0; m_pal_index[1] = 0; m_int_index[1] = 0; m_pal_mask = 0xff; } //************************************************************************** // READ/WRITE HANDLERS // [0] = W register, [1] = R register //************************************************************************** inline void ramdac_device::reg_increment(UINT8 inc_type) { m_int_index[inc_type]++; if(m_int_index[inc_type] == 3) { m_int_index[inc_type] = 0; m_pal_index[inc_type]++; } } READ8_MEMBER( ramdac_device::index_r ) { return m_pal_index[0]; } WRITE8_MEMBER( ramdac_device::index_w ) { m_pal_index[0] = data; m_int_index[0] = 0; } WRITE8_MEMBER( ramdac_device::index_r_w ) { m_pal_index[1] = data; m_int_index[1] = 0; } READ8_MEMBER( ramdac_device::pal_r ) { UINT8 res; res = readbyte(m_pal_index[m_split_read_reg] | (m_int_index[m_split_read_reg] << 8)); reg_increment(m_split_read_reg); return res; } WRITE8_MEMBER( ramdac_device::pal_w ) { writebyte(m_pal_index[0] | (m_int_index[0] << 8),data); reg_increment(0); } WRITE8_MEMBER( ramdac_device::mask_w ) { m_pal_mask = data; } //************************************************************************** // Generic bank read/write handlers //************************************************************************** READ8_MEMBER( ramdac_device::ramdac_pal_r ) { return m_palram[offset]; } WRITE8_MEMBER( ramdac_device::ramdac_rgb666_w ) { UINT16 pal_offs; m_palram[offset] = data & 0x3f; pal_offs = (offset & 0xff); m_palette->set_pen_color(offset&0xff,pal6bit(m_palram[pal_offs|0x000]),pal6bit(m_palram[pal_offs|0x100]),pal6bit(m_palram[pal_offs|0x200])); } WRITE8_MEMBER( ramdac_device::ramdac_rgb888_w ) { UINT16 pal_offs; m_palram[offset] = data; pal_offs = (offset & 0xff); m_palette->set_pen_color(offset&0xff,m_palram[pal_offs|0x000],m_palram[pal_offs|0x100],m_palram[pal_offs|0x200]); }
gpl-2.0
zdogma/wordpress
wp-content/themes/simplicity/lib/ad.php
5973
<?php //広告関係の関数 //H2見出しを判別する正規表現を定数にする define('H2_REG', '/<h2.*?>/i');//H2見出しのパターン //本文中にH2見出しが最初に含まれている箇所を返す(含まれない場合はnullを返す) //H3-H6しか使っていない場合は、h2部分を変更してください function get_h2_included_in_body( $the_content ){ if ( preg_match( H2_REG, $the_content, $h2results )) {//H2見出しが本文中にあるかどうか return $h2results[0]; } } function add_ads_before_1st_h2($the_content) { if ( is_single() && //投稿ページのとき、固定ページも表示する場合はis_singular()にする ( is_ads_in_content() || //本文中表示設定のときもしくは (!is_ads_sidebar_top() && is_responsive_enable()) ) //サイドバー項目設定じゃないときでレスポンシブ設定のとき ) { //広告(AdSense)タグを記入 ob_start();//バッファリング get_template_part('ad');//広告貼り付け用に作成したテンプレート $ad_template = ob_get_clean(); $h2result = get_h2_included_in_body( $the_content );//本文にH2タグが含まれていれば取得 if ( $h2result ) {//H2見出しが本文中にある場合のみ //最初のH2の手前に広告を挿入(最初のH2を置換) $count = 1; $the_content = preg_replace(H2_REG, $ad_template.$h2result, $the_content, 1); } } return $the_content; } add_filter('the_content','add_ads_before_1st_h2'); function get_all_post_count_in_publish(){ global $wpdb; return intval($wpdb->get_var("SELECT count(*) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post'")); } //広告をトップページのリスト表示中間に掲載するか function is_ads_list_in_middle_on_top_page_enable($count){ if ( ($count == 3) && //3個目の表示のときのみ is_home() && //トップページリストのみ !is_paged() && //2ページ目以降でないとき、もしくはレスポンシブ広告の時 (wp_is_mobile() || is_responsive_enable() ) && //モバイルの時 ( intval(get_option('posts_per_page')) >=6 ) && //1ページに表示する最大投稿数が6以上の時 !is_ads_sidebar_top() && //サイドバー広告が表示されていないとき is_ads_performance_visible() &&//パフォーマンス追求広告を表示するとき !is_list_style_tile_thumb_cards() && //タイル状リスト表示でないとき is_ads_top_page_visible() &&//トップページ広告が許可されているとき (get_all_post_count_in_publish() > 3)//公開記事が3つより多いとき ) { return true; } } //広告を関連記事下に掲載するか function is_ads_under_relations_enable(){ $o = get_option('ads_options'); if ( ($o['ads_position'] == 'under_relations' || $o['ads_position'] == null || ( $o['ads_position'] == 'content_top' && !is_ads_performance_visible() ) || //関連記事下広告のとき ( wp_is_mobile() && is_ads_in_content() ) || //モバイルの時も広告を表示 ( wp_is_mobile() && is_ads_content_top() ) || //モバイルの時も広告を表示 //「本文中広告がオン」でも //本文中にH2タグがない時は広告を表示(必ず記事に広告が3つ表示されるように) !get_h2_included_in_body( get_the_content() ) ) && //本文中にH2見出しが含まれていないとき !is_ads_sidebar_top() &&//サイドバートップに広告が表示されていないとき ( !is_ads_content_top() || wp_is_mobile() ) ||//パソコンでコンテンツ上部広告でないとき is_responsive_enable() ) { return true; } else { return false; } } //広告をサイドバーに掲載するか function is_ads_sidebar_enable(){ //広告を表示しているとき if ( is_ads_visible() ) { if ( is_ads_sidebar_top() && //サイドバー広告のとき !is_404() && //404ページじゃないとき ( !is_home() || is_ads_top_page_visible() )//トップページは「トップページ広告が許可」されている時だけ表示 ) { return true; } } } //パフォーマンス追求(トップバナー広告)広告が有効化どうか function is_ads_top_banner_enable(){ if ( is_ads_visible() && is_ads_performance_visible() && !is_responsive_enable() ) { if ( is_page() ) {//個別ページのとき if ( wp_is_mobile() ) { return true; } else { return !is_ads_sidebar_top() || is_ads_content_top();//サイドバートップ表示以外のとき } }elseif ( is_single() ){//投稿ページのとき if ( wp_is_mobile() ) { return ( is_ads_in_content() && !get_h2_included_in_body(get_the_content()) ) || //本文中表示設定で本文で表示されていない場合 is_ads_under_relations() || //関連記事表示のとき is_ads_sidebar_top() || //サイドバートップ表示のとき is_ads_content_top();//コンテンツトップ表示のとき } else { return is_ads_content_top();//コンテンツトップ表示のとき } }else{//その他、リスト表示のときなど if ( wp_is_mobile() ) { //トップページ以外は必ず表示、トップページは表示がオンになっていたら return (!is_home() || is_ads_top_page_visible()) && !is_list_style_bodies(); } else { //サイドバーに広告がなくて、トップページ以外か、TOPページ表示がオンになっているとき return !is_ads_sidebar_top() && ( !is_home() || is_ads_top_page_visible() || is_ads_content_top() ) && !is_list_style_bodies(); } } } }
gpl-2.0
michael9999/bc-portal
wp-content/plugins/ht-knowledge-base/php/ht-knowledge-base-common-display-functions.php
33310
<?php /* * Pluggable common functions for the ht knowledge base */ if(!function_exists('ht_kb_breadcrumb_display')){ /** * Breadcrumbs display * @pluggable */ function ht_kb_breadcrumb_display( $sep = '<span class="sep">/</span>' ) { //global WordPress variable $post. Needed to display multi-page navigations. global $post, $cat; if (!ht_kb_is_ht_kb_front_page()) { $homelink = '<a href="' . home_url() . '" class="ht-breadcrumbs-home">' . __('Home') . '</a> ' . $sep; echo '<div class="ht-breadcrumbs ht-kb-breadcrumbs" >'; $taxonomy = ht_kb_get_taxonomy(); $term_string = ht_kb_get_term(); $visited = array(); if (!empty($taxonomy) && !empty($term_string)) { //category terms bread crumb echo $homelink; echo '<a href="' . get_post_type_archive_link( 'ht_kb' ) . '">' . __('Knowledge Base', 'ht-knowledge-base') . '</a> ' . $sep; $term = get_term_by( 'slug', $term_string, $taxonomy ); if($term==false) return; if ($term->parent != 0) { $parents = get_custom_category_parents($term->term_id, 'ht_kb_category', true,'' .$sep . '', false, $visited ); //remove last separator from parents $parents = substr($parents, 0, strlen($parents )- strlen($sep) ); echo $parents; } else { echo '<a href="' . esc_attr(get_term_link($term, 'ht_kb_category')) . '" title="' . sprintf( __( "View all posts in %s" ), $term->name ) . '" ' . '>' . $term->name.'</a> '; $visited[] = $term->term_id; } } elseif ( !is_single() && 'ht_kb' == get_post_type() ) { //Archive $ht_kb_data = get_post_type_object('ht_kb'); echo $ht_kb_data->labels->name; } elseif ( is_single() && 'ht_kb' == get_post_type() ) { //Single post $terms = wp_get_post_terms( $post->ID , 'ht_kb_category'); if( !empty($terms) ){ foreach($terms as $term) { echo $homelink; echo '<a href="' . get_post_type_archive_link( 'ht_kb' ) . '">' . __('Knowledge Base', 'ht-knowledge-base') . '</a> ' . $sep; if ($term->parent != 0) { $parents = get_custom_category_parents($term->term_id, 'ht_kb_category', true,'' .$sep . '', false, $visited ); echo $parents; } else { echo '<a href="' . esc_attr(get_term_link($term, 'ht_kb_category')) . '" title="' . sprintf( __( "View all posts in %s" ), $term->name ) . '" ' . '>' . $term->name.'</a> '; echo $sep; $visited[] = $term->term_id; } echo get_the_title(); echo '<br/>'; } // End foreach } else { //uncategorized article echo '<a href="' . get_post_type_archive_link( 'ht_kb' ) . '">' . __('Knowledge Base', 'ht-knowledge-base') . '</a> ' . $sep; echo get_the_title(); echo '<br/>'; } } else { //Display the post title. echo get_the_title(); echo '<br/>'; } echo '</div>'; } //is_front_page } //end function } //end function exists if(!function_exists('get_term_parents')){ /** * Get the term parents * @pluggable */ function get_term_parents( $id, $taxonomy, $link = false, $separator = '/', $nicename = false, $visited = array() ) { $chain = ''; $parent = &get_term( $id, $taxonomy ); if ( is_wp_error( $parent ) ) return $parent; if ( $nicename ) $name = $parent->slug; else $name = $parent->name; if ( $parent->parent && ( $parent->parent != $parent->term_id ) && !in_array( $parent->parent, $visited ) ) { $visited[] = $parent->parent; $chain .= get_term_parents( $parent->parent, $taxonomy, $link, $separator, $nicename, $visited ); } if ( $link ) $chain .= '<a href="' . esc_url( get_term_link( intval( $parent->term_id ), $taxonomy ) ) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $parent->name ) ) . '">'.$name.'</a>' . $separator; else $chain .= $name.$separator; return $chain; }//end function }//end function_exists if(!function_exists('get_custom_category_parents')){ /** * Get the category parents * @pluggable */ function get_custom_category_parents( $id, $taxonomy = false, $link = false, $separator = '/', $nicename = false, $visited = array() ) { if(!($taxonomy && is_taxonomy_hierarchical( $taxonomy ))) return ''; $chain = ''; // $parent = get_category( $id ); $parent = get_term( $id, $taxonomy); if ( is_wp_error( $parent ) ) return $parent; if ( $nicename ) $name = $parent->slug; else $name = $parent->name; //reset visited if null if(empty($visited)) $visited = array( ); if ( $parent->parent && ( $parent->parent != $parent->term_id ) && (!in_array( $parent->parent, $visited ) ) ) { $visited[] = $parent->parent; // $chain .= get_category_parents( $parent->parent, $link, $separator, $nicename, $visited ); $chain .= get_custom_category_parents( $parent->parent, $taxonomy, $link, $separator, $nicename, $visited ); } if ( $link ) { // $chain .= '<a href="' . esc_url( get_category_link( $parent->term_id ) ) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $parent->name ) ) . '">'.$name.'</a>' . $separator; $chain .= '<a href="' . esc_url( get_term_link( (int) $parent->term_id, $taxonomy ) ) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $parent->name ) ) . '">'.$name.'</a>' . $separator; } else { $chain .= $name.$separator; } return $chain; } } if(!function_exists('ht_kb_related_articles')){ /** * Display related articles * @pluggable */ function ht_kb_related_articles(){ global $post, $ht_knowledge_base_options; $orig_post = $post; $categories = get_the_terms($post->ID, 'ht_kb_category'); if ($categories) { $category_ids = array(); foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id; $args=array( 'post_type' => 'ht_kb', 'tax_query' => array( array( 'taxonomy' => 'ht_kb_category', 'field' => 'term_id', 'terms' => $category_ids ) ), 'post__not_in' => array($post->ID), 'posts_per_page'=> 6, // Number of related posts that will be shown. 'ignore_sticky_posts'=>1 ); $related_articles_query = new wp_query( $args ); if( $related_articles_query->have_posts() ) { ?> <section id="ht-kb-related-articles" class="clearfix"> <h3 id="ht-kb-related-articles-title"><?php _e('Related Articles', 'ht-knowledge-base'); ?></h3> <ul class="ht-kb-article-list"><?php while( $related_articles_query->have_posts() ) { $related_articles_query->the_post(); //set post format class if ( has_post_format( 'video' )) { $ht_kb_format_class = 'format-video'; } else { $ht_kb_format_class = 'format-standard'; } ?> <li class="<?php echo $ht_kb_format_class; ?>"> <a href="<?php the_permalink()?>" rel="bookmark" title="<?php echo esc_attr( sprintf( the_title_attribute( 'echo=0' ) ) ); ?>"><?php the_title(); ?></a> <?php if ( $ht_knowledge_base_options['related-rating'] && function_exists('ht_usefulness') ) { $article_usefulness = ht_usefulness( get_the_ID() ); $helpful_article = ( $article_usefulness >= 0 ) ? true : false; $helpful_article_class = ( $helpful_article ) ? 'ht-kb-helpful-article' : 'ht-kb-unhelpful-article'; ?> <span class="ht-kb-usefulness <?php echo $helpful_article_class; ?>"><?php echo $article_usefulness ?></span> <?php } //rating ?> </li> <?php } ?> </ul> </section> <?php } //end $related_articles_query } //end if categories $post = $orig_post; wp_reset_postdata(); } } if(!function_exists('ht_kb_entry_meta_display')){ /** * Display entry meta * @pluggable */ function ht_kb_entry_meta_display(){ global $post; ?> <ul class="ht-kb-entry-meta clearfix"> <li class="ht-kb-em-date"> <span><?php _e( 'Created' , 'ht-knowledge-base' ) ?></span> <a href="<?php the_permalink(); ?>" rel="bookmark" itemprop="url"><time datetime="<?php the_time('Y-m-d')?>" itemprop="datePublished"><?php the_time( get_option('date_format') ); ?></time></a> </li> <li class="ht-kb-em-author"> <span><?php _e( 'Author' , 'ht-knowledge-base' ) ?></span> <a class="url fn n" href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" title="<?php echo esc_attr( get_the_author() ); ?>" rel="me" itemprop="author"><?php echo esc_attr( get_the_author() ); ?></a> </li> <?php if( !is_tax() ) : ?> <li class="ht-kb-em-category"> <span><?php _e( 'Category' , 'ht-knowledge-base' ) ?></span> <?php $terms = get_the_term_list( $post->ID, 'ht_kb_category', ' ', ', ', '' ); if(empty($terms)){ _e('Uncategorized', 'ht-knowledge-base'); } else { echo $terms; } ?> </li> <?php endif; //is tax ?> <?php if ( comments_open() && get_comments_number() > 0 ){ ?> <li class="ht-kb-em-comments"> <span><?php _e( 'Comments' , 'ht-knowledge-base' ) ?></span> <?php comments_popup_link( __( '0', 'ht-knowledge-base' ), __( '1', 'ht-knowledge-base' ), __( '%', 'ht-knowledge-base' ) ); ?> </li> <?php } ?> </ul> <?php } //end function }//end function exists if(!function_exists('ht_kb_display_attachments')){ /** * Display article attachments * @pluggable */ function ht_kb_display_attachments(){ global $post; $attachments = get_post_meta($post->ID, '_ht_knowledge_base_file_advanced', true); if( ! empty( $attachments ) ): ?> <section id="ht-kb-attachments"> <h3 class="ht-kb-attachments"><?php _e('Article Attachments', 'ht-knowledge-base'); ?></h3> <ul> <?php foreach ($attachments as $id => $attachment) { $attachment_post = get_post($id); $default_attachment_name = __('Attachment', 'ht-knowledge-base'); $attachment_name = !empty($attachment_post) ? $attachment_post->post_name : $default_attachment_name; ?> <li class="ht-kb-attachment-item"> <a href="<?php echo wp_get_attachment_url($id); ?>"><?php echo $attachment_name; ?></a> </li> <?php } ?> </ul> </section><!-- article-attachments --> <?php endif; //end test for } //end function } //end function exists if(!function_exists('ht_kb_display_tags')){ /** * Display article tags * @pluggable */ function ht_kb_display_tags(){ global $post; ?> <div class="tags"> <?php echo get_the_term_list( $post->ID, 'ht_kb_tag', __('Tagged: ', 'ht-knowledge-base'), '', '' );?> </div> <?php } //end function }//end function exists if(!function_exists('ht_kb_display_search')){ /** * Display article search * @pluggable */ function ht_kb_display_search(){ global $post, $ht_knowledge_base_options; $placeholder_text = (isset($ht_knowledge_base_options) && is_array($ht_knowledge_base_options) && array_key_exists('search-placeholder-text', $ht_knowledge_base_options)) ? $ht_knowledge_base_options['search-placeholder-text'] : __('Search the Knowledge Base', 'ht-knowledge-base'); ?> <div class="ht-kb-article-search"> <form role="search" method="get" id="searchform" class="searchform" action="<?php echo home_url( '/' ); ?>"> <label class="screen-reader-text" for="s"><?php _e( 'Search for:', 'ht-knowledge-base' ); ?></label> <input type="text" value="" placeholder="<?php echo $placeholder_text; ?>" name="s" id="s" autocomplete="off" /> <input type="hidden" name="ht-kb-search" value="1" /> <button type="submit" id="searchsubmit"> <i class="fa fa-search"></i> <span><?php _e( 'Search', 'ht-knowledge-base' ); ?></span> </button> </form> </div> <?php } //end function }//end function exists if(!function_exists('ht_kb_display_sub_cats')){ /** * Display sub categories * @pluggable */ function ht_kb_display_sub_cats($master_tax_terms, $parent_term_id, $depth, $display_sub_cat_count, $display_sub_cat_articles, $numberposts){ //return if max depth reached if($depth==0){ return; } //populate child tax terms $child_tax_terms = wp_list_filter($master_tax_terms,array('parent'=>$parent_term_id)); if(count($child_tax_terms)>0) { ?> <ul class="ht-kb-sub-cats"> <?php foreach ($child_tax_terms as $term) { ?> <li class="ht-kb-sub-cat"> <a class="ht-kb-sub-cat-title" href="<?php echo esc_attr(get_term_link($term, 'ht_kb_category')); ?>" title="<?php echo sprintf( __( 'View all posts in %s', 'ht-knowledge-base' ), $term->name ); ?>" ><?php echo $term->name; ?></a> <?php if($display_sub_cat_count): ?> <span class="ht-kb-category-count"><?php echo sprintf( _n( '1 Article', '%s Articles', $term->count, 'ht-knowledge-base' ), $term->count ); ?></span> <?php endif; ?> <?php //recursive ht_kb_display_sub_cats($master_tax_terms, $term->term_id, $depth--, $display_sub_cat_count, $display_sub_cat_articles, $numberposts); //continue if $display_sub_cat_articles == false if(!$display_sub_cat_articles){ continue; } //else show all the articles in this category //get posts per category $args = array( 'post_type' => 'ht_kb', 'posts_per_page' => $numberposts, 'orderby' => 'date', 'tax_query' => array( array( 'taxonomy' => 'ht_kb_category', 'field' => 'term_id', 'include_children' => false, 'terms' => $term->term_id ) ) ); $sub_cat_posts = get_posts( $args ); ?> <?php if ($sub_cat_posts) : ?> <ul class="ht-kb-article-list"> <?php foreach( $sub_cat_posts as $post ) : ?> <?php //set post format class if ( get_post_format( $post->ID )=='video') { $ht_kb_format_class = 'format-video'; } else { $ht_kb_format_class = 'format-standard'; } ?> <li class="<?php echo $ht_kb_format_class; ?>"><a href="<?php echo get_permalink($post->ID); ?>" rel="bookmark"><?php echo get_the_title($post->ID); ?></a></li> <?php endforeach; ?> </ul><!-- End Get posts per Category --> <?php endif; // End if ($sub_cat_posts) ?> </li> <!-- /.ht-kb-sub-cat --> <?php } ?> </ul><!--/sub-cats--> <?php } }//end function }//end function exists if(!function_exists('get_ht_kb_term_meta')){ /** * Get term meta * @pluggable * @return (Array) The term meta */ function get_ht_kb_term_meta($term){ //// put the term ID into a variable $t_id = $term->term_id; // retrieve the existing value(s) for this meta field. This returns an array $term_meta = get_option( "taxonomy_$t_id" ); return $term_meta; }//end function }//end function exists if(!function_exists('get_ht_kb_tags')){ /** * Get all knowledgebase tags * @pluggable * @return (Array) The ht_kb_tag taxonomy terms */ function get_ht_kb_tags(){ $taxonomies = array('ht_kb_tag'); $args = array( 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => true, 'exclude' => array(), 'exclude_tree' => array(), 'include' => array(), 'number' => '', 'fields' => 'all', 'slug' => '', 'parent' => '', 'hierarchical' => true, 'child_of' => 0, 'get' => '', 'name__like' => '', 'pad_counts' => false, 'offset' => '', 'search' => '', 'cache_domain' => 'core' ); $tags = get_terms( $taxonomies, $args ); return $tags; }//end function }//end function exists if(!function_exists('get_ht_kb_categories')){ /** * Get all knowledgebase categories * @pluggable * @return (Array) The ht_kb_category taxonomy terms */ function get_ht_kb_categories(){ $taxonomies = array('ht_kb_category'); $args = array( 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => true, 'exclude' => array(), 'exclude_tree' => array(), 'include' => array(), 'number' => '', 'fields' => 'all', 'slug' => '', 'parent' => '', 'hierarchical' => true, 'child_of' => 0, 'get' => '', 'name__like' => '', 'pad_counts' => false, 'offset' => '', 'search' => '', 'cache_domain' => 'core' ); $categories = get_terms( $taxonomies, $args ); return $categories; }//end function }//end function exists if(!function_exists('get_most_helpful_article_id')){ /** * Get the id of the most helpful article * @pluggable * @return (Int) ID of most helpful article */ function get_most_helpful_article_id(){ $most_helpful_article_id = 0; $most_helpful = new WP_Query('meta_key=_ht_kb_usefulness&post_type=ht_kb&orderby=meta_value_num&order=DESC'); if ($most_helpful->have_posts()) : while ($most_helpful->have_posts()) : $most_helpful->the_post(); $most_helpful_article_id = get_the_ID(); //this is the most helpful, break. break; endwhile; endif; wp_reset_postdata(); return $most_helpful_article_id; }//end function }//end function exists if(!function_exists('is_most_helpful_article_id')){ /** * Is the ID of the most helpful article * @pluggable * @param (Int) $article_id The test article ID * @return (Boolean) True when article ID matches most helpful article ID */ function is_most_helpful_article_id($article_id){ $most_helpful_article_id = get_most_helpful_article_id(); return $most_helpful_article_id == $article_id; }//end function }//end function exists if(!function_exists('display_is_most_helpful_article')){ /** * Displays badge if most helpful article * @pluggable */ function display_is_most_helpful_article(){ global $post; if(is_most_helpful_article_id($post->ID)){ ?> <span class="ht-kb-most-helpful-article">Most Helpful Article</span> <?php } }//end function }//end function exists if(!function_exists('get_most_viewed_article_id')){ /** * Get the id of the most viewed article * @pluggable * @return (Int) ID of most viewed article */ function get_most_viewed_article_id(){ $most_viewed_article_id = 0; $most_viewed = new WP_Query('meta_key=_ht_kb_post_views_count&post_type=ht_kb&orderby=meta_value_num&order=DESC'); if ($most_viewed->have_posts()) : while ($most_viewed->have_posts()) : $most_viewed->the_post(); $most_viewed_article_id = get_the_ID(); //this is the most viewed, break. break; endwhile; endif; wp_reset_postdata(); return $most_viewed_article_id; return 0; }//end function }//end function exists if(!function_exists('is_most_viewed_article_id')){ /** * Is the id of the most viewed article * @pluggable * @param (Int) $article_id The test article ID * @return (Boolean) True when article ID matches most viewed article ID */ function is_most_viewed_article_id($article_id){ $most_viewed_article_id = get_most_viewed_article_id(); return $most_viewed_article_id == $article_id; }//end function }//end function exists if(!function_exists('display_is_most_viewed_article')){ /** * Display badge if most viewed article * @pluggable */ function display_is_most_viewed_article(){ global $post; if(is_most_viewed_article_id($post->ID)){ ?> <span class="ht-kb-most-viewed-article">Most Viewed Article</span> <?php } }//end function }//end function exists if(!function_exists('get_most_helpful_user_id')){ /** * Get the id helpful user id * @pluggable * @return (Int) ID of most helpful user */ function get_most_helpful_user_id(){ //start here use WP_User_Query //this *should* be orderby meta_value_num, but not available $users = get_users('meta_key=_ht_kb_usefulness&orderby=meta_value&order=DESC'); if (!empty($users)) : foreach ($users as $key => $user) { return $user->ID; } endif; return 0; }//end function }//end function exists if(!function_exists('is_most_helpful_user_id')){ /** * Is the id of the most helpful user * @pluggable * @param (String) $user_id The test user ID * @return (Boolean) True when user ID matches most helpful user ID */ function is_most_helpful_user_id($user_id){ $most_helpful_user_id = get_most_helpful_user_id(); return $most_helpful_user_id == $user_id; }//end function }//end function exists if(!function_exists('display_is_most_helpful_user')){ /** * Is the id of the most helpful user * @pluggable * @param (String) $user_id The test user ID */ function display_is_most_helpful_user($user_id){ if( is_most_helpful_user_id( $user_id ) ){ ?> <span class="ht-kb-most-helpful-user">Most Helpful User</span> <?php } }//end function }//end function exists if(!function_exists('ht_kb_display_uncategorized_articles')){ /** * Display uncategorized articles * @pluggable */ function ht_kb_display_uncategorized_articles(){ global $ht_kb_display_uncategorized_articles, $ht_knowledge_base_options; //now getting uncategorized posts $ht_kb_display_uncategorized_articles = true; //set number of articles to fetch $numberposts = 100; //$numberposts = (array_key_exists('tax-cat-article-number', $ht_knowledge_base_options)) ? $ht_knowledge_base_options['tax-cat-article-number'] : 10; //get the master tax terms $args = array( 'orderby' => 'term_order', 'depth' => 0, 'child_of' => 0, 'hide_empty' => 0, 'pad_counts' => true ); $master_tax_terms = get_terms('ht_kb_category', $args); //get the top level terms, now unused $top_level_tax_terms = wp_list_filter($master_tax_terms,array('parent'=>0)); $tax_terms_ids = array(); if( !empty ($master_tax_terms ) && !is_a( $master_tax_terms, 'WP_Error' ) && is_array( $master_tax_terms ) ){ foreach ( (array)$master_tax_terms as $key => $term ) { array_push($tax_terms_ids, $term->term_id); } } $args = array( 'numberposts' => $numberposts, 'post_type' => 'ht_kb', 'orderby' => 'date', 'suppress_filters' => false, 'tax_query' => array( array( 'taxonomy' => 'ht_kb_category', 'field' => 'term_id', 'include_children' => false, 'terms' => $tax_terms_ids, 'operator' => 'NOT IN' ) ) ); $uncategorized_posts = get_posts( $args ); ?> <?php if( !empty( $uncategorized_posts ) && !is_a( $uncategorized_posts, 'WP_Error' ) ): ?> <div class="ht-kb-category-header"> <h2 class="ht-kb-category-title"> <?php _e( 'Uncategorized', 'ht-knowledge-base'); ?> </h2> </div> <ul class="ht-kb-article-list"> <?php foreach( $uncategorized_posts as $post ) : ?> <?php //set post format class if ( get_post_format( $post->ID )=='video') { $ht_kb_format_class = 'format-video'; } else { $ht_kb_format_class = 'format-standard'; } ?> <li class="<?php echo $ht_kb_format_class; ?>"><a href="<?php echo get_permalink($post->ID); ?>" rel="bookmark"><?php echo get_the_title($post->ID); ?></a></li> <?php endforeach; ?> </ul><!-- end get posts per category --> <?php endif; //finished getting uncategorized posts $ht_kb_display_uncategorized_articles = false; }//end function }//end function exists if(!function_exists('ht_kb_display_archive')){ /** * Display archive articles * @pluggable */ function ht_kb_display_archive($columns=2, $sub_cat_depth=2, $display_sub_cat_count=true, $display_sub_cat_articles=true, $sort_by='date', $sort_order='asc'){ global $ht_kb_display_archive, $ht_knowledge_base_options; //now displaying archive posts $ht_kb_display_archive = true; //set user options $columns = (array_key_exists('archive-columns', $ht_knowledge_base_options)) ? $ht_knowledge_base_options['archive-columns'] : $columns; $sort_by = (array_key_exists('sort-by', $ht_knowledge_base_options)) ? $ht_knowledge_base_options['sort-by'] : $sort_by; $sort_order = (array_key_exists('sort-order', $ht_knowledge_base_options)) ? $ht_knowledge_base_options['sort-order'] : $sort_order; $sub_cat_display = (array_key_exists('sub-cat-display', $ht_knowledge_base_options)) ? $ht_knowledge_base_options['sub-cat-display'] : $sub_cat_display; $sub_cat_depth = (array_key_exists('sub-cat-depth', $ht_knowledge_base_options)) ? $ht_knowledge_base_options['sub-cat-depth'] : $sub_cat_depth; $display_sub_cat_count = (array_key_exists('sub-cat-article-count', $ht_knowledge_base_options)) ? $ht_knowledge_base_options['sub-cat-article-count'] : $display_sub_cat_count; $display_sub_cat_articles = (array_key_exists('sub-cat-article-display', $ht_knowledge_base_options)) ? $ht_knowledge_base_options['sub-cat-article-display'] : $display_sub_cat_articles; //set number of posts to sub cat article number or global posts_per_page option $numberposts = (array_key_exists('sub-cat-article-number', $ht_knowledge_base_options)) ? $ht_knowledge_base_options['sub-cat-article-number'] : get_option('posts_per_page'); //list terms in a given taxonomy $args = array( 'orderby' => 'term_order', 'depth' => 0, 'child_of' => 0, 'hide_empty' => 0, 'pad_counts' => true, ); $master_tax_terms = get_terms('ht_kb_category', $args); $tax_terms = wp_list_filter($master_tax_terms,array('parent'=>0)); ?> <?php //category count (terms) $ht_kb_category_count = count($tax_terms); //category counter $cat_counter = 0; foreach ($tax_terms as $tax_term) { ?> <?php if( $cat_counter%$columns == 0 ): ?> <!--.ht-grid--> <div class="ht-grid ht-grid-gutter-20 ht-grid-gutter-bottom-40"> <?php else: ?> <?php endif; ?> <?php $grid_class_int = 12/$columns; ?> <!--.ht-grid-col--> <div class="ht-grid-col ht-grid-<?php echo $grid_class_int; ?>"> <!--.ht-kb-category--> <div id="ht-kb-category-<?php echo $tax_term->term_id; ?>" class="ht-kb-category"> <?php $term_meta = get_ht_kb_term_meta($tax_term); $category_thumb_att_id = 0; $category_color = '#434345'; $ht_kb_tax_desc = $tax_term->description; if(is_array($term_meta)&&array_key_exists('meta_image', $term_meta)&&!empty($term_meta['meta_image'])) $category_thumb_att_id = $term_meta['meta_image']; if(is_array($term_meta)&&array_key_exists('meta_color', $term_meta)&&!empty($term_meta['meta_color'])) $category_color = $term_meta['meta_color']; ?> <?php if( !empty( $category_thumb_att_id ) && $category_thumb_att_id!=0 ){ $ht_kb_category_class = "ht-kb-category-hasthumb"; $data_ht_category_custom_icon = 'true'; } else { $ht_kb_category_class = "ht-kb-category-hasicon"; $data_ht_category_custom_icon = 'false'; } if ( !empty( $ht_kb_tax_desc ) ) { $data_ht_kb_hasdesc = 'true'; } else { $data_ht_kb_hasdesc = 'false'; } ?> <!--.ht-kb-category-header--> <div class="ht-kb-category-header clearfix" data-ht-category-color="false" data-ht-category-color-hex="<?php echo $category_color; ?>" data-ht-category-icon="true" data-ht-category-custom-icon="<?php echo $data_ht_category_custom_icon; ?>" data-ht-category-desc="<?php echo $data_ht_kb_hasdesc; ?>"> <?php if( !empty( $category_thumb_att_id ) && $category_thumb_att_id!=0 ) : $category_thumb_obj = wp_get_attachment_image_src( $category_thumb_att_id, 'ht-kb-thumb'); $category_thumb_src = $category_thumb_obj[0]; ?> <div class="ht-kb-category-thumb"> <img src="<?php echo $category_thumb_src ?>" alt="" /> </div> <?php endif; ?> <h2 class="ht-kb-category-title"> <a href="<?php echo esc_attr(get_term_link($tax_term, 'ht_kb_category')) ?>" title="<?php echo sprintf( __( 'View all posts in %s', 'ht-knowledge-base' ), $tax_term->name ) ?>"><?php echo $tax_term->name ?></a> <?php if($display_sub_cat_count): ?> <span class="ht-kb-category-count"><?php echo sprintf( _n( '1 Article', '%s Articles', $tax_term->count, 'ht-knowledge-base' ), $tax_term->count ); ?></span> <?php endif; ?> </h2> <?php $ht_kb_tax_desc = $tax_term->description; ?> <?php if( !empty($ht_kb_tax_desc) ): ?> <p class="ht-kb-category-desc"><?php echo $ht_kb_tax_desc ?></p> <?php endif; ?> </div> <!--/.ht-kb-category-header--> <?php if($sub_cat_display && $sub_cat_depth){ ht_kb_display_sub_cats($master_tax_terms, $tax_term->term_id, $sub_cat_depth, $display_sub_cat_count, $display_sub_cat_articles, $numberposts); } //get posts per category $args = array( 'post_type' => 'ht_kb', 'posts_per_page' => $numberposts, 'order' => $sort_order, 'orderby' => $sort_by, 'suppress_filters' => 0, 'tax_query' => array( array( 'taxonomy' => 'ht_kb_category', 'field' => 'term_id', 'include_children' => false, 'terms' => $tax_term->term_id ) ) ); $cat_posts = get_posts( $args ); ?> <?php if( !empty( $cat_posts ) && !is_a( $cat_posts, 'WP_Error' ) ): ?> <ul class="ht-kb-article-list"> <?php foreach( $cat_posts as $post ) : ?> <?php //set post format class if ( get_post_format( $post->ID )=='video') { $ht_kb_format_class = 'format-video'; } else { $ht_kb_format_class = 'format-standard'; } ?> <li class="<?php echo $ht_kb_format_class; ?>"><a href="<?php echo get_permalink($post->ID); ?>" rel="bookmark"><?php echo get_the_title($post->ID); ?></a></li> <?php endforeach; ?> <!-- show all articles --> <?php global $wp_query; $term_link = get_term_link( $tax_term ); $link = is_wp_error( $term_link ) ? '#' : esc_url( $term_link ); ?> <?php if( count($cat_posts) < $tax_term->count ): ?> <li class="ht-kb-show-all-articles"> <a href="<?php echo $link; ?>" rel="bookmark"><?php echo sprintf( __('Show all %s articles', 'ht-knowledge-base'), $tax_term->count ); ?></a> </li> <?php endif; ?> </ul><!-- End Get posts per Category --> <?php endif; ?> </div> <!--/.ht-kb-category--> </div> <!--/.ht-grid-col--> <?php //increment counter $cat_counter+=1; ?> <?php if( ($cat_counter)%$columns == 0 || $cat_counter == $ht_kb_category_count ) : ?> </div> <!-- /.ht-grid --> <?php endif; ?> <?php } // close list terms in a given taxonomy //finished displaying archive posts $ht_kb_display_archive = false; }//end function }//end function exists if(!function_exists('ht_kb_display_view_count')){ /** * Display article view count * @pluggable */ function ht_kb_display_view_count( $post_id=null ){ global $ht_knowledge_base_options, $post; //set post_id $post_id = (empty($post_id)) ? $post->ID : $post_id; $count_key = HT_KB_POST_VIEW_COUNT_KEY; $views = get_post_meta($postID, $count_key, true); //hard set if(empty($views)){ $views = 0; } ?> <div class="ht-kb-view-count"> <span><?php echo sprintf( _n( '1 View', '%s Views', $views, 'ht-knowledge-base' ), $views ); ?></span> </div> <?php }//end function }//end function exists
gpl-2.0
ethomas1985/CharacterManager
src/Pathfinder.Api/Searching/SearchChip.cs
218
namespace Pathfinder.Api.Searching { public class SearchChip { public string Name { get; set; } public string Value { get; set; } public override string ToString() { return $"{Name}:{Value}"; } } }
gpl-2.0
arthurmelo88/palmetalADP
adempiere_360/zkwebui/WEB-INF/src/org/adempiere/webui/panel/InfoAssignmentPanel.java
12661
/****************************************************************************** * Product: Posterita Ajax UI * * Copyright (C) 2007 Posterita Ltd. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * * under the terms version 2 of the GNU General Public License as published * * by the Free Software Foundation. This program is distributed in the hope * * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * * with this program; if not, write to the Free Software Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * * For the text or an alternative of this public license, you may reach us * * Posterita Ltd., 3, Draper Avenue, Quatre Bornes, Mauritius * * or via info@posterita.org or http://www.posterita.org/ * *****************************************************************************/ package org.adempiere.webui.panel; import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.Timestamp; import java.util.Date; import java.util.logging.Level; import org.adempiere.webui.apps.AEnv; import org.adempiere.webui.component.Button; import org.adempiere.webui.component.Datebox; import org.adempiere.webui.component.Grid; import org.adempiere.webui.component.GridFactory; import org.adempiere.webui.component.Label; import org.adempiere.webui.component.Row; import org.adempiere.webui.component.Rows; import org.adempiere.webui.editor.WEditor; import org.adempiere.webui.editor.WSearchEditor; import org.adempiere.webui.event.ValueChangeEvent; import org.adempiere.webui.event.ValueChangeListener; import org.adempiere.webui.event.WTableModelEvent; import org.compiere.minigrid.ColumnInfo; import org.compiere.minigrid.IDColumn; import org.compiere.model.MLookupFactory; import org.compiere.model.MQuery; import org.compiere.util.DB; import org.compiere.util.DisplayType; import org.compiere.util.Env; import org.compiere.util.Msg; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.Events; import org.zkoss.zkex.zul.Borderlayout; import org.zkoss.zkex.zul.Center; import org.zkoss.zkex.zul.North; import org.zkoss.zkex.zul.South; import org.zkoss.zul.Div; import org.zkoss.zul.Separator; import org.zkoss.zul.Vbox; /** * Based on InfoAssignment written by Jorg Janke * * @author Niraj Sohun * Aug 06, 2007 * * Zk Port * @author Elaine * @version InfoAssignment.java Adempiere Swing UI 3.4.1 */ public class InfoAssignmentPanel extends InfoPanel implements EventListener, ValueChangeListener { /** * */ private static final long serialVersionUID = -935642651768066799L; private WEditor fieldResourceType; private WEditor fieldResource; private Button bNew = new Button(); private Datebox fieldFrom = new Datebox(); private Datebox fieldTo = new Datebox(); private Label labelFrom = new Label(Msg.translate(Env.getCtx(), "DateFrom")); private Label labelTo = new Label(Msg.translate(Env.getCtx(), "DateTo")); private Borderlayout layout; private Vbox southBody; /** From Clause */ private static String s_assignmentFROM = "S_ResourceAssignment ra, S_ResourceType rt, S_Resource r, C_UOM uom"; private static String s_assignmentWHERE = "ra.IsActive='Y' AND ra.S_Resource_ID=r.S_Resource_ID " + "AND r.S_ResourceType_ID=rt.S_ResourceType_ID AND rt.C_UOM_ID=uom.C_UOM_ID"; /** Array of Column Info */ private static ColumnInfo[] s_assignmentLayout = { new ColumnInfo(" ", "ra.S_ResourceAssignment_ID", IDColumn.class), new ColumnInfo(Msg.translate(Env.getCtx(), "S_ResourceType_ID"), "rt.Name", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "S_Resource_ID"), "r.Name", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "AssignDateFrom"), "ra.AssignDateFrom", Timestamp.class), new ColumnInfo(Msg.translate(Env.getCtx(), "Qty"), "ra.Qty", Double.class), new ColumnInfo(Msg.translate(Env.getCtx(), "C_UOM_ID"), "uom.UOMSymbol", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "AssignDateTo"), "ra.AssignDateTo", Timestamp.class), new ColumnInfo(Msg.translate(Env.getCtx(), "IsConfirmed"), "ra.IsConfirmed", Boolean.class) }; /** * Constructor * * @param WindowNo WindowNo * @param value Query value Name or Value if contains numbers * @param multiSelection multiple selection * @param whereClause where clause */ public InfoAssignmentPanel (int WindowNo, String value, boolean multiSelection, String whereClause) { this(WindowNo, value, multiSelection, whereClause, true); } /** * Constructor * * @param WindowNo WindowNo * @param value Query value Name or Value if contains numbers * @param multiSelection multiple selection * @param whereClause where clause */ public InfoAssignmentPanel (int WindowNo, String value, boolean multiSelection, String whereClause, boolean lookup) { super (WindowNo, "ra", "S_ResourceAssignment_ID", multiSelection, whereClause, lookup); log.info(value); setTitle(Msg.getMsg(Env.getCtx(), "InfoAssignment")); if (!initLookups()) return; statInit(); initInfo (value, whereClause); int no = contentPanel.getRowCount(); setStatusLine(Integer.toString(no) + " " + Msg.getMsg(Env.getCtx(), "SearchRows_EnterQuery"), false); setStatusDB(Integer.toString(no)); p_loadedOK = true; } // InfoAssignmentPanel /** * Initialize Lookups * @return true if OK */ private boolean initLookups() { try { int AD_Column_ID = 6851; // S_Resource.S_ResourceType_ID fieldResourceType = new WSearchEditor ( MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, AD_Column_ID, DisplayType.TableDir), Msg.translate(Env.getCtx(), "S_ResourceType_ID"), "", false, false, true); AD_Column_ID = 6826; // S_ResourceAssignment.S_Resource_ID fieldResource = new WSearchEditor ( MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, AD_Column_ID, DisplayType.TableDir), Msg.translate(Env.getCtx(), "S_Resource_ID"), "", false, false, true); } catch (Exception e) { log.log(Level.SEVERE, "InfoAssignment.initLookup"); return false; } bNew.setImage("/images/New16.png"); return true; } // initLookups /** * Static Setup - add fields to parameterPanel. * <pre> * ResourceType Resource DateTimeFrom DateTimeTo New * </pre> */ private void statInit() { fieldFrom.setWidth("180px"); fieldTo.setWidth("180px"); bNew.addEventListener(Events.ON_CLICK, this); Grid grid = GridFactory.newGridLayout(); Rows rows = new Rows(); grid.appendChild(rows); Row row = new Row(); rows.appendChild(row); row.appendChild(fieldResourceType.getLabel().rightAlign()); row.appendChild(fieldResource.getLabel().rightAlign()); row.appendChild(labelFrom.rightAlign()); row.appendChild(labelTo.rightAlign()); row.appendChild(new Label()); row = new Row(); rows.appendChild(row); row.appendChild(fieldResourceType.getComponent()); row.appendChild(fieldResource.getComponent()); Div div = new Div(); div.setAlign("right"); div.appendChild(fieldFrom); row.appendChild(div); div = new Div(); div.setAlign("right"); div.appendChild(fieldTo); row.appendChild(div); row.appendChild(bNew); layout = new Borderlayout(); layout.setWidth("100%"); layout.setHeight("100%"); if (!isLookup()) { layout.setStyle("position: absolute"); } this.appendChild(layout); North north = new North(); layout.appendChild(north); north.appendChild(grid); Center center = new Center(); layout.appendChild(center); center.setFlex(true); div = new Div(); div.appendChild(contentPanel); if (isLookup()) contentPanel.setWidth("99%"); else contentPanel.setStyle("width: 99%; margin: 0px auto;"); contentPanel.setVflex(true); div.setStyle("width :100%; height: 100%"); center.appendChild(div); South south = new South(); layout.appendChild(south); southBody = new Vbox(); southBody.setWidth("100%"); south.appendChild(southBody); southBody.appendChild(confirmPanel); southBody.appendChild(new Separator()); southBody.appendChild(statusBar); } /** * Dynamic Init * @param value value * @param whereClause where clause */ private void initInfo(String value, String whereClause) { // C_BPartner bp, AD_User c, C_BPartner_Location l, C_Location a // Create Grid StringBuffer where = new StringBuffer(s_assignmentWHERE); if (whereClause != null && whereClause.length() > 0) where.append(" AND ").append(whereClause); prepareTable(s_assignmentLayout, s_assignmentFROM, where.toString(), "rt.Name,r.Name,ra.AssignDateFrom"); } // initInfo /*************************************************************************/ /** * Event Listener * * @param e event */ public void onEvent (Event e) { // don't requery if fieldValue and fieldName are empty // return; super.onEvent(e); } // onEvent /*************************************************************************/ /** * Get dynamic WHERE part of SQL * To be overwritten by concrete classes * @return WHERE clause */ protected String getSQLWhere() { StringBuffer sql = new StringBuffer(); Integer S_ResourceType_ID = (Integer)fieldResourceType.getValue(); if (S_ResourceType_ID != null) sql.append(" AND rt.S_ResourceType_ID=").append(S_ResourceType_ID.intValue()); Integer S_Resource_ID = (Integer)fieldResource.getValue(); if (S_Resource_ID != null) sql.append(" AND r.S_Resource_ID=").append(S_Resource_ID.intValue()); Date f = fieldFrom.getValue(); Timestamp ts = f != null ? new Timestamp(f.getTime()) : null; if (ts != null) sql.append(" AND TRUNC(ra.AssignDateFrom)>=").append(DB.TO_DATE(ts,false)); Date t = fieldTo.getValue(); ts = t != null ? new Timestamp(t.getTime()) : null; if (ts != null) sql.append(" AND TRUNC(ra.AssignDateTo)<=").append(DB.TO_DATE(ts,false)); return sql.toString(); } // getSQLWhere /** * Set Parameters for Query * To be overwritten by concrete classes * @param pstmt pstmt * @param forCount for counting records * @throws SQLException */ protected void setParameters (PreparedStatement pstmt, boolean forCount) throws SQLException { } /** * History dialog * To be overwritten by concrete classes */ protected void showHistory() { } /** * Has History (false) * To be overwritten by concrete classes * @return true if it has history (default false) */ protected boolean hasHistory() { return false; } /** * Customize dialog * To be overwritten by concrete classes */ protected void customize() { } /** * Has Customize (false) * To be overwritten by concrete classes * @return true if it has customize (default false) */ protected boolean hasCustomize() { return false; } /** * Zoom action * To be overwritten by concrete classes */ public void zoom() { if (getSelectedRowKey() != null && getSelectedRowKey() > 0) { MQuery zoomQuery = new MQuery(); // ColumnName might be changed in MTab.validateQuery String column = getKeyColumn(); //strip off table name, fully qualify name doesn't work when zoom into detail tab if (column.indexOf(".") > 0) column = column.substring(column.indexOf(".")+1); zoomQuery.addRestriction(column, MQuery.EQUAL, getSelectedRowKey()); zoomQuery.setRecordCount(1); zoomQuery.setTableName(column.substring(0, column.length() - 3)); AEnv.zoom(236, zoomQuery); } } /** * Has Zoom (false) * To be overwritten by concrete classes * @return true if it has zoom (default false) */ protected boolean hasZoom() { return true; } /** * Save Selection Details * To be overwritten by concrete classes */ protected void saveSelectionDetail() { } public void valueChange(ValueChangeEvent evt) { } public void tableChanged(WTableModelEvent event) { } @Override protected void insertPagingComponent() { southBody.insertBefore(paging, southBody.getFirstChild()); layout.invalidate(); } }
gpl-2.0
jolay/intelisis3
sites/all/modules/acquia/modules/ac_shortcode/ac_composer/assets/composer/js/backend/composer-atts.js
9098
/* ========================================================= * composer-atts.js v0.2.1 * ========================================================= * Copyright 2013 Wpbakery * * Visual composer backbone/underscore shortcodes attributes * form field and parsing controls * ========================================================= */ var vc = {filters:{templates:[]}, addTemplateFilter:function (callback) { if (_.isFunction(callback)) this.filters.templates.push(callback); }}; (function ($) { var i18n = window.i18nLocale; vc.atts = { parse:function (param) { var value; var $field = this.$content.find('.wpb_vc_param_value[name=' + param.param_name + ']'); if (!_.isUndefined(vc.atts[param.type]) && !_.isUndefined(vc.atts[param.type].parse)) { value = vc.atts[param.type].parse.call(this, param); } else { value = $field.length ? $field.val() : null; } if ($field.data('js-function') !== undefined && typeof(window[$field.data('js-function')]) !== 'undefined') { var fn = window[$field.data('js-function')]; fn(this.$el, this); } return value; } }; // Default atts _.extend(vc.atts, { textarea_html:{ parse:function (param) { var $field = this.$content.find('textarea.wpb_vc_param_value.' + param.param_name + ''), mce_id = $field.attr('id'); try { window.tinyMCE.get(mce_id).save(); } catch (err) { } return vc_wpnop($field.val()); // !_.isUndefined(window.switchEditors) ? window.switchEditors._wp_Nop($field.val()) : $field.val(); }, render:function (param, value) { return vc_wpautop(value); } }, checkbox:{ parse:function (param) { var arr = [], new_value = ''; $('input[name=' + param.param_name + ']', this.$content).each(function (index) { var self = $(this); if (self.is(':checked')) { arr.push(self.attr("value")); } }); if (arr.length > 0) { new_value = arr.join(','); } return new_value; } }, posttypes:{ parse:function (param) { var posstypes_arr = [], new_value = ''; $('input[name=' + param.param_name + ']', this.$content).each(function (index) { var self = $(this); if (self.is(':checked')) { posstypes_arr.push(self.attr("value")); } }); if (posstypes_arr.length > 0) { new_value = posstypes_arr.join(','); } return new_value; } }, taxonomies:{ parse:function (param) { var posstypes_arr = [], new_value = ''; $('input[name=' + param.param_name + ']', this.$content).each(function (index) { var self = $(this); if (self.is(':checked')) { posstypes_arr.push(self.attr("value")); } }); if (posstypes_arr.length > 0) { new_value = posstypes_arr.join(','); } return new_value; } }, exploded_textarea:{ parse:function (param) { var $field = this.$content.find('.wpb_vc_param_value[name=' + param.param_name + ']'); return $field.val().replace(/\n/g, ","); } }, textarea_raw_html:{ parse:function (param) { var $field = this.$content.find('.wpb_vc_param_value[name=' + param.param_name + ']'), new_value = $field.val(); return base64_encode(new_value); }, render:function (param, value) { return $("<div/>").text(base64_decode(value)).html(); } }, dropdown:{ render:function (param, value) { var all_classes = _.isObject(param.value) ? _.values(param.value).join(' ') : ''; // this.$el.find('> .wpb_element_wrapper').removeClass(all_classes).addClass(value); // remove all possible class names and add only selected one return value; } }, attach_images:{ parse:function (param) { var $field = this.$content.find('.wpb_vc_param_value[name=' + param.param_name + ']'), thumbnails_html = ''; // TODO: Check image search with Wordpress $field.parent().find('li.added').each(function () { thumbnails_html += '<li><img src="' + $(this).find('img').attr('src') + '" alt=""></li>'; }); $('[data-model-id=' + this.model.id + ']').data('field-' + param.param_name + '-attach-images', thumbnails_html); return $field.length ? $field.val() : null; }, render:function (param, value) { var $thumbnails = this.$el.find('.attachment-thumbnails[data-name=' + param.param_name + ']'), thumbnails_html = this.$el.data('field-' + param.param_name + '-attach-images'); if (_.isUndefined(thumbnails_html)) { $.ajax({ type:'POST', url:window.ajaxurl, data:{ action:'wpb_gallery_html', content:value }, dataType:'html', context:this }).done(function (html) { vc.atts.attach_images.updateImages($thumbnails, html); }); } else { this.$el.removeData('field-' + param.param_name + '-attach-images'); vc.atts.attach_images.updateImages($thumbnails, thumbnails_html); } return value; }, updateImages:function ($thumbnails, thumbnails_html) { $thumbnails.html(thumbnails_html); if (thumbnails_html.length) { $thumbnails.removeClass('image-exists').next().addClass('image-exists'); } else { $thumbnails.addClass('image-exists').next().removeClass('image-exists'); } } }, attach_image:{ parse:function (param) { var $field = this.$content.find('.wpb_vc_param_value[name=' + param.param_name + ']'), image_src = ''; if ($field.parent().find('li.added').length) { image_src = $field.parent().find('li.added img').attr('src'); } $('[data-model-id=' + this.model.id + ']').data('field-' + param.param_name + '-attach-image', image_src); return $field.length ? $field.val() : null; }, render:function (param, value) { var image_src = $('[data-model-id=' + this.model.id + ']').data('field-' + param.param_name + '-attach-image'); var $thumbnail = this.$el.find('.attachment-thumbnail[data-name=' + param.param_name + ']'); if (_.isUndefined(image_src)) { $.ajax({ type:'POST', url:window.ajaxurl, data:{ action:'wpb_single_image_src', content:value }, dataType:'html', context:this }).done(function (src) { vc.atts['attach_image'].updateImage($thumbnail, src); }); } else { $('[data-model-id=' + this.model.id + ']').removeData('field-' + param.param_name + '-attach-image'); vc.atts['attach_image'].updateImage($thumbnail, image_src); } return value; }, updateImage:function ($thumbnail, image_src) { if (_.isEmpty(image_src)) { $thumbnail.attr('src', '').hide(); $thumbnail.next().removeClass('image-exists').next().removeClass('image-exists'); } else { $thumbnail.attr('src', image_src).show(); $thumbnail.next().addClass('image-exists').next().addClass('image-exists'); } } } }); })(window.jQuery);
gpl-2.0
jamielaff/als_resourcing
tmp/install_55cb054400b98/jsjobs/site/views/job/tmpl/myjobs.php
22575
<?php /** * @Copyright Copyright (C) 2009-2011 * @license GNU/GPL http://www.gnu.org/copyleft/gpl.html + Created by: Ahmad Bilal * Company: Buruj Solutions + Contact: www.burujsolutions.com , ahmad@burujsolutions.com * Created on: Jan 11, 2009 ^ + Project: JS Jobs * File Name: views/employer/tmpl/myjobs.php ^ * Description: template view for my jobs ^ * History: NONE ^ */ defined('_JEXEC') or die('Restricted access'); $link = 'index.php?option=com_jsjobs&c=job&view=job&layout=myjobs&Itemid=' . $this->Itemid; ?> <script language="Javascript"> function confirmdeletejob() { return confirm("<?php echo JText::_('JS_ARE_YOU_SURE_DELETE_THE_JOB'); ?>"); } </script> <div id="jsjobs_main"> <div id="js_menu_wrapper"> <?php if (sizeof($this->jobseekerlinks) != 0){ foreach($this->jobseekerlinks as $lnk){ ?> <a class="js_menu_link <?php if($lnk[2] == 'job') echo 'selected'; ?>" href="<?php echo $lnk[0]; ?>"><?php echo $lnk[1]; ?></a> <?php } } if (sizeof($this->employerlinks) != 0){ foreach($this->employerlinks as $lnk) { ?> <a class="js_menu_link <?php if($lnk[2] == 'job') echo 'selected'; ?>" href="<?php echo $lnk[0]; ?>"><?php echo $lnk[1]; ?></a> <?php } } ?> </div> <?php if ($this->config['offline'] == '1') { ?> <div class="js_job_error_messages_wrapper"> <div class="js_job_messages_image_wrapper"> <img class="js_job_messages_image" src="components/com_jsjobs/images/7.png"/> </div> <div class="js_job_messages_data_wrapper"> <span class="js_job_messages_main_text"> <?php echo JText::_('JS_JOBS_OFFLINE_MODE'); ?> </span> <span class="js_job_messages_block_text"> <?php echo $this->config['offline_text']; ?> </span> </div> </div> <?php }else { ?> <?php if($this->myjobs_allowed == VALIDATE){ if ($this->jobs) { if ($this->sortlinks['sortorder'] == 'ASC') $img = "components/com_jsjobs/images/sort0.png"; else $img = "components/com_jsjobs/images/sort1.png"; ?> <div id="js_main_wrapper"> <form action="index.php" method="post" name="adminForm"> <span class="js_controlpanel_section_title"><?php echo JText::_('JS_MY_JOBS');?></span> <div id="sortbylinks"> <span class="my_job_sbl_links"><a href="<?php echo $link ?>&sortby=<?php echo $this->sortlinks['title']; ?>" class="<?php if ($this->sortlinks['sorton'] == 'title') echo 'selected' ?>"><?php echo JText::_('JS_TITLE'); ?><?php if ($this->sortlinks['sorton'] == 'title') { ?> <img src="<?php echo $img ?>"> <?php } ?></a></span> <span class="my_job_sbl_links"><a href="<?php echo $link ?>&sortby=<?php echo $this->sortlinks['category']; ?>" class="<?php if ($this->sortlinks['sorton'] == 'category') echo 'selected' ?>"><?php echo JText::_('JS_CATEGORY'); ?><?php if ($this->sortlinks['sorton'] == 'category') { ?> <img src="<?php echo $img ?>"> <?php } ?></a></span> <span class="my_job_sbl_links"><a href="<?php echo $link ?>&sortby=<?php echo $this->sortlinks['jobtype']; ?>" class="<?php if ($this->sortlinks['sorton'] == 'jobtype') echo 'selected' ?>"><?php echo JText::_('JS_JOBTYPE'); ?><?php if ($this->sortlinks['sorton'] == 'jobtype') { ?> <img src="<?php echo $img ?>"> <?php } ?></a></span> <span class="my_job_sbl_links"><a href="<?php echo $link ?>&sortby=<?php echo $this->sortlinks['jobstatus']; ?>" class="<?php if ($this->sortlinks['sorton'] == 'jobstatus') echo 'selected' ?>"><?php echo JText::_('JS_JOBSTATUS'); ?><?php if ($this->sortlinks['sorton'] == 'jobstatus') { ?> <img src="<?php echo $img ?>"> <?php } ?></a></span> <span class="my_job_sbl_links"><a href="<?php echo $link ?>&sortby=<?php echo $this->sortlinks['company']; ?>" class="<?php if ($this->sortlinks['sorton'] == 'company') echo 'selected' ?>"><?php echo JText::_('JS_COMPANY'); ?><?php if ($this->sortlinks['sorton'] == 'company') { ?> <img src="<?php echo $img ?>"> <?php } ?></a></span> <span class="my_job_sbl_links"><a href="<?php echo $link ?>&sortby=<?php echo $this->sortlinks['salaryto']; ?>" class="<?php if ($this->sortlinks['sorton'] == 'salaryto') echo 'selected' ?>"><?php echo JText::_('JS_SALARY_RANGE'); ?><?php if ($this->sortlinks['sorton'] == 'salaryrange') { ?> <img src="<?php echo $img ?>"> <?php } ?></a></span> <span class="my_job_sbl_links"><a href="<?php echo $link ?>&sortby=<?php echo $this->sortlinks['created']; ?>" class="<?php if ($this->sortlinks['sorton'] == 'created') echo 'selected' ?>"><?php echo JText::_('JS_CREATED'); ?><?php if ($this->sortlinks['sorton'] == 'created') { ?> <img src="<?php echo $img ?>"> <?php } ?></a></span> </div> <?php $days = $this->config['newdays']; $isnew = date("Y-m-d H:i:s", strtotime("-$days days")); if (isset($this->jobs)) { foreach ($this->jobs as $job) { ?> <div class="js_job_main_wrapper"> <div class="js_job_data_1"> <span class="js_job_title"> <?php $jobaliasid = ($this->isjobsharing != "") ? $job->sjobaliasid : $job->jobaliasid; $link = 'index.php?option=com_jsjobs&c=job&view=job&layout=view_job&nav=19&bd=' . $jobaliasid . '&Itemid=' . $this->Itemid; ?> <a href="<?php echo $link; ?>" class=''><?php echo $job->title; ?></a> </span> <span class="js_job_posted"> <?php if ($this->listjobconfig['lj_created'] == '1') { echo JText::_('JS_CREATED') . ':&nbsp;' . date($this->config['date_format'], strtotime($job->created)); } ?> </span> </div> <div class="js_job_image_area"> <div class="js_job_image_wrapper"> <?php if(!empty($job->companylogo)){ if($this->isjobsharing){ $imgsrc = $job->companylogo; }else{ $imgsrc = $this->config['data_directory'].'/data/employer/comp_'.$job->companyid.'/logo/'.$job->companylogo; } }else{ $imgsrc = 'components/com_jsjobs/images/blank_logo.png'; } ?> <img class="js_job_image" src="<?php echo $imgsrc; ?>" /> </div> </div> <div class="js_job_data_area"> <div class="js_job_data_2"> <?php if ($this->listjobconfig['lj_company'] == '1') { echo "<div class='js_job_data_2_wrapper'>"; if ($this->config['labelinlisting'] == '1') { echo "<span class=\"js_job_data_2_title\">" . JText::_('JS_COMPANY') . ": </span>"; } $companyaliasid = ($this->isjobsharing != "") ? $job->scompanyaliasid : $job->companyaliasid; $jobcategory = ($this->isjobsharing != "") ? $job->sjobcategory : $job->jobcategory; $link = 'index.php?option=com_jsjobs&c=company&view=company&layout=view_company&nav=41&cd=' . $companyaliasid . '&cat=' . $jobcategory . '&Itemid=' . $this->Itemid; ?> <span class="js_job_data_2_value"><a href="<?php echo $link ?>"><?php echo $job->companyname; ?></a></span></div> <?php } if ($this->listjobconfig['lj_category'] == '1') { echo "<div class='js_job_data_2_wrapper'>"; if ($this->config['labelinlisting'] == '1') { echo "<span class=\"js_job_data_2_title\">" . JText::_('JS_CATEGORY') . ": </span>"; } echo '<span class="js_job_data_2_value">'.$job->cat_title . "</span></div>"; } if ($this->listjobconfig['lj_salary'] == '1') { $salary = $job->symbol . $job->rangestart . ' - ' . $job->symbol . $job->rangeend . ' ' . $job->salarytypetitle; if ($job->rangestart) { echo "<div class='js_job_data_2_wrapper'>"; if ($this->config['labelinlisting'] == '1') { echo "<span class=\"js_job_data_2_title\">" . JText::_('JS_SALARY') . ": </span>"; } echo '<span class="js_job_data_2_value">'.$salary . "</span></div>"; } } if ($this->listjobconfig['lj_jobtype'] == '1') { echo "<div class='js_job_data_2_wrapper'>"; if ($this->config['labelinlisting'] == '1') { echo "<span class=\"js_job_data_2_title\">" . JText::_('JS_JOB_TYPE') . ": </span>"; } echo '<span class="js_job_data_2_value">'.$job->jobtypetitle; if ($this->listjobconfig['lj_jobstatus'] == '1') echo ' - ' . $job->jobstatustitle; echo "</span></div>"; } ?> <?php if ($this->listjobconfig['lj_country'] == '1') { echo "<span class=\"js_job_data_location_title\">".JText::_('JS_LOCATION').":&nbsp;</span>"; if (isset($job->city) AND !empty($job->city)) { echo "<span class=\"js_job_data_location_value\">".$job->city."</span>"; } } ?> </div> </div> <div class="js_job_data_3 myjob"> <div class="js_job_data_3_myjob_no"> <?php if ($this->listjobconfig['lj_noofjobs'] == '1') { echo "<span class='js_job_myjob_numbers'>" ; if ($job->noofjobs != 0) { echo $job->noofjobs ." ".JText::_('JS_JOBS'); }else{ echo '1'." ".JText::_('JS_JOBS'); } echo "</span>"; } ?> </div> <div class="js_job_data_4 myjob"> <?php if ($job->status == '1') { $show_links = false; if ($this->isjobsharing) { if ($job->serverstatus == "ok") $show_links = true; else $show_links = false; }else { $show_links = true; } if ($show_links) { //check for is gold, featured or both $g_f_job = 0; if (isset($job->visitor) && $job->visitor == 'visitor') $link = 'index.php?option=com_jsjobs&c=job&view=job&layout=formjob_visitor&email=' . $job->contactemail . '&bd=' . $job->jobaliasid . '&Itemid=' . $this->Itemid; else $link = 'index.php?option=com_jsjobs&c=job&view=job&layout=formjob&bd=' . $job->jobaliasid . '&Itemid=' . $this->Itemid; if (isset($job->visitor) && $job->visitor == 'visitor') { if ($this->config['visitor_can_edit_job'] == 1) { ?> <a href="<?php echo $link ?>" class="company_icon" title="<?php echo JText::_('JS_EDIT'); ?>"><img width="17" height="17" src="components/com_jsjobs/images/edit.png" /></a> <?php } } else { ?> <a href="<?php echo $link ?>" class="company_icon" title="<?php echo JText::_('JS_EDIT'); ?>"><img width="17" height="17" src="components/com_jsjobs/images/edit.png" /></a> <?php } $jobaliasid = ($this->isjobsharing != "") ? $job->sjobaliasid : $job->jobaliasid; $link = 'index.php?option=com_jsjobs&c=job&view=job&layout=view_job&nav=19&bd=' . $jobaliasid . '&Itemid=' . $this->Itemid; ?> <a href="<?php echo $link ?>" class="company_icon" title="<?php echo JText::_('JS_VIEW'); ?>"><img width="17" height="17" src="components/com_jsjobs/images/view.png" /></a> <?php if (isset($job->visitor) && $job->visitor == 'visitor') $link = 'index.php?option=com_jsjobs&task=job.deletejob&email=' . $job->contactemail . '&bd=' . $job->jobaliasid . '&Itemid=' . $this->Itemid; else $link = 'index.php?option=com_jsjobs&task=job.deletejob&bd=' . $job->jobaliasid . '&Itemid=' . $this->Itemid; ?> <a href="<?php echo $link ?>" class="company_icon" onclick=" return confirmdeletejob();" title="<?php echo JText::_('JS_DELETE'); ?>"><img width="17" height="17" src="components/com_jsjobs/images/delete.png" /></a> <?php } ?> <?php } ?> </div> <div class="js_job_data_3_myjob_no"> <?php $jobaliasid = ($this->isjobsharing != "") ? $job->sjobaliasid : $job->jobaliasid; ?> <?php $link = 'index.php?option=com_jsjobs&c=jobapply&view=jobapply&layout=job_appliedapplications&bd='.$jobaliasid.'&Itemid='.$this->Itemid; ?> <a class="applied_resume_button" href="<?php echo $link?>"><?php echo JText::_('JS_RESUME'); echo ' ('.$job->totalapply.')'; ?></a> </div> </div> <?php $curdate = date('Y-m-d'); $startpublishing = date('Y-m-d', strtotime($job->startpublishing)); $stoppublishing = date('Y-m-d', strtotime($job->stoppublishing)); if ($job->status == 1) { if ($startpublishing <= $curdate) { if ($stoppublishing >= $curdate) { $jobstatus = "published_txt.png"; $jobstatus = JText::_('JS_PUBLISH'); $class = "publish"; $message = ""; } else { $jobstatus = "expired_txt.png"; $jobstatus = JText::_('JS_EXPIRED'); $class = "expired"; $message = ""; } } else { $jobstatus = "notpublish_txt.png"; $jobstatus = JText::_('JS_NOT_PUBLISH'); $class = "notpublish"; $message = ""; } } elseif ($job->status == -1) { $jobstatus = "rejected.png"; $jobstatus = JText::_('JS_REJECTED'); $class = "rejected"; $message = ""; } else { $jobstatus = "pending.png"; $jobstatus = JText::_('JS_PENDDING'); $class = "pending"; $message = ""; } ?> <div class="js_job_publish <?php echo $class; ?>"><canvas class="goldjob" width="20" height="20"></canvas><?php echo $jobstatus; ?></div> <?php $g_f_job = 0; if ($job->created > $isnew) { echo '<div class="js_job_new"><canvas class="newjob" width="20" height="20"></canvas>'.JText::_('JS_NEW').'</div>'; } ?> <?php switch($g_f_job){ case 1: // Gold job ?> <div class="js_job_gold mycompany"><canvas class="goldjob" width="20" height="20"></canvas><?php echo JText::_('JS_GOLD'); ?></div> <?php break; } ?> </div> <?php } } ?> <input type="hidden" name="option" value="<?php echo $this->option; ?>" /> <input type="hidden" name="task" value="deletejob" /> <input type="hidden" name="c" value="job" /> <input type="hidden" id="id" name="id" value="" /> <input type="hidden" name="boxchecked" value="0" /> </form> <form action="<?php echo JRoute::_('index.php?option=com_jsjobs&c=job&view=job&layout=myjobs&Itemid=' . $this->Itemid); ?>" method="post"> <div id="jl_pagination"> <div id="jl_pagination_pageslink"> <?php echo $this->pagination->getPagesLinks(); ?> </div> <div id="jl_pagination_box"> <?php echo JText::_('JS_DISPLAY_#'); echo $this->pagination->getLimitBox(); ?> </div> <div id="jl_pagination_counter"> <?php echo $this->pagination->getResultsCounter(); ?> </div> </div> </form> <?php } else { // no result found in this category ?> <div class="js_job_error_messages_wrapper"> <div class="js_job_messages_image_wrapper"> <img class="js_job_messages_image" src="components/com_jsjobs/images/2.png"/> </div> <div class="js_job_messages_data_wrapper"> <span class="js_job_messages_main_text"> <?php echo JText::_('JS_RESULT_NOT_FOUND'); ?> </span> <span class="js_job_messages_block_text"> <?php echo JText::_('JS_RESULT_NOT_FOUND'); ?> </span> </div> </div> <?php } }else{ switch($this->myjobs_allowed){ case JOBSEEKER_NOT_ALLOWED_EMPLOYER_PRIVATE_AREA: ?> <div class="js_job_error_messages_wrapper"> <div class="js_job_messages_image_wrapper"> <img class="js_job_messages_image" src="components/com_jsjobs/images/4.png"/> </div> <div class="js_job_messages_data_wrapper"> <span class="js_job_messages_main_text"> <?php echo JText::_('JS_JOBSEEKER_NOT_ALLOWED'); ?> </span> <span class="js_job_messages_block_text"> <?php echo JText::_('JS_JOBSEEKER_NOT_ALLOWED_EMPLOYER_PRIVATE_AREA'); ?> </span> </div> </div> <?php break; case USER_ROLE_NOT_SELECTED: ?> <div class="js_job_error_messages_wrapper"> <div class="js_job_messages_image_wrapper"> <img class="js_job_messages_image" src="components/com_jsjobs/images/1.png"/> </div> <div class="js_job_messages_data_wrapper"> <span class="js_job_messages_main_text"> <?php echo JText::_('JS_USER_ROLE_NOT_SELECTED'); ?> </span> <span class="js_job_messages_block_text"> <?php echo JText::_('JS_USER_ROLE_NOT_SELECTED_PLEASE_SELECT_ROLE_FIRST'); ?> </span> <div class="js_job_messages_button_wrapper"> <a class="js_job_message_button" href="index.php?option=com_jsjobs&c=common&view=common&layout=new_injsjobs&Itemid=<?php echo $itemid; ?>" ><?php echo JText::_('JS_SELECT_ROLE'); ?></a> </div> </div> </div> <?php break; case VISITOR_NOT_ALLOWED_TO_EDIT_THEIR_JOBS: ?> <div class="js_job_error_messages_wrapper"> <div class="js_job_messages_image_wrapper"> <img class="js_job_messages_image" src="components/com_jsjobs/images/4.png"/> </div> <div class="js_job_messages_data_wrapper"> <span class="js_job_messages_main_text"> <?php echo JText::_('JS_VISITOR_NOT_ALLOWED_TO_EDIT_THEIR_JOBS'); ?> </span> <span class="js_job_messages_block_text"> <?php echo JText::_('JS_VISITOR_NOT_ALLOWED_TO_EDIT_THEIR_JOBS'); ?> </span> </div> </div> <?php break; } } }//ol ?> <div id="jsjobs_footer"><?php echo '<table width="100%" style="table-layout:fixed;"> <tr><td height="15"></td></tr> <tr><td style="vertical-align:top;" align="center"> <a class="img" target="_blank" href="http://www.joomsky.com"><img src="http://www.joomsky.com/logo/jsjobscrlogo.png"></a> <br> Copyright &copy; 2008 - '.date('Y').', <span id="themeanchor"> <a class="anchor"target="_blank" href="http://www.joomsky.com">Joom Sky</a></span></td></tr> </table></div>'; ?></div> <script type="text/javascript" src="<?php echo JURI::root(); ?>components/com_jsjobs/js/tinybox.js"></script> <link media="screen" rel="stylesheet" href="<?php echo JURI::root(); ?>components/com_jsjobs/js/style.css" /> </div> <?php $document = JFactory::getDocument(); $document->addScript('components/com_jsjobs/js/canvas_script.js'); ?>
gpl-2.0
TylerConlee/BasicCMS
resources/views/errors/404.blade.php
1107
<!DOCTYPE html> <html> <head> <title>Oops. Not Found</title> <link href="https://fonts.googleapis.com/css?family=Lato:100" rel="stylesheet" type="text/css"> <style> html, body { height: 100%; } body { margin: 0; padding: 0; width: 100%; color: #B0BEC5; display: table; font-weight: 100; font-family: 'Lato'; } .container { text-align: center; display: table-cell; vertical-align: middle; } .content { text-align: center; display: inline-block; } .title { font-size: 72px; margin-bottom: 40px; } </style> </head> <body> <div class="container"> <div class="content"> <div class="title">Oops. Not Found.</div> </div> </div> </body> </html>
gpl-2.0
martolini/Vana
src/ChannelServer/SummonHandler.cpp
8992
/* Copyright (C) 2008-2015 Vana Development Team 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; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "SummonHandler.hpp" #include "BuffDataProvider.hpp" #include "BuffsPacket.hpp" #include "ChannelServer.hpp" #include "GameLogicUtilities.hpp" #include "IdPool.hpp" #include "Map.hpp" #include "Maps.hpp" #include "MovementHandler.hpp" #include "PacketReader.hpp" #include "PacketWrapper.hpp" #include "SkillConstants.hpp" #include "Player.hpp" #include "PlayerPacket.hpp" #include "SkillConstants.hpp" #include "SkillDataProvider.hpp" #include "Summon.hpp" #include "SummonsPacket.hpp" IdPool<summon_id_t> SummonHandler::summonIds; auto SummonHandler::useSummon(Player *player, skill_id_t skillId, skill_level_t level) -> void { // Determine if any summons need to be removed and do it switch (skillId) { case Skills::Ranger::Puppet: case Skills::Sniper::Puppet: case Skills::WindArcher::Puppet: player->getSummons()->forEach([player, skillId](Summon *summon) { if (summon->getSkillId() == skillId) { removeSummon(player, summon->getId(), false, SummonMessages::None); } }); break; case Skills::Ranger::SilverHawk: case Skills::Bowmaster::Phoenix: case Skills::Sniper::GoldenEagle: case Skills::Marksman::Frostprey: player->getSummons()->forEach([player, skillId](Summon *summon) { if (!GameLogicUtilities::isPuppet(summon->getSkillId())) { removeSummon(player, summon->getId(), false, SummonMessages::None); } }); break; case Skills::Outlaw::Gaviota: case Skills::Outlaw::Octopus: case Skills::Corsair::WrathOfTheOctopi: { int8_t maxCount = -1; int8_t currentCount = 0; switch (skillId) { case Skills::Outlaw::Octopus: maxCount = 2; break; case Skills::Corsair::WrathOfTheOctopi: maxCount = 3; break; case Skills::Outlaw::Gaviota: maxCount = 4; break; } player->getSummons()->forEach([player, skillId, &currentCount](Summon *summon) { if (summon->getSkillId() == skillId) { currentCount++; } }); if (currentCount == maxCount) { // We have to remove one bool removed = false; player->getSummons()->forEach([player, skillId, &removed](Summon *summon) { if (summon->getSkillId() != skillId || removed) { return; } removeSummon(player, summon->getId(), false, SummonMessages::None); removed = true; }); } break; } default: // By default, you can only have one summon out player->getSummons()->forEach([player, skillId](Summon *summon) { removeSummon(player, summon->getId(), false, SummonMessages::None); }); } Point playerPosition = player->getPos(); Point summonPosition; foothold_id_t foothold = player->getFoothold(); bool puppet = GameLogicUtilities::isPuppet(skillId); if (puppet) { // TODO FIXME formula // TODO FIXME skill // This is not kosher playerPosition.x += 200 * (player->isFacingRight() ? 1 : -1); player->getMap()->findFloor(playerPosition, summonPosition, -5); foothold = player->getMap()->getFootholdAtPosition(summonPosition); } else { summonPosition = playerPosition; } Summon *summon = new Summon(summonIds.lease(), skillId, level, player->isFacingLeft() && !puppet, summonPosition); if (summon->getMovementType() == Summon::Static) { summon->resetMovement(foothold, summon->getPos(), summon->getStance()); } auto skill = ChannelServer::getInstance().getSkillDataProvider().getSkill(skillId, level); player->getSummons()->addSummon(summon, skill->buffTime); player->sendMap(SummonsPacket::showSummon(player->getId(), summon, false)); } auto SummonHandler::removeSummon(Player *player, summon_id_t summonId, bool packetOnly, int8_t showMessage, bool fromTimer) -> void { Summon *summon = player->getSummons()->getSummon(summonId); if (summon != nullptr) { player->sendMap(SummonsPacket::removeSummon(player->getId(), summon, showMessage)); if (!packetOnly) { player->getSummons()->removeSummon(summonId, fromTimer); } } } auto SummonHandler::showSummon(Player *player) -> void { player->getSummons()->forEach([player](Summon *summon) { summon->setPos(player->getPos()); player->sendMap(SummonsPacket::showSummon(player->getId(), summon)); }); } auto SummonHandler::showSummons(Player *fromPlayer, Player *toPlayer) -> void { fromPlayer->getSummons()->forEach([fromPlayer, toPlayer](Summon *summon) { toPlayer->send(SummonsPacket::showSummon(fromPlayer->getId(), summon)); }); } auto SummonHandler::moveSummon(Player *player, PacketReader &reader) -> void { summon_id_t summonId = reader.get<summon_id_t>(); // I am not certain what this is, but in the Odin source they seemed to think it was original position. However, it caused AIDS. reader.unk<uint32_t>(); Summon *summon = player->getSummons()->getSummon(summonId); if (summon == nullptr || summon->getMovementType() == Summon::Static) { // Up to no good, lag, or something else return; } MovementHandler::parseMovement(summon, reader); reader.reset(10); player->sendMap(SummonsPacket::moveSummon(player->getId(), summon, summon->getPos(), reader.getBuffer(), (reader.getBufferLength() - 9))); } auto SummonHandler::damageSummon(Player *player, PacketReader &reader) -> void { summon_id_t summonId = reader.get<summon_id_t>(); int8_t unk = reader.get<int8_t>(); damage_t damage = reader.get<damage_t>(); map_object_t mobId = reader.get<map_object_t>(); if (Summon *summon = player->getSummons()->getSummon(summonId)) { if (!GameLogicUtilities::isPuppet(summon->getSkillId())) { // Hacking return; } summon->doDamage(damage); if (summon->getHp() <= 0) { removeSummon(player, summonId, false, SummonMessages::None, true); } } } auto SummonHandler::makeBuff(Player *player, item_id_t itemId) -> BuffInfo { const auto &buffData = ChannelServer::getInstance().getBuffDataProvider().getBuffsByEffect(); switch (itemId) { case Items::BeholderHexWatk: return buffData.physicalAttack; case Items::BeholderHexWdef: return buffData.physicalDefense; case Items::BeholderHexMdef: return buffData.magicDefense; case Items::BeholderHexAcc: return buffData.accuracy; case Items::BeholderHexAvo: return buffData.avoid; } // Hacking? throw std::invalid_argument{"invalid_argument"}; } auto SummonHandler::makeActiveBuff(Player *player, const BuffInfo &data, item_id_t itemId, const SkillLevelInfo *skillInfo) -> BuffPacketValues { BuffPacketValues buff; buff.player.types[data.getBuffByte()] = static_cast<uint8_t>(data.getBuffType()); switch (itemId) { case Items::BeholderHexWdef: buff.player.values.push_back(BuffPacketValue::fromValue(2, skillInfo->wDef)); break; case Items::BeholderHexMdef: buff.player.values.push_back(BuffPacketValue::fromValue(2, skillInfo->mDef)); break; case Items::BeholderHexAcc: buff.player.values.push_back(BuffPacketValue::fromValue(2, skillInfo->acc)); break; case Items::BeholderHexAvo: buff.player.values.push_back(BuffPacketValue::fromValue(2, skillInfo->avo)); break; case Items::BeholderHexWatk: buff.player.values.push_back(BuffPacketValue::fromValue(2, skillInfo->wAtk)); break; } return buff; } auto SummonHandler::summonSkill(Player *player, PacketReader &reader) -> void { summon_id_t summonId = reader.get<summon_id_t>(); Summon *summon = player->getSummons()->getSummon(summonId); if (summon == nullptr) { return; } skill_id_t skillId = reader.get<skill_id_t>(); uint8_t display = reader.get<uint8_t>(); skill_level_t level = player->getSkills()->getSkillLevel(skillId); auto skillInfo = ChannelServer::getInstance().getSkillDataProvider().getSkill(skillId, level); if (skillInfo == nullptr) { // Hacking return; } switch (skillId) { case Skills::DarkKnight::HexOfBeholder: { int8_t buffId = reader.get<int8_t>(); if (buffId < 0 || buffId > ((level - 1) / 5)) { // Hacking return; } item_id_t itemId = Items::BeholderHexWdef + buffId; seconds_t duration = skillInfo->buffTime; if (Buffs::addBuff(player, itemId, duration) == Result::Failure) { return; } break; } case Skills::DarkKnight::AuraOfBeholder: player->getStats()->modifyHp(skillInfo->hpProp); break; default: // Hacking return; } player->sendMap(SummonsPacket::summonSkill(player->getId(), skillId, display, level), true); player->sendMap(SummonsPacket::summonSkillEffect(player->getId(), Skills::DarkKnight::Beholder, display, level)); }
gpl-2.0
DarkTerror/LaPosadaDelOcio
src/game/MapManager.cpp
14867
/* * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/> * * 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 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "MapManager.h" #include "InstanceSaveMgr.h" #include "Policies/SingletonImp.h" #include "Database/DatabaseEnv.h" #include "Log.h" #include "Transports.h" #include "GridDefines.h" #include "InstanceData.h" #include "DestinationHolderImp.h" #include "World.h" #include "CellImpl.h" #include "Corpse.h" #include "ObjectMgr.h" #define CLASS_LOCK MaNGOS::ClassLevelLockable<MapManager, ACE_Recursive_Thread_Mutex> INSTANTIATE_SINGLETON_2(MapManager, CLASS_LOCK); INSTANTIATE_CLASS_MUTEX(MapManager, ACE_Recursive_Thread_Mutex); MapManager::MapManager() : i_gridCleanUpDelay(sWorld.getConfig(CONFIG_UINT32_INTERVAL_GRIDCLEAN)) { i_timer.SetInterval(sWorld.getConfig(CONFIG_UINT32_INTERVAL_MAPUPDATE)); } MapManager::~MapManager() { for(MapMapType::iterator iter=i_maps.begin(); iter != i_maps.end(); ++iter) delete iter->second; for(TransportSet::iterator i = m_Transports.begin(); i != m_Transports.end(); ++i) delete *i; DeleteStateMachine(); } void MapManager::Initialize() { InitStateMachine(); } void MapManager::InitStateMachine() { si_GridStates[GRID_STATE_INVALID] = new InvalidState; si_GridStates[GRID_STATE_ACTIVE] = new ActiveState; si_GridStates[GRID_STATE_IDLE] = new IdleState; si_GridStates[GRID_STATE_REMOVAL] = new RemovalState; } void MapManager::DeleteStateMachine() { delete si_GridStates[GRID_STATE_INVALID]; delete si_GridStates[GRID_STATE_ACTIVE]; delete si_GridStates[GRID_STATE_IDLE]; delete si_GridStates[GRID_STATE_REMOVAL]; } void MapManager::UpdateGridState(grid_state_t state, Map& map, NGridType& ngrid, GridInfo& ginfo, const uint32 &x, const uint32 &y, const uint32 &t_diff) { // TODO: The grid state array itself is static and therefore 100% safe, however, the data // the state classes in it accesses is not, since grids are shared across maps (for example // in instances), so some sort of locking will be necessary later. si_GridStates[state]->Update(map, ngrid, ginfo, x, y, t_diff); } void MapManager::InitializeVisibilityDistanceInfo() { for(MapMapType::iterator iter=i_maps.begin(); iter != i_maps.end(); ++iter) (*iter).second->InitVisibilityDistance(); } Map* MapManager::CreateMap(uint32 id, const WorldObject* obj) { MANGOS_ASSERT(obj); //if(!obj->IsInWorld()) sLog.outError("GetMap: called for map %d with object (typeid %d, guid %d, mapid %d, instanceid %d) who is not in world!", id, obj->GetTypeId(), obj->GetGUIDLow(), obj->GetMapId(), obj->GetInstanceId()); Guard _guard(*this); Map * m = NULL; const MapEntry* entry = sMapStore.LookupEntry(id); if(!entry) return NULL; if(entry->Instanceable()) { MANGOS_ASSERT(obj->GetTypeId() == TYPEID_PLAYER); //create InstanceMap object if(obj->GetTypeId() == TYPEID_PLAYER) m = CreateInstance(id, (Player*)obj); } else { //create regular Continent map m = FindMap(id); if( m == NULL ) { m = new Map(id, i_gridCleanUpDelay, 0, REGULAR_DIFFICULTY); //add map into container i_maps[MapID(id)] = m; } } return m; } Map* MapManager::CreateBgMap(uint32 mapid, BattleGround* bg) { TerrainInfo * pData = sTerrainMgr.LoadTerrain(mapid); Guard _guard(*this); return CreateBattleGroundMap(mapid, sObjectMgr.GenerateLowGuid(HIGHGUID_INSTANCE), bg); } Map* MapManager::FindMap(uint32 mapid, uint32 instanceId) const { Guard guard(*this); MapMapType::const_iterator iter = i_maps.find(MapID(mapid, instanceId)); if(iter == i_maps.end()) return NULL; //this is a small workaround for transports if(instanceId == 0 && iter->second->Instanceable()) { assert(false); return NULL; } return iter->second; } /* checks that do not require a map to be created will send transfer error messages on fail */ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player) { const MapEntry *entry = sMapStore.LookupEntry(mapid); if(!entry) return false; const char *mapName = entry->name[player->GetSession()->GetSessionDbcLocale()]; if(entry->map_type == MAP_INSTANCE || entry->map_type == MAP_RAID) { if (entry->map_type == MAP_RAID) { // GMs can avoid raid limitations if(!player->isGameMaster() && !sWorld.getConfig(CONFIG_BOOL_INSTANCE_IGNORE_RAID)) { // can only enter in a raid group Group* group = player->GetGroup(); if (!group || !group->isRaidGroup()) { // probably there must be special opcode, because client has this string constant in GlobalStrings.lua // TODO: this is not a good place to send the message player->GetSession()->SendAreaTriggerMessage("You must be in a raid group to enter %s instance", mapName); DEBUG_LOG("MAP: Player '%s' must be in a raid group to enter instance of '%s'", player->GetName(), mapName); return false; } } } //The player has a heroic mode and tries to enter into instance which has no a heroic mode MapDifficulty const* mapDiff = GetMapDifficultyData(entry->MapID,player->GetDifficulty(entry->map_type == MAP_RAID)); if (!mapDiff) { bool isRegularTargetMap = player->GetDifficulty(entry->IsRaid()) == REGULAR_DIFFICULTY; //Send aborted message // FIX ME: what about absent normal/heroic mode with specific players limit... player->SendTransferAborted(mapid, TRANSFER_ABORT_DIFFICULTY, isRegularTargetMap ? DUNGEON_DIFFICULTY_NORMAL : DUNGEON_DIFFICULTY_HEROIC); return false; } if (!player->isAlive()) { if(Corpse *corpse = player->GetCorpse()) { // let enter in ghost mode in instance that connected to inner instance with corpse uint32 instance_map = corpse->GetMapId(); do { if(instance_map==mapid) break; InstanceTemplate const* instance = ObjectMgr::GetInstanceTemplate(instance_map); instance_map = instance ? instance->parent : 0; } while (instance_map); if (!instance_map) { WorldPacket data(SMSG_CORPSE_IS_NOT_IN_INSTANCE); player->GetSession()->SendPacket(&data); DEBUG_LOG("MAP: Player '%s' doesn't has a corpse in instance '%s' and can't enter", player->GetName(), mapName); return false; } DEBUG_LOG("MAP: Player '%s' has corpse in instance '%s' and can enter", player->GetName(), mapName); } else { DEBUG_LOG("Map::CanEnter - player '%s' is dead but doesn't have a corpse!", player->GetName()); } } // TODO: move this to a map dependent location /*if(i_data && i_data->IsEncounterInProgress()) { DEBUG_LOG("MAP: Player '%s' can't enter instance '%s' while an encounter is in progress.", player->GetName(), GetMapName()); player->SendTransferAborted(GetId(), TRANSFER_ABORT_ZONE_IN_COMBAT); return(false); }*/ if (!player->isGameMaster()) { InstanceData* i_data = ((InstanceMap*)CreateMap(mapid, player))->GetInstanceData(); if (i_data && i_data->IsEncounterInProgress() && !player->isGameMaster()) { player->SendTransferAborted(mapid, TRANSFER_ABORT_ZONE_IN_COMBAT); return false; } } return true; } else return true; } void MapManager::DeleteInstance(uint32 mapid, uint32 instanceId) { Guard _guard(*this); MapMapType::iterator iter = i_maps.find(MapID(mapid, instanceId)); if(iter != i_maps.end()) { Map * pMap = iter->second; if (pMap->Instanceable()) { i_maps.erase(iter); pMap->UnloadAll(true); delete pMap; } } } void MapManager::Update(uint32 diff) { i_timer.Update(diff); if( !i_timer.Passed() ) return; for(MapMapType::iterator iter=i_maps.begin(); iter != i_maps.end(); ++iter) iter->second->Update((uint32)i_timer.GetCurrent()); for (TransportSet::iterator iter = m_Transports.begin(); iter != m_Transports.end(); ++iter) (*iter)->Update((uint32)i_timer.GetCurrent()); //remove all maps which can be unloaded MapMapType::iterator iter = i_maps.begin(); while(iter != i_maps.end()) { Map * pMap = iter->second; //check if map can be unloaded if(pMap->CanUnload((uint32)i_timer.GetCurrent())) { pMap->UnloadAll(true); delete pMap; i_maps.erase(iter++); } else ++iter; } i_timer.SetCurrent(0); } void MapManager::RemoveAllObjectsInRemoveList() { for(MapMapType::iterator iter=i_maps.begin(); iter != i_maps.end(); ++iter) iter->second->RemoveAllObjectsInRemoveList(); } bool MapManager::ExistMapAndVMap(uint32 mapid, float x,float y) { GridPair p = MaNGOS::ComputeGridPair(x,y); int gx=63-p.x_coord; int gy=63-p.y_coord; return GridMap::ExistMap(mapid,gx,gy) && GridMap::ExistVMap(mapid,gx,gy); } bool MapManager::IsValidMAP(uint32 mapid) { MapEntry const* mEntry = sMapStore.LookupEntry(mapid); return mEntry && (!mEntry->IsDungeon() || ObjectMgr::GetInstanceTemplate(mapid)); // TODO: add check for battleground template } void MapManager::UnloadAll() { for(MapMapType::iterator iter=i_maps.begin(); iter != i_maps.end(); ++iter) iter->second->UnloadAll(true); while(!i_maps.empty()) { delete i_maps.begin()->second; i_maps.erase(i_maps.begin()); } TerrainManager::Instance().UnloadAll(); } uint32 MapManager::GetNumInstances() { uint32 ret = 0; for(MapMapType::iterator itr = i_maps.begin(); itr != i_maps.end(); ++itr) { Map *map = itr->second; if(!map->IsDungeon()) continue; ret += 1; } return ret; } uint32 MapManager::GetNumPlayersInInstances() { uint32 ret = 0; for(MapMapType::iterator itr = i_maps.begin(); itr != i_maps.end(); ++itr) { Map *map = itr->second; if(!map->IsDungeon()) continue; ret += map->GetPlayers().getSize(); } return ret; } ///// returns a new or existing Instance ///// in case of battlegrounds it will only return an existing map, those maps are created by bg-system Map* MapManager::CreateInstance(uint32 id, Player * player) { Map* map = NULL; Map * pNewMap = NULL; uint32 NewInstanceId = 0; // instanceId of the resulting map const MapEntry* entry = sMapStore.LookupEntry(id); if(entry->IsBattleGroundOrArena()) { // find existing bg map for player NewInstanceId = player->GetBattleGroundId(); MANGOS_ASSERT(NewInstanceId); map = FindMap(id, NewInstanceId); MANGOS_ASSERT(map); } else if (InstanceSave* pSave = player->GetBoundInstanceSaveForSelfOrGroup(id)) { // solo/perm/group NewInstanceId = pSave->GetInstanceId(); map = FindMap(id, NewInstanceId); // it is possible that the save exists but the map doesn't if (!map) pNewMap = CreateInstanceMap(id, NewInstanceId, pSave->GetDifficulty(), pSave); } else { // if no instanceId via group members or instance saves is found // the instance will be created for the first time NewInstanceId = sObjectMgr.GenerateLowGuid(HIGHGUID_INSTANCE); Difficulty diff = player->GetGroup() ? player->GetGroup()->GetDifficulty(entry->IsRaid()) : player->GetDifficulty(entry->IsRaid()); pNewMap = CreateInstanceMap(id, NewInstanceId, diff); } //add a new map object into the registry if(pNewMap) { i_maps[MapID(id, NewInstanceId)] = pNewMap; map = pNewMap; } return map; } InstanceMap* MapManager::CreateInstanceMap(uint32 id, uint32 InstanceId, Difficulty difficulty, InstanceSave *save) { // make sure we have a valid map id if (!sMapStore.LookupEntry(id)) { sLog.outError("CreateInstanceMap: no entry for map %d", id); MANGOS_ASSERT(false); } if (!ObjectMgr::GetInstanceTemplate(id)) { sLog.outError("CreateInstanceMap: no instance template for map %d", id); MANGOS_ASSERT(false); } // some instances only have one difficulty if (!GetMapDifficultyData(id, difficulty)) difficulty = DUNGEON_DIFFICULTY_NORMAL; DEBUG_LOG("MapInstanced::CreateInstanceMap: %s map instance %d for %d created with difficulty %d", save?"":"new ", InstanceId, id, difficulty); InstanceMap *map = new InstanceMap(id, i_gridCleanUpDelay, InstanceId, difficulty); MANGOS_ASSERT(map->IsDungeon()); bool load_data = save != NULL; map->CreateInstanceData(load_data); return map; } BattleGroundMap* MapManager::CreateBattleGroundMap(uint32 id, uint32 InstanceId, BattleGround* bg) { DEBUG_LOG("MapInstanced::CreateBattleGroundMap: instance:%d for map:%d and bgType:%d created.", InstanceId, id, bg->GetTypeID()); PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(),bg->GetMinLevel()); uint8 spawnMode = bracketEntry ? bracketEntry->difficulty : REGULAR_DIFFICULTY; BattleGroundMap *map = new BattleGroundMap(id, i_gridCleanUpDelay, InstanceId, spawnMode); MANGOS_ASSERT(map->IsBattleGroundOrArena()); map->SetBG(bg); bg->SetBgMap(map); //add map into map container i_maps[MapID(id, InstanceId)] = map; return map; }
gpl-2.0
MinnPost/minnpost-wordpress
wp-content/plugins/category-pagination-fix/category-pagefix.php
2568
<?php /* Plugin Name: Category pagination fix Plugin URI: https://github.com/larsnystrom/category-pagination-fix Description: Fixes 404 page error in pagination of category page while using custom permalink. Now added support for custom post types by using snippets from jdantzer plugin Version: 3.2.3 Author: rahnas; version increased by Jonathan Stegall to prevent false updates and fix code standards Author URI: http://www.htmlremix.com Copyright 2009 Creative common (email: mail@htmlremix.com) 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 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You are allowed to use, change and redistibute without any legal issues. I am not responsible for any damage caused by this program. Use at your own risk Tested with WordPress 3. Works with wp-pagenavi */ /** * This plugin will fix the problem where next/previous of page number buttons are broken on list * of posts in a category when the custom permalink string is: * /%category%/%postname%/ * The problem is that with a url like this: * /categoryname/page/2 * the 'page' looks like a post name, not the keyword "page" */ if ( ! function_exists( 'remove_page_from_query_string' ) ) : add_filter( 'request', 'remove_page_from_query_string' ); function remove_page_from_query_string( $query_string ) { if ( isset( $query_string['name'] ) && 'page' === $query_string['name'] && isset( $query_string['page'] ) && 1 !== $query_string['page'] ) { unset( $query_string['name'] ); // 'page' in the query_string might look like '/2', so explode it out $page_part = explode( '/', $query_string['page'] ); $query_string['paged'] = end( $page_part ); } return $query_string; } endif; // following are code adapted from Custom Post Type Category Pagination Fix by jdantzer if ( ! function_exists( 'fix_category_pagination' ) ) : add_filter( 'request', 'fix_category_pagination' ); function fix_category_pagination( $qs ) { if ( isset( $qs['category_name'] ) && isset( $qs['paged'] ) ) { $qs['post_type'] = get_post_types(array( 'public' => true, '_builtin' => false, )); array_push( $qs['post_type'], 'post' ); } return $qs; } endif;
gpl-2.0
tobbi/projectgenerator
target_includes/android_bridges/ApplicationView.java
1970
package de.fhflensburg.tobiasmarkus.androidBridge; import java.util.ArrayList; import android.view.View; public class ApplicationView { /** * The Android activity */ private android.app.Activity parentContext = null; /** * Array list containing all subviews of this activity */ private ArrayList<View> containedViews; /** * Width of the parent activity */ private int width; /** * Height of the parent activity */ private int height; /** * Initialize application view * @param activity The MainActivity parent (aka "Main function") */ public ApplicationView(android.app.Activity context, int width, int height) { this.parentContext = context; this.containedViews = new ArrayList<View>(); this.width = width; this.height = height; } public int getWidth() { return width; } public int getHeight() { return height; } public android.app.Activity getParentContext() { return parentContext; } /** * Creates a new button element * @return The created button element */ public Button createButton() { return new Button(this); } /** * Creates a new text field element * @return The created text field element */ public Textfield createTextfield() { return new Textfield(this); } /** * Adds a text field to this application view * @param textfield The text field to add to this application view */ public void addTextfield(Textfield textfield) { containedViews.add(textfield.getWrappedElement()); parentContext.addContentView(textfield.getWrappedElement(), textfield.getWrappedElement().getLayoutParams()); } /** * Adds a button to this application view * @param button The button to add to this application view */ public void addButton(Button button) { containedViews.add(button.getWrappedElement()); parentContext.addContentView(button.getWrappedElement(), button.getWrappedElement().getLayoutParams()); } }
gpl-2.0
tu-vu-duy/betterthis
wp-content/plugins/genesis-featured-widget-amplified/widget.php
42551
<?php /** * To Do: * Add support for Grid Loop (0.9) * Make content float options with 2, 3, or 4 side by side clearing after the row (v0.9) * Create Simple Hooks interface (1.0) * Edit html to allow external style sheet instead of inline styles * Add support for child pages (selected or default to current page) * Add option for showing image via custom field * Add support for sticky posts * Add support for post_status * Add support for Post Formats * Create external stylesheet for widget * Create new widget for creating category thumbnails. * */ /* Prevent direct access to the plugin */ if ( !defined( 'ABSPATH' ) ) { wp_die( __( "Sorry, you are not allowed to access this page directly.", 'gfwa' ) ); } // Remove the current widget add_action( 'widgets_init', 'gfwa_unregister_widgets', 20 ); /** * Removes Genesis Featured Post Widget */ function gfwa_unregister_widgets() { unregister_widget( 'Genesis_Featured_Post' ); } add_action( 'widgets_init', create_function( '', "register_widget('Genesis_Featured_Widget_Amplified');" ) ); class Genesis_Featured_Widget_Amplified extends WP_Widget { /** * Holds widget settings defaults, populated in constructor. * * @var array */ protected $defaults; /** * Constructor. Set the default widget options and create widget. * * @since 0.1.8 */ function __construct() { $this->defaults = array( 'count' => 0, 'title' => '', 'post_type' => 'post', 'page_id' => '', 'posts_term' => '', 'exclude_terms' => '', 'exclude_cat' => '', 'include_exclude' => '', 'post_id' => '', 'posts_num' => 1, 'posts_offset' => 0, 'orderby' => '', 'order' => '', 'meta_key' => '', 'show_sticky' => '', 'paged' => '', 'show_paged' => '', 'post_align' => '', 'show_image' => 0, 'link_image' => 1, 'image_position' => 'before-title', 'image_alignment' => '', 'image_size' => '', 'link_image_field' => '', 'show_gravatar' => 0, 'gravatar_alignment' => '', 'gravatar_size' => '', 'link_gravatar' => 0, 'show_title' => 0, 'link_title' => 1, 'link_title_field' => '', 'title_limit' => '', 'title_cutoff' => '&hellip;', 'show_byline' => 0, 'post_info' => '[post_date] ' . __( 'By', 'gfwa' ) . ' [post_author_posts_link] [post_comments]', 'show_content' => 'excerpt', 'show_archive_line' => 0, 'archive_link' => '', 'post_meta' => '[post_categories] [post_tags]', 'content_limit' => '', 'more_text' => __( '[Read More...]', 'gfwa' ), 'extra_posts' => '', 'extra_num' => '', 'extra_title' => '', 'extra_format' => 'ul', 'more_from_category' => '', 'more_from_category_text' => __( 'More Posts from this Taxonomy', 'gfwa' ), 'custom_field' => '' ); $widget_ops = array( 'classname' => 'featuredpost', 'description' => __( 'Displays featured posts types with thumbnails', 'gfwa' ), ); $control_ops = array( 'id_base' => 'featured-post', 'width' => 505, 'height' => 350, ); $this->WP_Widget( 'featured-post', __( 'Genesis - Featured Widget Amplified', 'gfwa' ), $widget_ops, $control_ops ); } /** * Creates Widget Output * * @author Nick Croft * @since 0.1 * @version 0.5 * @param array $args * @param array $instance */ function widget( $args, $instance ) { global $gfwa_counter; $gfwa_counter = 0; extract( $args ); /** Merge with defaults */ $instance = wp_parse_args( (array) $instance, $this->defaults ); echo $before_widget; add_filter( 'post_class', 'gfwa_post_class' ); if ( !empty( $instance['posts_offset'] ) && !empty( $instance['paged'] ) ) add_filter( 'post_limits', 'gfwa_post_limit' ); else remove_filter( 'post_limits', 'gfwa_post_limit' ); // Set up the author bio if ( !empty( $instance['title'] ) ) echo $before_title . apply_filters( 'widget_title', $instance['title'] ) . $after_title; $term_args = array( ); if ( !empty( $instance['page_id'] ) ) $term_args['page_id'] = $instance['page_id']; if ( !empty( $instance['posts_term'] ) ) { $posts_term = explode( ',', $instance['posts_term'] ); if ( $posts_term['0'] == 'category' ) $posts_term['0'] = 'category_name'; if ( $posts_term['0'] == 'post_tag' ) $posts_term['0'] = 'tag'; if ( isset( $posts_term['1'] ) ) $term_args[$posts_term['0']] = $posts_term['1']; } if ( !empty( $posts_term['0'] ) ) { if ( $posts_term['0'] == 'category_name' ) $taxonomy = 'category'; elseif ( $posts_term['0'] == 'tag' ) $taxonomy = 'post_tag'; else $taxonomy = $posts_term['0']; } else $taxonomy = 'category'; if ( !empty( $instance['exclude_terms'] ) ) { $exclude_terms = explode( ',', str_replace( ' ', '', $instance['exclude_terms'] ) ); $term_args[$taxonomy . '__not_in'] = $exclude_terms; } $page = ''; if ( !empty( $instance['paged'] ) ) $page = get_query_var( 'paged' ); if ( !empty( $instance['posts_offset'] ) ) { global $myOffset; $myOffset = $instance['posts_offset']; $term_args['offset'] = $myOffset; } if ( !empty( $instance['post_id'] ) ) { $IDs = explode( ',', str_replace( ' ', '', $instance['post_id'] ) ); if ( $instance['include_exclude'] == 'include' ) $term_args['post__in'] = $IDs; else $term_args['post__not_in'] = $IDs; } gfwa_before_loop( $instance ); if ( $instance['posts_num'] != 0 ) { $query_args = array_merge( $term_args, array( 'post_type' => $instance['post_type'], 'posts_per_page' => $instance['posts_num'], 'orderby' => $instance['orderby'], 'order' => $instance['order'], 'meta_key' => $instance['meta_key'], 'paged' => $page ) ); $query_args = apply_filters( 'gfwa_query_args', $query_args, $instance ); query_posts( $query_args ); if ( have_posts ( ) ) : while ( have_posts ( ) ) : the_post(); echo '<div '; post_class(); echo '>'; gfwa_before_post_content( $instance ); gfwa_post_content( $instance ); gfwa_after_post_content( $instance ); echo '</div><!--end post_class()-->' . "\n\n"; $gfwa_counter++; endwhile; if ( !empty( $instance['show_paged'] ) ) genesis_posts_nav(); gfwa_endwhile( $instance ); endif; $gfwa_counter = ''; gfwa_after_loop( $instance ); } // The EXTRA Posts (list) if ( $instance['extra_posts'] && $instance['extra_num'] ) { if ( !empty( $instance['extra_title'] ) ) echo str_replace( '>', ' class="additional-posts-title">', $before_title ) . esc_html( $instance['extra_title'] ) . $after_title; $offset = intval( $instance['posts_num'] ) + intval( $instance['posts_offset'] ); $extra_posts_args = array_merge( $term_args, array( 'showposts' => $instance['extra_num'], 'offset' => $offset, 'post_type' => $instance['post_type'], 'orderby' => $instance['orderby'], 'order' => $instance['order'], 'meta_key' => $instance['meta_key'], 'paged' => $page ) ); $extra_posts_args = apply_filters( 'gfwa_extra_post_args', $extra_posts_args, $instance ); query_posts( $extra_posts_args ); $listitems = ''; if ( have_posts ( ) ) : while ( have_posts ( ) ) : the_post(); gfwa_list_items( $instance ); if ( 'drop_down' != $instance['extra_format'] ) $listitems .= sprintf( '<li><a href="%s" title="%s">%s</a></li>', get_permalink(), the_title_attribute( 'echo=0' ), get_the_title() ); else $listitems .= sprintf( '<option onclick="javascript:window.location=\'%s\';" value="%s">%s</option>', get_permalink(), get_permalink(), get_the_title() ); endwhile; if ( strlen( $listitems ) > 0 && ('drop_down' != $instance['extra_format']) ) printf( '<%s>%s</%s>', $instance['extra_format'], $listitems, $instance['extra_format'] ); elseif ( strlen( $listitems ) > 0 ) { printf( '<select id="%s" value="%s"><option value="none">%s %s</option>%s</select>', $this->get_field_id( 'extra_format' ), get_permalink(), __( 'Select', 'gfwa' ), $instance['post_type'], $listitems ); } gfwa_print_list_items( $instance ); endif; } if ( !empty( $instance['archive_link']) ){ echo '<p class="more-from-category"><a href="' . $instance['archive_link'] . '" title="' . esc_html( $instance['more_from_category_text'] ) . '">' . esc_html( $instance['more_from_category_text'] ) . '</a></p>'; } elseif ( !empty( $instance['more_from_category'] ) && !empty( $posts_term['1'] ) ) { gfwa_category_more( $instance ); $term = get_term_by( 'slug', $posts_term['1'], $taxonomy ); echo '<p class="more-from-category"><a href="' . get_term_link( $posts_term['1'], $taxonomy ) . '" title="' . $term->name . '">' . esc_html( $instance['more_from_category_text'] ) . '</a></p>'; } gfwa_after_category_more( $instance ); echo $after_widget; wp_reset_query(); remove_filter( 'post_class', 'gfwa_post_class' ); remove_filter( 'post_limits', 'gfwa_post_limit' ); } /** * Updates Widget Instance * * @author Nick Croft * @since 0.1 * @version 0.2 * @param <type> $new_instance * @param <type> $old_instance * @return <type> */ function update( $new_instance, $old_instance ) { return $new_instance; } /** * Creates Widget Form * * @author Nick Croft * @since 0.1 * @version 0.5 * @param array $instance Values set in widget isntance */ function form( $instance ) { /** Merge with defaults */ $instance = wp_parse_args( (array) $instance, $this->defaults ); $sizes = genesis_get_additional_image_sizes(); $imageSize_opt['thumbnail'] = 'thumbnail ('. get_option( 'thumbnail_size_w' ) . 'x' . get_option( 'thumbnail_size_h' ) . ')'; foreach( ( array )$sizes as $name => $size ) $imageSize_opt[$name] = esc_html( $name ) . ' (' . $size['width'] . 'x' . $size['height'] . ')'; $columns = array( 'col1' => array( array( 'post_type' => array( 'label' => __( 'Post Type', 'gfwa' ), 'description' => '', 'type' => 'post_type_select', 'save' => true, 'requires' => '', ), 'page_id' => array( 'label' => __( 'Page', 'gfwa' ), 'description' => '', 'type' => 'page_select', 'save' => true, 'requires' => array( 'post_type', 'page', false ), ), 'posts_term' => array( 'label' => __( 'Taxonomy and Terms', 'gfwa' ), 'description' => '', 'type' => 'select_taxonomy', 'save' => false, 'requires' => array( 'post_type', 'page', true ), ), 'exclude_terms' => array( 'label' => sprintf( __( 'Exclude Terms by ID %s (comma separated list)', 'gfwa' ), '<br />' ), 'description' => '', 'type' => 'text', 'save' => false, 'requires' => array( 'post_type', 'page', true ), ), 'include_exclude' => array( 'label' => '', 'description' => '', 'type' => 'select', 'options' => array( '' => __( 'Select' , 'gfwa' ), 'include' => __( 'Include' , 'gfwa' ), 'exclude' => __( 'Exclude' , 'gfwa' ), ), 'save' => true, 'requires' => array( 'page_id', '', false ), ), 'post_id' => array( 'label' => $instance['post_type'] . ' ' . __( 'ID', 'gfwa' ), 'description' => '', 'type' => 'text', 'save' => false, 'requires' => array( 'include_exclude', '', true ), ), 'posts_num' => array( 'label' => __( 'Number of Posts to Show', 'gfwa' ), 'description' => '', 'type' => 'text_small', 'save' => false, 'requires' => array( 'page_id', '', false ), ), 'posts_offset' => array( 'label' => __( 'Number of Posts to Offset', 'gfwa' ), 'description' => '', 'type' => 'text_small', 'save' => false, 'requires' => array( 'page_id', '', false ), ), 'orderby' => array( 'label' => __( 'Order By', 'gfwa' ), 'description' => '', 'type' => 'select', 'options' => array( 'date' => __( 'Date' , 'gfwa' ), 'title' => __( 'Title' , 'gfwa' ), 'parent' => __( 'Parent' , 'gfwa' ), 'ID' => __( 'ID' , 'gfwa' ), 'comment_count' => __( 'Comment Count' , 'gfwa' ), 'rand' => __( 'Random' , 'gfwa' ), 'meta_value' => __( 'Meta Value' , 'gfwa' ), 'meta_value_num' => __( 'Numeric Meta Value', 'gfwa' ), ), 'save' => false, 'requires' => array( 'page_id', '', false ), ), 'order' => array( 'label' => __( 'Sort Order', 'gfwa' ), 'description' => '', 'type' => 'select', 'options' => array( 'DESC' => __( 'Descending (3, 2, 1)', 'gfwa' ), 'ASC' => __( 'Ascending (1, 2, 3)' , 'gfwa' ), ), 'save' => false, 'requires' => array( 'page_id', '', false ), ), 'meta_key' => array( 'label' => __( 'Meta Key', 'gfwa' ), 'description' => '', 'type' => 'text', 'save' => false, 'requires' => array( 'page_id', '', false ), ), 'paged' => array( 'label' => __( 'Work with Pagination', 'gfwa' ), 'description' => '', 'type' => 'checkbox', 'save' => false, 'requires' => array( 'post_type', 'page', true ), ), 'show_paged' => array( 'label' => __( 'Show Page Navigation', 'gfwa' ), 'description' => '', 'type' => 'checkbox', 'save' => false, 'requires' => array( 'post_type', 'page', true ), ), ), array( 'show_gravatar' => array( 'label' => __( 'Show Author Gravatar', 'gfwa' ), 'description' => '', 'type' => 'checkbox', 'save' => true, 'requires' => '', ), 'gravatar_size' => array( 'label' => __( 'Gravatar Size', 'gfwa' ), 'description' => '', 'type' => 'select', 'options' => array( '45' => __( 'Small (45px)' , 'gfwa' ), '65' => __( 'Medium (65px)' , 'gfwa' ), '85' => __( 'Large (85px)' , 'gfwa' ), '125' => __( 'Extra Large (125px)', 'gfwa' ), ), 'save' => false, 'requires' => array( 'show_gravatar', '', true ), ), 'link_gravatar' => array( 'label' => '', 'description' => '', 'type' => 'select', 'options' => array( '' => __( 'Do not link gravatar' , 'gfwa' ), 'archive' => __( 'Link to author archive', 'gfwa' ), 'website' => __( 'Link to author website', 'gfwa' ), ), 'save' => false, 'requires' => array( 'show_gravatar', '', true ), ), 'gravatar_alignment' => array( 'label' => __( 'Gravatar Alignment', 'gfwa' ), 'description' => '', 'type' => 'select', 'options' => array( '' => __( 'None' , 'gfwa' ), 'alignleft' => __( 'Left' , 'gfwa' ), 'alignright' => __( 'Right', 'gfwa' ), ), 'save' => false, 'requires' => array( 'show_gravatar', '', true ), ), ), ), 'col2' => array( array( 'show_image' => array( 'label' => __( 'Show Featured Image', 'gfwa' ), 'description' => '', 'type' => 'checkbox', 'save' => true, 'requires' => '', ), 'link_image' => array( 'label' => '', 'description' => '', 'type' => 'select', 'options' => array( '1' => __( 'Link Image to Post', 'gfwa' ), '2' => __( 'Don\'t Link Image' , 'gfwa' ), ), 'save' => true, 'requires' => array( 'show_image', '', true ), ), 'link_image_field' => array( 'label' => __( 'Custom Field for Link ( Defaults to Permalink )'), 'description' => '', 'type' => 'text', 'save' => false, 'requires' => array( 'link_image', '1', false ), ), 'image_size' => array( 'label' => '', 'description' => '', 'type' => 'select', 'options' => $imageSize_opt, 'save' => false, 'requires' => array( 'show_image', '', true ), ), 'image_position' => array( 'label' => __( 'Image Placement', 'gfwa' ), 'description' => '', 'type' => 'select', 'options' => array( 'before-title' => __( 'Before Title' , 'gfwa' ), 'after-title' => __( 'After Title' , 'gfwa' ), 'after-content' => __( 'After Content', 'gfwa' ), ), 'save' => false, 'requires' => array( 'show_image', '', true ), ), 'image_alignment' => array( 'label' => '', 'description' => '', 'type' => 'select', 'options' => array( '' => __( 'None' , 'gfwa' ), 'alignleft' => __( 'Left' , 'gfwa' ), 'alignright' => __( 'Right' , 'gfwa' ), 'aligncenter' => __( 'Center', 'gfwa' ), ), 'save' => false, 'requires' => array( 'show_image', '', true ), ), ), array( 'show_title' => array( 'label' => __( 'Show Post Title', 'gfwa' ), 'description' => '', 'type' => 'checkbox', 'save' => true, 'requires' => '', ), 'title_limit' => array( 'label' => __( 'Limit title to', 'gfwa' ), 'description' => __( 'characters', 'gfwa' ), 'type' => 'text_small', 'save' => false, 'requires' => array( 'show_title', '', true ), ), 'title_cutoff' => array( 'label' => __( 'Title Cutoff Symbol', 'gfwa' ), 'description' => '', 'type' => 'text_small', 'save' => false, 'requires' => array( 'show_title', '', true ), ), 'link_title' => array( 'label' => '', 'description' => '', 'type' => 'select', 'options' => array( '1' => __( 'Link Title to Post', 'gfwa' ), '2' => __( 'Don\'t Link Title' , 'gfwa' ), ), 'save' => true, 'requires' => array( 'show_title', '', true ), ), 'link_title_field' => array( 'label' => __( 'Custom Field for Link ( Defaults to Permalink )'), 'description' => '', 'type' => 'text', 'save' => false, 'requires' => array( 'link_title', '1', false ), ), 'show_byline' => array( 'label' => __( 'Show Post Info', 'gfwa' ), 'description' => '', 'type' => 'checkbox', 'save' => true, 'requires' => '', ), 'post_info' => array( 'label' => '', 'description' => '', 'type' => 'text', 'save' => false, 'requires' => array( 'show_byline', '', true ), ), 'show_content' => array( 'label' => __( 'Content Type', 'gfwa' ), 'description' => '', 'type' => 'select', 'options' => array( 'content' => __( 'Show Content' , 'gfwa' ), 'excerpt' => __( 'Show Excerpt' , 'gfwa' ), 'content-limit' => __( 'Show Content Limit', 'gfwa' ), '' => __( 'No Content' , 'gfwa' ), ), 'save' => true, 'requires' => '', ), 'content_limit' => array( 'label' => __( 'Limit content to', 'gfwa' ), 'description' => __( 'characters', 'gfwa' ), 'type' => 'text_small', 'save' => false, 'requires' => array( 'show_content', 'content-limit', false ), ), 'show_archive_line' => array( 'label' => __( 'Show Post Meta', 'gfwa' ), 'description' => '', 'type' => 'checkbox', 'save' => true, 'requires' => array( 'post_type', 'page', true ), ), 'post_meta' => array( 'label' => '', 'description' => '', 'type' => 'text', 'save' => false, 'requires' => array( 'show_archive_line', '', true ), ), 'more_text' => array( 'label' => __( 'More Text (if applicable)', 'gfwa' ), 'description' => '', 'type' => 'text', 'save' => false, 'requires' => '', ), ), array( 'extra_posts' => array( 'label' => __( 'Display List of Additional Posts', 'gfwa' ), 'description' => '', 'type' => 'checkbox', 'save' => true, 'requires' => array( 'post_type', 'page', true ), ), 'extra_title' => array( 'label' => __( 'Title', 'gfwa' ), 'description' => '', 'type' => 'text', 'save' => false, 'requires' => array( 'extra_posts', '', true ), ), 'extra_num' => array( 'label' => __( 'Number of Posts to Show', 'gfwa' ), 'description' => '', 'type' => 'text_small', 'save' => false, 'requires' => array( 'extra_posts', '', true ), ), 'extra_format' => array( 'label' => __( 'Extra Post Format', 'gfwa' ), 'description' => '', 'type' => 'select', 'options' => array( 'ul' => __( 'Unordered List', 'gfwa' ), 'ol' => __( 'Ordered List' , 'gfwa' ), 'drop_down' => __( 'Drop Down' , 'gfwa' ), ), 'save' => false, 'requires' => array( 'extra_posts', '', true ), ), ), array( 'more_from_category' => array( 'label' => __( 'Show Category Archive Link', 'gfwa' ), 'description' => '', 'type' => 'checkbox', 'save' => true, 'requires' => array( 'post_type', 'page', true ), ), 'more_from_category_text' => array( 'label' => __( 'Link Text', 'gfwa' ), 'description' => '', 'type' => 'text', 'save' => false, 'requires' => array( 'more_from_category', '', true ), ), 'archive_link' => array( 'label' => __( 'Fill in this value with a URL if you wish to display an archive link when showing all terms or to override the normal archive link to another URL', 'gfwa' ), 'description' => '', 'type' => 'text', 'save' => false, 'requires' => array( 'more_from_category', '', true ), ), ), array( 'custom_field' => array( 'label' => __( 'Instance Identification Field', 'gfwa' ), 'description' => __( 'Fill in this field if you need to test against an $instance value not included in the form', 'gfwa' ), 'type' => 'text', 'save' => false, 'requires' => '', ), ) ), ); echo '<p><label for="'. $this->get_field_id( 'title' ) .'">'. __( 'Title', 'gfwa' ) .':</label> <input type="text" id="'. $this->get_field_id( 'title' ) .'" name="'. $this->get_field_name( 'title' ) .'" value="'. esc_attr( $instance['title'] ) .'" style="width:99%;" /></p>'; foreach( $columns as $column => $boxes ) { if( 'col1' == $column ) echo '<div style="float: left; width: 250px;">'; else echo '<div style="float: right; width: 250px;">'; foreach( $boxes as $box ){ echo '<div style="background: #f1f1f1; border: 1px solid #DDD; padding: 10px 10px 0px 10px; margin-bottom: 5px;">'; foreach( $box as $fieldID => $args ){ $class = $args['save'] ? 'class="widget-control-save" ' : ''; $style = $args['requires'] ? ' style="'. gfwa_get_display_option( $instance, $args['requires'][0], $args['requires'][1], $args['requires'][2] ) .'"' : ''; switch( $args['type'] ) { case 'post_type_select' : echo '<p><label for="'. $this->get_field_id( $fieldID ) .'">'. $args['label'] .':</label> <select '. $class .'id="'. $this->get_field_id( $fieldID ) .'" name="'. $this->get_field_name( $fieldID ) .'">'; $args = array( 'public' => true ); $output = 'names'; $operator = 'and'; $post_types = get_post_types( $args, $output, $operator ); $post_types = array_filter( $post_types, 'gfwa_exclude_post_types' ); foreach ( $post_types as $post_type ) echo '<option style="padding-right:10px;" value="'. esc_attr( $post_type ) .'" '. selected( esc_attr( $post_type ), $instance['post_type'], false ) .'>'. esc_attr( $post_type ) .'</option>'; echo '<option style="padding-right:10px;" value="any" '. selected( 'any', $instance['post_type'], false ) .'>'. __( 'any', 'gfwa' ) .'</option>'; echo '</select></p>'; break; case 'page_select' : echo '<p'. $style .'><label for="'. $this->get_field_id( $fieldID ) .'">'. $args['label'] .':</label> <select '. $class .' id="'. $this->get_field_id( $fieldID ) .'" name="'. $this->get_field_name( $fieldID ) .'"> <option value="" '. selected( '', $instance['page_id'], false ) .'>'. attribute_escape( __( 'Select page', 'gfwa' ) ) .'</option>'; $pages = get_pages(); foreach ( $pages as $page ) echo '<option style="padding-right:10px;" value="'. esc_attr( $page->ID ) .'" '. selected( esc_attr( $page->ID ), $instance['page_id'], false ) .'>'. esc_attr( $page->post_title ) .'</option>'; echo '</select> </p>'; break; case 'select_taxonomy' : echo '<p'. $style .'"><label for="'. $this->get_field_id( $fieldID ) .'">'. $args['label'] .':</label> <select id="'. $this->get_field_id( $fieldID ) .'" name="'. $this->get_field_name( $fieldID ) .'"> <option style="padding-right:10px;" value="" '. selected( '', $instance['posts_term'], false ) .'>'. __( 'All Taxonomies and Terms', 'gfwa' ) .'</option>'; $taxonomies = get_taxonomies( array( 'public' => true ), 'objects' ); $taxonomies = array_filter( $taxonomies, 'gfwa_exclude_taxonomies' ); $test = get_taxonomies( array( 'public' => true ), 'objects' ); foreach ( $taxonomies as $taxonomy ) { $query_label = ''; if ( !empty( $taxonomy->query_var ) ) $query_label = $taxonomy->query_var; else $query_label = $taxonomy->name; echo '<optgroup label="'. esc_attr( $taxonomy->labels->name ) .'"> <option style="margin-left: 5px; padding-right:10px;" value="'. esc_attr( $query_label ) .'" '. selected( esc_attr( $query_label ), $instance['posts_term'], false ) .'>'. $taxonomy->labels->all_items .'</option>'; $terms = get_terms( $taxonomy->name, 'orderby=name&hide_empty=1' ); foreach ( $terms as $term ) echo '<option style="margin-left: 8px; padding-right:10px;" value="'. esc_attr( $query_label ) . ',' . $term->slug .'" '. selected( esc_attr( $query_label ) . ',' . $term->slug, $instance['posts_term'], false ) .'>-' . esc_attr( $term->name ) .'</option>'; echo '</optgroup>'; } echo '</select></p>'; break; case 'text' : echo $args['description'] ? '<p>'. $args['description'] .'</p>' : ''; echo '<p'. $style .'><label for="'. $this->get_field_id( $fieldID ) .'">'. $args['label'] .':</label> <input type="text" id="'. $this->get_field_id( $fieldID ) .'" name="'. $this->get_field_name( $fieldID ) .'" value="'. esc_attr( $instance[$fieldID] ) .'" style="width:95%;" /></p>'; break; case 'text_small' : echo '<p'. $style .'><label for="'. $this->get_field_id( $fieldID ) .'">'. $args['label'] .':</label> <input type="text" id="'. $this->get_field_id( $fieldID ) .'" name="'. $this->get_field_name( $fieldID ) .'" value="'. esc_attr( $instance[$fieldID] ) .'" size="2" />'. $args['description'] .'</p>'; break; case 'select' : echo '<p'. $style .'"><label for="'. $this->get_field_id( $fieldID ) .'">'. $args['label'] .' </label> <select '. $class .'id="'. $this->get_field_id( $fieldID ) .'" name="'. $this->get_field_name( $fieldID ) .'">'; foreach( $args['options'] as $value => $label ) echo '<option style="padding-right:10px;" value="'. $value .'" '. selected( $value, $instance[$fieldID], false ) .'>'. $label .'</option>'; echo '</select></p>'; break; case 'checkbox' : echo '<p'. $style .'><input '. $class .'id="'. $this->get_field_id( $fieldID ).'" type="checkbox" name="'. $this->get_field_name( $fieldID ) .'" value="1" '. checked( 1, $instance[$fieldID], false ) .'/> <label for="'. $this->get_field_id( $fieldID ) .'">'. $args['label'] .'</label></p>'; break; } } echo '</div>'; } echo '</div>'; } } } /** * Adds number class, and odd/even class to widget output * * @author Nick Croft * @since 0.7 * @version 0.7 * @global integer $gfwa_counter * @param array $classes * @return array */ function gfwa_post_class( $classes ) { global $gfwa_counter; //if ( in_array( current_filter(), array( 'gfwa_before_post_content', 'gfwa_post_content', 'gfwa_after_post_content' ) ) ) { $classes[] = sprintf( 'gfwa-%s', $gfwa_counter + 1 ); $classes[] = $gfwa_counter + 1 & 1 ? 'gfwa-odd' : 'gfwa-even'; //} return $classes; } add_action( 'gfwa_before_post_content', 'gfwa_do_post_image', 5, 1 ); add_action( 'gfwa_post_content', 'gfwa_do_post_image', 5, 1 ); add_action( 'gfwa_after_post_content', 'gfwa_do_post_image', 10, 1 ); /** * Inserts Post Image * * @author Nick Croft * @since 0.1 * @version 0.5 * @param array $instance Values set in widget isntance */ function gfwa_do_post_image( $instance ) { $align = $instance['image_alignment'] ? esc_attr( $instance['image_alignment'] ) : 'alignnone'; $link = $instance['link_image_field'] && genesis_get_custom_field( $instance['link_image_field'] ) ? genesis_get_custom_field( $instance['link_image_field'] ) : get_permalink(); $image = !empty( $instance['show_image'] ) ? genesis_get_image( array( 'format' => 'html', 'size' => $instance['image_size'], 'attr' => array( 'class' => $align ) ) ) : ''; $image = $instance['link_image'] == 1 ? sprintf( '<a href="%s" title="%s" class="%s">%s</a>', $link, the_title_attribute( 'echo=0' ), $align, $image ) : $image; echo current_filter() == 'gfwa_before_post_content' && $instance['image_position'] == 'before-title' && !empty( $instance['show_image'] ) ? $image : ''; echo current_filter() == 'gfwa_post_content' && $instance['image_position'] == 'after-title' && !empty( $instance['show_image'] ) ? $image : ''; echo current_filter() == 'gfwa_after_post_content' && $instance['image_position'] == 'after-content' && !empty( $instance['show_image'] ) ? $image : ''; } add_action( 'gfwa_before_post_content', 'gfwa_do_gravatar', 10, 1 ); /** * Inserts Author Gravatar if option is selected * * @author Nick Croft * @since 0.1 * @version 0.8 * @param array $instance Values set in widget isntance */ function gfwa_do_gravatar( $instance ) { if ( !empty( $instance['show_gravatar'] ) ) { switch( $instance['link_gravatar'] ) { case 'archive' : $before = 'a href="'. get_author_posts_url( get_the_author_meta( 'ID' ) ) .'"'; $after = 'a'; break; case 'website' : $before = 'a href="'. get_the_author_meta( 'user_url' ) .'"'; $after = 'a'; break; default : $before = 'span'; $after = 'span'; break; } printf( '<%s class="%s">%s</%s>', $before, esc_attr( $instance['gravatar_alignment'] ), get_avatar( get_the_author_meta( 'ID' ), $instance['gravatar_size'] ), $after ); } } add_action( 'gfwa_before_post_content', 'gfwa_do_post_title', 10, 1 ); /** * Outputs Post Title if option is selects * * @author Nick Croft * @since 0.1 * @version 0.2 * @param array $instance Values set in widget isntance */ function gfwa_do_post_title( $instance ) { $link = $instance['link_title_field'] && genesis_get_custom_field( $instance['link_title_field']) ? genesis_get_custom_field( $instance['link_title_field']) : get_permalink(); $wrap_open = $instance['link_title'] == 1 ? sprintf( '<a href="%s" title="%s">', $link, the_title_attribute( 'echo=0' ) ) : ''; $wrap_close = $instance['link_title'] == 1 ? '</a>' : ''; if ( !empty( $instance['show_title'] ) && !empty( $instance['title_limit'] ) ) printf( '<h2>%s%s%s%s</h2>', $wrap_open, genesis_truncate_phrase( the_title_attribute( 'echo=0' ) , $instance['title_limit'] ), $instance['title_cutoff'], $wrap_close ); elseif ( !empty( $instance['show_title'] ) ) printf( '<h2>%s%s%s</h2>', $wrap_open, the_title_attribute( 'echo=0' ), $wrap_close ); } add_action( 'gfwa_before_post_content', 'gfwa_do_byline', 10, 1 ); /** * Outputs byline if option is selects and anything is in the post info field * * @author Nick Croft * @since 0.1 * @version 0.2 * @param array $instance Values set in widget isntance */ function gfwa_do_byline( $instance ) { if ( !empty( $instance['show_byline'] ) && !empty( $instance['post_info'] ) ) printf( '<p class="byline post-info">%s</p>', do_shortcode( esc_html( $instance['post_info'] ) ) ); } add_action( 'gfwa_post_content', 'gfwa_do_post_content', 10, 1 ); /** * Outputs the selected content option if any * * @author Nick Croft * @since 0.1 * @version 0.2 * @param array $instance Values set in widget isntance */ function gfwa_do_post_content( $instance ) { if ( !empty( $instance['show_content'] ) ) { if ( $instance['show_content'] == 'excerpt' ) the_excerpt(); elseif ( $instance['show_content'] == 'content-limit' ) the_content_limit( ( int ) $instance['content_limit'], esc_html( $instance['more_text'] ) ); else the_content( esc_html( $instance['more_text'] ) ); } } add_action( 'gfwa_after_post_content', 'gfwa_do_post_meta', 10, 1 ); /** * Outputs post meta if option is selected and anything is in the post meta field * * @author Nick Croft * @since 0.6 * @version 0.6 * @param array $instance Values set in widget isntance */ function gfwa_do_post_meta( $instance ) { if ( !empty( $instance['show_archive_line'] ) && !empty( $instance['post_meta'] ) ) printf( '<p class="post-meta">%s</p>', do_shortcode( esc_html( $instance['post_meta'] ) ) ); } add_action( 'admin_print_footer_scripts', 'gfwa_form_submit' ); function gfwa_form_submit() { ?> <script type="text/javascript"> (function(a) { a('select.widget-control-save').live('change', function(){ wpWidgets.save( a(this).closest('div.widget'), 0, 1, 0 ); return false; }); })(jQuery); </script> <?php } /** * Returns "display: none;" if option and value match, or of they don't match with $standard is set to false * * @author Nick Croft * @since 0.8 * @version 0.8 * @param array $instance Values set in widget isntance * @param mixed $option instance option to test * @param mixed $value value to test against * @param boolean $standard echo standard return false for oposite */ function gfwa_get_display_option( $instance, $option='', $value='', $standard=true ) { $display = ''; if ( is_array( $option ) ) { foreach ( $option as $key ) { if ( in_array( $instance[$key], $value ) ) $display = 'display: none;'; } } elseif ( is_array( $value ) ) { if ( in_array( $instance[$option], $value ) ) $display = 'display: none;'; } else { if ( $instance[$option] == $value ) $display = 'display: none;'; } if ( $standard == false ) { if ( $display == 'display: none;' ) $display = ''; else $display = 'display: none;'; } return $display; } /** * Outputs "display: none;" if option and value match, or of they don't match with $standard is set to false * * @author Nick Croft * @since 0.6 * @version 0.6 * @param array $instance Values set in widget isntance * @param mixed $option instance option to test * @param mixed $value value to test against * @param boolean $standard echo standard return false for oposite */ function gfwa_display_option( $instance, $option='', $value='', $standard=true ) { $display = ''; if ( is_array( $option ) ) { foreach ( $option as $key ) { if ( in_array( $instance[$key], $value ) ) $display = 'display: none;'; } } elseif ( is_array( $value ) ) { if ( in_array( $instance[$option], $value ) ) $display = 'display: none;'; } else { if ( $instance[$option] == $value ) $display = 'display: none;'; } if ( $standard == false ) { if ( $display == 'display: none;' ) $display = ''; else $display = 'display: none;'; } echo $display; }
gpl-2.0
martymcguire/epluribus
app/assets/javascripts/application.js
729
// This is a manifest file that'll be compiled into application.js, which will include all the files // listed below. // // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. // // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the // compiled file. // // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details // about supported directives. // //= require jquery //= require jquery_ujs //= require react //= require react_ujs //= require eventemitter //= require components //= require_tree .
gpl-2.0
alexanderschnitzler/templavoila
Classes/Form/FormDataProvider/TcaFlexProcess.php
39047
<?php /* * This file is part of the TemplaVoilà project. * * It is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License, either version 2 * of the License, or any later version. * * For the full copyright and license information, please read the * LICENSE.md file that was distributed with this source code. */ namespace Schnitzler\Templavoila\Form\FormDataProvider; use TYPO3\CMS\Backend\Form\FormDataCompiler; use TYPO3\CMS\Backend\Form\FormDataGroup\FlexFormSegment; use TYPO3\CMS\Backend\Form\FormDataProviderInterface; use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; use TYPO3\CMS\Core\Utility\GeneralUtility; /** * Class Schnitzler\Templavoila\Form\FormDataProvider\TcaFlexProcess */ class TcaFlexProcess implements FormDataProviderInterface { /** * Determine possible pageTsConfig overrides and apply them to ds. * Determine available languages and sanitize dv for further processing. Then kick * and validate further details like excluded fields. Finally for each possible * value and ds call FormDataCompiler with set FlexFormSegment group to resolve * single field stuff like item processor functions. * * @param array $result * @return array */ public function addData(array $result) { foreach ($result['processedTca']['columns'] as $fieldName => $fieldConfig) { if (empty($fieldConfig['config']['type']) || $fieldConfig['config']['type'] !== 'flex') { continue; } $flexIdentifier = $this->getFlexIdentifier($result, $fieldName); $pageTsConfigOfFlex = $this->getPageTsOfFlex($result, $fieldName, $flexIdentifier); $result = $this->modifyOuterDataStructure($result, $fieldName, $pageTsConfigOfFlex); $result = $this->removeExcludeFieldsFromDataStructure($result, $fieldName, $flexIdentifier); $result = $this->removeDisabledFieldsFromDataStructure($result, $fieldName, $pageTsConfigOfFlex); $result = $this->prepareLanguageHandlingInDataValues($result, $fieldName); $result = $this->modifyDataStructureAndDataValuesByFlexFormSegmentGroup($result, $fieldName, $pageTsConfigOfFlex); } return $result; } /** * Take care of ds_pointerField and friends to determine the correct sub array within * TCA config ds. * * Gets extension identifier. Use second pointer field if it's value is not empty, "list" or "*", * else it must be a plugin and first one will be used. * This code basically determines the sub key of ds field: * config = array( * ds => array( * 'aFlexConfig' => '<flexXml ... * ^^^^^^^^^^^ * $flexformIdentifier contains "aFlexConfig" after this operation. * * @todo: This method is only implemented half. It basically should do all the * @todo: pointer handling that is done within BackendUtility::getFlexFormDS() to $srcPointer. * * @param array $result Result array * @param string $fieldName Current handle field name * @return string Pointer */ protected function getFlexIdentifier(array $result, $fieldName) { // @todo: Current implementation with the "list_type, CType" fallback is rather limited and customized for // @todo: tt_content, also it forces a ds_pointerField to be defined and a casual "default" sub array does not work $pointerFields = !empty($result['processedTca']['columns'][$fieldName]['config']['ds_pointerField']) ? $result['processedTca']['columns'][$fieldName]['config']['ds_pointerField'] : 'list_type,CType'; $pointerFields = GeneralUtility::trimExplode(',', $pointerFields); $flexformIdentifier = !empty($result['databaseRow'][$pointerFields[0]]) ? $result['databaseRow'][$pointerFields[0]] : ''; if (!empty($result['databaseRow'][$pointerFields[1]]) && $result['databaseRow'][$pointerFields[1]] !== 'list' && $result['databaseRow'][$pointerFields[1]] !== '*' ) { $flexformIdentifier = $result['databaseRow'][$pointerFields[1]]; } if (empty($flexformIdentifier)) { $flexformIdentifier = 'default'; } return $flexformIdentifier; } /** * Determine TCEFORM.aTable.aField.matchingIdentifier * * @param array $result Result array * @param string $fieldName Handled field name * @param string $flexIdentifier Determined identifier * @return array PageTsConfig for this flex */ protected function getPageTsOfFlex(array $result, $fieldName, $flexIdentifier) { $table = $result['tableName']; $pageTs = []; if (!empty($result['pageTsConfig']['TCEFORM.'][$table . '.'][$fieldName . '.'][$flexIdentifier . '.']) && is_array($result['pageTsConfig']['TCEFORM.'][$table . '.'][$fieldName . '.'][$flexIdentifier . '.'])) { $pageTs = $result['pageTsConfig']['TCEFORM.'][$table . '.'][$fieldName . '.'][$flexIdentifier . '.']; } return $pageTs; } /** * Handle "outer" flex data structure changes like language and sheet * description. Does not change "TCA" or values of single elements * * @param array $result Result array * @param string $fieldName Current handle field name * @param array $pageTsConfig Given pageTsConfig of this flex form * @return array Modified item array */ protected function modifyOuterDataStructure(array $result, $fieldName, $pageTsConfig) { $modifiedDataStructure = $result['processedTca']['columns'][$fieldName]['config']['ds']; if (isset($pageTsConfig['langDisable'])) { $modifiedDataStructure['meta']['langDisable'] = $pageTsConfig['langDisable']; } if (isset($pageTsConfig['langChildren'])) { $modifiedDataStructure['meta']['langChildren'] = $pageTsConfig['langChildren']; } if (isset($modifiedDataStructure['sheets']) && is_array($modifiedDataStructure['sheets'])) { // Handling multiple sheets foreach ($modifiedDataStructure['sheets'] as $sheetName => $sheetStructure) { if (isset($pageTsConfig[$sheetName . '.']) && is_array($pageTsConfig[$sheetName . '.'])) { $pageTsOfSheet = $pageTsConfig[$sheetName . '.']; // Remove whole sheet if disabled if (!empty($pageTsOfSheet['disabled'])) { unset($modifiedDataStructure['sheets'][$sheetName]); continue; } // sheetTitle, sheetDescription, sheetShortDescr $modifiedDataStructure['sheets'][$sheetName] = $this->modifySingleSheetInformation($sheetStructure, $pageTsOfSheet); } } } $modifiedDataStructure['meta']['langDisable'] = isset($modifiedDataStructure['meta']['langDisable']) ? (bool)$modifiedDataStructure['meta']['langDisable'] : false; $modifiedDataStructure['meta']['langChildren'] = isset($modifiedDataStructure['meta']['langChildren']) ? (bool)$modifiedDataStructure['meta']['langChildren'] : false; $result['processedTca']['columns'][$fieldName]['config']['ds'] = $modifiedDataStructure; return $result; } /** * Removes fields from data structure the user has no access to * * @param array $result Result array * @param string $fieldName Current handle field name * @param string $flexIdentifier Determined identifier * @return array Modified result */ protected function removeExcludeFieldsFromDataStructure(array $result, $fieldName, $flexIdentifier) { $dataStructure = $result['processedTca']['columns'][$fieldName]['config']['ds']; $backendUser = $this->getBackendUser(); if ($backendUser->isAdmin() || !isset($dataStructure['sheets']) || !is_array($dataStructure['sheets'])) { return $result; } $userNonExcludeFields = GeneralUtility::trimExplode(',', $backendUser->groupData['non_exclude_fields']); $excludeFieldsPrefix = $result['tableName'] . ':' . $fieldName . ';' . $flexIdentifier . ';'; $nonExcludeFields = []; foreach ($userNonExcludeFields as $userNonExcludeField) { if (strpos($userNonExcludeField, $excludeFieldsPrefix) !== false) { $exploded = explode(';', $userNonExcludeField); $sheetName = $exploded[2]; $fieldName = $exploded[3]; $nonExcludeFields[$sheetName] = $fieldName; } } foreach ($dataStructure['sheets'] as $sheetName => $sheetDefinition) { if (!isset($sheetDefinition['ROOT']['el']) || !is_array($sheetDefinition['ROOT']['el'])) { continue; } foreach ($sheetDefinition['ROOT']['el'] as $flexFieldName => $fieldDefinition) { if (!empty($fieldDefinition['exclude']) && empty($nonExcludeFields[$sheetName])) { unset($result['processedTca']['columns'][$fieldName]['config']['ds']['sheets'][$sheetName]['ROOT']['el'][$flexFieldName]); } } } return $result; } /** * Handle "outer" flex data structure changes like language and sheet * description. Does not change "TCA" or values of single elements * * @param array $result Result array * @param string $fieldName Current handle field name * @param array $pageTsConfig Given pageTsConfig of this flex form * @return array Modified item array */ protected function removeDisabledFieldsFromDataStructure(array $result, $fieldName, $pageTsConfig) { $dataStructure = $result['processedTca']['columns'][$fieldName]['config']['ds']; if (!isset($dataStructure['sheets']) || !is_array($dataStructure['sheets'])) { return $result; } foreach ($dataStructure['sheets'] as $sheetName => $sheetDefinition) { if (!isset($sheetDefinition['ROOT']['el']) || !is_array($sheetDefinition['ROOT']['el']) || !isset($pageTsConfig[$sheetName . '.'])) { continue; } foreach ($sheetDefinition['ROOT']['el'] as $flexFieldName => $fieldDefinition) { if (!empty($pageTsConfig[$sheetName . '.'][$flexFieldName . '.']['disabled'])) { unset($result['processedTca']['columns'][$fieldName]['config']['ds']['sheets'][$sheetName]['ROOT']['el'][$flexFieldName]); } } } return $result; } /** * Remove data values in languages the user has no access to and add dummy entries * for languages that are available but do not exist in data values yet. * * @param array $result Result array * @param string $fieldName Current handle field name * @return array Modified item array */ protected function prepareLanguageHandlingInDataValues(array $result, $fieldName) { $backendUser = $this->getBackendUser(); $dataStructure = $result['processedTca']['columns'][$fieldName]['config']['ds']; $langDisabled = $dataStructure['meta']['langDisable']; $langChildren = $dataStructure['meta']['langChildren']; // Existing page language overlays are only considered if options.checkPageLanguageOverlay is set in userTs $checkPageLanguageOverlay = false; if (isset($result['userTsConfig']['options.']) && is_array($result['userTsConfig']['options.']) && array_key_exists('checkPageLanguageOverlay', $result['userTsConfig']['options.']) ) { $checkPageLanguageOverlay = (bool)$result['userTsConfig']['options.']['checkPageLanguageOverlay']; } $systemLanguageRows = $result['systemLanguageRows']; // Contains all language iso code that are valid and user has access to $availableLanguageCodes = []; $defaultCodeWasAdded = false; foreach ($systemLanguageRows as $systemLanguageRow) { $isoCode = $systemLanguageRow['iso']; $isAvailable = true; if ($langDisabled && $isoCode !== 'DEF') { $isAvailable = false; } // @todo: Is it possible a user has no write access to default lang? If so, what to do? if (!$backendUser->checkLanguageAccess($systemLanguageRow['uid'])) { $isAvailable = false; } if ($checkPageLanguageOverlay && $systemLanguageRow['uid'] > 0) { $found = false; foreach ($result['pageLanguageOverlayRows'] as $overlayRow) { if ((int)$overlayRow['sys_language_uid'] === (int)$systemLanguageRow['uid']) { $found = true; break; } } if (!$found) { $isAvailable = false; } } if ($isoCode === 'DEF' && $defaultCodeWasAdded) { $isAvailable = false; } if ($isAvailable) { $availableLanguageCodes[] = strtoupper($isoCode); } if ($isoCode === 'DEF') { $defaultCodeWasAdded = true; } } // Set the list of available languages in the data structure "meta" section to have it // available for the render engine to iterate over it. $result['processedTca']['columns'][$fieldName]['config']['ds']['meta']['availableLanguageCodes'] = $availableLanguageCodes; if (!$langChildren) { $allowedLanguageSheetKeys = []; foreach ($availableLanguageCodes as $isoCode) { $allowedLanguageSheetKeys['l' . $isoCode] = []; } $result = $this->setLanguageSheetsInDataValues($result, $fieldName, $allowedLanguageSheetKeys); // With $langChildren = 0, values must only contain vDEF prefixed keys $allowedValueLevelLanguageKeys = []; $allowedValueLevelLanguageKeys['vDEF'] = []; $allowedValueLevelLanguageKeys['vDEF.vDEFbase'] = []; // A richtext special $allowedValueLevelLanguageKeys['_TRANSFORM_vDEF.vDEFbase'] = []; $result = $this->setLanguageValueLevelValues($result, $fieldName, $allowedValueLevelLanguageKeys); } else { // langChildren is set - only lDEF as sheet language is allowed, but more fields on value field level $allowedLanguageSheetKeys = [ 'lDEF' => [], ]; $result = $this->setLanguageSheetsInDataValues($result, $fieldName, $allowedLanguageSheetKeys); $allowedValueLevelLanguageKeys = []; foreach ($availableLanguageCodes as $isoCode) { $allowedValueLevelLanguageKeys['v' . $isoCode] = []; $allowedValueLevelLanguageKeys['v' . $isoCode . '.vDEFbase'] = []; $allowedValueLevelLanguageKeys['_TRANSFORM_v' . $isoCode . '.vDEFbase'] = []; } $result = $this->setLanguageValueLevelValues($result, $fieldName, $allowedValueLevelLanguageKeys); } return $result; } /** * Feed single flex field and data to FlexFormSegment FormData compiler and merge result. * This one is nasty. Goal is to have processed TCA stuff in DS and also have validated / processed data values. * * Three main parts in this method: * * Process values of existing section container for default values * * Process values and TCA of possible section container and create a default value row for each * * Process TCA of "normal" fields and have default values in data ['templateRows']['containerName'] parallel to section ['el'] * * @param array $result Result array * @param string $fieldName Current handle field name * @param array $pageTsConfig Given pageTsConfig of this flex form * @return array Modified item array */ protected function modifyDataStructureAndDataValuesByFlexFormSegmentGroup(array $result, $fieldName, $pageTsConfig) { $dataStructure = $result['processedTca']['columns'][$fieldName]['config']['ds']; $dataValues = $result['databaseRow'][$fieldName]; $tableName = $result['tableName']; $availableLanguageCodes = $result['processedTca']['columns'][$fieldName]['config']['ds']['meta']['availableLanguageCodes']; if ($dataStructure['meta']['langChildren']) { $languagesOnSheetLevel = [ 'DEF' ]; $languagesOnElementLevel = $availableLanguageCodes; } else { $languagesOnSheetLevel = $availableLanguageCodes; $languagesOnElementLevel = [ 'DEF' ]; } $result['processedTca']['columns'][$fieldName]['config']['ds']['meta']['languagesOnSheetLevel'] = $languagesOnSheetLevel; $result['processedTca']['columns'][$fieldName]['config']['ds']['meta']['languagesOnElement'] = $languagesOnElementLevel; if (!isset($dataStructure['sheets']) || !is_array($dataStructure['sheets'])) { return $result; } /** @var FlexFormSegment $formDataGroup */ $formDataGroup = GeneralUtility::makeInstance(FlexFormSegment::class); /** @var FormDataCompiler $formDataCompiler */ $formDataCompiler = GeneralUtility::makeInstance(FormDataCompiler::class, $formDataGroup); foreach ($dataStructure['sheets'] as $dataStructureSheetName => $dataStructureSheetDefinition) { if (!isset($dataStructureSheetDefinition['ROOT']['el']) || !is_array($dataStructureSheetDefinition['ROOT']['el'])) { continue; } $dataStructureSheetElements = $dataStructureSheetDefinition['ROOT']['el']; // Prepare pageTsConfig of this sheet $pageTsConfig['TCEFORM.'][$tableName . '.'] = []; if (isset($pageTsConfig[$dataStructureSheetName . '.']) && is_array($pageTsConfig[$dataStructureSheetName . '.'])) { $pageTsConfig['TCEFORM.'][$tableName . '.'] = $pageTsConfig[$dataStructureSheetName . '.']; } foreach ($languagesOnSheetLevel as $isoSheetLevel) { $langSheetLevel = 'l' . $isoSheetLevel; foreach ($dataStructureSheetElements as $dataStructureSheetElementName => $dataStructureSheetElementDefinition) { if (isset($dataStructureSheetElementDefinition['type']) && $dataStructureSheetElementDefinition['type'] === 'array' && isset($dataStructureSheetElementDefinition['section']) && $dataStructureSheetElementDefinition['section'] === '1' ) { // A section // Existing section container elements if (isset($dataValues['data'][$dataStructureSheetName][$langSheetLevel][$dataStructureSheetElementName]['el']) && is_array($dataValues['data'][$dataStructureSheetName][$langSheetLevel][$dataStructureSheetElementName]['el']) ) { $containerArray = $dataValues['data'][$dataStructureSheetName][$langSheetLevel][$dataStructureSheetElementName]['el']; foreach ($containerArray as $aContainerNumber => $aContainerArray) { if (is_array($aContainerArray)) { foreach ($aContainerArray as $aContainerName => $aContainerElementArray) { if ($aContainerName === '_TOGGLE') { // Don't handle internal toggle state field continue; } if (!isset($dataStructureSheetElements[$dataStructureSheetElementName]['el'][$aContainerName])) { // Container not defined in ds continue; } foreach ($dataStructureSheetElements[$dataStructureSheetElementName]['el'][$aContainerName]['el'] as $singleFieldName => $singleFieldConfiguration) { // $singleFieldValueArray = ['data']['sSections']['lDEF']['section_1']['el']['1']['container_1']['el']['element_1'] $singleFieldValueArray = []; if (isset($aContainerElementArray['el'][$singleFieldName]) && is_array($aContainerElementArray['el'][$singleFieldName]) ) { $singleFieldValueArray = $aContainerElementArray['el'][$singleFieldName]; } foreach ($languagesOnElementLevel as $isoElementLevel) { $langElementLevel = 'v' . $isoElementLevel; $valueArray = [ 'uid' => $result['databaseRow']['uid'], ]; $command = 'new'; if (array_key_exists($langElementLevel, $singleFieldValueArray)) { $command = 'edit'; $valueArray[$singleFieldName] = $singleFieldValueArray[$langElementLevel]; } $inputToFlexFormSegment = [ 'tableName' => $result['tableName'], 'command' => $command, // It is currently not possible to have pageTsConfig for section container 'pageTsConfig' => [], 'databaseRow' => $valueArray, 'processedTca' => [ 'ctrl' => [], 'columns' => [ $singleFieldName => $singleFieldConfiguration, ], ], ]; $flexSegmentResult = $formDataCompiler->compile($inputToFlexFormSegment); // Set data value result if (array_key_exists($singleFieldName, $flexSegmentResult['databaseRow'])) { $result['databaseRow'][$fieldName] ['data'][$dataStructureSheetName][$langSheetLevel][$dataStructureSheetElementName]['el'] [$aContainerNumber][$aContainerName]['el'] [$singleFieldName][$langElementLevel] = $flexSegmentResult['databaseRow'][$singleFieldName]; } // Set TCA structure result, actually, this call *might* be obsolete since the "dummy" // handling below will set it again. $result['processedTca']['columns'][$fieldName]['config']['ds'] ['sheets'][$dataStructureSheetName]['ROOT']['el'][$dataStructureSheetElementName]['el'] [$aContainerName]['el'][$singleFieldName] = $flexSegmentResult['processedTca']['columns'][$singleFieldName]; } } } } } } // End of existing data value handling // Prepare "fresh" row for every possible container if (isset($dataStructureSheetElements[$dataStructureSheetElementName]['el']) && is_array($dataStructureSheetElements[$dataStructureSheetElementName]['el'])) { foreach ($dataStructureSheetElements[$dataStructureSheetElementName]['el'] as $possibleContainerName => $possibleContainerConfiguration) { if (isset($possibleContainerConfiguration['el']) && is_array($possibleContainerConfiguration['el'])) { // Initialize result data array templateRows $result['databaseRow'][$fieldName] ['data'][$dataStructureSheetName][$langSheetLevel][$dataStructureSheetElementName]['templateRows'] [$possibleContainerName]['el'] = []; foreach ($possibleContainerConfiguration['el'] as $singleFieldName => $singleFieldConfiguration) { foreach ($languagesOnElementLevel as $isoElementLevel) { $langElementLevel = 'v' . $isoElementLevel; $inputToFlexFormSegment = [ 'tableName' => $result['tableName'], 'command' => 'new', 'pageTsConfig' => [], 'databaseRow' => [ 'uid' => $result['databaseRow']['uid'], ], 'processedTca' => [ 'ctrl' => [], 'columns' => [ $singleFieldName => $singleFieldConfiguration, ], ], ]; $flexSegmentResult = $formDataCompiler->compile($inputToFlexFormSegment); if (array_key_exists($singleFieldName, $flexSegmentResult['databaseRow'])) { $result['databaseRow'][$fieldName] ['data'][$dataStructureSheetName][$langSheetLevel][$dataStructureSheetElementName]['templateRows'] [$possibleContainerName]['el'][$singleFieldName][$langElementLevel] = $flexSegmentResult['databaseRow'][$singleFieldName]; } $result['processedTca']['columns'][$fieldName]['config']['ds'] ['sheets'][$dataStructureSheetName]['ROOT']['el'][$dataStructureSheetElementName]['el'] [$possibleContainerName]['el'][$singleFieldName] = $flexSegmentResult['processedTca']['columns'][$singleFieldName]; } } } } } // End of preparation for each possible container // type without section is not ok } elseif (isset($dataStructureSheetElementDefinition['type']) || isset($dataStructureSheetElementDefinition['section'])) { throw new \UnexpectedValueException( 'Broken data structure on field name ' . $fieldName . '. section without type or vice versa is not allowed', 1440685208 ); // A "normal" TCA element } else { foreach ($languagesOnElementLevel as $isoElementLevel) { $langElementLevel = 'v' . $isoElementLevel; $valueArray = [ // uid of "parent" is given down for inline elements to resolve correctly 'uid' => $result['databaseRow']['uid'], ]; $command = 'new'; if (isset($dataValues['data'][$dataStructureSheetName][$langSheetLevel][$dataStructureSheetElementName]) && array_key_exists($langElementLevel, $dataValues['data'][$dataStructureSheetName][$langSheetLevel][$dataStructureSheetElementName]) ) { $command = 'edit'; $valueArray[$dataStructureSheetElementName] = $dataValues['data'][$dataStructureSheetName][$langSheetLevel][$dataStructureSheetElementName][$langElementLevel]; } $inputToFlexFormSegment = [ // tablename of "parent" is given down for inline elements to resolve correctly 'tableName' => $result['tableName'], 'command' => $command, 'pageTsConfig' => $pageTsConfig, 'databaseRow' => $valueArray, 'processedTca' => [ 'ctrl' => [], 'columns' => [ $dataStructureSheetElementName => $dataStructureSheetElementDefinition, ], ], ]; $flexSegmentResult = $formDataCompiler->compile($inputToFlexFormSegment); // Set data value result if (array_key_exists($dataStructureSheetElementName, $flexSegmentResult['databaseRow'])) { $result['databaseRow'][$fieldName] ['data'][$dataStructureSheetName][$langSheetLevel][$dataStructureSheetElementName][$langElementLevel] = $flexSegmentResult['databaseRow'][$dataStructureSheetElementName]; } // Set TCA structure result $result['processedTca']['columns'][$fieldName]['config']['ds'] ['sheets'][$dataStructureSheetName]['ROOT']['el'][$dataStructureSheetElementName] = $flexSegmentResult['processedTca']['columns'][$dataStructureSheetElementName]; } } // End of single element handling } } } return $result; } /** * Modify data structure of a single "sheet" * Sets "secondary" data like sheet names and so on, but does NOT modify single elements * * @param array $dataStructure Given data structure * @param array $pageTsOfSheet Page Ts config of given field * @return array Modified data structure */ protected function modifySingleSheetInformation(array $dataStructure, array $pageTsOfSheet) { // Return if no elements defined if (!isset($dataStructure['ROOT']['el']) || !is_array($dataStructure['ROOT']['el'])) { return $dataStructure; } // Rename sheet (tab) if (!empty($pageTsOfSheet['sheetTitle'])) { $dataStructure['ROOT']['sheetTitle'] = $pageTsOfSheet['sheetTitle']; } // Set sheet description (tab) if (!empty($pageTsOfSheet['sheetDescription'])) { $dataStructure['ROOT']['sheetDescription'] = $pageTsOfSheet['sheetDescription']; } // Set sheet short description (tab) if (!empty($pageTsOfSheet['sheetShortDescr'])) { $dataStructure['ROOT']['sheetShortDescr'] = $pageTsOfSheet['sheetShortDescr']; } return $dataStructure; } /** * Add new sheet languages not yet in data values and remove invalid ones * * databaseRow['aFlex']['data']['sDEF'] = array('lDEF', 'lNotAllowed'); * allowedLanguageKeys = array('lDEF', 'lNEW') * -> databaseRow['aFlex']['data']['sDEF'] = array('lDEF', 'lNEW'); * * @param array $result Result array * @param string $fieldName Current handle field name * @param array $allowedKeys List of allowed keys * @return array Modified result */ protected function setLanguageSheetsInDataValues(array $result, $fieldName, array $allowedKeys) { $valueArray = []; if (isset($result['databaseRow'][$fieldName]['data']) && is_array($result['databaseRow'][$fieldName]['data'])) { $valueArray = $result['databaseRow'][$fieldName]['data']; } foreach ($valueArray as $sheetName => $sheetLanguages) { // Add iso code with empty array if it does not yet exist in data // and remove codes from data that do not exist in $allowed $result['databaseRow'][$fieldName]['data'][$sheetName] = array_intersect_key(array_merge($allowedKeys, $sheetLanguages), $allowedKeys); } return $result; } /** * Remove invalid keys from data value array the user has no access to * or that were removed or similar to prevent any rendering of this stuff * * Handles this for "normal" fields and also for section container element values. * * @param array $result Result array * @param string $fieldName Current handle field name * @param array $allowedKeys List of allowed keys * @return array Modified result */ protected function setLanguageValueLevelValues(array $result, $fieldName, $allowedKeys) { $valueArray = []; if (isset($result['databaseRow'][$fieldName]['data']) && is_array($result['databaseRow'][$fieldName]['data'])) { $valueArray = $result['databaseRow'][$fieldName]['data']; } foreach ($valueArray as $sheetName => $sheetLanguages) { if (!is_array($sheetLanguages)) { continue; } foreach ($sheetLanguages as $languageName => $languageFields) { if (!is_array($languageFields)) { continue; } foreach ($languageFields as $flexFieldName => $fieldValues) { if (!is_array($fieldValues)) { continue; } $allowedSingleValues = []; foreach ($fieldValues as $fieldValueName => $fieldValueValue) { if (is_array($fieldValueValue) && $fieldValueName === 'el') { // A section container foreach ($fieldValueValue as $sectionNumber => $sectionElementArray) { if (is_array($sectionElementArray)) { $allowedSingleValues['el'][$sectionNumber] = []; foreach ($sectionElementArray as $sectionElementName => $containerElementArray) { if (isset($containerElementArray['el']) && is_array($containerElementArray['el']) && !empty($containerElementArray['el'])) { foreach ($containerElementArray['el'] as $aContainerElementName => $aContainerElementValues) { if (is_array($aContainerElementValues)) { foreach ($aContainerElementValues as $aContainerElementValueKey => $aContainerElementValueValue) { if (array_key_exists($aContainerElementValueKey, $allowedKeys)) { $allowedSingleValues['el'][$sectionNumber][$sectionElementName] ['el'][$aContainerElementName][$aContainerElementValueKey] = $aContainerElementValueValue; } } } else { $allowedSingleValues['el'][$sectionNumber][$sectionElementName]['el'] [$aContainerElementName] = $aContainerElementValues; } } } else { $allowedSingleValues['el'][$sectionNumber][$sectionElementName] = $containerElementArray; } } } else { $allowedSingleValues = $sectionElementArray; } } } else { // "normal" value field if (array_key_exists($fieldValueName, $allowedKeys)) { $allowedSingleValues[$fieldValueName] = $fieldValueValue; } } } $result['databaseRow'][$fieldName]['data'][$sheetName][$languageName][$flexFieldName] = $allowedSingleValues; } } } return $result; } /** * @return BackendUserAuthentication */ protected function getBackendUser() { return $GLOBALS['BE_USER']; } }
gpl-2.0
softwaremechanic/Miscellaneous
Python/hw.py
49
def a(*args, **kwargs): print("hello world")
gpl-2.0
lemonlistry/show_blog
wp-content/plugins/wp-post-view/wp-post-view.php
4983
<?php /* Plugin Name: WP-post-view Plugin URI: Description: Easily display the views visited of each post. Tracks the views in each posts visited, views number are also display in each row of the post in the admin area. Simply add this code echo_post_views(get_the_ID()); anywhere to display AFTER <?php if (have_posts ()) : while (have_posts ()) : the_post(); ?> in single.php file. Version: 1.0 Author: Towards Technology Author URI: http://answer2me.com/ */ /* Copyright 2011 Towards Technology (email : sales@towardstech.com) 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 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ //Activation register_activation_hook(__FILE__, wpp_init()); Register_uninstall_hook(__FILE__, wpp_destroy()); add_action('admin_head', 'post_view_style'); add_action('manage_posts_custom_column', 'show_post_row_views', 10, 2); add_filter('manage_posts_columns', 'show_post_header_views'); /** * When plugin activated, table is created. * @global $wpdb */ function wpp_init() { global $wpdb; $table = $wpdb->prefix . "postview"; if ($wpdb->get_var("SHOW TABLES LIKE '$table'") != $table) { $sql = "CREATE TABLE " . $table . " ( UNIQUE KEY id (post_id), post_id int(10) NOT NULL, view int(10), view_datetime datetime NOT NULL default '0000-00-00 00:00:00');"; require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); dbDelta($sql); } } /** * When plugin deleted, table is deleted. * @global $wpdb $wpdb */ function wpp_destroy() { global $wpdb; $table = $wpdb->prefix . "postview"; if ($wpdb->get_var("SHOW TABLES LIKE '$table'") != $table) { $sql = "DROP TABLE " . $table; require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); dbDelta($sql); } } /** * Some css adjustment. */ function post_view_style() { echo '<style type="text/css"> .column-views { width: 60px; text-align: right; } </style>'; } /** * Display the views header column name. * * @param array $columns * @return <type> */ function show_post_header_views($columns) { $columns['views'] = __('Views'); return $columns; } /** * * Display the views amount in each row of the posts admin panel. * * @param <type> $column_name * @param <type> $post_id * @return <type> */ function show_post_row_views($column_name, $post_id) { if ($column_name != 'views') return; echo wp_get_post_views($post_id); } if (!function_exists('echo_post_views')) { /** * Echo, print or display the views of the post. * @param <type> $post_id */ function echo_post_views($post_id) { if (wp_update_post_views($post_id) == 1) { $views = wp_get_post_views($post_id); echo number_format_i18n($views); } else { echo 0; } } } /** * Returns 1 if successfully updated post views. * * @global $wpdb $wpdb * @param <type> $views * @param <type> $post_id * @return <type> */ function wp_insert_post_views($views, $post_id) { global $wpdb; $table = $wpdb->prefix . "postview"; $result = $wpdb->query("INSERT INTO $table VALUES($post_id,$views,NOW())"); return ($result); } /** * Returns 1 if successfully updated post views. * * @global <type> $wpdb * @param <type> $post_id * @return <type> */ function wp_update_post_views($post_id) { global $wpdb; $table = $wpdb->prefix . "postview"; $views = wp_get_post_views($post_id) + 1; if ($wpdb->query("SELECT view FROM $table WHERE post_id = '$post_id'") != 1) wp_insert_post_views($views, $post_id); $result = $wpdb->query("UPDATE $table SET view=$views WHERE post_id = '$post_id'"); return ($result); } /** * Get the post views amount. * @global $wpdb $wpdb * @param <type> $post_id * @return <type> */ function wp_get_post_views($post_id) { global $wpdb; $table = $wpdb->prefix . "postview"; $result = $wpdb->get_results("SELECT view FROM $table WHERE post_id = '$post_id'", ARRAY_A); if (!is_array($result) || empty($result)) { return "0"; } else { return $result[0]['view']; } } ?>
gpl-2.0
igpay/jimbo
js/modules/window.js
1302
var jimbo = jimbo || {}; /** * window * Deals with the active window **/ jimbo.window = (function() { /** * addTabs(TabList or Tab tabs) * Add all of the given tabs to the window **/ function addTabs(tabs) { tabs.open(); } /** * loadTabs(Tab or TabList tabs) * Replace all tabs in the window with the given tabs **/ function loadTabs(tabs) { getAllTabs(function(oldTabs) { addTabs(tabs); removeTabs(oldTabs); }); } /** * getAllTabs(function(TabList) callback) * Get all of the tabs in the window and give them to callback **/ function getAllTabs(callback) { chrome.tabs.query({ "currentWindow": true }, function(tabs) { var tl = new jimbo.TabList(tabs); callback(tl); }); } /** * getHighlightedTabs(function(TabList) callback) * Get all highlighted tabs and give them to callback **/ function getHighlightedTabs(callback) { chrome.tabs.query({ "currentWindow": true, "highlighted": true }, function(tabs) { callback(new jimbo.TabList(tabs)); }); } /** * removeTabs(TabList or Tab tabs) * Remove all given tabs from window **/ function removeTabs(tabs) { tabs.remove(); } return { "addTabs": addTabs, "loadTabs": loadTabs, "getAllTabs": getAllTabs, "getHighlightedTabs": getHighlightedTabs, "removeTabs": removeTabs } })();
gpl-2.0
tinymac/123
src/server/scripts/Spells/spell_druid.cpp
15791
/* * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> * * 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 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ /* * Scripts for spells with SPELLFAMILY_DRUID and SPELLFAMILY_GENERIC spells used by druid players. * Ordered alphabetically using scriptname. * Scriptnames of files in this file should be prefixed with "spell_dru_". */ #include "ScriptMgr.h" #include "SpellScript.h" #include "SpellAuraEffects.h" enum DruidSpells { DRUID_INCREASED_MOONFIRE_DURATION = 38414, DRUID_NATURES_SPLENDOR = 57865, SPELL_KING_OF_THE_JUNGLE = 48492, SPELL_TIGER_S_FURY_ENERGIZE = 51178, SPELL_ENRAGE_MOD_DAMAGE = 51185, }; // 54846 Glyph of Starfire class spell_dru_glyph_of_starfire : public SpellScriptLoader { public: spell_dru_glyph_of_starfire() : SpellScriptLoader("spell_dru_glyph_of_starfire") { } class spell_dru_glyph_of_starfire_SpellScript : public SpellScript { PrepareSpellScript(spell_dru_glyph_of_starfire_SpellScript); bool Validate(SpellInfo const* /*spellEntry*/) { if (!sSpellMgr->GetSpellInfo(DRUID_INCREASED_MOONFIRE_DURATION) || !sSpellMgr->GetSpellInfo(DRUID_NATURES_SPLENDOR)) return false; return true; } void HandleScriptEffect(SpellEffIndex /*effIndex*/) { Unit* caster = GetCaster(); if (Unit* unitTarget = GetHitUnit()) if (AuraEffect const* aurEff = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, 0x00000002, 0, 0, caster->GetGUID())) { Aura* aura = aurEff->GetBase(); uint32 countMin = aura->GetMaxDuration(); uint32 countMax = aura->GetSpellInfo()->GetMaxDuration() + 9000; if (caster->HasAura(DRUID_INCREASED_MOONFIRE_DURATION)) countMax += 3000; if (caster->HasAura(DRUID_NATURES_SPLENDOR)) countMax += 3000; if (countMin < countMax) { aura->SetDuration(uint32(aura->GetDuration() + 3000)); aura->SetMaxDuration(countMin + 3000); } } } void Register() { OnEffectHitTarget += SpellEffectFn(spell_dru_glyph_of_starfire_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } }; SpellScript* GetSpellScript() const { return new spell_dru_glyph_of_starfire_SpellScript(); } }; // 69366 - Moonkin Form passive class spell_dru_moonkin_form_passive : public SpellScriptLoader { public: spell_dru_moonkin_form_passive() : SpellScriptLoader("spell_dru_moonkin_form_passive") { } class spell_dru_moonkin_form_passive_AuraScript : public AuraScript { PrepareAuraScript(spell_dru_moonkin_form_passive_AuraScript); uint32 absorbPct; bool Load() { absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster()); return true; } void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/) { // Set absorbtion amount to unlimited amount = -1; } void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount) { // reduces all damage taken while Stunned in Moonkin Form if (GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1<<MECHANIC_STUN)) absorbAmount = CalculatePctN(dmgInfo.GetDamage(), absorbPct); } void Register() { DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dru_moonkin_form_passive_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB); OnEffectAbsorb += AuraEffectAbsorbFn(spell_dru_moonkin_form_passive_AuraScript::Absorb, EFFECT_0); } }; AuraScript* GetAuraScript() const { return new spell_dru_moonkin_form_passive_AuraScript(); } }; // 33851 - Primal Tenacity class spell_dru_primal_tenacity : public SpellScriptLoader { public: spell_dru_primal_tenacity() : SpellScriptLoader("spell_dru_primal_tenacity") { } class spell_dru_primal_tenacity_AuraScript : public AuraScript { PrepareAuraScript(spell_dru_primal_tenacity_AuraScript); uint32 absorbPct; bool Load() { absorbPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue(GetCaster()); return true; } void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/) { // Set absorbtion amount to unlimited amount = -1; } void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount) { // reduces all damage taken while Stunned in Cat Form if (GetTarget()->GetShapeshiftForm() == FORM_CAT && GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1<<MECHANIC_STUN)) absorbAmount = CalculatePctN(dmgInfo.GetDamage(), absorbPct); } void Register() { DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dru_primal_tenacity_AuraScript::CalculateAmount, EFFECT_1, SPELL_AURA_SCHOOL_ABSORB); OnEffectAbsorb += AuraEffectAbsorbFn(spell_dru_primal_tenacity_AuraScript::Absorb, EFFECT_1); } }; AuraScript* GetAuraScript() const { return new spell_dru_primal_tenacity_AuraScript(); } }; // 62606 - Savage Defense class spell_dru_savage_defense : public SpellScriptLoader { public: spell_dru_savage_defense() : SpellScriptLoader("spell_dru_savage_defense") { } class spell_dru_savage_defense_AuraScript : public AuraScript { PrepareAuraScript(spell_dru_savage_defense_AuraScript); uint32 absorbPct; bool Load() { absorbPct = GetSpellInfo()->Effects[EFFECT_0].CalcValue(GetCaster()); return true; } void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/) { // Set absorbtion amount to unlimited amount = -1; } void Absorb(AuraEffect* aurEff, DamageInfo & /*dmgInfo*/, uint32 & absorbAmount) { absorbAmount = uint32(CalculatePctN(GetTarget()->GetTotalAttackPowerValue(BASE_ATTACK), absorbPct)); aurEff->SetAmount(0); } void Register() { DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dru_savage_defense_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB); OnEffectAbsorb += AuraEffectAbsorbFn(spell_dru_savage_defense_AuraScript::Absorb, EFFECT_0); } }; AuraScript* GetAuraScript() const { return new spell_dru_savage_defense_AuraScript(); } }; class spell_dru_t10_restoration_4p_bonus : public SpellScriptLoader { public: spell_dru_t10_restoration_4p_bonus() : SpellScriptLoader("spell_dru_t10_restoration_4p_bonus") { } class spell_dru_t10_restoration_4p_bonus_SpellScript : public SpellScript { PrepareSpellScript(spell_dru_t10_restoration_4p_bonus_SpellScript); bool Load() { return GetCaster()->GetTypeId() == TYPEID_PLAYER; } void FilterTargets(std::list<Unit*>& unitList) { if (!GetCaster()->ToPlayer()->GetGroup()) { unitList.clear(); unitList.push_back(GetCaster()); } else { unitList.remove(GetTargetUnit()); std::list<Unit*> tempTargets; for (std::list<Unit*>::const_iterator itr = unitList.begin(); itr != unitList.end(); ++itr) if ((*itr)->GetTypeId() == TYPEID_PLAYER && GetCaster()->IsInRaidWith(*itr)) tempTargets.push_back(*itr); if (tempTargets.empty()) { unitList.clear(); FinishCast(SPELL_FAILED_DONT_REPORT); return; } Unit* target = Trinity::Containers::SelectRandomContainerElement(tempTargets); unitList.clear(); unitList.push_back(target); } } void Register() { OnUnitTargetSelect += SpellUnitTargetFn(spell_dru_t10_restoration_4p_bonus_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ALLY); } }; SpellScript* GetSpellScript() const { return new spell_dru_t10_restoration_4p_bonus_SpellScript(); } }; class spell_dru_starfall_aoe : public SpellScriptLoader { public: spell_dru_starfall_aoe() : SpellScriptLoader("spell_dru_starfall_aoe") { } class spell_dru_starfall_aoe_SpellScript : public SpellScript { PrepareSpellScript(spell_dru_starfall_aoe_SpellScript); void FilterTargets(std::list<Unit*>& unitList) { unitList.remove(GetTargetUnit()); } void Register() { OnUnitTargetSelect += SpellUnitTargetFn(spell_dru_starfall_aoe_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY); } }; SpellScript* GetSpellScript() const { return new spell_dru_starfall_aoe_SpellScript(); } }; // 40121 - Swift Flight Form (Passive) class spell_dru_swift_flight_passive : public SpellScriptLoader { public: spell_dru_swift_flight_passive() : SpellScriptLoader("spell_dru_swift_flight_passive") { } class spell_dru_swift_flight_passive_AuraScript : public AuraScript { PrepareAuraScript(spell_dru_swift_flight_passive_AuraScript); bool Load() { return GetCaster()->GetTypeId() == TYPEID_PLAYER; } void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/) { if (Player* caster = GetCaster()->ToPlayer()) if (caster->Has310Flyer(false)) amount = 310; } void Register() { DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dru_swift_flight_passive_AuraScript::CalculateAmount, EFFECT_1, SPELL_AURA_MOD_INCREASE_VEHICLE_FLIGHT_SPEED); } }; AuraScript* GetAuraScript() const { return new spell_dru_swift_flight_passive_AuraScript(); } }; class spell_dru_starfall_dummy : public SpellScriptLoader { public: spell_dru_starfall_dummy() : SpellScriptLoader("spell_dru_starfall_dummy") { } class spell_dru_starfall_dummy_SpellScript : public SpellScript { PrepareSpellScript(spell_dru_starfall_dummy_SpellScript); void HandleDummy(SpellEffIndex /* effIndex */) { Unit* caster = GetCaster(); // Shapeshifting into an animal form or mounting cancels the effect if (caster->GetCreatureType() == CREATURE_TYPE_BEAST || caster->IsMounted()) { if (SpellInfo const* spellInfo = GetTriggeringSpell()) caster->RemoveAurasDueToSpell(spellInfo->Id); return; } //Any effect which causes you to lose control of your character will supress the starfall effect. if (caster->HasUnitState(UNIT_STATE_CONTROLLED)) return; caster->CastSpell(GetHitUnit(), GetEffectValue(), true); } void Register() { OnEffectHitTarget += SpellEffectFn(spell_dru_starfall_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; SpellScript* GetSpellScript() const { return new spell_dru_starfall_dummy_SpellScript(); } }; class spell_dru_enrage : public SpellScriptLoader { public: spell_dru_enrage() : SpellScriptLoader("spell_dru_enrage") { } class spell_dru_enrage_SpellScript : public SpellScript { PrepareSpellScript(spell_dru_enrage_SpellScript); void OnHit() { if (AuraEffect const* aurEff = GetHitUnit()->GetAuraEffectOfRankedSpell(SPELL_KING_OF_THE_JUNGLE, EFFECT_0)) GetHitUnit()->CastCustomSpell(SPELL_ENRAGE_MOD_DAMAGE, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetHitUnit(), true); } void Register() { AfterHit += SpellHitFn(spell_dru_enrage_SpellScript::OnHit); } }; SpellScript* GetSpellScript() const { return new spell_dru_enrage_SpellScript(); } }; class spell_dru_tiger_s_fury : public SpellScriptLoader { public: spell_dru_tiger_s_fury() : SpellScriptLoader("spell_dru_tiger_s_fury") { } class spell_dru_tiger_s_fury_SpellScript : public SpellScript { PrepareSpellScript(spell_dru_tiger_s_fury_SpellScript); void OnHit() { if (AuraEffect const* aurEff = GetHitUnit()->GetAuraEffectOfRankedSpell(SPELL_KING_OF_THE_JUNGLE, EFFECT_1)) GetHitUnit()->CastCustomSpell(SPELL_TIGER_S_FURY_ENERGIZE, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetHitUnit(), true); } void Register() { AfterHit += SpellHitFn(spell_dru_tiger_s_fury_SpellScript::OnHit); } }; SpellScript* GetSpellScript() const { return new spell_dru_tiger_s_fury_SpellScript(); } }; void AddSC_druid_spell_scripts() { new spell_dru_glyph_of_starfire(); new spell_dru_moonkin_form_passive(); new spell_dru_primal_tenacity(); new spell_dru_savage_defense(); new spell_dru_t10_restoration_4p_bonus(); new spell_dru_starfall_aoe(); new spell_dru_swift_flight_passive(); new spell_dru_starfall_dummy(); new spell_dru_enrage(); new spell_dru_tiger_s_fury(); }
gpl-2.0
bakkdoor/yarps
src/vendor/plugins/gloc/lib/gloc-constants.rb
540
# Copyright (c) 2005-2007 David Barri require 'yaml' module GLoc module Constants UTF_8= 'utf-8' SHIFT_JIS= 'sjis' EUC_JP= 'euc-jp' CONFIG= { :default_language => :en, :default_param_name => 'lang', :default_cookie_name => 'lang', :raise_string_not_found_errors => true, :verbose => false, } LOCALIZED_STRINGS= {} LOWERCASE_LANGUAGES= {} RULES= {} YAML_PRIVATETYPE2= YAML::Syck::PrivateType rescue YAML::PrivateType unless const_defined?(:YAML_PRIVATETYPE2) end end
gpl-2.0
ZmagoD/kirki
includes/class-kirki-init.php
6794
<?php class Kirki_Init { public static $control_types = array( 'checkbox' => 'Kirki_Controls_Checkbox_Control', 'code' => 'Kirki_Controls_Code_Control', 'color-alpha' => 'Kirki_Controls_Color_Alpha_Control', 'custom' => 'Kirki_Controls_Custom_Control', 'dimension' => 'Kirki_Controls_Dimension_Control', 'editor' => 'Kirki_Controls_Editor_Control', 'multicheck' => 'Kirki_Controls_MultiCheck_Control', 'number' => 'Kirki_Controls_Number_Control', 'palette' => 'Kirki_Controls_Palette_Control', 'preset' => 'Kirki_Controls_Preset_Control', 'radio' => 'Kirki_Controls_Radio_Control', 'radio-buttonset' => 'Kirki_Controls_Radio_ButtonSet_Control', 'radio-image' => 'Kirki_Controls_Radio_Image_Control', 'repeater' => 'Kirki_Controls_Repeater_Control', 'select' => 'Kirki_Controls_Select_Control', 'slider' => 'Kirki_Controls_Slider_Control', 'sortable' => 'Kirki_Controls_Sortable_Control', 'spacing' => 'Kirki_Controls_Spacing_Control', 'switch' => 'Kirki_Controls_Switch_Control', 'textarea' => 'Kirki_Controls_Textarea_Control', 'toggle' => 'Kirki_Controls_Toggle_Control', 'typography' => 'Kirki_Controls_Typography_Control', 'color' => 'WP_Customize_Color_Control', 'image' => 'WP_Customize_Image_Control', 'upload' => 'WP_Customize_Upload_Control', ); public static $setting_types = array( 'repeater' => 'Kirki_Settings_Repeater_Setting', ); /** * the class constructor */ public function __construct() { self::$control_types = apply_filters( 'kirki/control_types', self::$control_types ); self::$setting_types = apply_filters( 'kirki/setting_types', self::$setting_types ); add_action( 'wp_loaded', array( $this, 'add_to_customizer' ), 1 ); } /** * Helper function that adds the fields, sections and panels to the customizer. * @return void */ public function add_to_customizer() { new Kirki_Fields_Filter(); add_action( 'customize_register', array( $this, 'register_control_types' ) ); add_action( 'customize_register', array( $this, 'add_panels' ), 97 ); add_action( 'customize_register', array( $this, 'add_sections' ), 98 ); add_action( 'customize_register', array( $this, 'add_fields' ), 99 ); } /** * Register control types */ public function register_control_types() { global $wp_customize; $wp_customize->register_control_type( 'Kirki_Controls_Checkbox_Control' ); $wp_customize->register_control_type( 'Kirki_Controls_Code_Control' ); $wp_customize->register_control_type( 'Kirki_Controls_Color_Alpha_Control' ); $wp_customize->register_control_type( 'Kirki_Controls_Custom_Control' ); $wp_customize->register_control_type( 'Kirki_Controls_Dimension_Control' ); $wp_customize->register_control_type( 'Kirki_Controls_Number_Control' ); $wp_customize->register_control_type( 'Kirki_Controls_Radio_Control' ); $wp_customize->register_control_type( 'Kirki_Controls_Radio_Buttonset_Control' ); $wp_customize->register_control_type( 'Kirki_Controls_Radio_Image_Control' ); $wp_customize->register_control_type( 'Kirki_Controls_Select_Control' ); $wp_customize->register_control_type( 'Kirki_Controls_Slider_Control' ); $wp_customize->register_control_type( 'Kirki_Controls_Spacing_Control' ); $wp_customize->register_control_type( 'Kirki_Controls_Switch_Control' ); $wp_customize->register_control_type( 'Kirki_Controls_Textarea_Control' ); $wp_customize->register_control_type( 'Kirki_Controls_Toggle_Control' ); $wp_customize->register_control_type( 'Kirki_Controls_Typography_Control' ); $wp_customize->register_control_type( 'Kirki_Controls_Palette_Control' ); $wp_customize->register_control_type( 'Kirki_Controls_Preset_Control' ); $wp_customize->register_control_type( 'Kirki_Controls_Multicheck_Control' ); } /** * register our panels to the WordPress Customizer * @var object The WordPress Customizer object */ public function add_panels() { if ( ! empty( Kirki::$panels ) ) { foreach ( Kirki::$panels as $panel_args ) { new Kirki_Panel( $panel_args ); } } } /** * register our sections to the WordPress Customizer * @var object The WordPress Customizer object */ public function add_sections() { if ( ! empty( Kirki::$sections ) ) { foreach ( Kirki::$sections as $section_args ) { new Kirki_Section( $section_args ); } } } /** * Create the settings and controls from the $fields array and register them. * @var object The WordPress Customizer object */ public function add_fields() { foreach ( Kirki::$fields as $field ) { if ( isset( $field['type'] ) && 'background' == $field['type'] ) { continue; } if ( isset( $field['type'] ) && 'select2-multiple' == $field['type'] ) { $field['multiple'] = 999; } new Kirki_Field( $field ); } } /** * Build the variables. * * @return array ('variable-name' => value) */ public function get_variables() { $variables = array(); /** * Loop through all fields */ foreach ( Kirki::$fields as $field ) { /** * Check if we have variables for this field */ if ( isset( $field['variables'] ) && false != $field['variables'] && ! empty( $field['variables'] ) ) { /** * Loop through the array of variables */ foreach ( $field['variables'] as $field_variable ) { /** * Is the variable ['name'] defined? * If yes, then we can proceed. */ if ( isset( $field_variable['name'] ) ) { /** * Sanitize the variable name */ $variable_name = esc_attr( $field_variable['name'] ); /** * Do we have a callback function defined? * If not then set $variable_callback to false. */ $variable_callback = ( isset( $field_variable['callback'] ) && is_callable( $field_variable['callback'] ) ) ? $field_variable['callback'] : false; /** * If we have a variable_callback defined then get the value of the option * and run it through the callback function. * If no callback is defined (false) then just get the value. */ if ( $variable_callback ) { $variables[ $variable_name ] = call_user_func( $field_variable['callback'], Kirki::get_option( Kirki_Field_Sanitize::sanitize_settings( $field ) ) ); } else { $variables[ $variable_name ] = Kirki::get_option( $field['settings'] ); } } } } } /** * Pass the variables through a filter ('kirki/variable') * and return the array of variables */ return apply_filters( 'kirki/variable', $variables ); } public static function path() { } }
gpl-2.0
Siguana/square
wp-content/themes/jaf/flows.php
11348
<?php /* Template Name: Flows */ ?> <!DOCTYPE html> <html> <head> <!-- METAS --> <meta charset="<?php bloginfo( 'charset' );?>" > <!-- /METAS --> <title><?php /*With this code we add to Wordpress a tittle that changes according to the place where we are in the website. You may use also bloginfo('name') It shows in <title> tab the name of what you are seing about. This way is much more friendly for browsers because it shows the information if every place you are.*/ global $page, $paged; wp_title( '|', true, 'right' ); //It adds the name of the website. bloginfo( 'name' ); //It adds the name of the website in the main page. $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) echo " | $site_description"; //If it is necessary, it adds the page number. if ( $paged >= 2 || $page >= 2 ) echo ' | ' . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) ); ?> </title> <!-- CSS --> <link href='<?php bloginfo( 'stylesheet_url' ); ?>' rel="stylesheet"> <!-- /CSS --> <!-- RSS & PINGBACKS --> <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"> <link rel="alternate" type="application/rss+xml" title="<?php bloginfo( 'name' ); ?>" href="<?php bloginfo( 'rss2_url' ); ?>"> <link href='http://fonts.googleapis.com/css?family=Oswald:400,300,700' rel='stylesheet' type='text/css'> <!-- /RSS & PINGBACKS --> <!--Scripts--> <script type="text/javascript" src="<?php bloginfo('template_directory');?>/jquery-1.2.6.min.js"></script> <!--/Scripts--> <?php /* Para compatibilizar HTML5 con navegadores antiguos */ ?> <!--[if IE]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <script type="text/javascript"> function getLanguage(){ var strLink = document.location.href; var strLanguage = ''; if(strLink.indexOf('?lang=en')>0){ strLanguage = 'en_gb'; } return strLanguage; } $(document).ready(function(){ var strLanguage = getLanguage() + '/'; $(".top_btn").hover(function(){ var index = $(this).index(".top_btn"); if(index == 0){ $(this).find("img").attr("src", "pic/top/" + strLanguage + "02_1.png"); }else if(index == 1){ $(this).find("img").attr("src", "pic/top/" + strLanguage + "03_1.png"); }else if(index == 2){ $(this).find("img").attr("src", "pic/top/" + strLanguage + "04_1.png"); }else if(index == 3){ $(this).find("img").attr("src", "pic/top/" + strLanguage + "05_1.png"); }else if(index == 4){ $(this).find("img").attr("src", "pic/top/" + strLanguage + "06_1.png"); }else if(index == 5){ $(this).find("img").attr("src", "pic/top/" + strLanguage + "07_1.png"); } }, function(){ var index = $(this).index(".top_btn"); if(index == 0){ $(this).find("img").attr("src", "pic/top/" + strLanguage + "02_0.png"); }else if(index == 1){ $(this).find("img").attr("src", "pic/top/" + strLanguage + "03_0.png"); }else if(index == 2){ $(this).find("img").attr("src", "pic/top/" + strLanguage + "04_0.png"); }else if(index == 3){ $(this).find("img").attr("src", "pic/top/" + strLanguage + "05_0.png"); }else if(index == 4){ $(this).find("img").attr("src", "pic/top/" + strLanguage + "06_0.png"); }else if(index == 5){ $(this).find("img").attr("src", "pic/top/" + strLanguage + "07_0.png"); } }); }); function slideSwitch() { var $active = $('#slideshow IMG.active'); if ( $active.length == 0 ) $active = $('#slideshow IMG:last'); // use this to pull the images in the order they appear in the markup var $next = $active.next().length ? $active.next() : $('#slideshow IMG:first'); // uncomment the 3 lines below to pull the images in random order // var $sibs = $active.siblings(); // var rndNum = Math.floor(Math.random() * $sibs.length ); // var $next = $( $sibs[ rndNum ] ); $active.addClass('last-active'); $next.css({opacity: 0.0}) .addClass('active') .animate({opacity: 1.0}, 1000, function() { $active.removeClass('active last-active'); }); } $(function() { setInterval( "slideSwitch()", 5000 ); }); </script> <?php wp_head(); ?> <meta charset="UTF-8"> <title>外国人向けアパート、マンションを運営している不動産会社の紹介/外国人, ハウス, アパート : J&amp;F NETWORKS</title> <meta name="Keywords" content="お部屋探し, アパート, 不動産会社, 外国人, 外人, マンション, ルームシェア,ルームメイト,シェアメイト,東京"> <meta name="Description" content="アパート、マンションを探している外国人のための不動産会社検索サイト。"> <meta name="robots" content="all"> <meta name="language" content="japanese"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Script-Type" content="text/javascript"> <meta http-equiv="Content-Style-Type" content="text/css"> <meta name="google-site-verification" content="dS3bRyHN1N3BES6rZ0lDFHDk2lkkhQlxLhk9ZwzHeAs"> <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script> <link rel="stylesheet" href="style.css" media="screen"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script type="text/javascript" src="js/javascript.js"></script> </head> <body topmargin="0" <?php body_class(); ?>> <div id="wrapper"> <div id="header"> <!--<?php do_action('icl_language_selector'); ?> <img id="imgLanguages" src="<?php bloginfo('template_directory');?>/pic/flags/imgLanguages.jpg" alt="Languages" style="float: right;">--> <div style="float:right;"> <?php echo qtrans_generateLanguageSelectCode('image'); ?> <?php //if (function_exists('dynamic_sidebar')) dynamic_sidebar('translator'); ?> </div> <div style="float:right;"> <br/><img id="imgLanguages" src="<?php bloginfo('template_directory');?>/pic/flags/imgLanguages.jpg" alt="Languages" style="float: right;"> </div> </div> <div id="btn"> <?php //I get the language and the translations file if ($HTTP_GET_VARS["lang"]=="en"){$strLanguage = "en_gb/";} else if ($HTTP_GET_VARS["lang"]=="zh"){$strLanguage = "zh_cn/";} else if ($HTTP_GET_VARS["lang"]=="tw"){$strLanguage = "zh_tw/";} $strLang = substr($strLanguage, 0, 5); if ($strLang == ""){$strLang = "ja_jp";} $strPathLang = "&lang=".$HTTP_GET_VARS["lang"]; if ($strPathLang == "&lang="){$strPathLang = "";} include_once "translations/{$strLang}.php"; ?> <a href="http://jafplaza.com" class="top_btn"><img src="<?php bloginfo('template_directory');?>/pic/top/logo.png" alt="トップページ"><img src="<?php echo(bloginfo('template_directory').'/pic/top/'.$strLanguage.'01_0.png');?>" alt="J&F Plaza"></a> <a href="http://jafnet.co.jp/wordpress/?page_id=32<?php echo $strPathLang;?>" class="top_btn"><img src="<?php echo(bloginfo('template_directory').'/pic/top/'.$strLanguage.'02_0.png');?>" alt="マンション"></a> <a href="http://jafnet.co.jp/wordpress/?page_id=177<?php echo $strPathLang;?>" class="top_btn"><img src="<?php echo(bloginfo('template_directory').'/pic/top/'.$strLanguage.'03_0.png');?>" alt="戸建て"></a> <a href="http://jafnet.co.jp/wordpress/?page_id=186<?php echo $strPathLang;?>" class="top_btn"><img src="<?php echo(bloginfo('template_directory').'/pic/top/'.$strLanguage.'04_0.png');?>" alt="ビル"></a> <a href="http://jafnet.co.jp/wordpress/?page_id=195<?php echo $strPathLang;?>" class="top_btn"><img src="<?php echo(bloginfo('template_directory').'/pic/top/'.$strLanguage.'05_0.png');?>" alt="土地"></a> <img src="<?php echo(bloginfo('template_directory').'/pic/top/'.$strLanguage.'06_0.png');?>" alt="購入の流れ"> <a href="http://jafnet.co.jp/wordpress/?page_id=210<?php echo $strPathLang;?>" class="top_btn"><img src="<?php echo(bloginfo('template_directory').'/pic/top/'.$strLanguage.'07_0.png');?>" alt="会社概要"></a> </div> <div id="slideshow"> <img src="<?php bloginfo('template_directory');?>/ad01.png" alt="J&F Plaza" class="active"> <img src="<?php bloginfo('template_directory');?>/ad02.png" alt="J&F Plaza"> <img src="<?php bloginfo('template_directory');?>/ad03.png" alt="J&F Plaza"> </div> <div id="container" style="height: 220px;"> <input id="tab-1" type="radio" name="tab-group" checked="checked"> <label for="tab-1" style="width: 256px; text-align: left;">&nbsp;&nbsp;<?php echo BENEFITS_REAL_STATE; ?></label> <hr class="blue_bar"> <div id="content" style="background-color: transparent;"> <div id="content-1"> <ol> <li>所有権が取得できる</li> <li>家賃の相場が安定している為、投資に向いている</li> <p>一旦入居者が入れば、入居後に部屋の賃料が大きく変動する事は殆ど無いない。その為、長期にわたり、安定的に収益を上げることができる。 但し、人気の無いエリアは人が借りない為、物件の所在地は物件を選ぶ重要な要素となる。</p> <li>不動産の市場が成熟している</li> <p>賃貸、売買などに関する法律が整備されている為、安心して取引が出来る。また、自己使用の為に購入した場合も、本国へ帰るとき、賃貸として貸し出す事が可能。その場合の管理会社の数も充実している。</p> <li>円安</li> <p>急激な円安により、多くの外国人が日本の不動産を購入し始めている。その為、現時点でも良い不動産は競争率が高く、次々に売れている。</p> </ol> </div> </div> </div> <div id="container_flows"> <input id="tab-1-flows" type="radio" name="tab-group-flows" checked="checked"> <label for="tab-1-flows" style="width: 256px; text-align: left;">&nbsp;&nbsp;<?php echo HOW_TO_PURCHASE; ?></label> <hr class="blue_bar"> <div id="content-flows" style="background-color: transparent;"> <div id="content-1-flows"> <?php switch ($strLang){ case "ja_jp": $strFlows = "flows_j"; break; case "en_gb": $strFlows = "flows_e"; break; } ?> <img alt="J&F Plaza" src="<?php bloginfo('template_directory');?>/pic/content/<?php echo $strFlows; ?>.png"> </div> </div> </div> <div id="footer-container" class="footer-container"> <div id="footer-main" class="footer-main"> <img style="float: left;" alt="J&F Plaza" src="<?php bloginfo('template_directory');?>/pic/footer/footerlogo.png" width="220" height="50" > <p>〒150-0043 <?php echo ADDRESS ?> <img alt="J&F Plaza" src="<?php bloginfo('template_directory');?>/pic/footer/maps_logo.png"></p><p>TEL: (+81) 03-6455-0360 FAX: (+81) 03-6455-0360</p><p>Copyright (C) 2001 J&F Plaza Co., Ltd. All Rights Reserved.</p> </div> </div> </div> </body> </html>
gpl-2.0
naoyawada/Concurrent
wp-content/themes/Total/js/global.js
29832
( function( $ ) { "use strict"; // VARS var $window = $( window ), $windowsize = $window.width(), $isMobile = false, $isRTL = wpexLocalize.isRTL, $isOriginLeft = true, $stickyOnMobile = wpexLocalize.stickyOnMobile, $mobileMenuStyle = wpexLocalize.mobileMenuStyle; // Set $isMobile var to true if is-mobile class exists in body tag if ( $( 'body' ).hasClass( 'is-mobile' ) ) { $isMobile = true; } // RTL vars if ( $isRTL ) { var $isOriginLeft = false; } /* --------------------------------*/ /* - Doc Ready /* -------------------------------*/ $( document ).ready( function() { // If menu item has classname "nav-no-click" then return false $( 'li.nav-no-click > a' ).click( function() { return false; } ); // Main superfish menu without supersubs $( 'ul.sf-menu' ).superfish( { delay: 100, animation : { opacity : 'show', }, speed : 'fast', speedOut : 'fast', cssArrows : false, disableHI : false } ); // Search - overlay modal $( "a.search-overlay-toggle" ).leanerModal( { id : '#searchform-overlay', top : 100, overlay : 0.8 } ); $( "a.search-overlay-toggle" ).click( function() { $( '#site-searchform input' ).focus(); } ); // Search - dropdown $( "a.search-dropdown-toggle" ).click( function( event ) { $( 'div#current-shop-items-dropdown' ).hide(); $( "li.wcmenucart-toggle-dropdown" ).removeClass( 'current-menu-item' ); $( '#searchform-dropdown' ).fadeToggle( 'fast' ); $( '#searchform-dropdown input' ).focus(); $( this ).parent( 'li' ).toggleClass( 'current-menu-item' ); return false; } ); // Search - header replace $( "a.search-header-replace-toggle" ).click( function( event ) { $( '#searchform-header-replace' ).fadeToggle( 'fast' ); $( '#searchform-header-replace input' ).focus(); return false; } ); $( '#searchform-header-replace-close' ).click( function() { $( '#searchform-header-replace' ).fadeOut( 'fast' ); return false; } ); // Close searchforms $( '#searchform-dropdown, #searchform-header-replace, #toggle-bar-wrap' ).click( function( event ) { event.stopPropagation(); } ); $( document ).click( function() { $( '#searchform-dropdown, #searchform-header-replace' ).fadeOut( 'fast' ); $( 'a.search-dropdown-toggle' ).parent( 'li' ).removeClass( 'current-menu-item' ); $( '#toggle-bar-wrap' ).removeClass( 'active-bar' ); $( 'a.toggle-bar-btn.fade-toggle' ).children( '.fa' ).removeClass( 'fa-minus' ).addClass( 'fa-plus' ); } ); // Sidebar menu toggle var submenuParent = $( "div#main .widget_nav_menu ul.sub-menu" ).parent( 'li' ); if ( submenuParent.length ) { submenuParent.addClass( 'parent' ); $( '.parent > a' ).click( function() { $( this ).parent( 'li' ).children( '.sub-menu' ).stop(true,true).slideToggle( 'fast' ); $( this ).parent( 'li' ).toggleClass( 'active' ); return false; } ); } if ( ! $( 'a.wcmenucart' ).hasClass( 'go-to-shop' ) ) { // Woo Cart - Modal $( "li.wcmenucart-toggle-overlay" ).leanerModal( { id : '#current-shop-items-overlay', top : 100, overlay : 0.8 } ); // Woo Car - Drop-down $( "li.wcmenucart-toggle-dropdown" ).click( function( event ) { $( '#searchform-dropdown' ).hide(); $( 'a.search-dropdown-toggle' ).parent( 'li' ).removeClass( 'current-menu-item' ); $( 'div#current-shop-items-dropdown' ).fadeToggle( 'fast' ); $( this ).toggleClass( 'current-menu-item' ); return false; } ); $( 'div#current-shop-items-dropdown' ).click( function( event ) { event.stopPropagation(); } ); $( document ).click( function() { $( 'div#current-shop-items-dropdown' ).fadeOut( 'fast' ); $( "li.wcmenucart-toggle-dropdown" ).removeClass( 'current-menu-item' ); } ); } // Mobile Menu - Sidr if ( $mobileMenuStyle == 'sidr' ) { if ( typeof wpexLocalize.sidrSource != 'undefined' ) { $( 'a.mobile-menu-toggle' ).sidr( { name: 'sidr-main', source: wpexLocalize.sidrSource, side: wpexLocalize.sidrSide, renaming: true, displace: false } ); } // Mobile menu subitem toggle $( '.sidr-class-menu-item-has-children' ).each( function( index ) { $( this ).append( '<span class="sidr-class-dropdown-toggle"><i class="fa fa-chevron-right"></i></span>' ); } ); $( '.sidr-class-dropdown-toggle' ).on( $isMobile ? 'touchstart' : 'click', function( event ) { var nextList = $( this ).prev( 'ul' ), html = nextList.is( ':visible' ) ? '<i class="fa fa-chevron-right"></i>' : '<i class="fa fa-chevron-down"></i>'; $( this ).html(html); nextList.toggle(); $( this ).toggleClass( 'active' ); return false; } ); // Close sidr on click $( 'a.sidr-class-toggle-sidr-close' ).click( function() { $.sidr( 'close', 'sidr-main' ); return false; } ); } // Mobile Menu - Toggle else if ( $mobileMenuStyle == 'toggle' ) { $( '#site-header' ).append( '<nav class="mobile-toggle-nav clr"></nav>' ); // Grab all content from menu and add into mobile-toggle-nav element if ( $( '#mobile-menu-alternative' ).length ) { var mobileMenuContents = $( '#mobile-menu-alternative .dropdown-menu' ).html(); } else { var mobileMenuContents = $( '#site-navigation .dropdown-menu' ).html(); } $( '.mobile-toggle-nav' ).html( '<ul class="mobile-toggle-nav-ul">' + mobileMenuContents + '</ul>' ); // Remove all classes inside prepended nav $( '.mobile-toggle-nav-ul, .mobile-toggle-nav-ul *' ).children().each( function() { var attributes = this.attributes; $( this ).removeAttr("style"); } ); // Add classes where needed $( '.mobile-toggle-nav-ul' ).addClass( 'container' ); // Main toggle $( '.mobile-menu-toggle' ).on( $isMobile ? 'touchstart' : 'click', function( event ) { $( '.mobile-toggle-nav' ).toggle(); return false; } ); /* Add search $( '.mobile-toggle-nav' ).append($( '#mobile-menu-search' )); */ } // Back to top scroll var $scrollTopLink = $( 'a#site-scroll-top' ); $window.scroll(function() { if ($( this ).scrollTop() > 100) { $scrollTopLink.fadeIn(); } else { $scrollTopLink.fadeOut(); } } ); $scrollTopLink.on( 'click', function() { $( 'html, body' ).animate( {scrollTop:0}, 400); return false; } ); // Comment scroll $( '.single li.comment-scroll a' ).click( function( event ) { event.preventDefault(); $( 'html, body' ).animate( { scrollTop: $( this.hash ).offset().top -180 }, 'normal' ); } ); // Carousels $( '.wpex-carousel' ).each( function() { var $carousel = $( this ); $carousel.owlCarousel( { dots : false, items : $carousel.data( "items" ), slideBy : $carousel.data( "slideby" ), center : $carousel.data( "center" ), loop : $carousel.data( "loop" ), margin : $carousel.data( "margin" ), nav : $carousel.data( "nav" ), autoplay : $carousel.data( "autoplay" ), autoplayTimeout : $carousel.data( "autoplay-timeout" ), navText : [ '<span class="fa fa-chevron-left"><span>', '<span class="fa fa-chevron-right"></span>' ], responsive : { 0: { items : $carousel.data( "items-mobile-portrait" ) }, 480: { items : $carousel.data( "items-mobile-landscape" ) }, 768: { items : $carousel.data( "items-tablet" ) }, 960: { items : $carousel.data( "items" ) } } } ); } ); // Tipsy $( 'a.tooltip-left' ).tipsy( { fade : true, gravity : 'e' } ); $( 'a.tooltip-right' ).tipsy( { fade : true, gravity : 'w' } ); $( 'a.tooltip-up' ).tipsy( { fade : true, gravity : 's' } ); $( 'a.tooltip-down' ).tipsy( { fade : true, gravity : 'n' } ); // Custom Selects $( '.woocommerce-ordering .orderby, #dropdown_product_cat, .widget_categories select, .widget_archive select, #bbp_stick_topic_select, #bbp_topic_status_select, #bbp_destination_topic' ).customSelect( { customClass: "theme-select" } ); // Sociallight sharing buttons if ( $( '.social-share-buttons.style-counter' ).width() ) { Socialite.load(); } // Toggle bar $( 'a.toggle-bar-btn.fade-toggle' ).on( $isMobile ? 'touchstart' : 'click', function( event ) { $( this ).find( '.fa' ).toggleClass( 'fa-plus fa-minus' ); $( '#toggle-bar-wrap' ).toggleClass( 'active-bar' ); return false; } ); // Local Scroll - Menu $( 'li.local-scroll > a, li.sidr-class-local-scroll > a' ).click( function() { var target = $(this.hash); if ( $( 'body' ).hasClass( 'shrink-fixed-header' ) ) { var topOffset = '60'; } else if ( $( '#site-header' ).hasClass( 'fixed-scroll' ) ) { var topOffset = $( '#site-header' ).outerHeight(); } else { var topOffset = ''; } if ($( target ).length) { $( '.main-navigation li' ).removeClass( 'current-menu-item' ); $( this ).parent( 'li' ).addClass( 'current-menu-item' ); $( 'html,body' ).stop(true,true).animate( { scrollTop: target.offset().top - topOffset }, 1000); } $.sidr( 'close', 'sidr-main' ); return false; } ); // Local Scroll Anylink $( '.local-scroll-link' ).click( function() { var target = $(this.hash); if ( $( 'body' ).hasClass( 'shrink-fixed-header' ) ) { var topOffset = '60'; } else if ( $( '#site-header' ).hasClass( 'fixed-scroll' ) ) { var topOffset = $( '#site-header' ).outerHeight(); } else { var topOffset = ''; } if ( $( target ).length ) { $( 'html,body' ).stop( true, true ).animate( { scrollTop: target.offset().top - topOffset }, 1000 ); } return false; } ); // LocalScroll Woocommerce Reviews $( 'body.single div.entry-summary a.woocommerce-review-link' ).click( function() { var target = $(this.hash); if ( $( 'body' ).hasClass( 'shrink-fixed-header' ) ) { var topOffset = '60'; } else if ( $( '#site-header' ).hasClass( 'fixed-scroll' ) ) { var topOffset = $( '#site-header' ).outerHeight(); } else { var topOffset = ''; } if ( $( target ).length ) { $( 'html,body' ).stop( true, true ).animate( { scrollTop: target.offset().top - topOffset - 30 }, 800 ); } return false; } ); // Skillbar $( '.vcex-skillbar' ).each( function() { $( this ).find( '.vcex-skillbar-bar' ).animate( { width: $( this ).attr( 'data-percent' ) }, 800 ); } ); // Milestone $( '.vcex-animated-milestone' ).each( function() { $( this ).appear( function() { $( this ).find( '.vcex-milestone-time' ).countTo(); }, { accX : 0, accY : 0 } ); } ); // Custom hovers using data attributes $( '.wpex-data-hover' ).each( function() { // Get data var $this = $( this ), $originalBg = $( this ).css( 'backgroundColor' ), $originalColor = $( this ).css( 'color' ), $hoverBg = $( this ).attr( 'data-hover-background' ), $hoverColor = $( this ).attr( 'data-hover-color' ); // Hover $this.hover( function () { if ( $hoverBg ) { $this.css( 'background-color', $hoverBg ); } if ( $hoverColor ) { $this.css( 'color', $hoverColor ); } }, function () { if ( $hoverBg && $originalBg ) { $this.css( 'background-color', $originalBg ); } if ( $hoverColor && $originalColor ) { $this.css( 'color', $originalColor ); } } ); } ); // Lightbox Vars if ( wpexLocalize.lightboxArrows === '1' ) { wpexLocalize.lightboxArrows = true; } else { wpexLocalize.lightboxArrows = false; } if ( wpexLocalize.lightboxThumbnails === '1' ) { wpexLocalize.lightboxThumbnails = true; } else { wpexLocalize.lightboxThumbnails = false; } if ( wpexLocalize.lightboxFullScreen === '1' ) { wpexLocalize.lightboxFullScreen = true; } else { wpexLocalize.lightboxFullScreen = false; } if ( wpexLocalize.lightboxMouseWheel === '1' ) { wpexLocalize.lightboxMouseWheel = true; } else { wpexLocalize.lightboxMouseWheel = false; } if ( wpexLocalize.lightboxTitles === '1' ) { wpexLocalize.lightboxTitles = true; } else { wpexLocalize.lightboxTitles = false; } // Lightbox Standard $( '.wpex-lightbox, .wpb_single_image.image-lightbox a' ).each( function() { $( this ).iLightBox( { skin : wpexLocalize.lightboxSkin, controls : { fullscreen : wpexLocalize.lightboxFullScreen } } ); } ); // Lightbox Videos $( '.wpex-lightbox-video, .wpb_single_image.video-lightbox a, .wpex-lightbox-autodetect, .wpex-lightbox-autodetect a' ).iLightBox( { skin : wpexLocalize.LightboxSkin, path : 'horizontal', show : { title : wpexLocalize.lightboxTitles }, controls : { fullscreen : wpexLocalize.lightboxFullScreen, mousewheel : wpexLocalize.lightboxMouseWheel }, smartRecognition : true } ); // Lightbox Galleries - LEGACY $( '.wpex-gallery-lightbox' ).each( function() { $( this ).find( 'a' ).iLightBox( { skin : wpexLocalize.lightboxSkin, path : 'horizontal', show : { title : wpexLocalize.lightboxTitles }, controls : { arrows : wpexLocalize.lightboxArrows, thumbnail : wpexLocalize.lightboxThumbnails, fullscreen : wpexLocalize.lightboxFullScreen, mousewheel : wpexLocalize.lightboxMouseWheel } } ); } ); // Lightbox Galleries - NEW since 1.6.0 $( '.lightbox-group' ).each( function() { $( this ).find( 'a.lightbox-group-item' ).iLightBox( { skin : wpexLocalize.lightboxSkin, path : 'horizontal', show : { title : wpexLocalize.lightboxTitles }, controls : { arrows : wpexLocalize.lightboxArrows, thumbnail : wpexLocalize.lightboxThumbnails, fullscreen : wpexLocalize.lightboxFullScreen, mousewheel : wpexLocalize.lightboxMouseWheel } } ); } ); // Lightbox Gallery with custom imgs $( '.wpex-lightbox-gallery' ).on( $isMobile ? 'touchstart' : 'click', function( event ) { event.preventDefault(); var imagesArray = $( this ).data( 'gallery' ).split( ',' ); if ( imagesArray ) { $.iLightBox( imagesArray, { skin : wpexLocalize.lightboxSkin, path : 'horizontal', show : { title: wpexLocalize.lightboxTitles }, controls : { arrows : wpexLocalize.lightboxArrows, thumbnail : wpexLocalize.lightboxThumbnails, fullscreen : wpexLocalize.lightboxFullScreen, mousewheel : wpexLocalize.lightboxMouseWheel } } ); } } ); // FlexSliders $( '.vcex-flexslider, .vcex-galleryslider' ).each( function() { var $slider = $( this ), slideshow = $slider.data( 'slideshow' ), animation = $slider.data( 'animation' ), randomize = $slider.data( 'randomize' ), direction = $slider.data( 'direction' ), slideshowSpeed = $slider.data( 'slideshow-speed' ), animationSpeed = $slider.data( 'animation-speed' ), directionNav = $slider.data( 'direction-nav' ), pauseOnHover = $slider.data( 'pause' ), smoothHeight = $slider.data( 'smooth-height' ), controlNav = $slider.data( 'control-nav' ); $slider.imagesLoaded( function() { $slider.flexslider( { slideshow : slideshow, animation : animation, randomize : randomize, direction : direction, slideshowSpeed : slideshowSpeed, animationSpeed : animationSpeed, directionNav : directionNav, pauseOnHover : pauseOnHover, smoothHeight : smoothHeight, controlNav : controlNav, prevText : '<i class=fa fa-chevron-left"></i>', nextText : '<i class="fa fa-chevron-right"></i>', useCSS : false } ); } ); } ); // Gallery slider $( '.gallery-format-post-slider' ).each( function() { var $slider = $( this ); $slider.imagesLoaded( function() { $slider.flexslider( { animation : 'fade', animationSpeed : 500, slideshow : true, smoothHeight : false, directionNav : true, controlNav : 'thumbnails', prevText : '<span class="fa fa-chevron-left"></span>', nextText : '<span class="fa fa-chevron-right"></span>', useCSS : false } ); } ); } ); // Woo Entry slider var $singleProductSlider = $( 'body.single-product div.woocommerce-single-product-slider' ); $singleProductSlider.imagesLoaded( function() { $singleProductSlider.flexslider( { animation : 'fade', animationSpeed : 500, slideshow : false, smoothHeight : true, directionNav : false, controlNav : 'thumbnails', controlsContainer : '.woocommerce-single-product-slider-wrap', useCSS : false } ); } ); // Woo Entry slider $( ".woo-product-entry-slider" ).each( function() { var $this = $( this ); $this.imagesLoaded( function() { $this.flexslider( { animation : 'fade', slideshow : false, randomize : false, controlNav : true, directionNav : false, smoothHeight : true, prevText : '<span class="fa fa-chevron-left"></span>', nextText : '<span class="fa fa-chevron-right"></span>', useCSS : false, start : function(slider) { $this.click( function( event ){ event.preventDefault(); slider.flexAnimate(slider.getTarget( "next" ) ); } ); } } ); } ); } ); /* --------------------------------*/ /* - Run Functions /* -------------------------------*/ // Isotope grid wpexIsotopeGrid(); // Archive grids wpexArchiveGrids(); // Run or re-run functions on resize and orientation change var isIE8 = $.browser.msie && +$.browser.version === 8; if ( isIE8 ) { document.body.onresize = function() { wpexIsotopeGrid(); wpexArchiveGrids(); }; } else { $( window ).resize( function() { wpexIsotopeGrid(); wpexArchiveGrids(); } ); window.addEventListener( 'orientationchange', function() { wpexIsotopeGrid(); wpexArchiveGrids(); } ); } /* --------------------------------*/ /* - On Images Loaded - All images in Wrap /* -------------------------------*/ $( '#wrap' ).imagesLoaded( function() { // FadeIn images $( '.fade-in-image' ).addClass( 'no-opacity' ); // Advanced Parallax $( 'div.vcex-parallax-div' ).each( function() { $( this ).scrolly2().trigger( 'scroll' ); } ); // Equal Height columns $( '.equal-height-column, .blog-grid div.blog-entry-inner, .match-height-row .match-height-content, .match-height-feature-row .match-height-feature' ).matchHeight(); // Simple Parallax if ( ! $( 'body' ).hasClass( '.is_mobile' ) ) { $( '.style-parallax, .row-with-parallax .vcex-background-parallax' ).each( function() { var $bgobj = $( this ); $( window ).scroll( function() { var yPos = -($window.scrollTop() / '8' ); var coords = '50% '+ yPos + 'px'; $bgobj.css( { backgroundPosition: coords } ); } ); } ); } } ); // End Images Loaded } ); // End doc ready /* --------------------------------*/ /* - Window Load /* -------------------------------*/ $window.load( function() { // Fixed header/nav if ( $stickyOnMobile ) { wpexStickyHeader(); } else if ( $windowsize >= 960 ) { wpexStickyHeader(); } // Sticky function wpexStickyHeader() { $( "#site-header.fixed-scroll" ).sticky( { topSpacing : 0, getWidthFrom : '#wrap', responsiveWidth : true } ); $( ".fixed-nav" ).sticky( { topSpacing : 0, getWidthFrom : '#wrap', responsiveWidth : true } ); } // Scroll to hash function wpexScrollToHash() { var $hash = location.hash; if ( $hash.indexOf( 'localscroll-' ) != -1 ) { var target = $hash.replace( 'localscroll-','' ); if ( $( target ).length ) { if ( $( 'body' ).hasClass( 'shrink-fixed-header' ) ) { var topOffset = '60'; } else if ( $( '#site-header' ).hasClass( 'fixed-scroll' ) ) { var topOffset = $( '#site-header' ).outerHeight(); } else { var topOffset = ''; } $( 'html,body' ).animate( { scrollTop: $( target ).offset().top - topOffset }, 1000); } } } window.setTimeout(wpexScrollToHash, 500); $( window ).on( 'hashchange', wpexScrollToHash); // Footer reveal if ( $( 'body' ).hasClass( 'footer-has-reveal' ) ) { $( 'body.footer-has-reveal #main' ).css( { 'margin-bottom': $( '.footer-reveal' ).outerHeight() } ); } } ); // End on window load /* --------------------------------*/ /* - Define Functions /* -------------------------------*/ // Isotope Containers function wpexIsotopeGrid() { $( '.vcex-isotope-grid' ).each( function() { // Get data var $container = $( this ), $transitionDuration = $container.data( 'transition-duration' ), $layoutMode = $container.data( 'layout-mode' ); if ( ! $transitionDuration ) { $transitionDuration = '0.4' } if ( ! $layoutMode ) { $layoutMode = 'masonry' } // Initialize isotope $container.imagesLoaded( function() { $container.isotope( { itemSelector : '.vcex-isotope-entry', transformsEnabled : true, isOriginLeft : $isOriginLeft, transitionDuration : $transitionDuration + 's', layoutMode : $layoutMode } ); // Isotope filter links var $filter = $container.prev( 'ul.vcex-filter-links' ); if ( $filter.length ) { var $filterLinks = $filter.find( 'a' ); $filterLinks.each( function() { var $filterableDiv = $( this ).data( 'filter' ); if ( $filterableDiv !== '*' && ! $container.find($filterableDiv).length ) { $( this ).parent().hide( '100' ); } } ); $filterLinks.css( { opacity: 1 } ); $filterLinks.click( function() { var selector = $( this ).attr( 'data-filter' ); $container.isotope( { filter: selector } ); $( this ).parents( 'ul' ).find( 'li' ).removeClass( 'active' ); $( this ).parent( 'li' ).addClass( 'active' ); return false; } ); } } ); } ); } // Masonry Grids function wpexArchiveGrids() { var $container = $( '.blog-masonry-grid,div.wpex-row.portfolio-masonry,div.wpex-row.portfolio-no-margins,div.wpex-row.staff-masonry,div.wpex-row.staff-no-margins' ); $container.imagesLoaded( function() { $container.isotope( { itemSelector : '.isotope-entry', transformsEnabled : true, isOriginLeft : $isOriginLeft, transitionDuration : 0 } ); } ); } } )( jQuery );
gpl-2.0
emundus/v6
media/com_hikashop/mail/wishlist_share.preview.php
1432
<?php /** * @package HikaShop for Joomla! * @version 4.4.0 * @author hikashop.com * @copyright (C) 2010-2020 HIKARI SOFTWARE. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ defined('_JEXEC') or die('Restricted access'); ?><?php class wishlist_sharePreviewMaker { public $displaySubmitButton = true; public function prepareMail($data = null) { if(empty($data)) return $this->getDefaultData(); $wishlistClass = hikashop_get('class.cart'); $mail = $wishlistClass->loadNotification($data['cart']['cart_id'], 'wishlist_share'); return $mail; } public function getDefaultData() { } public function getSelector($data) { $nameboxType = hikashop_get('type.namebox'); $html = $nameboxType->display( 'data[cart][cart_id]', (int)@$data['cart']['cart_id'], hikashopNameboxType::NAMEBOX_SINGLE, 'cart', array( 'delete' => false, 'default_text' => '<em>'.JText::_('HIKA_NONE').'</em>', 'returnOnEmpty' => false, 'type' => 'wishlist', 'url_params' => array( 'TYPE' => 'wishlist', ), ) ); if(!$html){ hikashop_display(JText::_('PLEASE_FIRST_CREATE_A_WISHLIST'), 'info'); return; } if(empty($data)) { echo hikashop_display(Jtext::_('PLEASE_SELECT_A_WISHLIST_FOR_THE_PREVIEW')); } ?> <dl class="hika_options"> <dt> <?php echo JText::_('WISHLIST'); ?> </dt> <dd> <?php echo $html; ?> </dd> </dl> <?php } }
gpl-2.0
Drethek/Darkpeninsula-Wotlk
src/server/shared/Logging/Log.cpp
26921
/* * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * 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 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "Common.h" #include "Log.h" #include "Configuration/Config.h" #include "Util.h" #include "Implementation/LoginDatabase.h" // For logging extern LoginDatabaseWorkerPool LoginDatabase; #include <stdarg.h> #include <stdio.h> Log::Log() : raLogfile(NULL), logfile(NULL), gmLogfile(NULL), charLogfile(NULL), wardenLogFile(NULL), dberLogfile(NULL), chatLogfile(NULL), arenaLogFile(NULL), sqlLogFile(NULL), sqlDevLogFile(NULL), m_gmlog_per_account(false), m_enableLogDBLater(false), m_enableLogDB(false), m_colored(false) { Initialize(); } Log::~Log() { if ( logfile != NULL ) fclose(logfile); logfile = NULL; if ( gmLogfile != NULL ) fclose(gmLogfile); gmLogfile = NULL; if (charLogfile != NULL) fclose(charLogfile); charLogfile = NULL; if ( dberLogfile != NULL ) fclose(dberLogfile); dberLogfile = NULL; if (raLogfile != NULL) fclose(raLogfile); raLogfile = NULL; if (chatLogfile != NULL) fclose(chatLogfile); chatLogfile = NULL; if (arenaLogFile != NULL) fclose(arenaLogFile); arenaLogFile = NULL; if (sqlLogFile != NULL) fclose(sqlLogFile); sqlLogFile = NULL; if (sqlDevLogFile != NULL) fclose(sqlDevLogFile); sqlDevLogFile = NULL; } void Log::SetLogLevel(char *Level) { int32 NewLevel =atoi((char*)Level); if ( NewLevel <0 ) NewLevel = 0; m_logLevel = NewLevel; outString( "LogLevel is %u", m_logLevel ); } void Log::SetLogFileLevel(char *Level) { int32 NewLevel =atoi((char*)Level); if ( NewLevel <0 ) NewLevel = 0; m_logFileLevel = NewLevel; outString( "LogFileLevel is %u", m_logFileLevel ); } void Log::SetDBLogLevel(char *Level) { int32 NewLevel = atoi((char*)Level); if ( NewLevel < 0 ) NewLevel = 0; m_dbLogLevel = NewLevel; outString( "DBLogLevel is %u", m_dbLogLevel ); } void Log::Initialize() { /// Check whether we'll log GM commands/RA events/character outputs/chat stuffs m_dbChar = ConfigMgr::GetBoolDefault("LogDB.Char", false); m_dbRA = ConfigMgr::GetBoolDefault("LogDB.RA", false); m_dbGM = ConfigMgr::GetBoolDefault("LogDB.GM", false); m_dbChat = ConfigMgr::GetBoolDefault("LogDB.Chat", false); /// Realm must be 0 by default SetRealmID(0); /// Common log files data m_logsDir = ConfigMgr::GetStringDefault("LogsDir", ""); if (!m_logsDir.empty()) if ((m_logsDir.at(m_logsDir.length() - 1) != '/') && (m_logsDir.at(m_logsDir.length() - 1) != '\\')) m_logsDir.push_back('/'); m_logsTimestamp = "_" + GetTimestampStr(); /// Open specific log files logfile = openLogFile("LogFile", "LogTimestamp", "w"); InitColors(ConfigMgr::GetStringDefault("LogColors", "")); m_gmlog_per_account = ConfigMgr::GetBoolDefault("GmLogPerAccount", false); if (!m_gmlog_per_account) gmLogfile = openLogFile("GMLogFile", "GmLogTimestamp", "a"); else { // GM log settings for per account case m_gmlog_filename_format = ConfigMgr::GetStringDefault("GMLogFile", ""); if (!m_gmlog_filename_format.empty()) { bool m_gmlog_timestamp = ConfigMgr::GetBoolDefault("GmLogTimestamp", false); size_t dot_pos = m_gmlog_filename_format.find_last_of("."); if (dot_pos!=m_gmlog_filename_format.npos) { if (m_gmlog_timestamp) m_gmlog_filename_format.insert(dot_pos, m_logsTimestamp); m_gmlog_filename_format.insert(dot_pos, "_#%u"); } else { m_gmlog_filename_format += "_#%u"; if (m_gmlog_timestamp) m_gmlog_filename_format += m_logsTimestamp; } m_gmlog_filename_format = m_logsDir + m_gmlog_filename_format; } } charLogfile = openLogFile("CharLogFile", "CharLogTimestamp", "a"); dberLogfile = openLogFile("DBErrorLogFile", NULL, "a"); raLogfile = openLogFile("RaLogFile", NULL, "a"); chatLogfile = openLogFile("ChatLogFile", "ChatLogTimestamp", "a"); arenaLogFile = openLogFile("ArenaLogFile", NULL, "a"); sqlLogFile = openLogFile("SQLDriverLogFile", NULL, "a"); sqlDevLogFile = openLogFile("SQLDeveloperLogFile", NULL, "a"); wardenLogFile = openLogFile("WardenLogFile",NULL,"a"); // Main log file settings m_logLevel = ConfigMgr::GetIntDefault("LogLevel", LOGL_NORMAL); m_logFileLevel = ConfigMgr::GetIntDefault("LogFileLevel", LOGL_NORMAL); m_dbLogLevel = ConfigMgr::GetIntDefault("DBLogLevel", LOGL_NORMAL); m_sqlDriverQueryLogging = ConfigMgr::GetBoolDefault("SQLDriverQueryLogging", false); m_DebugLogMask = DebugLogFilters(ConfigMgr::GetIntDefault("DebugLogMask", LOG_FILTER_NONE)); // Char log settings m_charLog_Dump = ConfigMgr::GetBoolDefault("CharLogDump", false); m_charLog_Dump_Separate = ConfigMgr::GetBoolDefault("CharLogDump.Separate", false); if (m_charLog_Dump_Separate) { m_dumpsDir = ConfigMgr::GetStringDefault("CharLogDump.SeparateDir", ""); if (!m_dumpsDir.empty()) if ((m_dumpsDir.at(m_dumpsDir.length() - 1) != '/') && (m_dumpsDir.at(m_dumpsDir.length() - 1) != '\\')) m_dumpsDir.push_back('/'); } } void Log::ReloadConfig() { m_logLevel = ConfigMgr::GetIntDefault("LogLevel", LOGL_NORMAL); m_logFileLevel = ConfigMgr::GetIntDefault("LogFileLevel", LOGL_NORMAL); m_dbLogLevel = ConfigMgr::GetIntDefault("DBLogLevel", LOGL_NORMAL); m_DebugLogMask = DebugLogFilters(ConfigMgr::GetIntDefault("DebugLogMask", LOG_FILTER_NONE)); } FILE* Log::openLogFile(char const* configFileName, char const* configTimeStampFlag, char const* mode) { std::string logfn=ConfigMgr::GetStringDefault(configFileName, ""); if (logfn.empty()) return NULL; if (configTimeStampFlag && ConfigMgr::GetBoolDefault(configTimeStampFlag, false)) { size_t dot_pos = logfn.find_last_of("."); if (dot_pos!=logfn.npos) logfn.insert(dot_pos, m_logsTimestamp); else logfn += m_logsTimestamp; } return fopen((m_logsDir+logfn).c_str(), mode); } FILE* Log::openGmlogPerAccount(uint32 account) { if (m_gmlog_filename_format.empty()) return NULL; char namebuf[TRINITY_PATH_MAX]; snprintf(namebuf, TRINITY_PATH_MAX, m_gmlog_filename_format.c_str(), account); return fopen(namebuf, "a"); } void Log::outTimestamp(FILE* file) { time_t t = time(NULL); tm* aTm = localtime(&t); // YYYY year // MM month (2 digits 01-12) // DD day (2 digits 01-31) // HH hour (2 digits 00-23) // MM minutes (2 digits 00-59) // SS seconds (2 digits 00-59) fprintf(file, "%-4d-%02d-%02d %02d:%02d:%02d ", aTm->tm_year+1900, aTm->tm_mon+1, aTm->tm_mday, aTm->tm_hour, aTm->tm_min, aTm->tm_sec); } void Log::InitColors(const std::string& str) { if (str.empty()) { m_colored = false; return; } int color[4]; std::istringstream ss(str); for (uint8 i = 0; i < LogLevels; ++i) { ss >> color[i]; if (!ss) return; if (color[i] < 0 || color[i] >= Colors) return; } for (uint8 i = 0; i < LogLevels; ++i) m_colors[i] = ColorTypes(color[i]); m_colored = true; } void Log::SetColor(bool stdout_stream, ColorTypes color) { #if PLATFORM == PLATFORM_WINDOWS static WORD WinColorFG[Colors] = { 0, // BLACK FOREGROUND_RED, // RED FOREGROUND_GREEN, // GREEN FOREGROUND_RED | FOREGROUND_GREEN, // BROWN FOREGROUND_BLUE, // BLUE FOREGROUND_RED | FOREGROUND_BLUE, // MAGENTA FOREGROUND_GREEN | FOREGROUND_BLUE, // CYAN FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE, // WHITE // YELLOW FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY, // RED_BOLD FOREGROUND_RED | FOREGROUND_INTENSITY, // GREEN_BOLD FOREGROUND_GREEN | FOREGROUND_INTENSITY, FOREGROUND_BLUE | FOREGROUND_INTENSITY, // BLUE_BOLD // MAGENTA_BOLD FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY, // CYAN_BOLD FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY, // WHITE_BOLD FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY }; HANDLE hConsole = GetStdHandle(stdout_stream ? STD_OUTPUT_HANDLE : STD_ERROR_HANDLE ); SetConsoleTextAttribute(hConsole, WinColorFG[color]); #else enum ANSITextAttr { TA_NORMAL=0, TA_BOLD=1, TA_BLINK=5, TA_REVERSE=7 }; enum ANSIFgTextAttr { FG_BLACK=30, FG_RED, FG_GREEN, FG_BROWN, FG_BLUE, FG_MAGENTA, FG_CYAN, FG_WHITE, FG_YELLOW }; enum ANSIBgTextAttr { BG_BLACK=40, BG_RED, BG_GREEN, BG_BROWN, BG_BLUE, BG_MAGENTA, BG_CYAN, BG_WHITE }; static uint8 UnixColorFG[Colors] = { FG_BLACK, // BLACK FG_RED, // RED FG_GREEN, // GREEN FG_BROWN, // BROWN FG_BLUE, // BLUE FG_MAGENTA, // MAGENTA FG_CYAN, // CYAN FG_WHITE, // WHITE FG_YELLOW, // YELLOW FG_RED, // LRED FG_GREEN, // LGREEN FG_BLUE, // LBLUE FG_MAGENTA, // LMAGENTA FG_CYAN, // LCYAN FG_WHITE // LWHITE }; fprintf((stdout_stream? stdout : stderr), "\x1b[%d%sm", UnixColorFG[color], (color >= YELLOW && color < Colors ? ";1" : "")); #endif } void Log::ResetColor(bool stdout_stream) { #if PLATFORM == PLATFORM_WINDOWS HANDLE hConsole = GetStdHandle(stdout_stream ? STD_OUTPUT_HANDLE : STD_ERROR_HANDLE ); SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED ); #else fprintf(( stdout_stream ? stdout : stderr ), "\x1b[0m"); #endif } std::string Log::GetTimestampStr() { time_t t = time(NULL); tm* aTm = localtime(&t); // YYYY year // MM month (2 digits 01-12) // DD day (2 digits 01-31) // HH hour (2 digits 00-23) // MM minutes (2 digits 00-59) // SS seconds (2 digits 00-59) char buf[20]; snprintf(buf, 20, "%04d-%02d-%02d_%02d-%02d-%02d", aTm->tm_year+1900, aTm->tm_mon+1, aTm->tm_mday, aTm->tm_hour, aTm->tm_min, aTm->tm_sec); return std::string(buf); } void Log::outDB(LogTypes type, const char * str) { if (!str || type >= MAX_LOG_TYPES) return; std::string new_str(str); if (new_str.empty()) return; LoginDatabase.EscapeString(new_str); LoginDatabase.PExecute("INSERT INTO logs (time, realm, type, string) " "VALUES (" UI64FMTD ", %u, %u, '%s');", uint64(time(0)), realm, type, new_str.c_str()); } void Log::outString(const char * str, ...) { if (!str) return; if (m_enableLogDB) { // we don't want empty strings in the DB std::string s(str); if (s.empty() || s == " ") return; va_list ap2; va_start(ap2, str); char nnew_str[MAX_QUERY_LEN]; vsnprintf(nnew_str, MAX_QUERY_LEN, str, ap2); outDB(LOG_TYPE_STRING, nnew_str); va_end(ap2); } if (m_colored) SetColor(true, m_colors[LOGL_NORMAL]); va_list ap; va_start(ap, str); vutf8printf(stdout, str, &ap); va_end(ap); if (m_colored) ResetColor(true); printf("\n"); if (logfile) { outTimestamp(logfile); va_start(ap, str); vfprintf(logfile, str, ap); fprintf(logfile, "\n"); va_end(ap); fflush(logfile); } fflush(stdout); } void Log::outString() { printf("\n"); if (logfile) { outTimestamp(logfile); fprintf(logfile, "\n"); fflush(logfile); } fflush(stdout); } void Log::outCrash(const char * err, ...) { if (!err) return; if (m_enableLogDB) { va_list ap2; va_start(ap2, err); char nnew_str[MAX_QUERY_LEN]; vsnprintf(nnew_str, MAX_QUERY_LEN, err, ap2); outDB(LOG_TYPE_CRASH, nnew_str); va_end(ap2); } if (m_colored) SetColor(false, LRED); va_list ap; va_start(ap, err); vutf8printf(stderr, err, &ap); va_end(ap); if (m_colored) ResetColor(false); fprintf(stderr, "\n"); if (logfile) { outTimestamp(logfile); fprintf(logfile, "CRASH ALERT: "); va_start(ap, err); vfprintf(logfile, err, ap); va_end(ap); fprintf(logfile, "\n"); fflush(logfile); } fflush(stderr); } void Log::outError(const char * err, ...) { if (!err) return; if (m_enableLogDB) { va_list ap2; va_start(ap2, err); char nnew_str[MAX_QUERY_LEN]; vsnprintf(nnew_str, MAX_QUERY_LEN, err, ap2); outDB(LOG_TYPE_ERROR, nnew_str); va_end(ap2); } if (m_colored) SetColor(false, LRED); va_list ap; va_start(ap, err); vutf8printf(stderr, err, &ap); va_end(ap); if (m_colored) ResetColor(false); fprintf( stderr, "\n"); if (logfile) { outTimestamp(logfile); fprintf(logfile, "ERROR: "); va_start(ap, err); vfprintf(logfile, err, ap); va_end(ap); fprintf(logfile, "\n"); fflush(logfile); } fflush(stderr); } void Log::outArena(const char * str, ...) { if (!str) return; if (arenaLogFile) { va_list ap; outTimestamp(arenaLogFile); va_start(ap, str); vfprintf(arenaLogFile, str, ap); fprintf(arenaLogFile, "\n"); va_end(ap); fflush(arenaLogFile); } } void Log::outSQLDriver(const char* str, ...) { if (!str) return; va_list ap; va_start(ap, str); vutf8printf(stdout, str, &ap); va_end(ap); printf("\n"); if (sqlLogFile) { outTimestamp(sqlLogFile); va_list ap; va_start(ap, str); vfprintf(sqlLogFile, str, ap); va_end(ap); fprintf(sqlLogFile, "\n"); fflush(sqlLogFile); } fflush(stdout); } void Log::outErrorDb(const char * err, ...) { if (!err) return; if (m_colored) SetColor(false, LRED); va_list ap; va_start(ap, err); vutf8printf(stderr, err, &ap); va_end(ap); if (m_colored) ResetColor(false); fprintf( stderr, "\n" ); if (logfile) { outTimestamp(logfile); fprintf(logfile, "ERROR: " ); va_start(ap, err); vfprintf(logfile, err, ap); va_end(ap); fprintf(logfile, "\n" ); fflush(logfile); } if (dberLogfile) { outTimestamp(dberLogfile); va_start(ap, err); vfprintf(dberLogfile, err, ap); va_end(ap); fprintf(dberLogfile, "\n" ); fflush(dberLogfile); } fflush(stderr); } void Log::outBasic(const char * str, ...) { if (!str) return; if (m_enableLogDB && m_dbLogLevel > LOGL_NORMAL) { va_list ap2; va_start(ap2, str); char nnew_str[MAX_QUERY_LEN]; vsnprintf(nnew_str, MAX_QUERY_LEN, str, ap2); outDB(LOG_TYPE_BASIC, nnew_str); va_end(ap2); } if (m_logLevel > LOGL_NORMAL) { if (m_colored) SetColor(true, m_colors[LOGL_BASIC]); va_list ap; va_start(ap, str); vutf8printf(stdout, str, &ap); va_end(ap); if (m_colored) ResetColor(true); printf("\n"); if (logfile) { outTimestamp(logfile); va_list ap; va_start(ap, str); vfprintf(logfile, str, ap); fprintf(logfile, "\n" ); va_end(ap); fflush(logfile); } } fflush(stdout); } void Log::outDetail(const char * str, ...) { if (!str) return; if (m_enableLogDB && m_dbLogLevel > LOGL_BASIC) { va_list ap2; va_start(ap2, str); char nnew_str[MAX_QUERY_LEN]; vsnprintf(nnew_str, MAX_QUERY_LEN, str, ap2); outDB(LOG_TYPE_DETAIL, nnew_str); va_end(ap2); } if (m_logLevel > LOGL_BASIC) { if (m_colored) SetColor(true, m_colors[LOGL_DETAIL]); va_list ap; va_start(ap, str); vutf8printf(stdout, str, &ap); va_end(ap); if (m_colored) ResetColor(true); printf("\n"); if (logfile) { outTimestamp(logfile); va_list ap; va_start(ap, str); vfprintf(logfile, str, ap); va_end(ap); fprintf(logfile, "\n"); fflush(logfile); } } fflush(stdout); } void Log::outDebugInLine(const char * str, ...) { if (!str) return; if (m_logLevel > LOGL_DETAIL) { va_list ap; va_start(ap, str); vutf8printf(stdout, str, &ap); va_end(ap); //if (m_colored) // ResetColor(true); if (logfile) { va_list ap; va_start(ap, str); vfprintf(logfile, str, ap); va_end(ap); } } } void Log::outSQLDev(const char* str, ...) { if (!str) return; va_list ap; va_start(ap, str); vutf8printf(stdout, str, &ap); va_end(ap); printf("\n"); if (sqlDevLogFile) { va_list ap; va_start(ap, str); vfprintf(sqlDevLogFile, str, ap); va_end(ap); fprintf(sqlDevLogFile, "\n"); fflush(sqlDevLogFile); } fflush(stdout); } void Log::outDebug(DebugLogFilters f, const char * str, ...) { if (!(m_DebugLogMask & f)) return; if (!str) return; if (m_enableLogDB && m_dbLogLevel > LOGL_DETAIL) { va_list ap2; va_start(ap2, str); char nnew_str[MAX_QUERY_LEN]; vsnprintf(nnew_str, MAX_QUERY_LEN, str, ap2); outDB(LOG_TYPE_DEBUG, nnew_str); va_end(ap2); } if ( m_logLevel > LOGL_DETAIL ) { if (m_colored) SetColor(true, m_colors[LOGL_DEBUG]); va_list ap; va_start(ap, str); vutf8printf(stdout, str, &ap); va_end(ap); if (m_colored) ResetColor(true); printf( "\n" ); if (logfile) { outTimestamp(logfile); va_list ap; va_start(ap, str); vfprintf(logfile, str, ap); va_end(ap); fprintf(logfile, "\n" ); fflush(logfile); } } fflush(stdout); } void Log::outStaticDebug(const char * str, ...) { if (!str) return; if (m_enableLogDB && m_dbLogLevel > LOGL_DETAIL) { va_list ap2; va_start(ap2, str); char nnew_str[MAX_QUERY_LEN]; vsnprintf(nnew_str, MAX_QUERY_LEN, str, ap2); outDB(LOG_TYPE_DEBUG, nnew_str); va_end(ap2); } if ( m_logLevel > LOGL_DETAIL ) { if (m_colored) SetColor(true, m_colors[LOGL_DEBUG]); va_list ap; va_start(ap, str); vutf8printf(stdout, str, &ap); va_end(ap); if (m_colored) ResetColor(true); printf( "\n" ); if (logfile) { outTimestamp(logfile); va_list ap; va_start(ap, str); vfprintf(logfile, str, ap); va_end(ap); fprintf(logfile, "\n" ); fflush(logfile); } } fflush(stdout); } void Log::outStringInLine(const char * str, ...) { if (!str) return; va_list ap; va_start(ap, str); vutf8printf(stdout, str, &ap); va_end(ap); if (logfile) { va_start(ap, str); vfprintf(logfile, str, ap); va_end(ap); } } void Log::outCommand(uint32 account, const char * str, ...) { if (!str) return; // TODO: support accountid if (m_enableLogDB && m_dbGM) { va_list ap2; va_start(ap2, str); char nnew_str[MAX_QUERY_LEN]; vsnprintf(nnew_str, MAX_QUERY_LEN, str, ap2); outDB(LOG_TYPE_GM, nnew_str); va_end(ap2); } if (m_logLevel > LOGL_NORMAL) { if (m_colored) SetColor(true, m_colors[LOGL_BASIC]); va_list ap; va_start(ap, str); vutf8printf(stdout, str, &ap); va_end(ap); if (m_colored) ResetColor(true); printf("\n"); if (logfile) { outTimestamp(logfile); va_list ap; va_start(ap, str); vfprintf(logfile, str, ap); fprintf(logfile, "\n" ); va_end(ap); fflush(logfile); } } if (m_gmlog_per_account) { if (FILE* per_file = openGmlogPerAccount (account)) { outTimestamp(per_file); va_list ap; va_start(ap, str); vfprintf(per_file, str, ap); fprintf(per_file, "\n" ); va_end(ap); fclose(per_file); } } else if (gmLogfile) { outTimestamp(gmLogfile); va_list ap; va_start(ap, str); vfprintf(gmLogfile, str, ap); fprintf(gmLogfile, "\n" ); va_end(ap); fflush(gmLogfile); } fflush(stdout); } void Log::outChar(const char * str, ...) { if (!str) return; if (m_enableLogDB && m_dbChar) { va_list ap2; va_start(ap2, str); char nnew_str[MAX_QUERY_LEN]; vsnprintf(nnew_str, MAX_QUERY_LEN, str, ap2); outDB(LOG_TYPE_CHAR, nnew_str); va_end(ap2); } if (charLogfile) { outTimestamp(charLogfile); va_list ap; va_start(ap, str); vfprintf(charLogfile, str, ap); fprintf(charLogfile, "\n" ); va_end(ap); fflush(charLogfile); } } void Log::outCharDump(const char * str, uint32 account_id, uint32 guid, const char * name) { FILE* file = NULL; if (m_charLog_Dump_Separate) { char fileName[29]; // Max length: name(12) + guid(11) + _.log (5) + \0 snprintf(fileName, 29, "%d_%s.log", guid, name); std::string sFileName(m_dumpsDir); sFileName.append(fileName); file = fopen((m_logsDir + sFileName).c_str(), "w"); } else file = charLogfile; if (file) { fprintf(file, "== START DUMP == (account: %u guid: %u name: %s )\n%s\n== END DUMP ==\n", account_id, guid, name, str); fflush(file); if (m_charLog_Dump_Separate) fclose(file); } } void Log::outRemote(const char * str, ...) { if (!str) return; if (m_enableLogDB && m_dbRA) { va_list ap2; va_start(ap2, str); char nnew_str[MAX_QUERY_LEN]; vsnprintf(nnew_str, MAX_QUERY_LEN, str, ap2); outDB(LOG_TYPE_RA, nnew_str); va_end(ap2); } if (raLogfile) { outTimestamp(raLogfile); va_list ap; va_start(ap, str); vfprintf(raLogfile, str, ap); fprintf(raLogfile, "\n" ); va_end(ap); fflush(raLogfile); } } void Log::outChat(const char * str, ...) { if (!str) return; if (m_enableLogDB && m_dbChat) { va_list ap2; va_start(ap2, str); char nnew_str[MAX_QUERY_LEN]; vsnprintf(nnew_str, MAX_QUERY_LEN, str, ap2); outDB(LOG_TYPE_CHAT, nnew_str); va_end(ap2); } if (chatLogfile) { outTimestamp(chatLogfile); va_list ap; va_start(ap, str); vfprintf(chatLogfile, str, ap); fprintf(chatLogfile, "\n" ); fflush(chatLogfile); va_end(ap); } } void Log::outWarden(const char * str, ...) { if(!str) return; va_list ap; printf("WARDEN: "); va_start(ap, str); vutf8printf(stdout, str, &ap); va_end(ap); printf("\n"); if (wardenLogFile) { outTimestamp(wardenLogFile); va_start(ap, str); vfprintf(wardenLogFile, str, ap); fprintf(wardenLogFile, "\n"); va_end(ap); fflush(wardenLogFile); } fflush(stdout); } void Log::outErrorST(const char * str, ...) { va_list ap; va_start(ap, str); char nnew_str[MAX_QUERY_LEN]; vsnprintf(nnew_str, MAX_QUERY_LEN, str, ap); va_end(ap); ACE_Stack_Trace st; outError("%s [Stacktrace: %s]", nnew_str, st.c_str()); }
gpl-2.0
thuesing/bmu_wiki
extensions/ReplaceText/ReplaceText.i18n.php
199662
<?php /** * Internationalization file for the Replace Text extension * * @file * @ingroup Extensions */ $messages = array(); /** English * @author Yaron Koren */ $messages['en'] = array( // user messages 'replacetext' => 'Replace text', 'replacetext-desc' => 'Provides a [[Special:ReplaceText|special page]] to allow administrators to do a global string find-and-replace on all the content pages of a wiki', 'replacetext_docu' => 'To replace one text string with another across all regular pages on this wiki, enter the two pieces of text here and then hit "{{int:replacetext_continue}}". You will then be shown a list of pages that contain the search text, and you can choose the ones in which you want to replace it. Your name will appear in page histories as the user responsible for any changes.', 'replacetext_originaltext' => 'Original text:', 'replacetext_replacementtext' => 'Replacement text:', 'replacetext_useregex' => 'Use regular expressions', 'replacetext_regexdocu' => '(Example: values of "a(.*)c" for "{{int:replacetext_originaltext}}" and "ac$1" for "{{int:replacetext_replacementtext}}" would replace "abc" with "acb".)', 'replacetext_optionalfilters' => 'Optional filters:', 'replacetext_categorysearch' => 'Replace only in category:', 'replacetext_prefixsearch' => 'Replace only in pages with the prefix:', 'replacetext_editpages' => 'Replace text in page contents', 'replacetext_movepages' => 'Replace text in page titles, when possible', 'replacetext_givetarget' => 'You must specify the string to be replaced.', 'replacetext_nonamespace' => 'You must select at least one namespace.', 'replacetext_editormove' => 'You must select at least one of the replacement options.', 'replacetext_choosepagesforedit' => 'Replace "$1" with "$2" in the text of the following {{PLURAL:$3|page|$3 pages}}:', 'replacetext_choosepagesformove' => 'Replace "$1" with "$2" in the {{PLURAL:$3|title of the following page|titles of the following $3 pages}}:', 'replacetext_cannotmove' => 'The following {{PLURAL:$1|page|$1 pages}} cannot be moved:', 'replacetext_formovedpages' => 'For moved pages:', 'replacetext_savemovedpages' => 'Save the old titles as redirects to the new titles', 'replacetext_watchmovedpages' => 'Watch these pages', 'replacetext_invertselections' => 'Invert selections', 'replacetext_replace' => 'Replace', 'replacetext_success' => '"$1" will be replaced with "$2" in {{PLURAL:$3|one page|$3 pages}}.', 'replacetext_noreplacement' => 'No pages were found containing the string "$1".', 'replacetext_nomove' => 'No pages were found whose title contains "$1".', 'replacetext_nosuchcategory' => 'No category exists with the name "$1".', 'replacetext_return' => 'Return to form.', 'replacetext_warning' => "'''Warning:''' There {{PLURAL:$1|is one page that already contains|are $1 pages that already contain}} the replacement string, \"$2\". If you make this replacement you will not be able to separate your replacements from these strings.", 'replacetext_blankwarning' => "'''Warning:''' Because the replacement string is blank, this operation will not be reversible.", 'replacetext_continue' => 'Continue', // content messages 'replacetext_editsummary' => 'Text replace - "$1" to "$2"', 'right-replacetext' => 'Make string replacements on the entire wiki', ); /** Message documentation (Message documentation) * @author Darth Kule * @author EugeneZelenko * @author Fryed-peach * @author Kghbln * @author Kwj2772 * @author McMonster * @author Nike * @author Purodha * @author Umherirrender */ $messages['qqq'] = array( 'replacetext' => "This message is displayed as a title of this extension's special page.", 'replacetext-desc' => '{{desc}} {{Identical|Content page}}', 'replacetext_docu' => "Description of how to use this extension, displayed on the extension's special page ([[Special:ReplaceText]]). The translation of 'Continue' should correspond with message {{msg-mw|Replacetext continue}}.", 'replacetext_originaltext' => 'Label of the text field, where user enters original piece of text, which would be replaced.', 'replacetext_regexdocu' => '* "Original text" - {{msg-mw|replacetext_originaltext}} * "Replacement text" - {{msg-mw|replacetext_replacementtext}}', 'replacetext_choosepagesforedit' => 'Displayed over the list of pages where the given text was found.', 'replacetext_replace' => 'Label of the button, which triggers the begin of replacment. {{Identical|Replace}}', 'replacetext_continue' => '{{Identical|Continue}}', 'right-replacetext' => '{{doc-right|replacetext}}', ); /** Afrikaans (Afrikaans) * @author Naudefj */ $messages['af'] = array( 'replacetext' => 'Vervang teks', 'replacetext-desc' => "Administrateurs kan via 'n [[Special:ReplaceText|spesiale bladsy]] teks in alle bladsye soek en vervang", 'replacetext_originaltext' => 'Oorspronklike teks:', 'replacetext_replacementtext' => 'Vervangende teks:', 'replacetext_optionalfilters' => 'Opsionele filters:', 'replacetext_categorysearch' => 'Vervang slegs in kategorie:', 'replacetext_prefixsearch' => 'Vervang slegs in bladsye met voorvoegsel:', 'replacetext_editpages' => 'Vervang teks in die bladsy-inhoud', 'replacetext_movepages' => 'Vervang teks in bladsyname (waar moontlik)', 'replacetext_givetarget' => 'U moet die string wat vervang moet word verskaf', 'replacetext_nonamespace' => 'U moet ten minste een naamruimte kies.', 'replacetext_editormove' => 'U moet ten minste een van die vervangingsopsies kies.', 'replacetext_choosepagesforedit' => "Kies die {{PLURAL:$3|bladsy|blaaie}} waar u '$1' met '$2' wil vervang:", 'replacetext_choosepagesformove' => 'Vervang "$1" met "$2" in die volgende {{PLURAL:$3|bladsynaam|bladsyname}}:', 'replacetext_cannotmove' => 'Die volgende {{PLURAL:$1|bladsy|blaaie}} kan nie geskuif word nie:', 'replacetext_formovedpages' => 'Vir geskuifde bladsye:', 'replacetext_savemovedpages' => 'Stoor die ou bladsyname as aansture na die nuwe name', 'replacetext_watchmovedpages' => 'Hou hierdie bladsy dop', 'replacetext_invertselections' => 'Omgekeerde seleksie', 'replacetext_replace' => 'Vervang', 'replacetext_success' => '"$1" word in $3 {{PLURAL:$3|bladsy|blaaie}} met "$2" vervang.', 'replacetext_noreplacement' => "Daar was geen bladsye wat die teks '$1' bevat gevind nie.", 'replacetext_nomove' => 'Daar is geen bladsye met "$1" in die naam gevind nie.', 'replacetext_nosuchcategory' => 'Die kategorie "$1" bestaan nie.', 'replacetext_return' => 'Terug na die vorm.', 'replacetext_blankwarning' => 'Omdat u teks met niks vervang kan hierdie aksie nie ongedaan gemaak word nie. Wil u voortgaan?', 'replacetext_continue' => 'Gaan voort', 'replacetext_editsummary' => "Teks vervang - '$1' na '$2'", 'right-replacetext' => 'Doen vervangings oor die hele wiki', ); /** Arabic (العربية) * @author Alnokta * @author Meno25 * @author OsamaK * @author Ouda */ $messages['ar'] = array( 'replacetext' => 'استبدل النص', 'replacetext-desc' => 'يوفر [[Special:ReplaceText|صفحة خاصة]] للسماح للإداريين للقيام بعملية أوجد واستبدل على نص في كل صفحات المحتوى لويكي', 'replacetext_docu' => "لاستبدال سلسلة نص بأخرى عبر كل الصفحات العادية في هذا الويكي، أدخل قطعتي النص هنا ثم اضغط 'استمرار'. سيعرض عليك بعد ذلك قائمة بالصفحات التي تحتوي على نص البحث، ويمكنك اختيار اللواتي تريد الاستبدال فيها. اسمك سيظهر في تواريخ الصفحات كالمستخدم المسؤول عن أية تغييرات.", # Fuzzy 'replacetext_originaltext' => 'النص الأصلي:', 'replacetext_replacementtext' => 'نص الاستبدال:', 'replacetext_optionalfilters' => 'مرشحات اختيارية:', 'replacetext_categorysearch' => 'استبدل فقط في التصنيف:', 'replacetext_prefixsearch' => 'استبدل فقط في الصفحات ذات البادئة:', 'replacetext_editpages' => 'استبدل النص في محتويات الصفحة', 'replacetext_movepages' => 'استبدل النص في عناوين الصفحات، عندما يكون ممكنا', 'replacetext_givetarget' => 'لابد أن تحدد السلسلة التي تريد استبدالها', 'replacetext_nonamespace' => 'يجب أن تختار على الأقل نطاقا واحدا.', 'replacetext_editormove' => 'لابد أن تختار خيار واحد على الأقل من خيارات الاستبدال.', 'replacetext_choosepagesforedit' => "استبدال ب'$1' '$2' في نص {{PLURAL:$3||الصفحة التالية|الصفحتين التاليتين|الصفحات التالية}}:", 'replacetext_choosepagesformove' => 'استبدل "$1" ب"$2" في {{PLURAL:$3||اسم الصفحة التالية|اسمي الصفحتين التاليتين|أسماء الصفحات التالية}}:', 'replacetext_cannotmove' => 'لا يمكن نقل {{PLURAL:$1||الصفحة التالية|الصفحتين التاليتين|الصفحات التالية}}:', 'replacetext_formovedpages' => 'للصفحات المنقولة:', 'replacetext_savemovedpages' => 'احفظ العناوين القديمة كتحويلات للعناوين الجديدة', 'replacetext_watchmovedpages' => 'راقب هذه الصفحات', 'replacetext_invertselections' => 'عكس الاختيارات', 'replacetext_replace' => 'استبدل', 'replacetext_success' => "سوف تستبدل '$2' ب'$1' في {{PLURAL:$3||صفحة واحدة|صفحتين|$3 صفحات|$3 صفحة}}.", 'replacetext_noreplacement' => "لا صفحات تم العثور عليها تحتوي على السلسلة '$1'.", 'replacetext_nomove' => "لم توجد صفحات تحتوي عناوينها '$1'.", 'replacetext_nosuchcategory' => 'لا يوجد تصنيف بالاسم "$1".', 'replacetext_return' => 'رجوع إلى الاستمارة', 'replacetext_warning' => "'''تحذير''': توجد {{PLURAL:$1||صفحة واحدة تحتوي|صفحتان تحتويان|$1 صفحات تحتوي|$1 صفحة تحتوي}} بالفعل على سلسلة الاستبدال '$2'. إذا قمت بهذا الاستبدال فلن تصبح قادرًا على فصل استبدالاتك عن هذه السلاسل.", 'replacetext_blankwarning' => 'لأن سلسلة الاستبدال فارغة، هذه العملية لن تكون عكسية؛ استمر؟', 'replacetext_continue' => 'استمرار', 'replacetext_editsummary' => "استبدال النص - '$1' ب'$2'", 'right-replacetext' => 'القيام باستبدال للسلاسل في الويكي بأكمله', ); /** Aramaic (ܐܪܡܝܐ) * @author Basharh */ $messages['arc'] = array( 'replacetext_originaltext' => 'ܟܬܒܬܐ ܫܪܫܝܬܐ:', 'replacetext_watchmovedpages' => 'ܪܗܝ ܦܐܬܬ̈ܐ ܗܠܝܢ', 'replacetext_invertselections' => 'ܐܗܦܟ ܠܓܘܒܝ̈ܐ', ); /** Egyptian Spoken Arabic (مصرى) * @author Ghaly * @author Meno25 * @author Ramsis II */ $messages['arz'] = array( 'replacetext' => 'استبدل النص', 'replacetext-desc' => 'يوفر [[Special:ReplaceText|صفحة خاصة]] للسماح للإداريين للقيام بعملية أوجد واستبدل على نص فى كل صفحات المحتوى لويكي', 'replacetext_docu' => "لاستبدال سلسلة نص بأخرى عبر كل الصفحات العادية فى هذا الويكى، أدخل قطعتى النص هنا ثم اضغط 'استمرار'. سيعرض عليك بعد ذلك قائمة بالصفحات التى تحتوى على نص البحث، ويمكنك اختيار اللواتى تريد الاستبدال فيها. اسمك سيظهر فى تواريخ الصفحات كالمستخدم المسؤول عن أية تغييرات.", # Fuzzy 'replacetext_originaltext' => 'النص الأصلي:', 'replacetext_replacementtext' => 'نص الاستبدال:', 'replacetext_movepages' => 'استبدل النص فى عناوين الصفحات، عندما يكون ممكنا', 'replacetext_choosepagesforedit' => "من فضلك اختار {{PLURAL:$3|الصفحه|الصفحات}} اللى فيها عايز تستبدل ب'$1' '$2':", 'replacetext_choosepagesformove' => 'استبدل "$1" ب"$2" فى {{PLURAL:$3||اسم الصفحة التالية|اسمى الصفحتين التاليتين|أسماء الصفحات التالية}}:', 'replacetext_cannotmove' => '{{PLURAL:$1|الصفحة|الصفحات}} التالية لا يمكن نقلها:', 'replacetext_savemovedpages' => 'احفظ العناوين القديمة كتحويلات للعناوين الجديدة', 'replacetext_invertselections' => 'عكس الاختيارات', 'replacetext_replace' => 'استبدل', 'replacetext_success' => "'$1' ح تتبدل بـ '$2' فى $3 {{PLURAL:$3|صفحه|صفحات}}.", 'replacetext_noreplacement' => "لا صفحات تم العثور عليها تحتوى على السلسلة '$1'.", 'replacetext_return' => 'رجوع إلى الإستمارة', 'replacetext_warning' => "فيه $1 {{PLURAL:$1|$1 صفحه|$1 صفحات}} فيها سلسلة الاستبدال، '$2'. لو أنك قمت بالاستبدال ده مش هاتقدر تفصل استبدالاتك من السلاسل دى. استمرار مع الاستبدال؟", # Fuzzy 'replacetext_blankwarning' => 'لأن سلسلة الاستبدال فارغة، هذه العملية لن تكون عكسية؛ استمر؟', 'replacetext_continue' => 'استمر', 'replacetext_editsummary' => "استبدال النص - '$1' ب'$2'", 'right-replacetext' => 'القيام باستبدال للسلاسل فى الويكى بأكمله', ); /** Asturian (asturianu) * @author Xuacu */ $messages['ast'] = array( 'replacetext' => 'Reemplazar testu', 'replacetext-desc' => "Ufre una [[Special:ReplaceText|páxina especial]] que permite a los alministradores facer una gueta y sustitución global d'una cadena de testu en toles páxines de conteníu d'una wiki", 'replacetext_docu' => "Pa sustituir una cadena de testu por otra en toles páxines regulares d'esta wiki, escribi equí les dos pieces de testu y llueu calca \"{{int:replacetext_continue}}\". Dempués s'amosará una llista de les páxines que contienen el testu buscáu, y podrás esbillar aquelles nes que quieras sustituilu. El to nome apaecerá nos historiales de les páxines como l'usuariu responsable de cualesquier cambiu.", 'replacetext_originaltext' => 'Testu orixinal:', 'replacetext_replacementtext' => 'Testu de sustitución:', 'replacetext_useregex' => 'Usar espresiones regulares', 'replacetext_regexdocu' => '(Exemplu: los valores "a(.*)c" pa "{{int:replacetext_originaltext}}" y "ac$1" pa "{{int:replacetext_replacementtext}}" camudarán "abc" por "acb".)', 'replacetext_optionalfilters' => 'Peñeres opcionales:', 'replacetext_categorysearch' => 'Sustituir sólo na categoría:', 'replacetext_prefixsearch' => 'Sustituir sólo nes páxines col prefixu:', 'replacetext_editpages' => 'Sustituir el testu nel conteníu de la páxina', 'replacetext_movepages' => 'Sustituir el testu nos títulos de les páxines, si ye posible', 'replacetext_givetarget' => 'Debes conseñar la cadena que se va a sustituir.', 'replacetext_nonamespace' => 'Debes escoyer, polo menos, un espaciu de nomes.', 'replacetext_editormove' => 'Debes escoyer polo menos una de les opciones de sustitución.', 'replacetext_choosepagesforedit' => 'Sustituír "$1" por "$2" nel testu de {{PLURAL:$3|la páxina siguiente|les páxines siguientes}}:', 'replacetext_choosepagesformove' => 'Sustituír "$1" por "$2" {{PLURAL:$3|nel títulu de la páxina siguiente|nos títulos de les páxines siguientes}}:', 'replacetext_cannotmove' => '{{PLURAL:$1|La siguiente páxina|Les siguientes páxines}} nun se {{PLURAL:$1|pue|puen}} mover:', 'replacetext_formovedpages' => 'Pa páxines movies:', 'replacetext_savemovedpages' => 'Guardar los títulos antiguos como redireiciones a los títulos nuevos', 'replacetext_watchmovedpages' => 'Vixilar eses páxines', 'replacetext_invertselections' => 'Invertir seleiciones', 'replacetext_replace' => 'Sustituir', 'replacetext_success' => '"$1" se sustituirá por "$2" en {{PLURAL:$3|una páxina|$3 páxines}}.', 'replacetext_noreplacement' => "Nun s'alcontraron páxines que contengan la cadena de caráuteres «$1».", 'replacetext_nomove' => "Nun s'alcontraron páxines que contengan «$1» nel títulu.", 'replacetext_nosuchcategory' => 'Nun esiste denguna categoría col nome «$1».', 'replacetext_return' => 'Volver al formulariu.', 'replacetext_warning' => "'''Avisu:''' Hai {{PLURAL:$1|una páxina|$1 páxines}} que yá {{PLURAL:$1|contién|contienen}} la cadena de sustitución «$2». Si faes esta sustitución nun podrás distinguir los tos cambios d'estes cadenes.", 'replacetext_blankwarning' => "'''Avisu:''' Como la cadena de sustitución ta balera, esta operación nun sedrá reversible.", 'replacetext_continue' => 'Siguir', 'replacetext_editsummary' => 'Sustitución de testu - de «$1» a «$2»', 'right-replacetext' => 'Facer les sustituciones de la cadena na wiki ensembre', ); /** Azerbaijani (azərbaycanca) * @author Cekli829 */ $messages['az'] = array( 'replacetext_originaltext' => 'Orijinal mətn:', ); /** Bashkir (башҡортса) * @author Assele */ $messages['ba'] = array( 'replacetext' => 'Тексты алмаштырырға', 'replacetext-desc' => 'Хәкимдәргә бөтә эстәлек биттәрендә тексты табып алмаштырырға мөмкинлек биреүсе [[Special:ReplaceText|махсус бит]] менән тәьмин итә', 'replacetext_docu' => 'Был викиның бөтә биттәрендә бер текст юлын икенсе менән алмаштырыр өсөн, ике текст керетегеҙ һәм "Дауам итергә" төймәһенә баҫығыҙ. Артабан һеҙгә эҙләнгән тексты үҙ эсенә алған биттәр исемлеге күрһәтеләсәк, һеҙ улар араһында алмаштырырға теләгәндәрен һайлай алаһығыҙ. Һеҙҙең исемегеҙ биттәрҙең үҙгәртеү тарихтарында үҙгәртеүҙәргә яуаплы ҡатнашыусы булараҡ күрһәтеләсәк.', # Fuzzy 'replacetext_originaltext' => 'Сығанаҡ текст:', 'replacetext_replacementtext' => 'Алмаш текст:', 'replacetext_useregex' => 'Регуляр аңлатмаларҙы ҡулланырға', 'replacetext_regexdocu' => '(Миҫал: "Сығанаҡ текст" өсөн "a(.*)c" аңлатмаһы һәм "Алмаш текст" өсөн "ac$1" "abc" тексын "acb" тип алмаштырасаҡ.)', # Fuzzy 'replacetext_optionalfilters' => 'Мөһим булмаған һөҙгөстәр:', 'replacetext_categorysearch' => 'Был категорияла ғына алмаштырырға:', 'replacetext_prefixsearch' => 'Ошо хәрефтәр менән башланған биттәрҙә генә алмаштырырға:', 'replacetext_editpages' => 'Тексты бит эстәлектәрендә алмаштырырға', 'replacetext_movepages' => 'Тексты бит исемдәрендә, мөмкин булһа, алмаштырырға', 'replacetext_givetarget' => 'Һеҙ алмаштырыла торған юлды күрһәтергә тейешһегеҙ.', 'replacetext_nonamespace' => 'Һеҙ кәмендә бер исемдәр арауығын һайларға тейешһегеҙ.', 'replacetext_editormove' => 'Һеҙ кәмендә бер алмаштырыу төрөн һайларға тейешһегеҙ.', 'replacetext_choosepagesforedit' => '"$1" тексын "$2" менән түбәндәге {{PLURAL:$3|биттә|биттәрҙә}} алмаштырырға:', 'replacetext_choosepagesformove' => '"$1" тексын "$2" менән түбәндәге бит {{PLURAL:$3|исемендә|исемдәрендә}} алмаштырырға:', 'replacetext_cannotmove' => 'Түбәндәге {{PLURAL:$1|биттең|биттәрҙең}} исемен үҙгәртеп булмай:', 'replacetext_formovedpages' => 'Исемдәре үҙгәртелгән биттәр өсөн:', 'replacetext_savemovedpages' => 'Иҫке исемдәрен яңы исемдәргә йүнәлтеүҙәр рәүешендә һаҡларға', 'replacetext_watchmovedpages' => 'Был биттәрҙе күҙәтеүҙәр исемлегенә индерергә', 'replacetext_invertselections' => 'Һайланғандарҙы әйләндерергә', 'replacetext_replace' => 'Алмаштырырға', 'replacetext_success' => '"$1" "$2" менән $3 {{PLURAL:$3|биттә}} алмаштырыласаҡ.', 'replacetext_noreplacement' => '"$1" юлын үҙ эсенә алған бер бит тә табылманы.', 'replacetext_nomove' => 'Исемендә "$1" булған бер бит тә табылманы.', 'replacetext_nosuchcategory' => '"$1" исемле бер категория ла юҡ.', 'replacetext_return' => 'Формаға кире ҡайтырға.', 'replacetext_warning' => "'''Иғтибар:''' Алмаш \"\$2\" тексын үҙ эсенә алған {{PLURAL:\$1|\$1 бит}} бар инде. Әгәр һеҙ алмаштырыуҙы башҡарһағыҙ, алмаштырылған текстарҙы булғандарынан айыра алмаясаҡһығыҙ.", 'replacetext_blankwarning' => "'''Иғтибар:'''Алмаш текст буш булғанға күрә, был ғәмәлде кире алыу мөмкин түгел.", 'replacetext_continue' => 'Дауам итергә', 'replacetext_editsummary' => '"$1" тексын "$2" менән алмаштырыу', 'right-replacetext' => 'Бөтә викила тексты алмаштырыу', ); /** Belarusian (Taraškievica orthography) (беларуская (тарашкевіца)‎) * @author EugeneZelenko * @author Jim-by * @author Wizardist * @author Zedlik */ $messages['be-tarask'] = array( 'replacetext' => 'Замяніць тэкст', 'replacetext-desc' => 'Дадае [[Special:ReplaceText|спэцыяльную старонку]], якая дазваляе адміністратарам глябальны пошук і замену тэксту ва усіх старонках вікі', 'replacetext_docu' => 'Каб замяніць адзін радок на іншы ва ўсіх звычайных старонках гэтай вікі, увядзіце два радкі тут, а потым націсьніце «{{int:replacetext_continue}}». Будзе паказаны сьпіс старонак, якія ўтрымліваюць тэкст, які Вы шукалі, і Вы зможаце выбраць старонкі, дзе Вы жадаеце зрабіць замену. Ваша імя будзе запісанае ў гісторыю старонкі, таму што ўдзельнікі адказныя за ўсе зробленыя зьмены.', 'replacetext_originaltext' => 'Арыгінальны тэкст:', 'replacetext_replacementtext' => 'Тэкст на замену:', 'replacetext_useregex' => 'Выкарыстоўваць рэгулярныя выразы', 'replacetext_regexdocu' => '(Напрыклад, выразы «a(.*)c» ў полі «{{int:replacetext_originaltext}}» і «ac$1» у полі «{{int:replacetext_replacementtext}}» прывядуць да замены «abc» на «acb».)', 'replacetext_optionalfilters' => 'Неабавязковыя фільтры:', 'replacetext_categorysearch' => 'Замяніць толькі ў катэгорыі:', 'replacetext_prefixsearch' => 'Замяніць толькі ў старонках, назвы якіх пачынаюцца з:', 'replacetext_editpages' => 'Замяніць тэкст ў зьмесьце старонак', 'replacetext_movepages' => 'Замяніць тэкст у назвах старонак, калі гэта магчыма', 'replacetext_givetarget' => 'Вам неабходна пазначыць радок для замены.', 'replacetext_nonamespace' => 'Вам неабходна выбраць хаця б адну прастору назваў.', 'replacetext_editormove' => 'Вам неабходна выбраць хаця б адну з наладаў пераносу.', 'replacetext_choosepagesforedit' => 'Калі ласка, выберыце {{PLURAL:$3|старонку, у якой|старонкі, у якіх}} Вы жадаеце замяніць «$1» на «$2»:', 'replacetext_choosepagesformove' => 'Замяніць «$1» на «$2» у {{PLURAL:$3|назьве наступнай старонкі|назвах наступных старонак}}:', 'replacetext_cannotmove' => '{{PLURAL:$1|Наступная старонка ня можа быць перанесена|Наступныя старонкі ня могуць быць перанесены}}:', 'replacetext_formovedpages' => 'Для перанесеных старонак:', 'replacetext_savemovedpages' => 'Захаваць старыя назвы як перанакіраваньні на новыя', 'replacetext_watchmovedpages' => 'Назіраць за гэтымі старонкамі', 'replacetext_invertselections' => 'Адваротны выбар', 'replacetext_replace' => 'Замяніць', 'replacetext_success' => '«$1» будзе заменены на «$2» ў $3 {{PLURAL:$3|старонцы|старонках|старонках}}.', 'replacetext_noreplacement' => 'Старонак, якія ўтрымліваюць тэкст «$1» ня знойдзена.', 'replacetext_nomove' => 'Ня знойдзена старонак, у назвах якіх утрымліваецца «$1».', 'replacetext_nosuchcategory' => 'Не існуе катэгорыі з назвай «$1».', 'replacetext_return' => 'Вярнуцца да формы.', 'replacetext_warning' => "'''Папярэджаньне:''' Існуе $1 {{PLURAL:$1|старонка, якая ўтрымлівае|старонкі, якія ўтрымліваюць|старонак, якія ўтрымліваюць}} тэкст на замену «$2». Калі Вы зробіце гэту замену, Вы ня зможаце аддзяліць Вашыя замены ад гэтых тэкстаў.", 'replacetext_blankwarning' => 'У выніку таго, што радок, на які павінна адбыцца замена, пусты, апэрацыя ня будзе выкананая. Вы жадаеце працягваць?', 'replacetext_continue' => 'Працягваць', 'replacetext_editsummary' => 'Замена тэксту: «$1» на «$2»', 'right-replacetext' => 'замена тэксту ва ўсёй вікі', ); /** Bulgarian (български) * @author DCLXVI */ $messages['bg'] = array( 'replacetext' => 'Заместване на текст', 'replacetext-desc' => 'Предоставя [[Special:ReplaceText|специална страница]], чрез която администраторите могат да извършват глобално откриване-и-заместване на низове в страниците на уикито', 'replacetext_originaltext' => 'Оригинален текст:', 'replacetext_replacementtext' => 'Текст за заместване:', 'replacetext_choosepagesforedit' => "Изберете страници, в които желаете да замените '$1' с '$2':", # Fuzzy 'replacetext_replace' => 'Заместване', 'replacetext_success' => "Заместване на '$1' с '$2' в $3 страници.", # Fuzzy 'replacetext_noreplacement' => "Не бяха открити страници, съдържащи низа '$1'.", 'replacetext_blankwarning' => 'Тъй като низът за заместване е празен, процесът на заместване е необратим; продължаване?', 'replacetext_continue' => 'Продължаване', 'replacetext_editsummary' => "Заместване на текст - '$1' на '$2'", ); /** Bengali (বাংলা) * @author Bellayet * @author Wikitanvir */ $messages['bn'] = array( 'replacetext' => 'লেখা প্রতিস্থাপন', 'replacetext_originaltext' => 'মূল লেখা:', 'replacetext_replacementtext' => 'প্রতিস্থাপিত লেখা:', 'replacetext_useregex' => 'রেগুলার এক্সপ্রেশন ব্যবহার করো', 'replacetext_optionalfilters' => 'ঐচ্ছিক ফিল্টার', 'replacetext_categorysearch' => 'শুধুমাত্র বিষয়শ্রেণীতেই প্রতিস্থাপন করো:', ); /** Breton (brezhoneg) * @author Fohanno * @author Fulup * @author Y-M D */ $messages['br'] = array( 'replacetext' => "Erlec'hiañ an destenn", 'replacetext-desc' => "Pourchas a ra ur [[Special:ReplaceText|bajenn dibar]] a aotre ar verourien da erlec'hiañ steudadoù arouezennoù dre arouezennoù all er wiki a-bezh", 'replacetext_docu' => "Evit erlec'hiañ ur steudad arouezennoù gant unan all e holl bajennoù boutin ar wiki-mañ e c'hallit merkañ an div destenn amañ ha klikañ war 'kenderc'hel'. Diskouezet e vo deoc'h ur roll pajennoù m'emañ an destenn klasket enno ha gallout a reot dibab ar re a fell deoc'h cheñch. War wel e teuio hoc'h anv war roll istor pep pajenn evit ma vo gouezet gant piv eo bet graet ar cheñchamant.", # Fuzzy 'replacetext_originaltext' => 'Testenn orin :', 'replacetext_replacementtext' => "Testenn erlec'hiañ :", 'replacetext_useregex' => 'Ober gant jedadennoù reoliek', 'replacetext_regexdocu' => '(Da skouer : Talvoudenn "a(.*)c" evit "Testenn orin" ha "ac$1" evit "Testenn erlec\'hiañ" a vo erlec\'ho "abc" gant "acb".)', # Fuzzy 'replacetext_optionalfilters' => 'Siloù diret :', 'replacetext_categorysearch' => "Erlec'hiañ er rummad hepken :", 'replacetext_prefixsearch' => "Erlec'hiañ hepken er bajennoù gant ar rakger :", 'replacetext_editpages' => "Erlec'hiañ an destenn e-mesk danvez ar bajenn", 'replacetext_movepages' => "Erlec'hiañ an destenn e titl ar pajennoù, pa vez posupl", 'replacetext_givetarget' => "Rankout a rit reiñ ar chadenn a rank bezañ erlec'hiet.", 'replacetext_nonamespace' => "Rankout a rit dibab un esaouenn anv d'an nebeutañ.", 'replacetext_editormove' => "Rankout a rit dibab d'an nebeutañ un dibarzh erlec'hiañ.", 'replacetext_choosepagesforedit' => 'Erlec\'hiañ "$1" gant "$2" e testenn ar bajenn{{PLURAL:$3||où}} da heul :', 'replacetext_choosepagesformove' => 'Erlec\'hiañ "$1" gant "$2" e titl{{PLURAL:$3| ar bajenn da heul|où ar bajennoù da heul}} :', 'replacetext_cannotmove' => "Ne c'hell ket bezañ fiñvet ar bajenn{{PLURAL:$1||où}} da heul :", 'replacetext_formovedpages' => "Evit ar pajennoù dilec'hiet :", 'replacetext_savemovedpages' => 'Enrollañ an titloù kozh evel adkasoù davet an titloù nevez', 'replacetext_watchmovedpages' => 'Evezhiañ ar pajennoù-mañ', 'replacetext_invertselections' => 'Eilpennañ an diuzadennoù', 'replacetext_replace' => "Erlec'hiañ", 'replacetext_success' => '"$1" a vo erlec\'hiet gant "$2" e $3 pajenn{{PLURAL:$3||}}.', 'replacetext_noreplacement' => "N'eus bet kavet pajenn ebet gant an neudennad « $1 ».", 'replacetext_nomove' => 'N\'eo bet kavet pennad ebet gant "$1" en ul lodenn eus an titl.', 'replacetext_nosuchcategory' => "N'eus rummad ebet en anv « $1 ».", 'replacetext_return' => "Distreiñ d'ar furmskrid.", 'replacetext_warning' => "'''Diwallit :''' {{PLURAL:\$1| \$1 bajenn enni| \$1 pajenn enno}} ar steudad arouezennoù erlec'hiañ zo dija, \"\$2\". Ma kasit ar cheñchamant da benn ne vo ket posupl diforc'hañ ar cheñchamantoù degaset ganeoc'h diouzh an neudennadoù-se ken.", 'replacetext_blankwarning' => "'''Diwallit : ''' Dre m'eo goullo ar steudad erlec'hiañ, ne vo ket tu da zizober an urzh-mañ.", 'replacetext_continue' => "Kenderc'hel", 'replacetext_editsummary' => 'Erlec\'hiañ an destenn - "$1" dre "$2"', 'right-replacetext' => "Krouiñ erlec'hiadurioù testenn er wiki a-bezh", ); /** Bosnian (bosanski) * @author CERminator */ $messages['bs'] = array( 'replacetext' => 'Zamijeni tekst', 'replacetext-desc' => 'Dodaje [[Special:ReplaceText|posebnu stranicu]] koja omogućava administratorima da izvrše globalnu pretragu nađi-i-zamijeni na svim stranicama sadržaja na wikiju.', 'replacetext_docu' => "Da bi ste zamijenili jedan tekst s drugim po svim regularnim stranicama na ovom wikiju, unesite dva dijela teksta ovdje i kliknite 'Nastavi'. Prikazat će Vam se spisak stranica koje sadrže traženi tekst, i možete odabrati one kod kojih želite taj tekst zamijeniti. Vaše ime će se prikazati na historiji izmjena stranice kao korisnika koji je odgovoran za sve promjene.", # Fuzzy 'replacetext_originaltext' => 'Prvobitni tekst:', 'replacetext_replacementtext' => 'Tekst za zamjenu:', 'replacetext_useregex' => 'Koristi regularne izraze', 'replacetext_regexdocu' => '(Primjer: vrijednosti od "a(.*)c" za "Prvobitni tekst" i "ac$1" za "Novi tekst" će zamijeniti "abc" sa "acb".)', # Fuzzy 'replacetext_optionalfilters' => 'Opcionalni filteri:', 'replacetext_categorysearch' => 'Zamijeni samo u kategoriji:', 'replacetext_prefixsearch' => 'Zamijeni samo na stranicama sa prefiksom:', 'replacetext_editpages' => 'Zamijeni tekst u sadržaju stranice', 'replacetext_movepages' => 'Zamijeni tekst u naslovima stranica, ako je moguće', 'replacetext_givetarget' => 'Morate navesti znakove koji se zamjenjuju.', 'replacetext_nonamespace' => 'Morate odabrati najmanje jedan imenski prostor.', 'replacetext_editormove' => 'Morate odabrati najmanje jednu od opcija za zamjenu.', 'replacetext_choosepagesforedit' => "Molimo odaberite {{PLURAL:$3|stranicu|stranice}} za {{PLURAL:$3|koju|koje}} želite zamijeniti '$1' sa '$2':", 'replacetext_choosepagesformove' => 'Zamjena "$1" sa "$2" u nazivu {{PLURAL:$3|slijedeće stranice|slijedećih stranica}}:', 'replacetext_cannotmove' => '{{PLURAL:$1|Slijedeća stranica|Slijedeće stranice}} se ne mogu premjestiti:', 'replacetext_formovedpages' => 'Za premještene stranice:', 'replacetext_savemovedpages' => 'Spremi stare naslove kao preusmjerenja na nove naslove', 'replacetext_watchmovedpages' => 'Prati ove stranice', 'replacetext_invertselections' => 'Preokreni odabir', 'replacetext_replace' => 'Zamijeni', 'replacetext_success' => "'$1' će biti zamijenjeno sa '$2' na $3 {{PLURAL:$3|stranici|stranice|stranica}}.", 'replacetext_noreplacement' => "Nije pronađena nijedna stranica koja sadrži '$1'.", 'replacetext_nomove' => "Nijedna stranica nije pronađena čiji naslov sadrži '$1'.", 'replacetext_nosuchcategory' => 'Ne postoji nijedna kategorija pod nazivom "$1".', 'replacetext_return' => 'Nazad na obrazac.', 'replacetext_warning' => "'''Upozorenje:''' {{PLURAL:$1|Postoji $1 stranica koja već sadrži|Postoje $1 stranice koje već sadrže|Postoji $1 stranica koje već sadrže}} zamjenski tekst ''$2''. Ako želite napraviti ovu zamjenu nećete biti u mogućnosti da razdvojite Vaše zamjene od ovih tekstova.", 'replacetext_blankwarning' => 'Pošto je zamjenski tekst prazan, ovu operaciju neće biti moguće vratiti. Da li želite nastaviti?', 'replacetext_continue' => 'Nastavi', 'replacetext_editsummary' => "Zamjena teksta - '$1' u '$2'", 'right-replacetext' => 'Pravljenje zamjene teksta na cijelom wikiju', ); /** Catalan (català) * @author SMP * @author Solde */ $messages['ca'] = array( 'replacetext_continue' => 'Continua', 'right-replacetext' => 'Fer substitucions de cadena a tot el wiki', ); /** Chechen (нохчийн) * @author Sasan700 */ $messages['ce'] = array( 'replacetext_optionalfilters' => 'Тlедожийна доцу литтарш:', ); /** Czech (česky) * @author Matěj Grabovský * @author Mormegil */ $messages['cs'] = array( 'replacetext' => 'Nahradit text', 'replacetext-desc' => 'Poskytuje [[Special:ReplaceText|speciální stránku]], která správcům umožňuje globálně najít a nahradit nějaký text na všech obsahových stránkách wiki', 'replacetext_docu' => 'Pro nahrazení jednoho textového řetězce jiným na všech běžných stránkách této wiki sem zadejte ony dva texty a klikněte na „Pokračovat“. Zobrazí se seznam stránek obsahujících hledaný text, ze kterých si budete moci vybrat ty, na kterých chcete provést nahrazení. Vaše jméno se objeví v historiích stránek jako osoba zodpovědná za příslušné změny.', # Fuzzy 'replacetext_originaltext' => 'Původní text:', 'replacetext_replacementtext' => 'Nahradit textem:', 'replacetext_replace' => 'Nahradit', 'replacetext_continue' => 'Pokračovat', 'replacetext_editsummary' => 'Nahrazení textu „$1“ textem „$2“', 'right-replacetext' => 'Hledání a nahrazování textu na celé wiki', ); /** German (Deutsch) * @author Kghbln * @author Leithian * @author Melancholie * @author Merlissimo * @author Raimond Spekking * @author Umherirrender */ $messages['de'] = array( 'replacetext' => 'Text ersetzen', 'replacetext-desc' => 'Ergänzt eine [[Special:ReplaceText|Spezialseite]], die eine globale Text-suchen-und-ersetzen-Operation auf allen Inhaltsseiten ermöglicht', 'replacetext_docu' => 'Um einen Text durch einen anderen Text auf allen Inhaltsseiten zu ersetzen, gib hier die beiden Textteile ein und klicke danach auf die Schaltfläche „{{int:replacetext_continue}}“. Auf der dann folgenden Seite erhält man eine Aufzählung der Seiten, die den zu ersetzenden Text enthalten. Dort kann man auch auswählen, auf welchen Seiten die Ersetzungen durchgeführt werden sollen. Dein Benutzername wird während der Ersetzungen in der Versionsgeschichte aufgenommen.', 'replacetext_originaltext' => 'Vorhandener Text:', 'replacetext_replacementtext' => 'Neuer Text:', 'replacetext_useregex' => 'Platzhalter und reguläre Ausdrücke verwenden', 'replacetext_regexdocu' => '(Beispiel: Die Werte für „a(.*)c“ für „{{int:replacetext_originaltext}}“ und „ac$1“ für „{{int:replacetext_replacementtext}}“ würden zur Ersetzung „abc“ durch „acb“ führen.)', 'replacetext_optionalfilters' => 'Optionale Filter:', 'replacetext_categorysearch' => 'Ersetze nur in der Kategorie:', 'replacetext_prefixsearch' => 'Ersetze nur in Seiten mit dem Präfix:', 'replacetext_editpages' => 'Ersetze Text im Seiteninhalt', 'replacetext_movepages' => 'Ersetze Text auch in Seitentiteln (sofern möglich)', 'replacetext_givetarget' => 'Du musst eine Zeichenkette angeben, die ersetzt werden soll.', 'replacetext_nonamespace' => 'Mindestens ein Namensraum muss ausgewählt werden.', 'replacetext_editormove' => 'Du musst mindestens eine Ersetzungsoption wählen.', 'replacetext_choosepagesforedit' => 'Ersetzen von „$1“ durch „$2“ im Text der {{PLURAL:$3|Seite|Seiten}}:', 'replacetext_choosepagesformove' => 'Ersetze „$1“ durch „$2“ im Titel der folgenden {{PLURAL:$3|Seite|Seiten}}:', 'replacetext_cannotmove' => 'Die {{PLURAL:$1|folgende Seite kann|folgenden Seiten können}} nicht verschoben werden:', 'replacetext_formovedpages' => 'Für verschobene Seiten:', 'replacetext_savemovedpages' => 'Eine Weiterleitung für die verschobene Seite anlegen', 'replacetext_watchmovedpages' => 'Diese Seiten beobachten', 'replacetext_invertselections' => 'Auswahl umkehren', 'replacetext_replace' => 'Ersetzen', 'replacetext_success' => '„$1“ wird durch „$2“ in $3 {{PLURAL:$3|Seite|Seiten}} ersetzt.', 'replacetext_noreplacement' => 'Es wurde keine Seite gefunden, die den Text „$1“ enthält.', 'replacetext_nomove' => 'Es wurde keine Seite gefunden, deren Titel den Text „$1“ enthält.', 'replacetext_nosuchcategory' => 'Es ist keine Kategorie namens „$1“ vorhanden.', 'replacetext_return' => 'Zurück zum Formular.', 'replacetext_warning' => "'''Warnung:''' $1 {{PLURAL:$1|Seite enthält|Seiten enthalten}} bereits den zu ersetzenden Textteil „$2“. Sofern du nun die {{PLURAL:$1|Ersetzung|Ersetzungen}} durchführst, ist eine spätere Unterscheidung zwischen den nunmehr zu ersetzenden und den bereits vorhandenen Textteilen nicht mehr möglich.", 'replacetext_blankwarning' => "'''Warnung:''' Da der zu ersetzende Textteil leer ist, kann die Operation nicht rückgängig gemacht werden. Möchtest du dennoch fortfahren?", 'replacetext_continue' => 'Fortfahren', 'replacetext_editsummary' => 'Textersetzung - „$1“ durch „$2“', 'right-replacetext' => 'Textersetzung für das gesamte Wiki durchführen', ); /** German (formal address) (Deutsch (Sie-Form)‎) * @author Imre * @author Kghbln * @author Umherirrender */ $messages['de-formal'] = array( 'replacetext_docu' => 'Um einen Text durch einen anderen Text auf allen Inhaltsseiten zu ersetzen, geben Sie hier die beiden Textteile ein und klicken danach auf die „Fortfahren“-Schaltfläche. Auf der dann folgenden Seite erhält man eine Aufzählung der Seiten, die den zu ersetzenden Text enthalten. Dort kann man auch auswählen, auf welchen Seiten die Ersetzungen durchgeführt werden sollen. Ihr Benutzername wird während der Ersetzungen in der Versionsgeschichte aufgenommen.', # Fuzzy 'replacetext_givetarget' => 'Sie müssen eine Zeichenkette angeben, die ersetzt werden soll.', 'replacetext_editormove' => 'Sie müssen mindestens eine Ersetzungsoption wählen.', 'replacetext_warning' => "'''Warnung:''' $1 {{PLURAL:$1|Seite enthält|Seiten enthalten}} bereits den zu ersetzenden Textteil „$2“. Sofern Sie nun die {{PLURAL:$1|Ersetzung|Ersetzungen}} durchführen, ist eine spätere Unterscheidung zwischen den nunmehr zu ersetzenden und den bereits vorhandenen Textteilen nicht mehr möglich.", 'replacetext_blankwarning' => "'''Warnung:''' Da der zu ersetzende Textteil leer ist, kann die Operation nicht rückgängig gemacht werden. Möchten Sie dennoch fortfahren?", ); /** Lower Sorbian (dolnoserbski) * @author Michawiki */ $messages['dsb'] = array( 'replacetext' => 'Tekst wuměniś', 'replacetext-desc' => 'Staja [[Special:ReplaceText|specialny bok]] k dispoziciji, aby zmóžnił administratoram operaciju globalnego namakanja-wuměnjenja na wšych wopśimjeśowych bokach wikija pśewjasć', 'replacetext_docu' => 'Aby wuměnił tekst pśez drugi tekst na wšych regularnych bokach w toś tom wikiju, zapódaj wobej tekstowej źěla a klikni na "{{int:replacetext_continue}}". Buźoš pótom lisćinu bokow wiźeś, kótarež wopśimuju pytański tekst a móžoš wubraś te, w kótarychž coš jen wuměniś. Twójo mě zjawijo se w stawiznach boka ako wužywaŕ, kótaryž jo zagronity za te změny.', 'replacetext_originaltext' => 'Originalny tekst:', 'replacetext_replacementtext' => 'Tekst pó wuměnjenju:', 'replacetext_useregex' => 'Regularne wuraze wužywaś', 'replacetext_regexdocu' => '(Pśikład: gódnoty za "a(.*)c" za "{{int:replacetext_originaltext}}" a "ac$1" za "{{int:replacetext_replacementtext}}" by "abc" pśez "acb" wuměnili.)', 'replacetext_optionalfilters' => 'Opcionalne filtry:', 'replacetext_categorysearch' => 'Jano w kategoriji wuměniś:', 'replacetext_prefixsearch' => 'Jano w bokach wuměniś z prefiksom:', 'replacetext_editpages' => 'Tekst w datajowem wopśimjeśu wuměniś', 'replacetext_movepages' => 'Tekst w bokowych titelach wuměniś, jolic móžno', 'replacetext_givetarget' => 'Musyš tekst pódaś, kótaryž ma se wuměniś.', 'replacetext_nonamespace' => 'Musyš nanejmjenjej jaden mjenjowy rum wubraś.', 'replacetext_editormove' => 'Musyš nanejmjenjej jadnu z wuměnjeńskich opcijow wubraś.', 'replacetext_choosepagesforedit' => "Pšosym wubjeŕ {{PLURAL:$3|bok|boka|boki|boki}}, na {{PLURAL:$3|kótaremž|kótarymaž|kótarychž|kótarychž}} coš '$1' pśez '$2' wuměniś:", 'replacetext_choosepagesformove' => '"$1" pśez "$2" w titelu {{PLURAL:$3|slědujucego boka|slědujuceju bokowu|slědujucych bokow|slědujucych bokow}} wuměniś:', 'replacetext_cannotmove' => '{{PLURAL:$1|Slědujucy bok njedajo|Slědujucej boka njedajotej|Slědujuce boki njedaju|Slědujuce boki njedaju}} se pśesunuś:', 'replacetext_formovedpages' => 'Za pśesunjone boki:', 'replacetext_savemovedpages' => 'Stare titele ako dalejpósrědnjenja do nowych titelow składowaś', 'replacetext_watchmovedpages' => 'Toś te boki wobglědowaś', 'replacetext_invertselections' => 'Wuběrk pśewobrośiś', 'replacetext_replace' => 'Wuměniś', 'replacetext_success' => "'$1' wuměnja se pśez '$2' na $3 {{PLURAL:$3|boku|bokoma|bokach|bokach}}.", 'replacetext_noreplacement' => "Njejsu se namakali žedne boki, kótarež wopśimuju tekst '$1'.", 'replacetext_nomove' => "Boki, kótarychž titel wopśimujo '$1', njejsu se namakali.", 'replacetext_nosuchcategory' => 'Kategorija z mjenim "$1" njeeksistěrujo.', 'replacetext_return' => 'Slědk k formularoju.', 'replacetext_warning' => '\'\'\'Warnowanje:\'\'\' {{PLURAL:$1|Jo $1 bok, kótaryž južo wopśimujo|stej $1 boka, kótarejž južo wopśimujotej|su $1 boki, kótarež južo wopśimuju|jo $1 bokow, kótarež južo wopśimujo}} tekst, kótaryž ma se wuměniś, "$2". Jolic wuwjedujoš toś tu wuměnu, njamóžoš rozeznaś swóje wuměny wót toś togo teksta.', 'replacetext_blankwarning' => 'Dokulaž njejo tekst za wuměnjenje, toś ta operacija njedajo se anulěrowaś. Coš weto pókšacowaś?', 'replacetext_continue' => 'Dalej', 'replacetext_editsummary' => "Wuměna teksta - '$1' do '$2'", 'right-replacetext' => 'Tekst na cełem wikiju wuměniś', ); /** Greek (Ελληνικά) * @author Consta * @author Dada * @author ZaDiak * @author Απεργός */ $messages['el'] = array( 'replacetext' => 'Αντικατάσταση κειμένου', 'replacetext_originaltext' => 'Αρχικό κείμενο:', 'replacetext_replacementtext' => 'Κείμενο αντικατάστασης:', 'replacetext_optionalfilters' => 'Προαιρετικά φίλτρα:', 'replacetext_categorysearch' => 'Αντικατάσταση μόνο στην κατηγορία:', 'replacetext_editpages' => 'Αντικατάσταση κειμένου στα περιεχόμενα σελίδας', 'replacetext_nonamespace' => 'Πρέπει να επιλέξεις τουλάχιστον μια περιοχή.', 'replacetext_formovedpages' => 'Για μετακινούμενες σελίδες:', 'replacetext_watchmovedpages' => 'Παρακολούθηση αυτών των σελίδων', 'replacetext_invertselections' => 'Αναστροφή επιλογών', 'replacetext_replace' => 'Αντικατάσταση', 'replacetext_noreplacement' => 'Δε βρέθηκαν σελίδες που να περιέχουν τη συμβολοσειρά "$1".', 'replacetext_nomove' => 'Δε βρέθηκαν σελίδες των οποίων ο τίτλος να περιέχει τον όρο "$1".', 'replacetext_nosuchcategory' => 'Δεν υπάρχει κατηγορία με το όνομα "$1".', 'replacetext_return' => 'Επιστροφή στη φόρμα.', 'replacetext_continue' => 'Συνέχεια', 'replacetext_editsummary' => "Αντικατάσταση κειμένου - '$1' σε '$2'", ); /** Esperanto (Esperanto) * @author Michawiki * @author Yekrats */ $messages['eo'] = array( 'replacetext' => 'Anstataŭigi tekston', 'replacetext_originaltext' => 'Originala teksto:', 'replacetext_replacementtext' => 'Anstataŭigita teksto:', 'replacetext_optionalfilters' => 'Nedevigaj filtriloj:', 'replacetext_categorysearch' => 'Anstataŭigi nur en kategorio:', 'replacetext_movepages' => 'Anstataŭigi tekston en paĝaj titoloj, kiam eble', 'replacetext_nonamespace' => 'Vi devas elekti almenaŭ unu nomspacon.', 'replacetext_watchmovedpages' => 'Atenti ĉi tiujn paĝojn', 'replacetext_invertselections' => 'Inversigi selektojn', 'replacetext_replace' => 'Anstataŭigi', 'replacetext_success' => '"$1" estos anstataŭigita de "$2" en $3 {{PLURAL:$3|paĝo|paĝoj}}.', 'replacetext_noreplacement' => "Neniuj paĝoj estis trovitaj enhavantaj la ĉenon '$1'.", 'replacetext_return' => 'Reiri al formularo.', 'replacetext_continue' => 'Reaktivigi', 'replacetext_editsummary' => "Teksta anstataŭigo - '$1' al '$2'", ); /** Spanish (español) * @author Antur * @author Armando-Martin * @author Crazymadlover * @author Dferg * @author Imre * @author Locos epraix * @author Pertile * @author Translationista */ $messages['es'] = array( 'replacetext' => 'Reemplazar texto', 'replacetext-desc' => 'Provee a los administradores de una [[Special:ReplaceText|página especial]] para realizar una búsqueda y reemplazo global de una expresión en todas las páginas de una wiki.', 'replacetext_docu' => 'Para sustituir una cadena de texto con otra en todas las páginas de este wiki, introduce ambos textos aquí y haz clic en "{{int:replacetext_continue}}". A continuación verás un listado de páginas que contienen el texto de búsqueda, de los cuales podrás elegir aquellos en los que quieras cambiar el texto. Tu nombre aparecerá como usuario responsable de los cambios en el historial de cada una de esas páginas.', 'replacetext_originaltext' => 'Texto original:', 'replacetext_replacementtext' => 'Texto de reemplazo:', 'replacetext_useregex' => 'Utilizar expresiones regulares', 'replacetext_regexdocu' => '(Ejemplo: los valores "a(.*)c" para "{{int:replacetext_originaltext}}" y "ac$1" para "{{int:replacetext_replacementtext}}" cambiarán "abc" por "acb".)', 'replacetext_optionalfilters' => 'Filtros opcionales:', 'replacetext_categorysearch' => 'Reemplace sólo en la categoría:', 'replacetext_prefixsearch' => 'Reemplaza solamente en páginas con el prefijo:', 'replacetext_editpages' => 'Reemplazar textos en los contenidos de la página', 'replacetext_movepages' => 'Reemplazar texto en títulos de página, cuando sea posible', 'replacetext_givetarget' => 'Debe especificar la cadena de caracteres a reemplazar.', 'replacetext_nonamespace' => 'Debes seleccionar al menos un espacio de nombres.', 'replacetext_editormove' => 'Debes seleccionar al menos una de las opciones de reemplazo.', 'replacetext_choosepagesforedit' => "Por favor seleccione las {{PLURAL:$3|página|páginas}} para las cuales desea reemplazar '$1' con '$2':", 'replacetext_choosepagesformove' => 'Reemplazar "$1" con "$2" en los {{PLURAL:$3|título de la siguiente página|títulos de las siguientes páginas}}:', 'replacetext_cannotmove' => 'Las siguientes {{PLURAL:$1|página|páginas}} no pueden ser movidas:', 'replacetext_formovedpages' => 'Para páginas movidas:', 'replacetext_savemovedpages' => 'Grabar los títulos antiguos como redirecciones a los nuevos títulos', 'replacetext_watchmovedpages' => 'Vigilar estas páginas', 'replacetext_invertselections' => 'Invertir selecciones', 'replacetext_replace' => 'Reemplazar', 'replacetext_success' => "'$1' será reemplazado con '$2' en $3 {{PLURAL:$3|página|páginas}}.", 'replacetext_noreplacement' => "No se hallaron páginas que contengan la cadena de caracteres '$1'.", 'replacetext_nomove' => "No se hallaron páginas cuyo título contenga '$1'.", 'replacetext_nosuchcategory' => 'No existen categorías con el nombre "$1".', 'replacetext_return' => 'Retornar al formulario.', 'replacetext_warning' => '\'\'\'Advertencia:\'\'\' hay {{PLURAL:$1|$1 página que ya contiene|$1 páginas que ya contienen}} la cadena de sustitución, "$2". Si realizas esta sustituación, no podrás separar tus sustituciones de estas cadenas. ¿Deseas continuar con la sustitución?', 'replacetext_blankwarning' => 'Como la cadena de reemplazo está vacía, esta operación no podrá revertirse. ¿ Desea continuar ?', 'replacetext_continue' => 'Continuar', 'replacetext_editsummary' => "Texto reemplaza - '$1' a '$2'", 'right-replacetext' => 'Reemplaza cadenas de caracteres en toda la wiki', ); /** Estonian (eesti) * @author Avjoska */ $messages['et'] = array( 'replacetext_replace' => 'Asenda', ); /** Basque (euskara) * @author An13sa * @author Kobazulo */ $messages['eu'] = array( 'replacetext' => 'Testua ordeztu', 'replacetext_originaltext' => 'Jatorrizko testua:', 'replacetext_movepages' => 'Posiblea denean, orrialdeen izenburuetan ere testua ordezkatu', 'replacetext_cannotmove' => 'Hurrengo {{PLURAL:$1|orrialdea ezin da mugitu:|orrialdeak ezin dira mugitu:}}', 'replacetext_watchmovedpages' => 'Orrialde hauek jarraitu', 'replacetext_invertselections' => 'Hautaketak alderantzikatu', 'replacetext_replace' => 'Ordeztu', 'replacetext_noreplacement' => "Ez da aurkitu '$1' karaktere-katea duen orrialderik.", 'replacetext_continue' => 'Jarraitu', 'replacetext_editsummary' => "Testu aldaketa - '$1'(e)tik '$2'(e)ra.", ); /** Persian (فارسی) * @author Ebraminio * @author Huji * @author Wayiran */ $messages['fa'] = array( 'replacetext' => 'جایگزینی متن', 'replacetext-desc' => 'یک [[Special:ReplaceText|صفحهٔ ویژه]] اضافه می‌کند که به مدیران اجازه می‌دهد یک جستجو و جایگزینی سراسری در تمام محتوای ویکی انجام دهند', 'replacetext_docu' => 'برای جایگزین کردن یک رشتهٔ متنی با رشته دیگر در کل داده‌های این ویکی، شما می‌توانید دو متن را در زیر وارد کرده و دکمهٔ «جایگزین کن» را بزنید. اسم شما در تاریخچهٔ صفحه‌ها به عنوان کاربری که مسئول این تغییرها است ثبت می‌شود.', # Fuzzy 'replacetext_originaltext' => 'متن اصلی:', 'replacetext_replacementtext' => 'متن جایگزین:', 'replacetext_useregex' => 'استفاده از عبارت باقاعده', 'replacetext_regexdocu' => '(مثال: مقادیر «a(.*)c» برای «متن اصلی» و «ac$1» برای «متن جایگزین»، «abc» را با «acb» جایگزین خواهد کرد.)', # Fuzzy 'replacetext_optionalfilters' => 'پالایه‌های اختیاری:', 'replacetext_categorysearch' => 'جایگزینی فقط در ردهٔ:', 'replacetext_prefixsearch' => 'جایگزینی فقط در صفحه‌هایی با پیشوند:', 'replacetext_editpages' => 'جایگزینی متن در محتویات صفحه', 'replacetext_movepages' => 'جایگزینی متن و در عنوان صفحه‌ها، وقتی که امکان‌پذیر است', 'replacetext_givetarget' => 'شما می‌بایست متنی را که باید جایگزین شود مشخص نمایید.', 'replacetext_nonamespace' => 'شما می‌بایست حداقل یک فضای نام را انتخاب کنید.', 'replacetext_editormove' => 'شما می‌بایست حداقل یکی از گزینه‌های جایگزین کردن را انتخاب کنید.', 'replacetext_choosepagesforedit' => 'جایگزینی «$1» با «$2» در متن این {{PLURAL:$3|صفحه|صفحه‌ها}}:', 'replacetext_choosepagesformove' => 'جایگزینی «$1» با «$2» در {{PLURAL:$3|عنوان این صفحه|عنوان این صفحه‌ها}}', 'replacetext_cannotmove' => 'این {{PLURAL:$1|صفحه|صفحه‌ها}} نمی‌توانند منتقل شوند:', 'replacetext_formovedpages' => 'برای صفحه‌های منتقل شده:', 'replacetext_savemovedpages' => 'ذخیره‌سازی عنوان‌های قدیم به عنوان تغییر مسیرهایی به عنوان‌های جدید', 'replacetext_watchmovedpages' => '‌پی‌گیری این صفحه‌ها', 'replacetext_invertselections' => 'وارانه کردن انتخاب‌ها', 'replacetext_replace' => 'جایگزین کن', 'replacetext_success' => 'در $3 {{PLURAL:$3|صفحه|صفحه}} «$1» با «$2» جایگزین می‌شود.', 'replacetext_noreplacement' => "جایگزینی انجام نشد؛ صفحه‌ای که حاوی '$1' باشد پیدا نشد.", 'replacetext_nomove' => 'صفحه‌ای پیدا نشد که عنوان آن «$1» را داشته باشد.', 'replacetext_nosuchcategory' => 'رده‌ای با نام «$1» وجود ندارد.', 'replacetext_return' => 'بازگشت به فرم.', 'replacetext_warning' => "'''هشدار:''' در حال حاضر $1 صفحه وجود دارد که حاوی رشتهٔ جایگزینی «$2» {{PLURAL:$1|است|هستند}}. اگر شما این جایگزینی را انجام دهید، قادر نخواهید بود تا جایگزینی‌هایتان را از این رشته‌ها جدا کنید.", 'replacetext_blankwarning' => 'چون متن جایگزین خالی است، این عمل قابل بازگشت نخواهد بود؛ ادامه می‌دهید؟', 'replacetext_continue' => 'ادامه', 'replacetext_editsummary' => "جایگزینی متن - '$1' به '$2'", 'right-replacetext' => 'انجام جایگزین کردن رشته در تمام ویکی', ); /** Finnish (suomi) * @author Cimon Avaro * @author Crt * @author Nike * @author Silvonen * @author Str4nd * @author Usp */ $messages['fi'] = array( 'replacetext' => 'Korvaa teksti', 'replacetext-desc' => 'Lisää [[Special:ReplaceText|toimintosivun]], jonka kautta ylläpitäjät voivat etsiä ja korvata wikin sisältämää tekstiä', 'replacetext_docu' => "Korvataksesi yhden merkkijonon toisella kaikissa tämän wikin tavallisissa sivuissa, syötä molemmat kaksi tekstinpätkää tänne ja sitten napsauta kohtaa 'Jatka'. Tämän jälkeen sinulle näytetään luettelo sivuista, jotka sisältävät haetun tekstin, ja voit valita ne, joihin haluat korvata sen. Oma nimesi näkyy sivun historiassa käyttäjänä joka on vastuussa kaikista tehdyistä muutoksista.", # Fuzzy 'replacetext_originaltext' => 'Alkuperäinen teksti', 'replacetext_replacementtext' => 'Korvaava teksti', 'replacetext_useregex' => 'Käytä säännöllisiä lausekkeita', 'replacetext_optionalfilters' => 'Lisäehtoja:', 'replacetext_categorysearch' => 'Muokkaa ainoastaan sivuja, jotka ovat luokassa:', 'replacetext_prefixsearch' => 'Korvaa ainoastaan sivuilla, joissa on etuliite:', 'replacetext_editpages' => 'Korvaa teksti sivujen sisällöstä', 'replacetext_movepages' => 'Korvaa teksti otsikoista, jos mahdollista', 'replacetext_givetarget' => 'Sinun tulee määrittää korvattava merkkijono.', 'replacetext_nonamespace' => 'Sinun täytyy valita vähintään yksi nimiavaruus.', 'replacetext_editormove' => 'Sinun on valittava vähintään yksi kohde, mistä etsitään.', 'replacetext_choosepagesforedit' => 'Korvaa teksti "$1" tekstillä "$2" {{PLURAL:$3|seuraavalta sivulta|seuraavilta sivuilta}}:', 'replacetext_choosepagesformove' => 'Korvaa teksti "$1" tekstillä "$2" {{PLURAL:$3|seuraavan sivun otsikossa|seuraavien sivujen otsikoissa}}:', 'replacetext_cannotmove' => '{{PLURAL:$1|Seuraavaa sivua|Seuraavia sivuja}} ei voi siirtää:', 'replacetext_formovedpages' => 'Tee siirretyille sivuille:', 'replacetext_savemovedpages' => 'Tallenna vanhat sivujen otsikot ohjauksina uusiin sivuihin.', 'replacetext_watchmovedpages' => 'Tarkkaile näitä sivuja', 'replacetext_invertselections' => 'Käänteinen valinta', 'replacetext_replace' => 'Korvaa', 'replacetext_success' => '"$1" korvataan tekstillä "$2" $3 {{PLURAL:$3|sivulla|sivulla}}.', 'replacetext_noreplacement' => 'Tekstin "$1" leipätekstissään sisältäviä sivuja ei löytynyt.', 'replacetext_nomove' => 'No pages were found whose title contains "$1".', 'replacetext_nosuchcategory' => 'Luokkaa "$1" ei ole.', 'replacetext_return' => 'Palaa lomakkeeseen.', 'replacetext_warning' => "'''Varoitus:''' {{PLURAL:$1|$1 sivu| $1 sivua}} sisältää jo korvaavan tekstin, ”$2”. Korvauksen jälkeen korvatut ja jo tekstin sisältäneet kohdat eivät erotu toisistaan.", 'replacetext_blankwarning' => "'''Varoitus:''' Koska korvaava teksti on tyhjä, operaatiota ei voi palauttaa käänteisellä korvauksella.", 'replacetext_continue' => 'Jatka', 'replacetext_editsummary' => 'Tekstin korvaus – ”$1” muotoon ”$2”', 'right-replacetext' => 'Tehdä merkkijonojen korvauksia koko wikin laajuudella', ); /** French (français) * @author Crochet.david * @author Grondin * @author IAlex * @author McDutchie * @author Peter17 * @author PieRRoMaN * @author Urhixidur * @author Verdy p * @author Zetud */ $messages['fr'] = array( 'replacetext' => 'Remplacer le texte', 'replacetext-desc' => 'Fournit une page spéciale permettant aux administrateurs de remplacer des chaînes de caractères par d’autres sur l’ensemble du wiki', 'replacetext_docu' => 'Pour remplacer une chaîne de caractères par une autre sur l’ensemble des données des pages de ce wiki, vous pouvez entrez les deux textes ici et cliquer sur « {{int:replacetext_replace}} ». Une liste des pages contenant le texte recherché apparaîtra et vous pourrez choisir celles que vous voulez modifier. Votre nom apparaîtra dans l’historique des pages tel un utilisateur auteur des changements.', 'replacetext_originaltext' => 'Texte original :', 'replacetext_replacementtext' => 'Texte de remplacement :', 'replacetext_useregex' => 'Utiliser des expressions rationnelles', 'replacetext_regexdocu' => '(Exemple : la valeur « a(.*)c » pour « {{int:replacetext_originaltext}} » et « ac$1 » pour « {{int:replacetext_replacementtext}} » remplace « abc » avec « acb ».)', 'replacetext_optionalfilters' => 'Filtres optionnels :', 'replacetext_categorysearch' => 'Remplacer seulement dans la catégorie :', 'replacetext_prefixsearch' => 'Remplacer seulement dans les pages ayant le préfixe :', 'replacetext_editpages' => 'Remplacer le texte dans le contenu dans la page', 'replacetext_movepages' => 'Remplacer le texte dans le titre des pages, si possible', 'replacetext_givetarget' => 'Vous devez spécifier la chaîne à remplacer.', 'replacetext_nonamespace' => 'Vous devez sélectionner au moins un espace de noms.', 'replacetext_editormove' => 'Vous devez choisir au moins une option de remplacement.', 'replacetext_choosepagesforedit' => 'Veuillez sélectionner {{PLURAL:$3|la pages|les pages}} dans {{PLURAL:$3|laquelle|lesquelles}} vous voulez remplacer « $1 » par « $2 » :', 'replacetext_choosepagesformove' => 'Remplacer « $1 » par « $2 » dans {{PLURAL:$3|le nom de la page suivante|les noms des pages suivantes}} :', 'replacetext_cannotmove' => '{{PLURAL:$1|La page suivante n’a pas pu être renommée|Les pages suivantes n’ont pas pu être renommées}} :', 'replacetext_formovedpages' => 'Pour les pages renommées :', 'replacetext_savemovedpages' => 'Enregistrer les anciens titres comme redirections vers les nouveaux titres', 'replacetext_watchmovedpages' => 'Suivre ces pages', 'replacetext_invertselections' => 'Inverser les sélections', 'replacetext_replace' => 'Remplacer', 'replacetext_success' => '« $1 » sera remplacé par « $2 » dans $3 fichier{{PLURAL:$3||s}}.', 'replacetext_noreplacement' => 'Aucun fichier contenant la chaîne « $1 » n’a été trouvé.', 'replacetext_nomove' => 'Aucune page n’a été trouvée dont le titre contient « $1 ».', 'replacetext_nosuchcategory' => 'Il n’existe pas de catégorie nommée « $1 ».', 'replacetext_return' => 'Revenir au formulaire.', 'replacetext_warning' => 'Il y a $1 fichier{{PLURAL:$1| qui contient|s qui contiennent}} déjà la chaîne de remplacement « $2 ». Si vous effectuez cette substitution, vous ne pourrez pas distinguer vos modifications de ces chaînes.', 'replacetext_blankwarning' => 'Parce que la chaîne de remplacement est vide, cette opération sera irréversible ; voulez-vous continuer ?', 'replacetext_continue' => 'Continuer', 'replacetext_editsummary' => 'Remplacement du texte — « $1 » par « $2 »', 'right-replacetext' => 'Faire des remplacements de texte dans tout le wiki', ); /** Franco-Provençal (arpetan) * @author ChrisPtDe */ $messages['frp'] = array( 'replacetext' => 'Remplaciér lo tèxto', 'replacetext_originaltext' => 'Tèxto d’origina :', 'replacetext_replacementtext' => 'Tèxto de remplacement :', 'replacetext_useregex' => 'Utilisar des èxprèssions racionèles', 'replacetext_optionalfilters' => 'Filtros u chouèx :', 'replacetext_categorysearch' => 'Remplaciér solament dedens la catègorie :', 'replacetext_prefixsearch' => 'Remplaciér solament dedens les pâges qu’ont lo prèfixo :', 'replacetext_editpages' => 'Remplaciér lo tèxto dedens lo contegnu de la pâge', 'replacetext_movepages' => 'Remplaciér lo tèxto dedens lo titre de les pâges, se possiblo', 'replacetext_givetarget' => 'Vos dête spècifiar la chêna a remplaciér.', 'replacetext_nonamespace' => 'Vos dête chouèsir u muens yon èspâço de noms.', 'replacetext_editormove' => 'Vos dête chouèsir u muens yon chouèx de remplacement.', 'replacetext_formovedpages' => 'Por les pâges renomâs :', 'replacetext_watchmovedpages' => 'Siuvre cetes pâges', 'replacetext_invertselections' => 'Envèrsar los chouèx', 'replacetext_replace' => 'Remplaciér', 'replacetext_return' => 'Tornar u formulèro.', 'replacetext_continue' => 'Continuar', 'replacetext_editsummary' => 'Remplacement du tèxto — « $1 » per « $2 »', ); /** Galician (galego) * @author Hamilton Abreu * @author Toliño */ $messages['gl'] = array( 'replacetext' => 'Substituír un texto', 'replacetext-desc' => 'Proporciona unha [[Special:ReplaceText|páxina especial]] para que os administradores poidan facer unha cadea global para atopar e substituír un texto no contido de todas as páxinas dun wiki', 'replacetext_docu' => 'Para substituír unha cadea de texto por outra en todas as páxinas regulares deste wiki, insira aquí as dúas pezas de texto e logo prema en "{{int:replacetext_continue}}". Despois mostraráselle unha lista das páxinas que conteñen o texto buscado e poderá elixir en cales quere substituílo. O seu nome aparecerá nos histotiais das páxinas como o usuario responsable de calquera cambio.', 'replacetext_originaltext' => 'Texto orixinal:', 'replacetext_replacementtext' => 'Texto de substitución:', 'replacetext_useregex' => 'Usar expresións regulares', 'replacetext_regexdocu' => '(Exemplo: Os valores "a(.*)c" en "{{int:replacetext_originaltext}}" e "ac$1" en "{{int:replacetext_replacementtext}}" han substituír "abc" por "acb".)', 'replacetext_optionalfilters' => 'Filtros opcionais:', 'replacetext_categorysearch' => 'Substituír só na categoría:', 'replacetext_prefixsearch' => 'Substituír só nas páxinas co prefixo:', 'replacetext_editpages' => 'Substituír o texto nos contidos da páxina', 'replacetext_movepages' => 'Substituír o texto nos títulos das páxinas, cando sexa posible', 'replacetext_givetarget' => 'Debe especificar a cadea que vai ser substituída.', 'replacetext_nonamespace' => 'Debe escoller, polo menos, un espazo de nomes.', 'replacetext_editormove' => 'Debe seleccionar, polo menos, unha das opcións de substitución.', 'replacetext_choosepagesforedit' => 'Substituír "$1" por "$2" no texto {{PLURAL:$3|da seguinte páxina|das seguintes páxinas}}:', 'replacetext_choosepagesformove' => 'Substituír "$1" por "$2" {{PLURAL:$3|no título da seguinte páxina|nos títulos das seguintes páxinas}}:', 'replacetext_cannotmove' => '{{PLURAL:$1|A seguinte páxina|As seguintes páxinas}} non {{PLURAL:$1|pode|poden}} ser {{PLURAL:$1|movida|movidas}}:', 'replacetext_formovedpages' => 'Para as páxinas movidas:', 'replacetext_savemovedpages' => 'Gardar os títulos vellos como redireccións cara aos títulos novos', 'replacetext_watchmovedpages' => 'Vixíe estas páxinas', 'replacetext_invertselections' => 'Inverter as seleccións', 'replacetext_replace' => 'Substituír', 'replacetext_success' => '"$1" será substituído por "$2" {{PLURAL:$3|nunha páxina|en $3 páxinas}}.', 'replacetext_noreplacement' => "Non foi atopada ningunha páxina que contivese a cadea '$1'.", 'replacetext_nomove' => 'Non se atopou ningún artigo cuxo título conteña "$1".', 'replacetext_nosuchcategory' => 'Non existe ningunha categoría co nome "$1".', 'replacetext_return' => 'Volver ao formulario.', 'replacetext_warning' => '\'\'\'Aviso:\'\'\' Hai {{PLURAL:$1|unha páxina|$1 páxinas}} que xa {{PLURAL:$1|contén|conteñen}} a cadea de substitución "$2". Se fai esta substitución non poderá distinguir as súas modificacións destas cadeas.', 'replacetext_blankwarning' => "'''Atención:''' Debido a que a cadea de substitución está baleira, esta operación non será reversible.", 'replacetext_continue' => 'Continuar', 'replacetext_editsummary' => 'Substitución de texto - de "$1" a "$2"', 'right-replacetext' => 'Facer substitucións de cordas no wiki enteiro', ); /** Ancient Greek (Ἀρχαία ἑλληνικὴ) * @author Crazymadlover * @author Omnipaedista */ $messages['grc'] = array( 'replacetext' => 'Ἀντικαθιστάναι κείμενον', 'replacetext_originaltext' => 'Πρωτότυπον κείμενον:', 'replacetext_replacementtext' => 'Κείμενον ἀντικαταστάσεως:', 'replacetext_formovedpages' => 'Περὶ μετακεκινημένων δέλτων:', 'replacetext_watchmovedpages' => 'Ἐφορᾶν τάσδε τὰς δέλτους', 'replacetext_replace' => 'Ἀντικαθιστάναι', 'replacetext_return' => 'Ἐπανιέναι εἰς τὸν τύπον.', 'replacetext_continue' => 'Συνεχίζειν', ); /** Swiss German (Alemannisch) * @author Als-Holder */ $messages['gsw'] = array( 'replacetext' => 'Täxt ersetze', 'replacetext-desc' => 'Ergänzt e [[Special:ReplaceText|Spezialsyte]], wu s Ammanne megli macht, e wältwyti Täxt-suechen-un-ersetze-Operation in allene Inhaltsyte vum Wiki durzfiere', 'replacetext_docu' => 'Go ne Täxt dur e andere Täxt uf allene Inhaltssyte z ersetze, gib di bede Täxtteil doo yy un druck uf Ersetze-Schaltflächi. Dir wird derno ne Lischt vu dr Syte zeigt, wu s dr gsuecht Täxt din het, un Du chasch die uuswehle, wu Du dr Täxt witt din ersetze. Dyy Benutzername wird in d Versionsgschicht ufgnuh', # Fuzzy 'replacetext_originaltext' => 'Originaltäxt:', 'replacetext_replacementtext' => 'Neje Täxt:', 'replacetext_useregex' => 'Platzhalter un reguläri Uusdruck verwände', 'replacetext_regexdocu' => '(Byschpel: D Wärt fir „a(.*)c“ fir „Originaltext“ un „ac$1“ fir „Neje Text“ deete zue dr Ersetzig „abc“ dur „acb“ fiere.)', # Fuzzy 'replacetext_optionalfilters' => 'Optionali Filter:', 'replacetext_categorysearch' => 'Nume in däre Kategorie ersetze:', 'replacetext_prefixsearch' => 'Nume in Syte ersetze mit däm Präfix:', 'replacetext_editpages' => 'Täxt im Syteinhalt ersetze', 'replacetext_movepages' => 'Ersetz Täxt au in Sytetitel, wänn s goht', 'replacetext_givetarget' => 'Du muesch d Zeichechette spezifiziere, wu soll ersetzt wäre.', 'replacetext_nonamespace' => 'Zmindescht ei Namensruum muess uusgwehlt wäre.', 'replacetext_editormove' => 'Du muesch zmindescht eini vu dr Ersetzigsoptione uuswehle.', 'replacetext_choosepagesforedit' => 'Bitte d {{PLURAL:$3|Syten|Syten}} uuswehle, wu Du „$1“ dur „$2“ wetsch ersetzen:', 'replacetext_choosepagesformove' => 'Ersetz „$1“ dur „$2“ {{PLURAL:$3|im Name vu däre Syte|in dr Näme vu däne Syte}}:', 'replacetext_cannotmove' => 'Die {{PLURAL:$1|Syte cha|Syte chenne}} nit verschobe wäre:', 'replacetext_formovedpages' => 'Fir verschobeni Syte:', 'replacetext_savemovedpages' => 'Di alte Sytenäme as Wyterleitig zue dr neje Sytenäme spychere', 'replacetext_watchmovedpages' => 'Die Syte beobachte', 'replacetext_invertselections' => 'Uuswahl umchehre', 'replacetext_replace' => 'Ersetze', 'replacetext_success' => '„$1“ wird dur „$2“ in $3 {{PLURAL:$3|Syten|Syten}} ersetzt.', 'replacetext_noreplacement' => 'S isch kei Syte gfunde wore, wu s dr Täxt „$1“ din het.', 'replacetext_nomove' => "S sin kei Syte gfunde wore, wu '$1' im Titel hän", 'replacetext_nosuchcategory' => 'S git kei Kategorii mit em Name „$1“.', 'replacetext_return' => 'Zrugg zum Formular.', 'replacetext_warning' => "'''Warnig:''' In $1 {{PLURAL:$1|Syte het s|Seite het s}} dr Täxtteil „$2“, wu ersetzt soll wäre, scho. E Trännig vu dr Ersetzige mit dr Täxtteil, wu s scho het, sich nit megli. Mechtsch einewäg wytermache?", 'replacetext_blankwarning' => 'Dr Täxtteil, wu soll ersetzt wären, isch läär. D Operation cha nit ruckgängig gmacht wäre, einewäg wytermache?', 'replacetext_continue' => 'Wytermache', 'replacetext_editsummary' => 'Täxtersetzig - „$1“ dur „$2“', 'right-replacetext' => 'Mach e Täxtersetzig fir s gsamt Wiki', ); /** Hebrew (עברית) * @author Amire80 * @author Rotemliss * @author YaronSh */ $messages['he'] = array( 'replacetext' => 'החלפת טקסט', 'replacetext-desc' => 'אספקת [[Special:ReplaceText|דף מיוחד]] כדי לאפשר למפעילים לבצע חיפוש והחלפה של מחרוזות בכל דפי התוכן בוויקי', 'replacetext_docu' => 'כדי להחליף מחרוזת טקסט אחת באחרת בכל הדפים הרגילים בוויקי זה, הזינו את הטקסט בשני חלקים ולחצו על "{{int:replacetext_continue}}". אז תוצג בפניכם רשימת דפים המכילים את הטקסט שחיפשתם, ותוכלו לבחור את הדפים שבהם תרצו להחליף את הטקסט האמור. שמכם יופיע בהיסטוריית הגרסאות של כל דף בתור המשתמש האחראי לשינויים שנעשו.', 'replacetext_originaltext' => 'הטקסט המקורי:', 'replacetext_replacementtext' => 'טקסט ההחלפה:', 'replacetext_useregex' => 'להשתמש בביטויים רגולריים', 'replacetext_regexdocu' => '(דוגמה: ערכים של "a(.*)c" עבור "{{int:replacetext_originaltext}}" ושל "ac$1" עבור "{{int:replacetext_replacementtext}}" יחליפו "abc" ב־"acb".)', 'replacetext_optionalfilters' => 'מסננים אופציונליים:', 'replacetext_categorysearch' => 'החלפה רק בקטגוריה:', 'replacetext_prefixsearch' => 'החלפה רק בדפים בעלי הקידומת:', 'replacetext_editpages' => 'החלפת טקסט בתוכן הדפים', 'replacetext_movepages' => 'החלפת טקסט בכותרות הדפים, כשניתן', 'replacetext_givetarget' => 'יש לציין את המחרוזת שתוחלף.', 'replacetext_nonamespace' => 'יש לבחור מרחב שם אחד לפחות.', 'replacetext_editormove' => 'יש לבחור לפחות באחת מאפשרויות ההחלפה.', 'replacetext_choosepagesforedit' => "אנא בחרו את {{PLURAL:$3|הדף בו|הדפים בהם}} ברצונכם להחליף את '$1' ב־'$2':", 'replacetext_choosepagesformove' => 'החלפת "$1" ב־"$2" ב{{PLURAL:$3|שם הדף הבא|שמות הדפים הבאים}}:', 'replacetext_cannotmove' => 'לא ניתן להעביר את {{PLURAL:$1|הדף הבא|הדפים הבאים}}:', 'replacetext_formovedpages' => 'עבור דפים שיועברו:', 'replacetext_savemovedpages' => 'שמירת שמות הדפים הישנים כהפניות לשמות הדפים החדשים', 'replacetext_watchmovedpages' => 'מעקב אחר דפים אלה', 'replacetext_invertselections' => 'הפיכת הבחירות', 'replacetext_replace' => 'החלפה', 'replacetext_success' => "'$1' יוחלף ב־'$2' ב־{{PLURAL:$3|דף אחד|$3 דפים}}.", 'replacetext_noreplacement' => "לא נמצאו דפים המכילים את המחרוזת '$1'.", 'replacetext_nomove' => "לא נמצאו דפים ששמם מכיל '$1'.", 'replacetext_nosuchcategory' => 'לא קיימת קטגוריה בשם "$1".', 'replacetext_return' => 'חזרה לטופס.', 'replacetext_warning' => '\'\'\'אזהרה\'\'\': {{PLURAL:$1|ישנו עמוד אחד שכבר מכיל|ישנם $1 עמודים שכבר מכילים}} את מחרוזת ההחלפה, "$2". אם החלפה זו תבוצע לא תהיה באפשרותך להפריד את החלפותיך מ{{PLURAL:$1|מחרוזת זו|מחרוזות אלו}}.', 'replacetext_blankwarning' => 'כיוון שמחרוזת ההחלפה ריקה, לא ניתן יהיה לבטל פעולה זו; להמשיך?', 'replacetext_continue' => 'המשך', 'replacetext_editsummary' => 'החלפת טקסט – "$1" ב־"$2"', 'right-replacetext' => 'ביצוע החלפת מחרוזות באתר הוויקי כולו', ); /** Croatian (hrvatski) * @author Bugoslav * @author Dalibor Bosits * @author Ex13 * @author Herr Mlinka */ $messages['hr'] = array( 'replacetext' => 'Zamjeni tekst', 'replacetext-desc' => 'Dodaje [[Special:ReplaceText|posebnu stranicu]] koja omogućava administratorima globalnu zamjenu teksta na principu nađi-zamjeni na svim stranicama wikija.', 'replacetext_docu' => "Za zamjenu jednog teksta s drugim na svim stranicama wikija, upišite ciljani i zamjenski tekst ovdje i pritisnite 'Dalje'. Pokazati će vam se popis stranica koje sadrže ciljani tekst, i moći ćete odabrati u kojima od njih želite izvršiti zamjenu. Vaše ime će se pojaviti u povijesti stranice kao suradnik odgovoran za promjenu.", # Fuzzy 'replacetext_originaltext' => 'Izvorni tekst:', 'replacetext_replacementtext' => 'Zamjenski tekst:', 'replacetext_movepages' => 'Zamijeni tekst u naslovima stranica, ako je moguće', 'replacetext_choosepagesforedit' => "Molimo odaberite {{PLURAL:$3|stranicu|stranice}} na kojima želite zamijeniti '$1' za '$2':", 'replacetext_choosepagesformove' => 'Zamijeni "$1" s "$2" u {{PLURAL:$1|naslovu sljedeće stranice|naslovima sljedećih stranica}}:', # Fuzzy 'replacetext_cannotmove' => '{{PLURAL:$1|Sljedeća stranica|Sljedeće stranice}} ne mogu biti premještene:', 'replacetext_watchmovedpages' => 'Prati ove stranice', 'replacetext_invertselections' => 'Izvrni odabir', 'replacetext_replace' => 'Zamjeni', 'replacetext_success' => "'$1' će biti zamijenjen za '$2' na $3 {{PLURAL:$3|stranici|stranice|stranica}}.", 'replacetext_noreplacement' => "Nije pronađena ni jedna stranica koja sadrži '$1'.", 'replacetext_warning' => "Postoji {{PLURAL:$1|$1 stranica koja već sadrži|$1 stranica koje već sadrže}} zamjenski tekst, '$2'. Ako napravite ovu zamjenu nećete moći odvojiti svoju zamjenu od ovog teksta. Nastaviti sa zamjenom?", # Fuzzy 'replacetext_blankwarning' => 'Zato što je zamjenski tekst prazan, ovaj postupak se neće moći vratiti; nastaviti?', 'replacetext_continue' => 'Dalje', 'replacetext_editsummary' => "Zamjena teksta - '$1' u '$2'", ); /** Upper Sorbian (hornjoserbsce) * @author Michawiki */ $messages['hsb'] = array( 'replacetext' => 'Tekst narunać', 'replacetext-desc' => 'Staji [[Special:ReplaceText|specialnu stronu]] k dispoziciji, kotraž administratoram zmóžnja, globalne pytanje a narunanje teksta na wšěch wobsahowych stronach wikija přewjesć', 'replacetext_docu' => 'Zo by tekst přez druhi tekst na wšěch regularnych stronach tutoho wikija narunał, zapodaj wobaj tekstowej dźělej a klikń potom na "{{int:replacetext_continue}}". Budźeš potom lisćinu stronow widźeć, kotrež pytany tekst wobsahuja a móžeš te z nich wubrać, w kotrejž chceš tekst narunać. Twoje mjeno zjewi so w stawiznach strony jako wužiwar, kotryž je zamołwity za změny.', 'replacetext_originaltext' => 'Originalny tekst:', 'replacetext_replacementtext' => 'Narunanski tekst:', 'replacetext_useregex' => 'regularne wuraz wužiwać', 'replacetext_regexdocu' => '(Přikład: hódnoty za "a(.*)c" za "{{int:replacetext_originaltext}}"a "ac$1" za "{{int:replacetext_replacementtext}}" bychu "abc" přez "acb" wuměnili.)', 'replacetext_optionalfilters' => 'Opcionalne filtry:', 'replacetext_categorysearch' => 'Jenož w kategoriji narunać:', 'replacetext_prefixsearch' => 'Jenož w stronach narunać z prefiksom:', 'replacetext_editpages' => 'Tekst we wobsahu strony narunać', 'replacetext_movepages' => 'Tekst w titulach stronow narunać, jeli móžno', 'replacetext_givetarget' => 'Dyrbiš tekst podać, kotryž ma so narunać.', 'replacetext_nonamespace' => 'Dyrbiš znajmjeńša jedyn mjenowy rum wubrać.', 'replacetext_editormove' => 'Dyrbiš znajmjeńša jednu z narunanskich opcijow wubrać.', 'replacetext_choosepagesforedit' => '"$1" w {{PLURAL:$3|slědowacej stronje|slědowacymaj stronomaj|slědowacych stronach|slědowacych stronach}} přez "$2" wuměnić:', 'replacetext_choosepagesformove' => '"$1" přez "$2" w titulu {{PLURAL:$3|slědowaceje strony|slědowaceju stronow|slědowacych stronow|slědowacych stronow}} narunać:', 'replacetext_cannotmove' => '{{PLURAL:$1|Slědowaca strona njehodźi|Slědowacej stronje njehodźitej|Slědowace strony njehodźa|Slědowace strony njehodźa}} so přesunyć:', 'replacetext_formovedpages' => 'Za přesunjene strony:', 'replacetext_savemovedpages' => 'Stare titule jako daleposrědkowanja do nowych titulow składować', 'replacetext_watchmovedpages' => 'Tute strony wobkedźbować', 'replacetext_invertselections' => 'Wuběry wobroćić', 'replacetext_replace' => 'Narunać', 'replacetext_success' => "'$1' so w $3 {{PLURAL:$3|stronje|stronomaj|stronach|stronach}} přez '$2' naruna.", 'replacetext_noreplacement' => "Njejsu so žane strony namakali, kotrež wuraz '$1' wobsahuja.", 'replacetext_nomove' => "Strony, kotrychž titul '$1' wobsahuje, njebuchu namakane.", 'replacetext_nosuchcategory' => 'Kategorija z mjenom "$1" njeeksistuje.', 'replacetext_return' => 'Wróćo k formularej', 'replacetext_warning' => "'''Warnowanje:''' {{PLURAL:$1|Je hižo $1 strona, kotraž wobsahuje|Stej hižo $1 stronje, kotejž wobsahujetej|Su hižo $1 strony, kotrež wobsahuja|Je hižo $1 stronow, kotrež wobsahuje}} narunanski tekst, '$2'. Jeli tute narunanje činiš, njemóžeš swoje narunanja wot tutoho teksta rozdźělić.", 'replacetext_blankwarning' => 'Narunanski dźěl je prózdny, tohodla operacija njeda so cofnyć; njedźiwajo na to pokročować?', 'replacetext_continue' => 'Dale', 'replacetext_editsummary' => "Tekstowe narunanje - '$1' do '$2'", 'right-replacetext' => 'Tekstowe narunanja na cyłym wikiju činić', ); /** Hungarian (magyar) * @author Glanthor Reviol */ $messages['hu'] = array( 'replacetext' => 'Szöveg cseréje', 'replacetext-desc' => '[[Special:ReplaceText|Speciális lap]] adminisztrátorok részére szövegek globális keresés-és-cseréjére a wiki összes tartalom oldalán', 'replacetext_docu' => 'Hogy lecserélj egy szöveget egy másikra az összes tartalom lapon a wikin, add meg a keresendő és a cél szöveget, majd kattints a „Folytatás”-ra. Ezután kapsz egy listát azokról a lapokról, amelyek tartalmazzák a cserélendő szöveget, és kiválaszthatod azokat, amelyekben végre szeretnéd hajtani a cserét. A neved szerepelni fog a laptörténetekben, mint aki a változtatásokat végezte.', # Fuzzy 'replacetext_originaltext' => 'Eredeti szöveg:', 'replacetext_replacementtext' => 'Új szöveg:', 'replacetext_optionalfilters' => 'Választható szűrők:', 'replacetext_categorysearch' => 'Csere csak ebben a kategóriában:', 'replacetext_prefixsearch' => 'Csere csak a következő előtaggal rendelkező lapokon:', 'replacetext_editpages' => 'Szöveg cseréje a lap tartalmában', 'replacetext_movepages' => 'Szöveg cseréje a lapok címeiben, ha lehetséges', 'replacetext_givetarget' => 'Meg kell adnod a cserélendő szöveget.', 'replacetext_nonamespace' => 'Ki kell választanod legalább egy névteret.', 'replacetext_editormove' => 'Ki kell választanod legalább egyet a csere lehetőségek közül.', 'replacetext_choosepagesforedit' => '„$1” cseréje „$2” kifejezésre a következő {{PLURAL:$3|lap|lapok}} szövegében:', 'replacetext_choosepagesformove' => '„$1” cseréje „$2” kifejezésre a következő {{PLURAL:$3|lap címében|lapok címeiben}}:', 'replacetext_cannotmove' => 'A következő {{PLURAL:$1|lap|lapok}} nem nevezhetőek át:', 'replacetext_formovedpages' => 'Az átnevezett lapokhoz:', 'replacetext_savemovedpages' => 'A régi címek megtartása átirányításként az új címekre', 'replacetext_watchmovedpages' => 'Figyeld ezeket a lapokat', 'replacetext_invertselections' => 'Kijelölések megfordítása', 'replacetext_replace' => 'Csere', 'replacetext_success' => '„$1” cseréje $3 lapon erre: „$2”.', 'replacetext_noreplacement' => 'Egy lap sem tartalmazza a(z) „$1” szöveget.', 'replacetext_nomove' => 'Nem található olyan lap, melynek címe tartalmazza a(z) „$1” keresőkifejezést.', 'replacetext_nosuchcategory' => 'Nincs „$1” nevű kategória.', 'replacetext_return' => 'Visszatérés az űrlapra.', 'replacetext_warning' => "'''Figyelem:''' {{PLURAL:$1|egy|$1}} lap már tartalmazza a szöveget, amire cserélni szeretnél („$2”). Ha végrehajtod a cserét, utólag nem fogod tudni megkülönböztetni az újonnan bekerült szövegeket a már előtte is meglevő előfordulásoktól.", 'replacetext_blankwarning' => 'Mivel az új szöveg üres, ez a művelet nem lesz visszavonható. Biztosan folytatni szeretnéd?', 'replacetext_continue' => 'Folytatás', 'replacetext_editsummary' => 'Szöveg cseréje – „$1” → „$2”', 'right-replacetext' => 'szövegcserék végrehajtása az egész wikin', ); /** Interlingua (interlingua) * @author McDutchie */ $messages['ia'] = array( 'replacetext' => 'Reimplaciar texto', 'replacetext-desc' => 'Forni un [[Special:ReplaceText|pagina special]] que permitte al administratores cercar e reimplaciar globalmente un catena de characteres in tote le paginas de contento de un wiki', 'replacetext_docu' => "Pro reimplaciar un catena de characteres per un altere trans tote le paginas regular in iste wiki, entra le duo pecias de texto hic e clicca super 'Continuar'. Postea se monstrara un lista de paginas que contine le texto cercate, e tu potera seliger in quales tu vole reimplaciar lo. Tu nomine figurara in le historias del paginas como le usator responsabile de omne modificationes.", # Fuzzy 'replacetext_originaltext' => 'Texto original:', 'replacetext_replacementtext' => 'Nove texto:', 'replacetext_useregex' => 'Usar expressiones regular', 'replacetext_regexdocu' => '(Exemplo: valores de "a(.*)c" pro "Texto original" e "ac$1" pro "Texto de substitution" reimplaciarea "abc" per "acb".)', # Fuzzy 'replacetext_optionalfilters' => 'Filtros optional:', 'replacetext_categorysearch' => 'Reimplaciar solmente in le categoria:', 'replacetext_prefixsearch' => 'Reimplaciar solmente in paginas con le prefixo:', 'replacetext_editpages' => 'Reimplaciar texto in contento de pagina', 'replacetext_movepages' => 'Reimplaciar texto in titulos de paginas, quando possibile', 'replacetext_givetarget' => 'Tu debe specificar le texto a esser reimplaciate.', 'replacetext_nonamespace' => 'Tu debe seliger al minus un spatio de nomines.', 'replacetext_editormove' => 'Tu debe seliger al minus un del optiones de reimplaciamento.', 'replacetext_choosepagesforedit' => "Per favor selige le {{PLURAL:$3|pagina in le qual|paginas in le quales}} tu vole reimplaciar '$1' per '$2':", 'replacetext_choosepagesformove' => 'Reimplaciar "$1" per "$2" in le {{PLURAL:$3|titulo del sequente pagina|titulos del sequente paginas}}:', 'replacetext_cannotmove' => 'Le sequente {{PLURAL:$1|pagina|paginas}} non pote esser renominate:', 'replacetext_formovedpages' => 'Pro pagina renominate:', 'replacetext_savemovedpages' => 'Preservar le ancian titulos como redirectiones verso le nove titulos', 'replacetext_watchmovedpages' => 'Observar iste paginas', 'replacetext_invertselections' => 'Inverter selectiones', 'replacetext_replace' => 'Reimplaciar', 'replacetext_success' => "'$1' essera reimplaciate per '$2' in $3 {{PLURAL:$3|pagina|paginas}}.", 'replacetext_noreplacement' => "Nulle pagina esseva trovate que contine le catena de characteres '$1'.", 'replacetext_nomove' => "Nulle pagina esseva trovate con un titulo que contine '$1'.", 'replacetext_nosuchcategory' => "Nulle categoria existe con le nomine '$1'.", 'replacetext_return' => 'Retornar al formulario.', 'replacetext_warning' => "'''Attention:''' Il ha \$1 {{PLURAL:\$1|pagina|paginas}} que contine ja le nove texto, \"\$2\". Si tu face iste reimplaciamento, tu non potera distinguer inter tu reimplaciamentos e iste texto ja existente.", 'replacetext_blankwarning' => 'Post que le nove texto es vacue, iste operation non essera reversibile; continuar?', 'replacetext_continue' => 'Continuar', 'replacetext_editsummary' => "Reimplaciamento de texto - '$1' per '$2'", 'right-replacetext' => 'Facer reimplaciamentos de texto in le wiki integre', ); /** Indonesian (Bahasa Indonesia) * @author Bennylin * @author Farras * @author IvanLanin * @author Rex */ $messages['id'] = array( 'replacetext' => 'Mengganti teks', 'replacetext-desc' => 'Menyediakan [[Special:ReplaceText|halaman istimewa]] untuk memungkinkan pengurus untuk melakukan pencarian-dan-penggantian untaian secara global pada semua halaman isi dari suatu wiki', 'replacetext_docu' => "Untuk mengganti suatu teks kalimat dengan kalimat lain di antara semua halaman-halaman regular wiki ini, masukkan kedua teks di sini dan klik 'Lanjutkan'. Anda akan mendapatkan tampilan daftar halaman yang berisikan teks yang dicari, dan Anda dapat memilih yang mana saja yang ingin digantikan. Nama Anda akan tampil di versi terdahulu halaman sebagai pengguna yang melakukan perubahan.", # Fuzzy 'replacetext_originaltext' => 'Teks asli:', 'replacetext_replacementtext' => 'Teks pengganti:', 'replacetext_useregex' => 'Gunakan persamaan reguler', 'replacetext_regexdocu' => '(Congoh: nilai dari "a(.*)c" untuk "Teks asal" dan "ac$1" untuk "Teks pengganti" akan mengganti "abc" dengan "acb".)', # Fuzzy 'replacetext_optionalfilters' => 'Filter opsional:', 'replacetext_categorysearch' => 'Hanya ganti pada kategori:', 'replacetext_prefixsearch' => 'Hanya ganti pada halaman dengan awalan:', 'replacetext_editpages' => 'Ganti teks pada isi halaman', 'replacetext_movepages' => 'Ganti teks pada judul halaman, jika mungkin', 'replacetext_givetarget' => 'Anda harus menyebutkan untaian yang akan diganti.', 'replacetext_nonamespace' => 'Anda harus memilih paling tidak satu ruang nama.', 'replacetext_editormove' => 'Anda harus memilih paling tidak salah satu opsi penggantian.', 'replacetext_choosepagesforedit' => 'Ganti "$1" dengan "$2" pada teks dari {{PLURAL:$3|halaman|halaman}} berikut:', 'replacetext_choosepagesformove' => 'Ganti "$1" dengan "$2" pada {{PLURAL:$3|judul halaman berikut|judul halaman berikut}}:', 'replacetext_cannotmove' => '{{PLURAL:$1|Halaman|Halaman}} berikut tidak dapat dipindahkan:', 'replacetext_formovedpages' => 'Untuk halaman yang dipindahkan:', 'replacetext_savemovedpages' => 'Simpan judul lama sebagai pengalihan ke judul baru', 'replacetext_watchmovedpages' => 'Pantau halaman-halaman ini', 'replacetext_invertselections' => 'Balikkan pilihan', 'replacetext_replace' => 'Gantikan', 'replacetext_success' => '"$1" akan diganti dengan "$2" pada $3 {{PLURAL:$3|halaman|halaman}}.', 'replacetext_noreplacement' => 'Tidak ada halaman yang ditemukan yang mengandung untaian "$1".', 'replacetext_nomove' => 'Tidak ada halaman yang ditemukan yang judulnya mengandung "$1".', 'replacetext_nosuchcategory' => 'Tidak ditemukan kategori bernama "$1".', 'replacetext_return' => 'Kembali ke isian.', 'replacetext_warning' => 'Ada {{PLURAL:$1|$1 halaman|$1 halaman}} yang telah berisi untaian pengganti, "$2". Jika Anda melakukan penggantian ini Anda tidak akan dapat memisahkan pengganti Anda dari untaian ini.', 'replacetext_blankwarning' => 'Karena untaian pengganti kosong, operasi ini tidak dapat dikembalikan. Apakah ingin dilanjutkan?', 'replacetext_continue' => 'Lanjutkan', 'replacetext_editsummary' => 'Penggantian teks - "$1" menjadi "$2"', 'right-replacetext' => 'Melakukan penggantian seluruh teks kalimat di wiki ini', ); /** Igbo (Igbo) * @author Ukabia */ $messages['ig'] = array( 'replacetext_originaltext' => 'Mkpụrụ nke mbu:', 'replacetext_replace' => 'Kwụchí na élú', ); /** Italian (italiano) * @author Beta16 * @author Civvì * @author Darth Kule * @author Marco 27 */ $messages['it'] = array( 'replacetext' => 'Sostituzione testo', 'replacetext-desc' => 'Fornisce una [[Special:ReplaceText|pagina speciale]] per permettere agli amministratori di effettuare una ricerca e sostituzione globale di testo su tutte le pagine di contenuti di un sito', 'replacetext_docu' => 'Per sostituire una stringa di testo con un\'altra su tutte le pagine del sito, inserire qui due pezzi di testo e poi premere "{{int:replacetext_continue}}". Verrà quindi mostrato un elenco delle pagine che contengono il testo cercato e sarà possibile scegliere quelle in cui si desidera sostituirlo. Il proprio nome verrà visualizzato nella pagina della cronologia come l\'utente responsabile delle eventuali modifiche.', 'replacetext_originaltext' => 'Testo originale:', 'replacetext_replacementtext' => 'Testo sostituito:', 'replacetext_useregex' => 'Utilizza le espressioni regolari', 'replacetext_regexdocu' => '(Esempio: con valori di "a(.*)c" per "{{int:replacetext_originaltext}}" e "ac$1" per "{{int:replacetext_replacementtext}}" trasformerebbe "abc" in "acb".)', 'replacetext_optionalfilters' => 'Filtri opzionali:', 'replacetext_categorysearch' => 'Sostituire solo nella categoria:', 'replacetext_prefixsearch' => 'Sostituire solo nelle pagine con il prefisso:', 'replacetext_editpages' => 'Sostituire il testo nella pagina di contenuti', 'replacetext_movepages' => 'Sostituisci il testo nei titoli delle pagine, quando possibile', 'replacetext_givetarget' => 'È necessario specificare il testo da sostituire.', 'replacetext_nonamespace' => 'È necessario selezionare almeno un namespace', 'replacetext_editormove' => 'È necessario selezionare almeno una delle opzioni di sostituzione.', 'replacetext_choosepagesforedit' => "Selezionare {{PLURAL:$3|la pagina per la quale|le pagine per le quali}} si desidera sostituire '$1' con '$2':", 'replacetext_choosepagesformove' => 'Sostituire "$1" con "$2" {{PLURAL:$3|nel titolo della pagina seguente|nei titoli delle pagine seguenti}}:', 'replacetext_cannotmove' => '{{PLURAL:$1|La pagina seguente non può essere spostata|Le pagine seguenti non possono essere spostate}}:', 'replacetext_formovedpages' => 'Per le pagine spostate:', 'replacetext_savemovedpages' => 'Conservare i vecchi titoli come redirect al nuovo titolo:', 'replacetext_watchmovedpages' => 'Aggiungi agli osservati speciali', 'replacetext_invertselections' => 'Inverti selezione', 'replacetext_replace' => 'Sostituisci', 'replacetext_success' => "'$1' sarà sostituito con '$2' in $3 {{PLURAL:$3|pagina|pagine}}.", 'replacetext_noreplacement' => "Non sono state trovate pagine contenenti il testo '$1'.", 'replacetext_nomove' => "Non sono state trovate pagine il cui titolo contiene '$1'.", 'replacetext_nosuchcategory' => 'Non esiste categoria con il nome "$1".', 'replacetext_return' => 'Torna al modulo.', 'replacetext_warning' => '{{PLURAL:$1|C\'è già $1 pagina che contiene|Ci sono già $1 pagine che contengono}} il testo di sostituzione, "$2". Se si effettua questa sostituzione non si sarà in grado di separare le sostituzioni da questi testi. Continuare con la sostituzione?', 'replacetext_blankwarning' => "Poiché il testo di sostituzione è vuoto, l'operazione non sarà reversibile. Si desidera continuare?", 'replacetext_continue' => 'Continua', 'replacetext_editsummary' => "Sostituzione testo - '$1' con '$2'", 'right-replacetext' => 'Esegue sostituzioni di testo in tutto il sito', ); /** Japanese (日本語) * @author Aotake * @author Fryed-peach * @author Schu * @author Shirayuki * @author 青子守歌 */ $messages['ja'] = array( 'replacetext' => '文字列の置換', 'replacetext-desc' => '管理者がウィキ内の全記事で、ある文字列に一致する部分すべてを置換できるようにする[[Special:ReplaceText|特別ページ]]を提供する', 'replacetext_docu' => 'このウィキ上のすべての標準ページについて、ある文字列を別の文字列に置換するには、2 つの文字列をここに入力して「{{int:replacetext_continue}}」を押します。 検索した文字列を含むページが列挙されますので、置換したいページを選択してください。 置換すると、その編集を担当した利用者としてあなたの名前が、ページ履歴に表示されます。', 'replacetext_originaltext' => '置換前の文字列:', 'replacetext_replacementtext' => '置換後の文字列:', 'replacetext_useregex' => '正規表現を使用', 'replacetext_regexdocu' => '(例: 「{{int:replacetext_originaltext}}」の値が「a(.*)c」、「{{int:replacetext_replacementtext}}」の値が「ac$1」の場合、「abc」を「acb」に置換します。)', 'replacetext_optionalfilters' => '追加のフィルター (任意):', 'replacetext_categorysearch' => '以下のカテゴリにあるもののみを置換:', 'replacetext_prefixsearch' => '以下の文字列から始まるページ内のもののみを置換:', 'replacetext_editpages' => 'ページ本文中の文字列を置換', 'replacetext_movepages' => '可能ならば、ページ名中の文字列を置換する', 'replacetext_givetarget' => '置換される対象となる文字列を指定する必要があります。', 'replacetext_nonamespace' => '名前空間を少なくとも1つ選択する必要があります。', 'replacetext_editormove' => '置換オプションから少なくとも1つ選択する必要があります。', 'replacetext_choosepagesforedit' => '以下の{{PLURAL:$3|ページ}}の本文中の「$1」を「$2」に置換する:', 'replacetext_choosepagesformove' => '以下の名前の{{PLURAL:$3|ページ}}中の文字列「$1」を「$2」に置換する:', 'replacetext_cannotmove' => '以下の{{PLURAL:$1|ページ}}は移動できません:', 'replacetext_formovedpages' => '移動したページについて:', 'replacetext_savemovedpages' => '古いページ名を新しいページへのリダイレクトとして残す', 'replacetext_watchmovedpages' => 'これらのページをウォッチ', 'replacetext_invertselections' => '選択を反転', 'replacetext_replace' => '置換', 'replacetext_success' => '$3{{PLURAL:$3|ページ}}で「$1」が「$2」に置換されます。', 'replacetext_noreplacement' => '文字列「$1」を含むページは見つかりませんでした。', 'replacetext_nomove' => '「$1」を名前に含むページは見つかりませんでした。', 'replacetext_nosuchcategory' => '「$1」という名前のカテゴリは存在しません。', 'replacetext_return' => 'フォームに戻る', 'replacetext_warning' => "'''警告:''' 置換後の文字列「$2」を含むページが既に $1{{PLURAL:$1|ページ}}あります。この置換を実行すると、これらの文字列と実際に置換された箇所を区別できなくなります。", 'replacetext_blankwarning' => '置換後文字列が空であるため、この操作は実行後の取り消しができなくなります。続行しますか?', 'replacetext_continue' => '続行', 'replacetext_editsummary' => '文字列「$1」を「$2」に置換', 'right-replacetext' => 'ウィキ全体で文字列の置換を実行', ); /** Javanese (Basa Jawa) * @author Meursault2004 * @author Pras */ $messages['jv'] = array( 'replacetext' => 'Ganti tèks', 'replacetext_originaltext' => 'Tèks asli:', 'replacetext_continue' => 'Banjurna', ); /** Georgian (ქართული) * @author BRUTE * @author David1010 */ $messages['ka'] = array( 'replacetext' => 'ტექსტის შეცვლა', 'replacetext_originaltext' => 'პირველადი ტექსტი:', 'replacetext_replacementtext' => 'შესაცვლელი ტექსტი:', 'replacetext_replace' => 'ჩანაცვლება', 'replacetext_return' => 'ფორმასთან დაბრუნება.', 'replacetext_continue' => 'გაგრძელება', 'replacetext_editsummary' => 'ტექსტის შეცვლა - „$1“ „$2“-ზე', ); /** Khmer (ភាសាខ្មែរ) * @author Lovekhmer * @author Thearith * @author គីមស៊្រុន */ $messages['km'] = array( 'replacetext' => 'ជំនួសអត្ថបទ', 'replacetext_originaltext' => 'អត្ថបទដើម៖', 'replacetext_replacementtext' => 'អត្ថបទជំនួស៖', 'replacetext_movepages' => 'ជំនួស​អត្ថបទ​នៅក្នុង​ចំណងជើង​ទំព័រ​បើអាច', 'replacetext_choosepagesforedit' => "សូម​ជ្រើសរើស {{PLURAL:$3|ទំព័រ|ទំព័រ}} សម្រាប់​អ្វី​ដែល​អ្នក​ចង់​ជំនួស '$1' ដោយ '$2':", 'replacetext_choosepagesformove' => 'ជំនួស​អត្ថបទ​នៅក្នុង {{PLURAL:$1|ឈ្មោះ​ទំព័រ​ដូចតទៅ|ឈ្មោះ​ទំព័រ​ដូចតទៅ}}:', # Fuzzy 'replacetext_invertselections' => 'ដាក់បញ្ច្រាស​ជម្រើស', 'replacetext_replace' => 'ជំនួស', 'replacetext_success' => "'$1' នឹងត្រូវបានជំនួសដោយ '$2' ក្នុង $3 {{PLURAL:$3|ទំព័រ|ទំព័រ}}​។", 'replacetext_noreplacement' => "រក​មិន​ឃើញ​ទំព័រ​ដែល​មាន​ខ្សែអក្សរ (string) '$1' ។", 'replacetext_continue' => 'បន្ត', 'replacetext_editsummary' => "អត្ថបទជំនួស - '$1' ទៅ '$2'", ); /** Korean (한국어) * @author Devunt * @author Kwj2772 * @author 아라 */ $messages['ko'] = array( 'replacetext' => '찾아 바꾸기', 'replacetext-desc' => '관리자가 위키 전체의 내용을 찾아 바꿀 수 있도록 [[Special:ReplaceText|특수 문서]]를 추가', 'replacetext_docu' => '이 위키에서 어떤 문자열을 다른 문자열로 바꾸기 위해서는, 찾을 문자열과 바꿀 문자열을 입력한 뒤 "{{int:replacetext_continue}}"을 누르세요. 그러면 해당 문자열을 포함하고 있는 문서 목록이 나오며, 그중에서 바꿀 문서들을 선택할 수 있습니다. 당신의 사용자 이름이 문서 역사에 나올 것입니다.', 'replacetext_originaltext' => '찾을 문자열:', 'replacetext_replacementtext' => '바꿀 문자열:', 'replacetext_useregex' => '정규 표현식 사용', 'replacetext_regexdocu' => '(예: "{{int:replacetext_originaltext}}"에 "a(.*)c"값을 입력하고 "{{int:replacetext_replacementtext}}"에 "ac$1"을 입력하면 "abc"가 "acb"로 바뀝니다.)', 'replacetext_optionalfilters' => '선택적 필터:', 'replacetext_categorysearch' => '다음 분류에서만 바꾸기:', 'replacetext_prefixsearch' => '다음 접두어로 시작하는 문서만 바꾸기:', 'replacetext_editpages' => '문서 내용의 문자열을 바꾸기', 'replacetext_movepages' => '가능하다면 문서 제목에 있는 문자열도 바꾸기', 'replacetext_givetarget' => '찾을 문자열을 반드시 지정해야 합니다.', 'replacetext_nonamespace' => '이름공간을 적어도 하나는 선택해야 합니다.', 'replacetext_editormove' => '찾아 바꾸기 옵션을 적어도 하나는 선택해야 합니다.', 'replacetext_choosepagesforedit' => '{{PLURAL:$3|문서|문서 $3개}}에 있는 "$1" 문자열을 "$2" 문자열로 바꿉니다:', 'replacetext_choosepagesformove' => '가리키는 문서 제목 $3개에 있는 "$1" 문자열을 "$2" 문자열로 바꿉니다:', 'replacetext_cannotmove' => '다음 {{PLURAL:$1|문서는}} 이동할 수 없습니다:', 'replacetext_formovedpages' => '이동한 페이지의 경우:', 'replacetext_savemovedpages' => '옛 문서 제목을 새 문서 제목으로 넘겨 주는 문서로 만들기', 'replacetext_watchmovedpages' => '이 문서 주시하기', 'replacetext_invertselections' => '선택 반전', 'replacetext_replace' => '찾아 바꾸기', 'replacetext_success' => '"$1" 문자열은 문서 $3개에서 "$2" 문자열로 바뀔 것입니다.', 'replacetext_noreplacement' => '"$1" 문자열을 포함하고 있는 문서가 없습니다.', 'replacetext_nomove' => '"$1" 문자열을 포함하고 있는 문서 제목이 없습니다.', 'replacetext_nosuchcategory' => '"$1" 문자열을 포함하고 있는 분류가 없습니다.', 'replacetext_return' => '찾아 바꾸기 양식으로 돌아가기', 'replacetext_warning' => '"$2" 문자열을 포함하고 있는 문서 $1개가 이미 있습니다. 이 찾아 바꾸기를 실행하면, 이미 존재하는 "$2" 문자열과 더 이상 구분되지 않을 것입니다. 찾아 바꾸기를 계속하겠습니까?', 'replacetext_blankwarning' => '바꿀 문자열이 비어 있으므로 이 동작은 되돌릴 수 없습니다. 계속하시겠습니까?', 'replacetext_continue' => '계속', 'replacetext_editsummary' => '찾아 바꾸기 – "$1" 문자열을 "$2" 문자열로', 'right-replacetext' => '찾아 바꾸기를 위키 전체에 수행합니다.', ); /** Colognian (Ripoarisch) * @author Purodha */ $messages['ksh'] = array( 'replacetext' => 'Täx-Shtöcksher ußtuusche', 'replacetext-desc' => 'Deit en [[Special:ReplaceText|Söndersigg]] en et Wiki, womet {{int:group-sysop}} aanjefbaa Täx-Shtöcksher en alle Atikelle em Wiki söke un ußtuusche künne.', 'replacetext_docu' => 'Öm ene Täx en alle nomaale Sigge em Wiki ze söke un ußzetuusche, jif hee zwei Täx-Schtöcksher en, un donn dann op „{{int:replacetext continue}}“ klecke. Dann süühß De en Leß met Sigge, wo dö dä jesoohte Täx dren änthallde es, un De kanns Der erußsöke, en wat för enne dovun dat De dä och jetuusch han wells. Dinge Name als Metmaacher weed met dä neu veränderte Versione fun dä Sigge faßjehallde als dä Schriiver, dä et jemaat hät.', 'replacetext_originaltext' => 'Dä ojinaal Täx för Ußzetuusche:', 'replacetext_replacementtext' => 'Dä neue Täx för anshtatt dämm Ojinaal erin ze donn', 'replacetext_useregex' => 'Met „<i lang="en">regular Expressions</i>“', 'replacetext_regexdocu' => '(För e Beispel: Nämm „a(.*)c“ för „{{int:replacetext_originaltext}}“ un „ac$1“ för „{{int:replacetext_replacementtext}}“, un De kriß „abc“ dorsh „acb“ ußjetuusch.)', 'replacetext_optionalfilters' => 'Müjjelesche Beschrängkunge:', 'replacetext_categorysearch' => 'Bloß en dä Saachjropp ußtuusche:', 'replacetext_prefixsearch' => 'Bloß en Sigge ußtuusche, dänne ier Tittelle aanfange met:', 'replacetext_editpages' => 'Donn dä Täx em Sigge_Enhaldt ußtuusche', 'replacetext_movepages' => 'Donn dä Täx en de Sigge ier Tittele ußtuusche, wan et jeiht', 'replacetext_givetarget' => 'Do moß aanjevve, wat ußjetuusch wäde sull. „Nix“ ußtuusche künne mer nit.', 'replacetext_nonamespace' => 'Do moß winnischßdens ei Appachtemang ußwähle.', 'replacetext_editormove' => 'Do moß winnischßdenß ei Höksche maache, sönß brengk dat hee nix.', 'replacetext_choosepagesforedit' => 'Don {{PLURAL:$3|en Sigg|die Sigge|nix aan Sigge}} ußsöke, en dänne De „$1“ jääje „$2“ jetuusch han wells:', 'replacetext_choosepagesformove' => 'Donn dä Täx „$1“ en hee dä {{PLURAL:$3|Sigg|Sigge|nix}} ierem Name jäje der Täx „$2“ ußtuusche:', 'replacetext_cannotmove' => 'Hee die {{PLURAL:$1|Sigg kann|Sigge künne|nix kann}} nit ömjenannt wäde:', 'replacetext_formovedpages' => 'För ömjenannte Sigge:', 'replacetext_savemovedpages' => 'Donn der ahle Tittel faßallde un en Ömleidung op der Neue druß maache, wann en Sigg ömjenannt woode es.', 'replacetext_watchmovedpages' => 'Op di Sigge oppasse', 'replacetext_invertselections' => 'De Ußwahl ömdrieje', 'replacetext_replace' => 'Tuusche', 'replacetext_success' => '„$1“ soll en {{PLURAL:$3|eine Sigg|$3 Sigge|nix}} dorsch „$2“ ußjetuusch wääde.', 'replacetext_noreplacement' => 'Kein Sigge jefonge met däm Täxstöck „$1“ dren.', 'replacetext_nomove' => 'Mer han kei Sigge jefonge, woh „$1“ em Tittel dren förkütt.', 'replacetext_nosuchcategory' => 'Mer han kein Saachjropp met dämm Name „$1“.', 'replacetext_return' => 'Jangk retuur op dat Fommulaa.', 'replacetext_warning' => "'''Opjepaß:''' {{PLURAL:$1|Ein Sigg enthält|$1 Sigge enthallde}} ald dat Täxstöck „$2“, wat bemm Tuusche ennjeföch wääde sull. Wenn De dat jemaat häs, kam_mer die Änderong nit esu leich automattesch retuur maache, weil mer die ald do woore, un de ennjetuuschte Täxstöcker nit ungerscheide kann. Wells De trozdämm wigger maache?", 'replacetext_blankwarning' => 'Dat Täxstöck, wat beim Tuusche ennjfööch weed, is leddich, dröm kam_mer die Änderong nit esu leich automattesch retuur maache. Wells De trozdämm wigger maache?', 'replacetext_continue' => 'Wiggermaache', 'replacetext_editsummary' => 'Täx-Shtöcker tuusche — vun „$1“ noh „$2“', 'right-replacetext' => 'Donn Täx-Shtöcksher em janze Wiki ußtuusche', ); /** Luxembourgish (Lëtzebuergesch) * @author Les Meloures * @author Robby */ $messages['lb'] = array( 'replacetext' => 'Text ersetzen', 'replacetext-desc' => "Weist eng [[Special:ReplaceText|Spezialsäit]] déi Administrateuren et erlaabt eng Rei vun Textzeechen op alle Contenu-säite vun enger Wiki ze gesinn an z'ersetzen", 'replacetext_docu' => 'Fir en Text duerch en aneren Text op allen Inhaltssäite vun dëser Wiki z\'ersetzen, gitt w.e.g. déi zwéin Texter hei an klickt op "{{int:replacetext_continue}}". Dir gesitt dann eng Lëscht vu Säiten op deenen de gesichten Text dran ass, an Dir kënnt déi eraussichen op deenen Dir den Text ersetze wëllt. Ären Numm steet an der Lëscht vun de Versiounen als Auteur vun all deenen Ännerungen.', 'replacetext_originaltext' => 'Originaltext:', 'replacetext_replacementtext' => 'Neien Text:', 'replacetext_useregex' => 'Regulär Ausdréck benotzen', 'replacetext_regexdocu' => '(Beispill: De Wäert „a(.*)c“ fir "{{int:replacetext_originaltext}}“ an "ac$1" fir „Neien Text"{{int:replacetext_replacementtext}}" géif „abc“ duerch „acb“ ersetzen.)', 'replacetext_optionalfilters' => 'Optional Filteren:', 'replacetext_categorysearch' => 'Ersetz nëmmen an der Kategorie:', 'replacetext_prefixsearch' => 'Ersetz nëmmen a Säite mam Prefix:', 'replacetext_editpages' => 'Den Text a Säiteninhalter ersetzen', 'replacetext_movepages' => 'Text an den Titele vun de Säiten ersetzen, wa méiglech', 'replacetext_givetarget' => 'Dir musst déi Zeechen uginn déi ersat solle ginn.', 'replacetext_nonamespace' => 'Dir musst mindestens een Nummraum eraussichen.', 'replacetext_editormove' => 'Dir musst mindestens eng vun den Optioune vum Ersetzen eraussichen.', 'replacetext_choosepagesforedit' => 'Wielt w.e.g. d\'{{PLURAL:$3|Säit op där|Säiten op deenen}} Dir "$1" duerch "$2" ersetze wëllt:', 'replacetext_choosepagesformove' => "'$1' duerch '$2' am Titel vun {{PLURAL:$3|dëser Säit|dëse Säiten}} ersetzen:", 'replacetext_cannotmove' => 'Dës {{PLURAL:$1|Säit kann|Säite kënne}} net geréckelt ginn:', 'replacetext_formovedpages' => 'Fir geréckelt Säiten:', 'replacetext_savemovedpages' => 'Déi al Titelen als Viruleedung op déi nei Titele späicheren', 'replacetext_watchmovedpages' => 'Dës Säiten iwwerwaachen', 'replacetext_invertselections' => 'Auswiel ëmdréinen', 'replacetext_replace' => 'Ersetzen', 'replacetext_success' => "'$1' gëtt duerch '$2' op $3 {{PLURAL:$3|Säit|Säiten}} ersat.", 'replacetext_noreplacement' => "Et goufe keng Säite mam Text '$1' fonnt.", 'replacetext_nomove' => "Keng Säite fonnt wou '$1' am Titel drasteet.", 'replacetext_nosuchcategory' => 'Et gëtt keng Kategorie mam Numm "$1".', 'replacetext_return' => 'Zréck op de Formulaire', 'replacetext_warning' => "'''Opgepasst:''' Et gëtt schonn {{PLURAL:$1|eng Säit op där|$1 Säiten op deenen}} d'Zeecherei '$2' schonn dran ass. Wann Dir dës Ännerunge maacht wäert et Iech net méi méiglech sinn déi Säiten op deenen Dir Ännerunge gemaach hutt vun de Säiten z'ënnerscheeden wou elo d'Zeecherei '$2' schonn dran ass.", 'replacetext_blankwarning' => 'Well den Textdeel mat dem de gesichten Text ersat gi soll eidel ass, kann dës Aktioun net réckgängeg gemaach ginn; wëllt Dir awer weiderfueren?', 'replacetext_continue' => 'Weiderfueren', 'replacetext_editsummary' => "Text ersat - '$1' duerch '$2'", 'right-replacetext' => 'Ersetze vun enger Rei vun Textzeechen op der ganzer Wiki', ); /** Lithuanian (lietuvių) * @author Homo */ $messages['lt'] = array( 'replacetext' => 'Keisti tekstą', 'replacetext_continue' => 'Tęsti', 'replacetext_editsummary' => 'Teksto pakeitimas - "$1" į "$2"', ); /** Malagasy (Malagasy) * @author Jagwar */ $messages['mg'] = array( 'right-replacetext' => 'Manolo lahatsoratra misy manerana ilay wiki', ); /** Macedonian (македонски) * @author Bjankuloski06 */ $messages['mk'] = array( 'replacetext' => 'Замени текст', 'replacetext-desc' => 'Додава [[Special:ReplaceText|специјална страница]] која им овозможува на администраторите да вршат пронаоѓање и замена на глобални низи во страниците на викито', 'replacetext_docu' => 'За да замените една низа со друга, ширум сите регуларни страници на ова вики, внесете ги тука двете парчиња текст и потоа притиснете на „{{int:replacetext_continue}}“. Потоа ќе ви се прикаже список на страници кои го содржат бараниот текст, и ќе можете да изберете во кои од нив сакате да ја извршите змената. Вашето име ќе се појави во историјата на страниците како корисник одговорен за промените.', 'replacetext_originaltext' => 'Изворен текст:', 'replacetext_replacementtext' => 'Нов текст:', 'replacetext_useregex' => 'Користи регуларни изрази', 'replacetext_regexdocu' => '(Пример: вредностите на „a(.*)c“ за „{{int:replacetext_originaltext}}“ и „ac$1“ за „{{int:replacetext_replacementtext}}“ ќе го заменат „abc“ со „acb“.)', 'replacetext_optionalfilters' => 'Незадолжителни филтри:', 'replacetext_categorysearch' => 'Замени само во категорија:', 'replacetext_prefixsearch' => 'Замени само во страници со префиксот:', 'replacetext_editpages' => 'Замени текст во содржина на страница', 'replacetext_movepages' => 'Замени текст во насловите на страниците, кога е можно', 'replacetext_givetarget' => 'Мора да ја наведете низата што треба да се замени.', 'replacetext_nonamespace' => 'Мора да изберете барем еден именски простор.', 'replacetext_editormove' => 'Мора да одберете барем една од можностите за замена.', 'replacetext_choosepagesforedit' => 'Замени „$1“ со „$2“ во текстот на {{PLURAL:$3|следнава страница|следниве страници}}:', 'replacetext_choosepagesformove' => 'Замени „$1“ со „$2“ во {{PLURAL:$3|насловот на следната страница|насловите на следните страници}}:', 'replacetext_cannotmove' => '{{PLURAL:$1|Следнава страница не може да се премести|Следниве страници не можат да се преместат}}:', 'replacetext_formovedpages' => 'За преместени страници:', 'replacetext_savemovedpages' => 'Зачувај ги старите наслови како пренасочувања кон новите наслови', 'replacetext_watchmovedpages' => 'Набљудувај ги овие страници', 'replacetext_invertselections' => 'Обратен избор', 'replacetext_replace' => 'Замени', 'replacetext_success' => '„$1“ ќе биде заменето со „$2“ во $3 {{PLURAL:$3|страница|страници}}.', 'replacetext_noreplacement' => 'Нема пронајдено страници кои ја содржат низата „$1“.', 'replacetext_nomove' => 'Нема пронајдено страници чиј наслов содржи „$1“.', 'replacetext_nosuchcategory' => 'Не постои категорија по име „$1“', 'replacetext_return' => 'Назад кон образецот', 'replacetext_warning' => "'''Предупредување:''' Има {{PLURAL:$1|$1 страница што веќе ја содржи|$1 страници што веќе ја содржат}} новата низа „$2“. Ако ја извршите оваа замена, тогаш нема да можете да ги раздвоите вашите замени од тие низи.", 'replacetext_blankwarning' => 'Бидејќи новата низа е празна, оваа операција не може да се врати. Дали сакате да продолжите?', 'replacetext_continue' => 'Продолжи', 'replacetext_editsummary' => 'Замена на текст - „$1“ со „$2“', 'right-replacetext' => 'Вршење замена на низи во целото вики', ); /** Malayalam (മലയാളം) * @author Praveenp * @author Shijualex */ $messages['ml'] = array( 'replacetext' => 'എഴുത്ത് മാറ്റിച്ചേർക്കുക', 'replacetext-desc' => 'വിക്കിയിലെ എല്ലാ ഉള്ളടക്ക താളിൽ നിന്നും കാര്യനിർവാഹകർക്ക് ഒരു പ്രത്യേക പദത്തെ കണ്ടെത്തി-മാറ്റിച്ചേർക്കാനുള്ള [[Special:ReplaceText|പ്രത്യേക താൾ]] നൽകുന്നു', 'replacetext_originaltext' => 'യഥാർത്ഥ എഴുത്ത്:', 'replacetext_replacementtext' => 'മാറ്റിച്ചേർക്കേണ്ട എഴുത്ത്:', 'replacetext_optionalfilters' => 'ഐച്ഛിക അരിപ്പകൾ:', 'replacetext_categorysearch' => 'ഈ വർഗ്ഗത്തിൽ നിന്നു മാത്രം മാറ്റിച്ചേർക്കുക:', 'replacetext_prefixsearch' => 'ഈ പൂർവ്വപദമുള്ള താളുകളിൽ മാത്രം മാറ്റിച്ചേർക്കുക:', 'replacetext_editpages' => 'താളിന്റെ ഉള്ളടക്കത്തിലെ എഴുത്ത് മാറ്റിച്ചേർക്കുക', 'replacetext_movepages' => 'സാദ്ധ്യമെങ്കിൽ, താളിന്റെ ഉള്ളടക്കത്തിലെ എഴുത്തുകൾ മാറ്റിച്ചേർക്കുക', 'replacetext_givetarget' => 'മാറ്റിച്ചേർക്കാനുള്ള പദം താങ്കൾ വ്യക്തമാക്കണം.', 'replacetext_nonamespace' => 'ഒരു നാമമേഖലയെങ്കിലും തിരഞ്ഞെടുത്തിരിക്കണം.', 'replacetext_editormove' => 'ഒരു മാറ്റിച്ചേർക്കൽ ഐച്ഛികമെങ്കിലും തിരഞ്ഞെടുത്തിരിക്കണം.', 'replacetext_choosepagesforedit' => 'താഴെയുള്ള {{PLURAL:$3|താളിൽ|താളുകളിൽ}} നിന്നും "$1" എന്നത് "$2" എന്നതുകൊണ്ട് മാറ്റിച്ചേർക്കുക:', 'replacetext_choosepagesformove' => 'താഴെയുള്ള {{PLURAL:$3|താളിന്റെ തലക്കെട്ടിൽ|താളുകളുടെ തലക്കെട്ടുകളിൽ}} നിന്നും "$1" എന്നത് "$2" എന്നതുകൊണ്ട് മാറ്റിച്ചേർക്കുക:', 'replacetext_cannotmove' => 'താഴെയുള്ള {{PLURAL:$1|താൾ|താളുകൾ}} മാറ്റാനാവില്ല:', 'replacetext_formovedpages' => 'മാറ്റിയ താളുകൾക്ക് വേണ്ടി:', 'replacetext_savemovedpages' => 'പഴയ തലക്കെട്ടുകൾ പുതിയ തലക്കെട്ടുകളിലോട്ടുള്ള തിരിച്ചുവിടലായി നിലനിർത്തുക', 'replacetext_watchmovedpages' => 'ഈ താളുകൾ ശ്രദ്ധിക്കുക', 'replacetext_invertselections' => 'വിപരീതം തിരഞ്ഞെടുക്കുക', 'replacetext_replace' => 'മാറ്റിച്ചേർക്കുക', 'replacetext_success' => '{{PLURAL:$3|ഒരു താളിൽ|$3 താളുകളിൽ}} "$1" എന്നത് "$2" എന്നതുകൊണ്ട് മാറ്റിച്ചേർക്കപ്പെടും.', 'replacetext_noreplacement' => '"$1" എന്ന പദമുള്ള താളുകളൊന്നും കണ്ടെത്താനായില്ല.', 'replacetext_nomove' => 'ഒരു താളിന്റെയും തലക്കെട്ടിൽ "$1" എന്നു കണ്ടെത്താനായില്ല.', 'replacetext_return' => 'ഫോമിലേക്ക് തിരിച്ചു പോവുക', 'replacetext_continue' => 'തുടരുക', 'replacetext_editsummary' => 'എഴുത്ത് മാറ്റിച്ചേർക്കൽ - "$1" എന്നത് "$2" എന്നതുകൊണ്ട്', 'right-replacetext' => 'വിക്കിയിൽ മുഴുവനും പദം മാറ്റിച്ചേർക്കുക', ); /** Marathi (मराठी) * @author Kaustubh */ $messages['mr'] = array( 'replacetext' => 'मजकूरावर पुनर्लेखन करा', 'replacetext-desc' => 'एक [[Special:ReplaceText|विशेष पान]] देते ज्याच्यामुळे प्रबंधकांना एखाद्या विकिवरील सर्व पानांमध्ये शोधा व बदला सुविधा वापरता येते', 'replacetext_docu' => "एखाद्या विकितील सर्व डाटा पानांवरील एखादा मजकूर बदलायचा झाल्यास, मजकूराचे दोन्ही तुकडे खाली लिहून 'पुनर्लेखन करा' कळीवर टिचकी द्या. तुम्हाला एक यादी दाखविली जाईल व त्यामधील कुठली पाने बदलायची हे तुम्ही ठरवू शकता. तुमचे नाव त्या पानांच्या इतिहास यादीत दिसेल.", # Fuzzy 'replacetext_originaltext' => 'मूळ मजकूर', # Fuzzy 'replacetext_replacementtext' => 'बदलण्यासाठीचा मजकूर', # Fuzzy 'replacetext_choosepagesforedit' => "ज्या पानांवर तुम्ही '$1' ला '$2' ने बदलू इच्छिता ती पाने निवडा:", # Fuzzy 'replacetext_replace' => 'पुनर्लेखन करा', 'replacetext_success' => "'$1' ला '$2' ने $3 पानांवर बदलले जाईल.", # Fuzzy 'replacetext_noreplacement' => "'$1' मजकूर असणारे एकही पान सापडले नाही.", 'replacetext_warning' => "अगोदरच $1 पानांवर '$2' हा बदलण्यासाठीचा मजकूर आहे; जर तुम्ही पुनर्लेखन केले तर तुम्ही केलेले बदल तुम्ही या पानांपासून वेगळे करू शकणार नाही. पुनर्लेखन करायचे का?", # Fuzzy 'replacetext_blankwarning' => 'बदलण्यासाठीचा मजकूर रिकामा असल्यामुळे ही क्रिया उलटविता येणार नाही; पुढे जायचे का?', 'replacetext_continue' => 'पुनर्लेखन करा', 'replacetext_editsummary' => "मजकूर पुनर्लेखन - '$1' ते '$2'", ); /** Malay (Bahasa Melayu) * @author Anakmalaysia */ $messages['ms'] = array( 'replacetext' => 'Ganti teks', 'replacetext-desc' => 'Menyediakan [[Special:ReplaceText|laman khas]] untuk membolehkan para pentadbir melakukan pencarian dan penggantian rentetan sejagat di semua laman-laman kandungan wiki', 'replacetext_docu' => "Untuk mengganti satu rentetan teks dengan satu lagi merentasi semua laman biasa di wiki ini, isikan kedua-dua teks yang terlibat di sini, kemudian tekan '{{int:replacetext_continue}}'. Kemudian, anda akan ditunjukkan satu senarai laman yang mengandungi teks carian, dan anda boleh memilih laman-laman yang mana anda ingin melakukan penggantian itu. Nama anda akan terpapar dalam sejarah laman sebagai pengguna yang bertanggungjawab atas sebarang perubahan.", 'replacetext_originaltext' => 'Teks asal:', 'replacetext_replacementtext' => 'Teks ganti:', 'replacetext_useregex' => 'Gunakan ungkapan nalar', 'replacetext_regexdocu' => '(Contoh: nilai "a(.*)c" untuk "{{int:replacetext_originaltext}}" dan "ac$1" untuk "{{int:replacetext_replacementtext}}" akan mengganti "abc" dengan "acb".)', 'replacetext_optionalfilters' => 'Penapis pilihan:', 'replacetext_categorysearch' => 'Ganti dalam kategori sahaja:', 'replacetext_prefixsearch' => 'Ganti dalam laman yang berawalan ini sahaja:', 'replacetext_editpages' => 'Ganti teks dalam kandungan laman', 'replacetext_movepages' => 'Ganti teks dalam tajuk laman, jika boleh', 'replacetext_givetarget' => 'Anda mesti menyatakan rentetan untuk diganti.', 'replacetext_nonamespace' => 'Anda mesti memilih sekurang-kurangnya satu ruang nama.', 'replacetext_editormove' => 'Anda mesti memilih sekurang-kurangnya satu pilihan penggantian.', 'replacetext_choosepagesforedit' => 'Ganti "$1" dengan "$2" dalam teks {{PLURAL:$3|laman|laman-laman}} berikut:', 'replacetext_choosepagesformove' => 'Ganti "$1" dengan "$2" dalam {{PLURAL:$3|judul|judul-judul}} laman yang berikut:', 'replacetext_cannotmove' => '{{PLURAL:$1|Laman|Laman-laman}} yang berikut tidak boleh dipindahkan:', 'replacetext_formovedpages' => 'Untuk laman yang dipindahkan:', 'replacetext_savemovedpages' => 'Simpan tajuk lama sebagai lencongan kepada tajuk baru', 'replacetext_watchmovedpages' => 'Pantau laman-laman ini', 'replacetext_invertselections' => 'Songsangkan pilihan', 'replacetext_replace' => 'Ganti', 'replacetext_success' => '"$1" akan digantikan oleh "$2" di $3 laman.', 'replacetext_noreplacement' => 'Tiada laman yang mengandungi rentetan "$1".', 'replacetext_nomove' => 'Tiada laman yang mengandungi "$1" dalam tajuknya.', 'replacetext_nosuchcategory' => 'Tiada kategori dengan nama "$1".', 'replacetext_return' => 'Kembali ke borang.', 'replacetext_warning' => "'''Amaran:''' Terdapat \$1 laman yang sudah mengandungi rentetan ganti \"\$2\". Jika anda melakukan penggantian ini, anda tidak akan dapat mengasingkan gantian anda daripada rentetan-rentetan ini.", 'replacetext_blankwarning' => "'''Amaran:''' Oleh sebab rentetan ganti adalah kosong, operasi ini tidak boleh dimansuhkan.", 'replacetext_continue' => 'Sambung', 'replacetext_editsummary' => 'Ganti teks - "$1" kepada "$2"', 'right-replacetext' => 'Membuat penggantian rentetan di seluruh wiki', ); /** Norwegian Bokmål (norsk (bokmål)‎) * @author Event * @author Laaknor * @author Nghtwlkr * @author Simny */ $messages['nb'] = array( 'replacetext' => 'Erstatt tekst', 'replacetext-desc' => 'Lar administratorer kunne [[Special:ReplaceText|erstatte tekst]] på alle innholdssider på en wiki.', 'replacetext_docu' => 'For å erstatte én tekststreng med en annen på alle datasider på denne wikien kan du skrive inn de to tekstene her og trykke «Erstatt». Du vil da bli ført til en liste over sider som inneholder søketeksten, og du kan velge hvilke sider du ønsker å erstatte den i. Navnet ditt vil stå i sidehistorikkene som den som er ansvarlig for endringene.', # Fuzzy 'replacetext_originaltext' => 'Originaltekst:', 'replacetext_replacementtext' => 'Erstatningstekst:', 'replacetext_useregex' => 'Bruk regulæruttrykk', 'replacetext_regexdocu' => '(Eksempel: Verdier for "a(.*)c" i "Opprinnelig tekst" og "ac$1" i "Erstatningstekst" erstatter "abc" med "acb".)', # Fuzzy 'replacetext_optionalfilters' => 'Valgfrie filter:', 'replacetext_categorysearch' => 'Erstatt kun i kategori:', 'replacetext_prefixsearch' => 'Erstatt kun i sider med prefikset:', 'replacetext_editpages' => 'Erstatt tekst i sideinnholdet', 'replacetext_movepages' => 'Erstatt tekst i sidetitler, der dette er mulig', 'replacetext_givetarget' => 'Du må spesifisere en streng som skal erstattes.', 'replacetext_nonamespace' => 'Du må velge minst ett navnerom.', 'replacetext_editormove' => 'Du må velge minst ett av alternativene for erstatning.', 'replacetext_choosepagesforedit' => 'Velg {{PLURAL:$3|siden|sidene}} der du ønsker å bytte ut «$1» med «$2»:', 'replacetext_choosepagesformove' => 'Erstatt «$1» med «$2» i {{PLURAL:$3|tittelen på den følgende siden|titlene på de følgende sidene}}:', 'replacetext_cannotmove' => '{{PLURAL:$1|Den følgende siden|De følgende sidene}} kan ikke flyttes:', 'replacetext_formovedpages' => 'For flyttede sider:', 'replacetext_savemovedpages' => 'Lagre de gamle titlene som omdirigeringer til de nye', 'replacetext_watchmovedpages' => 'Overvåk disse sidene', 'replacetext_invertselections' => 'Inverter valg', 'replacetext_replace' => 'Erstatt', 'replacetext_success' => '«$1» blir erstattet med «$2» på {{PLURAL:$3|én side|$3 sider}}.', 'replacetext_noreplacement' => 'Ingen sider ble funnet med strengen «$1».', 'replacetext_nomove' => 'Ingen sider ble funnet der tittelen inneholder «$1».', 'replacetext_nosuchcategory' => 'Det eksisterer ingen kategori med navnet «$1».', 'replacetext_return' => 'Tilbake til skjemaet.', 'replacetext_warning' => "'''Advarsel:''' Det er {{PLURAL:$1|én side|$1 sider}} som allerede har erstatningsteksten «$2». Om du gjør denne erstatningen vil du ikke kunne skille ut dine erstatninger fra denne teksten.", 'replacetext_blankwarning' => 'Fordi erstatningsteksten er tom vil denne handlingen ikke kunne angres automatisk; fortsette?', 'replacetext_continue' => 'Fortsett', 'replacetext_editsummary' => 'Teksterstatting – «$1» til «$2»', 'right-replacetext' => 'Gjennomfør teksterstatninger på hele wikien', ); /** Dutch (Nederlands) * @author SPQRobin * @author Siebrand */ $messages['nl'] = array( 'replacetext' => 'Tekst vervangen', 'replacetext-desc' => "Beheerders kunnen via een [[Special:ReplaceText|speciale pagina]] tekst zoeken en vervangen in alle pagina's", 'replacetext_docu' => "Om een stuk tekst te vervangen door een ander stuk tekst in alle pagina's van de wiki, kunt u hier deze twee tekstdelen ingeven en daarna op \"{{int:replacetext_continue}}\" klikken. U krijgt dan een lijst met pagina's te zien waar uw te vervangen tekstdeel in voorkomt, en u kunt kiezen in welke pagina's u de tekst ook echt wilt vervangen. Uw naam wordt opgenomen in de geschiedenis van de pagina als verantwoordelijke voor de wijzigingen.", 'replacetext_originaltext' => 'Oorspronkelijke tekst:', 'replacetext_replacementtext' => 'Vervangende tekst:', 'replacetext_useregex' => 'Reguliere expressies en wildcards gebruiken', 'replacetext_regexdocu' => 'Voorbeeld: waarden van "a(.*)c" voor "{{int:replacetext_originaltext}}" en "ac$1" voor "{{int:replacetext_replacementtext}}", vervangt "abc" door "acb".', 'replacetext_optionalfilters' => 'Optionele filters:', 'replacetext_categorysearch' => 'Alleen in de volgende categorie vervangen:', 'replacetext_prefixsearch' => "Alleen in pagina's met het volgende voorvoegsel vervangen:", 'replacetext_editpages' => 'Tekst vervangen in de pagina-inhoud', 'replacetext_movepages' => 'Tekst vervangen in paginanamen als mogelijk', 'replacetext_givetarget' => 'U moet de te vervangen tekst opgeven.', 'replacetext_nonamespace' => 'U moet ten minste één naamruimte selecteren.', 'replacetext_editormove' => 'U moet tenminste een van de vervangingingsopties kiezen.', 'replacetext_choosepagesforedit' => 'Selecteer de {{PLURAL:$3|pagina|pagina\'s}} waar u "$1" door "$2" wilt vervangen:', 'replacetext_choosepagesformove' => '"$1" door "$2" vervangen in de volgende {{PLURAL:$3|paginanaam|paginanamen}}:', 'replacetext_cannotmove' => "De volgende {{PLURAL:$1|pagina kan|pagina's kunnen}} niet hernoemd worden:", 'replacetext_formovedpages' => "Voor hernoemde pagina's:", 'replacetext_savemovedpages' => "Een doorwijziging aanmaken voor hernoemde pagina's", 'replacetext_watchmovedpages' => "Deze pagina's volgen", 'replacetext_invertselections' => 'Selecties omkeren', 'replacetext_replace' => 'Vervangen', 'replacetext_success' => '"$1" wordt in $3 {{PLURAL:$3|pagina|pagina\'s}} vervangen door "$2".', 'replacetext_noreplacement' => "Er waren geen pagina's die de tekst '$1' bevatten.", 'replacetext_nomove' => 'Er zijn geen pagina\'s gevonden met "$1" in de naam.', 'replacetext_nosuchcategory' => 'De categorie "$1" bestaat niet.', 'replacetext_return' => 'Terugkeren naar het formulier.', 'replacetext_warning' => "'''Waarschuwing:''' Er {{PLURAL:\$1|is één pagina|zijn \$1 pagina's}} die het te vervangen tekstdeel al \"\$2\" al {{PLURAL:\$1|bevat|bevatten}}. Als u nu doorgaat met vervangen, kunt u geen onderscheid meer maken.", 'replacetext_blankwarning' => 'Omdat u tekst vervangt door niets, kan deze handeling niet ongedaan gemaakt worden. Wilt u doorgaan?', 'replacetext_continue' => 'Doorgaan', 'replacetext_editsummary' => "Tekst vervangen - '$1' door '$2'", 'right-replacetext' => 'Tekst vervangen in de hele wiki', ); /** Norwegian Nynorsk (norsk (nynorsk)‎) * @author Gunnernett * @author Harald Khan * @author Njardarlogar */ $messages['nn'] = array( 'replacetext' => 'Byt ut tekst', 'replacetext-desc' => 'Gjev ei [[Special:ReplaceText|spesialsida]] som lèt administratorar søkja etter og byta ut tekst på alle innhaldssidene på ein wiki.', 'replacetext_docu' => 'For å byta éin tekststreng med ein annan på alle datasidene på denne wikien kan du skriva inn dei to tekstane her og trykkja «Hald fram». Du vil då bli førd til ei lista over sidene som inneheld søkjestrengen, og du kan velja kva sider du ønskjer å byta han ut i. Namnet ditt vil stå i sidehistorikkane som han som er ansvarleg for endringane.', # Fuzzy 'replacetext_originaltext' => 'Originaltekst:', 'replacetext_replacementtext' => 'Ny tekst til erstatning:', 'replacetext_optionalfilters' => 'Valfrie filter:', 'replacetext_categorysearch' => 'Byt berre ut i kategorien:', 'replacetext_prefixsearch' => 'Byt berre ut på sider med førestavinga:', 'replacetext_editpages' => 'Byt ut tekst i sideinnhaldet', 'replacetext_movepages' => 'Byt ut tekst i sidetitlar der dette er mogleg', 'replacetext_givetarget' => 'Du må spesifisera strengen som skal verta bytt ut.', 'replacetext_nonamespace' => 'Du må velja minst eitt namnerom.', 'replacetext_editormove' => 'Du må velja minst eitt av vala for tekstbyte.', 'replacetext_choosepagesforedit' => 'Vel {{PLURAL:$3|sida|sidene}} der du ønskjer å byta ut «$1» med «$2»:', 'replacetext_choosepagesformove' => 'Byt ut «$1» med «$2» i {{PLURAL:$3|namnet på den følgjande sida|namna på dei følgjande sidene}}:', 'replacetext_cannotmove' => '{{PLURAL:$1|Den følgjande sida|Dei følgjande sidene}} kan ikkje bli flytta:', 'replacetext_formovedpages' => 'For flytta sider:', 'replacetext_savemovedpages' => 'Lagra dei gamle titlane som omdirigeringar til dei nye', 'replacetext_watchmovedpages' => 'Hald oppsyn med desse sidene', 'replacetext_invertselections' => 'Inverter val', 'replacetext_replace' => 'Byt ut', 'replacetext_success' => '$1» blir byta ut med «$2» på {{PLURAL:$3|éi sida|$3 sider}}.', 'replacetext_noreplacement' => 'Fann ingen sider som inneheldt søkjestrengen «$1».', 'replacetext_nomove' => 'Ingen sider vart funne der tittelen inneheld «$1».', 'replacetext_nosuchcategory' => 'Det finst ingen kategoriar med namnet «$1».', 'replacetext_return' => 'Attende til skjemaet.', 'replacetext_warning' => 'Det finst {{PLURAL:$1|éi sida|$1 sider}} som allereie inneheld strengen som skal bli sett inn, «$2». Om du utfører denne utbytinga vil du ikkje vera i stand til å skilja utbytingane dine frå desse strengane. Halda fram med utbytinga?', # Fuzzy 'replacetext_blankwarning' => 'Av di teksten som skal bli sett inn er tom, vil ikkje denne handlinga kunna bli køyrt omvendt. Vil du halda fram?', 'replacetext_continue' => 'Hald fram', 'replacetext_editsummary' => 'Utbyting av tekst - «$1» til «$2»', 'right-replacetext' => 'Gjennomfør utbyting av tekst på heile wikien', ); /** Occitan (occitan) * @author Cedric31 */ $messages['oc'] = array( 'replacetext' => 'Remplaçar lo tèxte', 'replacetext-desc' => 'Provesís una [[Special:ReplaceText|pagina especiala]] que permet als administrators de remplaçar de cadenas de caractèrs per d’autras sus l’ensemble del wiki', 'replacetext_docu' => "Per remplaçar una cadena de caractèrs amb una autra sus l'ensemble de las donadas de las paginas d'aqueste wiki, podètz picar los dos tèxtes aicí e clicar sus 'Remplaçar'. Vòstre nom apareiserà dins l'istoric de las paginas tal coma un utilizaire autor dels cambiaments.", # Fuzzy 'replacetext_originaltext' => 'Tèxte original :', 'replacetext_replacementtext' => 'Tèxte novèl :', 'replacetext_optionalfilters' => 'Filtres opcionals :', 'replacetext_categorysearch' => 'Remplaçar solament dins la categoria :', 'replacetext_prefixsearch' => "Remplaçar solament dins las paginas qu'an lo prefix :", 'replacetext_editpages' => 'Remplaçar lo tèxte dins lo contengut dins la pagina', 'replacetext_movepages' => 'Remplaçar lo tèxte dins lo títol de las paginas, se possible', 'replacetext_givetarget' => 'Vos cal especificar la cadena de remplaçar.', 'replacetext_nonamespace' => 'Vos cal seleccionar al mens un espaci de noms.', 'replacetext_editormove' => 'Vos cal causir al mens una opcion de remplaçament.', 'replacetext_choosepagesforedit' => 'Seleccionatz {{PLURAL:$3|la pagina|las paginas}} dins {{PLURAL:$3|la quala|las qualas}} volètz remplaçar « $1 » per « $2 » :', 'replacetext_choosepagesformove' => 'Remplaçar « $1 » per « $2 » dins {{PLURAL:$3|lo nom de la pagina seguenta|los noms de las paginas seguentas}} :', 'replacetext_cannotmove' => '{{PLURAL:$1|La pagina seguenta a pas pogut èsser renomenada|Las paginas seguentas an pas pogut èsser renomenadas}} :', 'replacetext_formovedpages' => 'Per las paginas renomenadas :', 'replacetext_savemovedpages' => 'Enregistratz los títols ancians coma redireccions cap als títols novèls', 'replacetext_watchmovedpages' => 'Seguir aquestas paginas', 'replacetext_invertselections' => 'Inversar las seleccions', 'replacetext_replace' => 'Remplaçar', 'replacetext_success' => '« $1 » es estat remplaçat per « $2 » dins $3 fichièr{{PLURAL:$3||s}}.', 'replacetext_noreplacement' => 'Cap de fichièr que conten la cadena « $1 » es pas estat trobat.', 'replacetext_nomove' => 'Cap de pagina es pas estada trobada amb lo títol que conten « $1 ».', 'replacetext_nosuchcategory' => 'Existís pas de categoria nomenada « $1 ».', 'replacetext_return' => 'Tornar al formulari.', 'replacetext_warning' => "I a $1 fichièr{{PLURAL:$1| que conten|s que contenon}} ja la cadena de remplaçament « $2 ». S'efectuatz aquesta substitucion, poiretz pas separar vòstres cambiaments a partir d'aquestas cadenas.", 'replacetext_blankwarning' => 'Perque la cadena de remplaçament es voida, aquesta operacion serà irreversibla ; volètz contunhar ?', 'replacetext_continue' => 'Contunhar', 'replacetext_editsummary' => 'Remplaçament del tèxte — « $1 » per « $2 »', 'right-replacetext' => 'Far de remplaçaments de tèxte dins tot lo wiki', ); /** Deitsch (Deitsch) * @author Xqt */ $messages['pdc'] = array( 'replacetext_noreplacement' => 'Ken Blatt gfunne mit „$1“.', 'replacetext_continue' => 'Weider', ); /** Polish (polski) * @author Ankry * @author Derbeth * @author Leinad * @author Maikking * @author Matma Rex * @author Odder * @author Reedy * @author Sp5uhe * @author ToSter */ $messages['pl'] = array( 'replacetext' => 'Zastąp tekst', 'replacetext-desc' => 'Dodaje [[Special:ReplaceText|stronę specjalną]], pozwalającą administratorom na wyszukanie i zamianę zadanego tekstu w treści wszystkich stron wiki', 'replacetext_docu' => 'Możesz zastąpić jeden ciąg znaków innym, w treści wszystkich stron tej wiki. W tym celu wprowadź tutaj dwa fragmenty tekstu i naciśnij „{{int:replacetext_continue}}”. Zostanie pokazana lista stron, które zawierają wyszukiwany tekst. Będziesz {{GENDER:|mógł|mogła}} wybrać te strony, na których chcesz ten tekst zamienić na nowy. W historii zmian stron, do opisu autora edycji, zostanie użyta Twoja nazwa użytkownika.', # Fuzzy 'replacetext_originaltext' => 'Wyszukiwany tekst', 'replacetext_replacementtext' => 'Zamień na', 'replacetext_useregex' => 'Użyj wyrażeń regularnych', 'replacetext_regexdocu' => '(Przykładowo: wstawiając „a(.*)c” w polu „{{int:replacetext_originaltext}}” oraz „ac$1” w polu „{{int:replacetext_replacementtext}}” spowodujesz zastąpienie „abc” przez „acb”.)', 'replacetext_optionalfilters' => 'Dodatkowe filtry:', 'replacetext_categorysearch' => 'Zamień tylko w kategorii', 'replacetext_prefixsearch' => 'Zamień tylko na stronach z prefiksem', 'replacetext_editpages' => 'Zastąp tekst w treści stron', 'replacetext_movepages' => 'Jeśli to możliwe wykonaj zastępowanie również w tytułach stron', 'replacetext_givetarget' => 'Musisz podać łańcuch znaków, który ma zostać zastąpiony.', 'replacetext_nonamespace' => 'Musisz wybrać co najmniej jedną przestrzeń nazw.', 'replacetext_editormove' => 'Musisz wybrać co najmniej jedną opcję zastępowania.', 'replacetext_choosepagesforedit' => 'Wybierz {{PLURAL:$3|stronę|strony}}, na których chcesz „$1” zastąpić „$2”', 'replacetext_choosepagesformove' => 'Zastąp „$1” tekstem „$2” w {{PLURAL:$3|tytule strony|tytułach następujących stron:}}', 'replacetext_cannotmove' => '{{PLURAL:$1|Poniższa strona nie może zostać przeniesiona|Poniższe strony nie mogą zostać przeniesione}}:', 'replacetext_formovedpages' => 'Dla przeniesionych stron:', 'replacetext_savemovedpages' => 'Zapisz stare tytuły jako przekierowania do nowych', 'replacetext_watchmovedpages' => 'Obserwuj te strony', 'replacetext_invertselections' => 'Odwróć zaznaczenie', 'replacetext_replace' => 'Zastąp', 'replacetext_success' => '„$1” zostanie zastąpiony przez „$2” na $3 {{PLURAL:$3|stronie|stronach}}.', 'replacetext_noreplacement' => 'Nie znaleziono stron zawierających tekst „$1”.', 'replacetext_nomove' => 'Nie znaleziono żadnych stron o tytule zawierającym „$1”.', 'replacetext_nosuchcategory' => 'Kategoria „$1” nie istnieje.', 'replacetext_return' => 'Powrót do formularza.', 'replacetext_warning' => "'''Uwaga''' {{PLURAL:$1|Jest $1 strona zawierająca|Są $1 strony zawierające|Jest $1 stron zawierających}} tekst „$2”, którym chcesz zastępować. Jeśli wykonasz zastępowanie nie będzie możliwe odseparowanie Twoich zastąpień od tych tekstów.", 'replacetext_blankwarning' => 'Ponieważ ciąg znaków, którym ma być wykonane zastępowanie jest pusty, operacja będzie nieodwracalna. Czy kontynuować?', 'replacetext_continue' => 'Kontynuuj', 'replacetext_editsummary' => 'zamienił w treści „$1” na „$2”', 'right-replacetext' => 'Wykonywanie zastępowania tekstu w całej wiki', ); /** Piedmontese (Piemontèis) * @author Borichèt * @author Dragonòt */ $messages['pms'] = array( 'replacetext' => 'Rimpiassa test', 'replacetext-desc' => "A dà na [[Special:ReplaceText|pàgina special]] për përmëtte a j'aministrator ëd fé un sërca-e-rampiassa dë stringhe global su tute le pàgine ëd contnù ëd na wiki", 'replacetext_docu' => "Për rampiassé na stringa ëd test con n'àutra dzora a tute le pàgine regolar dë sta wiki-sì, ch'a buta ij doi tòch ëd test ambelessì e peui ch'a sgnaca \"{{int:replacetext_continue}}\". A-j sarà alora mostrà na lista ëd pàgine ch'a conten-o ël test d'arserca, e a podrà serne cole andoa a veul rampiasselo. Sò nòm a comparirà ant le stòrie dle pàgine com l'utent responsàbil ëd tute modìfiche.", 'replacetext_originaltext' => 'Test original:', 'replacetext_replacementtext' => 'Test ëd rimpiassadura:', 'replacetext_useregex' => "Dovré dj'espression regolar", 'replacetext_regexdocu' => '(Esempi: ij valor «a(.*)c» për «{{int:replacetext_originaltext}}» e «ac$1» për «{{int:replacetext_replacementtext}}» a rampiasso «abc» with «acb».)', 'replacetext_optionalfilters' => 'Filtr opsionaj:', 'replacetext_categorysearch' => 'Rimpiassa mach an categorìa:', 'replacetext_prefixsearch' => 'Rimpiassa mach an pàgine con ël prefiss:', 'replacetext_editpages' => 'Rimpiassa test ant ij contnù dla pàgina', 'replacetext_movepages' => 'Rimpiassa test ant ij tìtoj dla pàgina, quand possìbil', 'replacetext_givetarget' => 'It deve spessifiché la stringa da esse rimpiassà.', 'replacetext_nonamespace' => 'It deve spessifiché almanch në spassi nominal.', 'replacetext_editormove' => "It deve selessioné almanch un-a dj'opsion ëd rampiass.", 'replacetext_choosepagesforedit' => 'Rimpiassa "$1" con "$2" ant ël test ëd {{PLURAL:$3|la pàgina|le pàgine}} sota:', 'replacetext_choosepagesformove' => 'Rimpiassa "$1" con "$2" ant {{PLURAL:$3|ël tìtol dla pàgina|ij tìtoj dle pàgine}} sota:', 'replacetext_cannotmove' => '{{PLURAL:$1|La pàgina|Le pàgine}} sota a peulo pa esse tramudà:', 'replacetext_formovedpages' => 'Për le pàgine tramudà:', 'replacetext_savemovedpages' => 'Salva ël tìtol vej com ridiression al tìtol neuv', 'replacetext_watchmovedpages' => "Ten d'euj ste pàgine-sì", 'replacetext_invertselections' => 'Anvert selession', 'replacetext_replace' => 'Rimpiassa', 'replacetext_success' => '"$1" a sarà rimpiassà con "$2" an $3 {{PLURAL:$3|pàgina|pàgine}}.', 'replacetext_noreplacement' => 'Pa gnun-e pàgine trovà contenente la stringa "$1".', 'replacetext_nomove' => 'Pa gnun-e pàgine trovà con ij tìtoj contenent "$1".', 'replacetext_nosuchcategory' => 'A esisto gnun-e categorìe con ël nòm "$1".', 'replacetext_return' => 'Artorna al formolari.', 'replacetext_warning' => "'''Atension:''' A-i {{PLURAL:\$1|é \$1 pàgina ch'a conten|son \$1 pàgine ch'a conten-o}} già la stringa ëd rimpiassadura, \"\$2\". S'it fas sta rimpiassadura-sì it saras pa bon a separé toe rimpiassadure da ste stringhe-sì.", 'replacetext_blankwarning' => "Da già che la stringa ëd rimpiass a l'é veuida, st'operassion-sì a sarà pa reversìbil. Veul-lo continué?", 'replacetext_continue' => 'Continua', 'replacetext_editsummary' => 'Rimpiassadura test - "$1" a "$2"', 'right-replacetext' => "Fà rimpiassadura dë stringhe an sl'antrega wiki", ); /** Pontic (Ποντιακά) * @author Omnipaedista */ $messages['pnt'] = array( 'replacetext_originaltext' => 'Πρωτότυπον κείμενον:', ); /** Pashto (پښتو) * @author Ahmed-Najib-Biabani-Ibrahimkhel */ $messages['ps'] = array( 'replacetext' => 'متن ځايناستول', 'replacetext_originaltext' => 'آرنی متن:', 'replacetext_replacementtext' => 'د متن ځايناستوب:', 'replacetext_categorysearch' => 'يوازې په وېشنيزه کې ځايناستول:', 'replacetext_prefixsearch' => 'يوازې په مختاړي لرونکيو مخونو کې ځايناستول:', 'replacetext_editpages' => 'د مخ په مېنځپانګه کې متن ځايناستول', 'replacetext_movepages' => 'د شونتيا په وخت کې، د مخ د سرليک متن ځايناستول', 'replacetext_nonamespace' => 'تاسې بايد لږ تر لږه يو نوم-تشيال وټاکۍ.', 'replacetext_cannotmove' => 'دا {{PLURAL:$1|لاندې مخ|لانديني مخونه}} د لېږدولو وړ نه دي:', 'replacetext_formovedpages' => 'د لېږدل شويو مخونو لپاره:', 'replacetext_watchmovedpages' => 'همدا مخونه کتل', 'replacetext_invertselections' => 'ټاکنې سرچپه کول', 'replacetext_replace' => 'ځايناستول', 'replacetext_editsummary' => 'متن ځايناستول - له "$1" نه "$2" ته', ); /** Portuguese (português) * @author Crazymadlover * @author Hamilton Abreu * @author Lijealso * @author Malafaya * @author Waldir * @author 555 */ $messages['pt'] = array( 'replacetext' => 'Substituir texto', 'replacetext-desc' => "[[Special:ReplaceText|Página especial]] que permite que os administradores façam substituições globais de texto ''(string find-and-replace)'' em todas as páginas de conteúdo de uma wiki", 'replacetext_docu' => 'Para substituir um texto por outro texto em todas as páginas desta wiki, introduza os dois textos e clique o botão "Prosseguir". Serão listadas as páginas que contêm o texto a substituir e poderá seleccionar em quais deseja proceder à substituição. O seu nome aparecerá no histórico dessas páginas como o utilizador responsável pelas alterações.', # Fuzzy 'replacetext_originaltext' => 'Texto original:', 'replacetext_replacementtext' => 'Texto de substituição:', 'replacetext_useregex' => 'Usar expressões regulares', 'replacetext_regexdocu' => '(Exemplo: os valores "a(.*)c" no "Texto original" e "ac$1" no "Texto de substituição" substituiriam "abc" por "acb")', # Fuzzy 'replacetext_optionalfilters' => 'Filtros opcionais:', 'replacetext_categorysearch' => 'Substituir só na categoria:', 'replacetext_prefixsearch' => 'Substituir só em páginas com o prefixo:', 'replacetext_editpages' => 'Substituir texto no conteúdo da página', 'replacetext_movepages' => 'Substituir texto nos títulos de páginas, quando possível', 'replacetext_givetarget' => 'Deve especificar o texto que será substituído.', 'replacetext_nonamespace' => 'Deverá seleccionar pelo menos um espaço nominal.', 'replacetext_editormove' => 'Deve seleccionar pelo menos uma das opções de substituição.', 'replacetext_choosepagesforedit' => 'Substituir "$1" por "$2" no texto {{PLURAL:$3|da seguinte página|das seguintes páginas}}:', 'replacetext_choosepagesformove' => 'Substituir "$1" por "$2" {{PLURAL:$3|no título da seguinte página|nos títulos das seguintes páginas}}:', 'replacetext_cannotmove' => '{{PLURAL:$1|A seguinte página não pode ser movida|As seguintes páginas não podem ser movidas}}:', 'replacetext_formovedpages' => 'Para páginas movidas:', 'replacetext_savemovedpages' => 'Gravar os títulos anteriores como redireccionamentos para os novos títulos', 'replacetext_watchmovedpages' => 'Vigiar estas páginas', 'replacetext_invertselections' => 'Inverter selecções', 'replacetext_replace' => 'Substituir', 'replacetext_success' => "'$1' será substituído por '$2' em $3 {{PLURAL:$3|página|páginas}}.", 'replacetext_noreplacement' => 'Não foram encontradas páginas que contenham o texto "$1".', 'replacetext_nomove' => 'Não foram encontradas páginas cujo título contenha "$1".', 'replacetext_nosuchcategory' => 'Não existe nenhuma categoria com o nome "$1".', 'replacetext_return' => 'Voltar ao formulário.', 'replacetext_warning' => "'''Aviso:''' Há {{PLURAL:\$1|uma página que já contém|\$1 páginas que já contêm}} o texto de substituição, \"\$2\". Se fizer esta substituição não poderá distingui-las das suas substituições, nem desfazer a operação com uma simples substituição em ordem inversa.", 'replacetext_blankwarning' => "'''Aviso:''' Como o texto de substituição foi deixado em branco, esta operação não será reversível.", 'replacetext_continue' => 'Prosseguir', 'replacetext_editsummary' => 'Substituição de texto - de "$1" para "$2"', 'right-replacetext' => 'Fazer substituições de texto em toda a wiki', ); /** Brazilian Portuguese (português do Brasil) * @author Crazymadlover * @author Eduardo.mps * @author Enqd * @author Giro720 * @author Hamilton Abreu * @author Jaideraf * @author Luckas Blade * @author 555 */ $messages['pt-br'] = array( 'replacetext' => 'Substituir texto', 'replacetext-desc' => '[[Special:ReplaceText|Página especial]] que permite que os administradores façam substituições globais de texto em todas as páginas de conteúdo de um wiki', 'replacetext_docu' => 'Para substituir uma "string" de texto por outra em todas as páginas deste wiki, forneça o texto a ser substituído e o novo texto e clique no botão "{{int:replacetext_continue}}". Será exibida uma lista de páginas que possuem o termo pesquisado. A partir dela, selecione em quais você deseja realizar substituições. Seu nome de usuário aparecerá nos históricos das páginas como o responsável por ter feito as alterações.', 'replacetext_originaltext' => 'Texto original:', 'replacetext_replacementtext' => 'Novo texto:', 'replacetext_useregex' => 'Usar expressões regulares', 'replacetext_regexdocu' => '(Exemplo: os valores "a(.*)c" no "{{int:replacetext_originaltext}}" e "ac$1" em "{{int:replacetext_replacementtext}}" substituiriam "abc" por "acb")', 'replacetext_optionalfilters' => 'Filtros opcionais:', 'replacetext_categorysearch' => 'Substituir apenas na categoria:', 'replacetext_prefixsearch' => 'Substituir apenas em páginas com o prefixo:', 'replacetext_editpages' => 'Substituir texto no conteúdo da página', 'replacetext_movepages' => 'Substituir texto nos títulos das páginas, quando possível', 'replacetext_givetarget' => 'Você precisa especificar um texto para ser substituído.', 'replacetext_nonamespace' => 'Você precisa selecionar no mínimo um espaço nominal.', 'replacetext_editormove' => 'Você precisa selecionar no mínimo uma das opções de substituição.', 'replacetext_choosepagesforedit' => 'Substituir "$1" por "$2" no texto {{PLURAL:$3|da página|das páginas}} a seguir:', 'replacetext_choosepagesformove' => 'Substituir "$1" por "$2" {{PLURAL:$3|no nome da seguinte página|nos nomes das seguintes páginas}}:', 'replacetext_cannotmove' => '{{PLURAL:$1|A seguinte página não pode ser movida|As seguintes páginas não podem ser movidas}}:', 'replacetext_formovedpages' => 'Para páginas movidas:', 'replacetext_savemovedpages' => 'Manter os títulos antigos como redirecionamentos para os novos títulos', 'replacetext_watchmovedpages' => 'Vigiar estas páginas', 'replacetext_invertselections' => 'Inverter seleções', 'replacetext_replace' => 'Substituir', 'replacetext_success' => '"$1" será substituído por "$2" em $3 {{PLURAL:$3|página|páginas}}.', 'replacetext_noreplacement' => 'Não foram encontradas páginas que contenham a expressão "$1".', 'replacetext_nomove' => 'Não foram encontradas páginas cujo título contenha "$1".', 'replacetext_nosuchcategory' => 'Não existe nenhuma categoria com o nome "$1".', 'replacetext_return' => 'Voltar ao formulário.', 'replacetext_warning' => "'''Aviso:''' Há {{PLURAL:\$1|uma página que já contém|\$1 páginas que já contêm}} a expressão de substituição, \"\$2\". Se você prosseguir, não será possível distinguí-las das suas substituições, nem desfazer a operação com uma simples substituição em ordem inversa.", 'replacetext_blankwarning' => "'''Aviso:''' Como o texto de substituição foi deixado em branco, esta operação não será reversível.", 'replacetext_continue' => 'Avançar', 'replacetext_editsummary' => "Substituindo texto '$1' por '$2'", 'right-replacetext' => 'Fazer substituições de texto em toda a wiki', ); /** Romanian (română) * @author Firilacroco * @author KlaudiuMihaila * @author Stelistcristi */ $messages['ro'] = array( 'replacetext' => 'Înlocuiește text', 'replacetext_originaltext' => 'Text original:', 'replacetext_optionalfilters' => 'Filtre opționale:', 'replacetext_watchmovedpages' => 'Urmărește aceste pagini', 'replacetext_invertselections' => 'Inversează selecțiile', 'replacetext_replace' => 'Înlocuire', 'replacetext_nomove' => "Nu a fost găsită nici o pagină al cărei titlu să conțină '$1'.", 'replacetext_return' => 'Revenire la formular.', 'replacetext_continue' => 'Continuare', 'replacetext_editsummary' => "Înlocuire de text - '$1' în '$2'", ); /** tarandíne (tarandíne) * @author Joetaras */ $messages['roa-tara'] = array( 'replacetext' => "Sostituisce 'u teste", 'replacetext_originaltext' => 'Teste origgenale:', 'replacetext_replace' => 'Sostituisce', 'replacetext_continue' => 'Condinue', ); /** Russian (русский) * @author AlexSm * @author Ferrer * @author Kv75 * @author Normalex * @author Rubin * @author Александр Сигачёв */ $messages['ru'] = array( 'replacetext' => 'Заменить текст', 'replacetext-desc' => 'Добавляет [[Special:ReplaceText|служебную страницу]], позволяющую администраторам осуществлять повсеместную замену указанного текста на всех обычных страницах вики', 'replacetext_docu' => 'Для того, чтобы заменить один текст на другой на всех страницах вики, вам необходимо ввести здесь желаемый текст и нажать на кнопку «Продолжить». После этого вам будет предложен список всех страниц, содержащих заменяемый текст, и вы сможете выбрать из них те, в которых нужно произвести замены. В качестве лица, отвечающего за внесённые изменения, в истории правок страниц, в которых произойдёт замена текста, будете указаны вы.', # Fuzzy 'replacetext_originaltext' => 'Исходный текст:', 'replacetext_replacementtext' => 'Текст для замены:', 'replacetext_useregex' => 'Использовать регулярные выражения', 'replacetext_regexdocu' => '(Например, выражения «a(.*)c» в поле «Исходный текст» и «ac$1» в поле «Текст для замены» приведут к замене «abc» на «acb».)', # Fuzzy 'replacetext_optionalfilters' => 'Необязательные фильтры:', 'replacetext_categorysearch' => 'Заменить только в категории:', 'replacetext_prefixsearch' => 'Заменить только в страницах с приставкой:', 'replacetext_editpages' => 'Замена текста в содержимом страниц', 'replacetext_movepages' => 'Заменить текст в названиях страниц, если это возможно', 'replacetext_givetarget' => 'Вы должны указать строку, которую нужно заменить.', 'replacetext_nonamespace' => 'Вы должны выбрать по крайней мере одно пространство имён.', 'replacetext_editormove' => 'Вы должны выбрать по крайней мере, один из вариантов замены.', 'replacetext_choosepagesforedit' => 'Пожалуйста, выберите {{PLURAL:$3|страницу, в которой|страницы, в которых}} вы хотите осуществить замену «$1» на «$2»:', 'replacetext_choosepagesformove' => 'Заменить «$1» на «$2» в {{PLURAL:$3|названии следующей страницы|названиях следующих страниц}}:', 'replacetext_cannotmove' => '{{PLURAL:$1|Следующая страница не может быть переименована|Следующие страницы не могут быть переименованы}}:', 'replacetext_formovedpages' => 'Для переименованных страниц:', 'replacetext_savemovedpages' => 'Сохранить старые названия как перенаправления на новые', 'replacetext_watchmovedpages' => 'Включить эти страницы в список наблюдения', 'replacetext_invertselections' => 'Инвертировать выбор', 'replacetext_replace' => 'Заменить', 'replacetext_success' => '«$1» будет заменён на «$2» на $3 {{PLURAL:$3|странице|страницах|страницах}}.', 'replacetext_noreplacement' => 'Не найдено ни одной страницы, содержащей «$1».', 'replacetext_nomove' => 'Не удалось найти страницы, заголовок которых содержит «$1».', 'replacetext_nosuchcategory' => 'Не существует категории с именем «$1».', 'replacetext_return' => 'Вернуться к форме.', 'replacetext_warning' => "'''Внимание.''' Найдена {{PLURAL:$1|$1 страница, содержащая|$1 страницы, содержащие|$1 страниц, содержащих}} текст для замены, «$2». Если вы продолжите операцию замены, то не сможете отделить уже существующие записи от тех, которые появятся после замены.", 'replacetext_blankwarning' => 'Из-за того, что текст для замены пуст, операция по замене не сможет быть отменена. Вы хотите продолжить?', 'replacetext_continue' => 'Продолжить', 'replacetext_editsummary' => 'Замена текста — «$1» на «$2»', 'right-replacetext' => 'выполнение замен текста во всей вики', ); /** Sinhala (සිංහල) * @author පසිඳු කාවින්ද */ $messages['si'] = array( 'replacetext_replace' => 'ප්‍රතිස්ථාපනය', ); /** Slovak (slovenčina) * @author Helix84 * @author Teslaton */ $messages['sk'] = array( 'replacetext' => 'Nahradiť text', 'replacetext-desc' => 'Poskytuje [[Special:ReplaceText|špeciálnu stránku]], ktorá správcom umožňuje globálne nájsť a nahradiť text na všetkých stránkach celej wiki.', 'replacetext_docu' => 'Nájsť text na všetkých stránkach tejto wiki a nahradiť ho iným textom môžete tak, že sem napíšete texty a stlačíte „Pokračovať”. Potom sa vám zobrazí zoznam stránok obsahujúcich hľadaný text a môžete si zvoliť tie, na ktorých ho chcete nahradiť. V histórii úprav sa zaznamená vaše meno.', # Fuzzy 'replacetext_originaltext' => 'Pôvodný text:', 'replacetext_replacementtext' => 'Nahradiť textom:', 'replacetext_useregex' => 'Použiť regulárne výrazy', 'replacetext_regexdocu' => '(Príklad: výraz „a(.*)c“ pre „Pôvodný text“ a „ac$1“ pre „Nahradiť textom“ nahradí „abc“ textom „acb“.)', # Fuzzy 'replacetext_optionalfilters' => 'Nepovinné filtre:', 'replacetext_categorysearch' => 'Nahradiť iba v kategórii:', 'replacetext_prefixsearch' => 'Nahradiť iba v stránkach s predponou:', 'replacetext_editpages' => 'Nahradiť text v obsahu stránok', 'replacetext_movepages' => 'Nahradiť text v názvoch stránok, keď je to možné', 'replacetext_givetarget' => 'Musíte zadať reťazec, ktorý sa má nahradiť.', 'replacetext_nonamespace' => 'Musíte vybrať aspoň jeden menný priestor.', 'replacetext_editormove' => 'Musíte vybrať aspoň jednu z volieb nahrádzania.', 'replacetext_choosepagesforedit' => 'Prosím, vyberte {{PLURAL:$3|stránku, na ktorej|stránky, na ktorých}} chcete nahradiť „$1“ za „$2“:', 'replacetext_choosepagesformove' => 'Nahradiť text „$1“ textom „$2“ v {{PLURAL:$3|názve nasledovnej stránky|názvoch nasledovných stránok}}:', 'replacetext_cannotmove' => '{{PLURAL:$1|Nasledovnú stránku|Nasledovné stránky}} nemožno presunúť:', 'replacetext_formovedpages' => 'Pri presunutých stránkach:', 'replacetext_savemovedpages' => 'Ukladať staré názvy ako presmerovania na nové názvy', 'replacetext_watchmovedpages' => 'Sledovať tieto stránky', 'replacetext_invertselections' => 'Invertovať výber', 'replacetext_replace' => 'Nahradiť', 'replacetext_success' => 'Text „$1” bude nahradený textom „$2” na $3 {{PLURAL:$3|stránke|stránkach}}.', 'replacetext_noreplacement' => 'Nenašli sa žiadne stránky obsahujúce text „$1”.', 'replacetext_nomove' => 'Neboli nájdené žiadne stránky, ktorých názov obsahuje „$1“.', 'replacetext_nosuchcategory' => 'Žiadna kategória s názvom „$1“ neexistuje.', 'replacetext_return' => 'Späť na formulár.', 'replacetext_warning' => "'''Upozornenie:''' $1 {{PLURAL:$1|stránka|stránky|stránok}} už obsahuje text „$2”, ktorým chcete pôvodný text nahradiť. Ak budete pokračovať a text nahradíte, nebudete môcť odlíšiť vaše nahradenia od existujúceho textu, ktorý tento reťazec už obsahuje.", 'replacetext_blankwarning' => 'Pretože text, ktorým text chcete nahradiť je prázdny, operácia bude nevratná. Pokračovať?', 'replacetext_continue' => 'Pokračovať', 'replacetext_editsummary' => 'Nahradenie textu „$1” textom „$2”', 'right-replacetext' => 'Vykonať náhradu reťazcov na celej wiki', ); /** Serbian (Cyrillic script) (српски (ћирилица)‎) * @author Rancher * @author Sasa Stefanovic * @author Жељко Тодоровић * @author Михајло Анђелковић */ $messages['sr-ec'] = array( 'replacetext' => 'Замена текста', 'replacetext_originaltext' => 'Изворни текст:', 'replacetext_replacementtext' => 'Нови текст:', 'replacetext_optionalfilters' => 'Необавезни филтери:', 'replacetext_categorysearch' => 'Замени само у категорији:', 'replacetext_editpages' => 'Замени текст у садржају странице', 'replacetext_movepages' => 'Замени текст у насловима страница, када је могуће', 'replacetext_givetarget' => 'Морате навести ниску коју желите да замените.', 'replacetext_nonamespace' => 'Морате изабрати барем један именски простор.', 'replacetext_editormove' => 'Морате изабрати барем једну од могућности за замену.', 'replacetext_choosepagesforedit' => 'Замени „$1“ са „$2“ у тексту {{PLURAL:$3|следеће странице|следећих страница}}:', 'replacetext_cannotmove' => '{{PLURAL:$1|Следећа страница не може бити премештена|Следеће странице не могу бити премештене}}:', 'replacetext_formovedpages' => 'За премештене странице:', 'replacetext_savemovedpages' => 'Сачувај старе наслове као преусмерења ка новим насловима', 'replacetext_watchmovedpages' => 'Надгледај ове стране', 'replacetext_invertselections' => 'Обрни избор', 'replacetext_replace' => 'Замени', 'replacetext_success' => "'$1' ће бити замењено са '$2' у $3 {{PLURAL:$3|страни|страна}}.", 'replacetext_noreplacement' => "Није нађена ниједна страница која садржи стринг '$1'.", 'replacetext_nomove' => 'Није нађена ниједна страница чији наслов садржи „$1“.', 'replacetext_return' => 'Назад на образац.', 'replacetext_continue' => 'Настави', 'replacetext_editsummary' => "Замена текста - '$1' у '$2'", 'right-replacetext' => 'замењивање ниски на целом викију', ); /** Serbian (Latin script) (srpski (latinica)‎) * @author Michaello * @author Rancher * @author Жељко Тодоровић */ $messages['sr-el'] = array( 'replacetext' => 'Zamena teksta', 'replacetext_originaltext' => 'Izvorni tekst:', 'replacetext_replacementtext' => 'Novi tekst:', 'replacetext_optionalfilters' => 'Neobavezni filteri:', 'replacetext_categorysearch' => 'Zameni samo u kategoriji:', 'replacetext_editpages' => 'Zameni tekst u sadržaju stranice', 'replacetext_movepages' => 'Zameni tekst u naslovima stranica, kada je moguće', 'replacetext_givetarget' => 'Morate navesti nisku koju želite da zamenite.', 'replacetext_nonamespace' => 'Morate izabrati barem jedan imenski prostor.', 'replacetext_editormove' => 'Morate izabrati barem jednu od mogućnosti za zamenu.', 'replacetext_choosepagesforedit' => 'Zameni „$1“ sa „$2“ u tekstu {{PLURAL:$3|sledeće stranice|sledećih stranica}}:', 'replacetext_cannotmove' => '{{PLURAL:$1|Sledeća stranica ne može biti premeštena|Sledeće stranice ne mogu biti premeštene}}:', 'replacetext_formovedpages' => 'Za premeštene stranice:', 'replacetext_savemovedpages' => 'Sačuvaj stare naslove kao preusmerenja ka novim naslovima', 'replacetext_watchmovedpages' => 'Nadgledaj ove strane', 'replacetext_invertselections' => 'Obrni izbor', 'replacetext_replace' => 'Zameni', 'replacetext_success' => "'$1' će biti zamenjeno sa '$2' u $3 {{PLURAL:$3|strani|strana}}.", 'replacetext_noreplacement' => "Nije nađena nijedna stranica koja sadrži string '$1'.", 'replacetext_nomove' => 'Nije nađena nijedna stranica čiji naslov sadrži „$1“.', 'replacetext_return' => 'Nazad na obrazac.', 'replacetext_continue' => 'Nastavi', 'replacetext_editsummary' => "Zamena teksta - '$1' u '$2'", 'right-replacetext' => 'zamenjivanje niski na celom vikiju', ); /** Swedish (svenska) * @author Cybjit * @author Fluff * @author M.M.S. * @author Martinwiss * @author Najami * @author Per * @author Rotsee */ $messages['sv'] = array( 'replacetext' => 'Ersätt text', 'replacetext-desc' => 'Låter administratörer [[Special:ReplaceText|ersätta text]] på alla innehållssidor på en wiki', 'replacetext_docu' => 'För att ersätta en textsträng med en annan på alla vanliga sidor i den här wikin, skriv in de två texterna här och klicka på "{{int:replacetext_continue}}". Du kommer sedan att visas på en lista över sidor som innehåller söktexten, där du kan välja de som du vill ersätta i. Ditt namn kommer visas i sidhistoriken som den som är ansvarig för ändringarna.', 'replacetext_originaltext' => 'Originaltext:', 'replacetext_replacementtext' => 'Ersättningstext:', 'replacetext_useregex' => 'Använd reguljära uttryck', 'replacetext_regexdocu' => '(T.ex: värden på "a(.*)c" för "{{int:replacetext_originaltext}}" och "ac$1" för "{{int:replacetext_replacementtext}}" skulle ersätta "abc" med "acb".)', 'replacetext_optionalfilters' => 'Valbara filter:', 'replacetext_categorysearch' => 'Ersätt endast i kategori:', 'replacetext_prefixsearch' => 'Ersätt endast sidor med prefixet:', 'replacetext_editpages' => 'Ersätt text i sidinnehåll', 'replacetext_movepages' => 'Ersätt text i sidtitlar när det är möjligt', 'replacetext_givetarget' => 'Du måste ange en textsträng som ska ersättas.', 'replacetext_nonamespace' => 'Du måste ange minst en namnrymd.', 'replacetext_editormove' => 'Du måste ange minst ett alternativ för ersättning.', 'replacetext_choosepagesforedit' => "Var god ange för {{PLURAL:$3|vilken sida|vilka sidor}} du vill ersätta '$1' med '$2':", 'replacetext_choosepagesformove' => "Ersätt '$1' med '$2' i {{PLURAL:$3|namnet på den följande sidan|namnen på de följande sidorna}}:", 'replacetext_cannotmove' => '{{PLURAL:$1|Den följande sidan|De följande sidorna}} kan inte flyttas:', 'replacetext_formovedpages' => 'För flyttade sidor:', 'replacetext_savemovedpages' => 'Spara de gamla artikeltitlarna som omdirigeringar till de nya', 'replacetext_watchmovedpages' => 'Bevaka de här sidorna', 'replacetext_invertselections' => 'Invertera val', 'replacetext_replace' => 'Ersätt', 'replacetext_success' => "'$1' kommer att ersättas med '$2' på $3 {{PLURAL:$3|sida|sidor}}.", 'replacetext_noreplacement' => 'Inga sidor hittades med strängen "$1".', 'replacetext_nomove' => 'Inga sidor hittades som innehåller "$1" i titeln.', 'replacetext_nosuchcategory' => 'Det exisgterar inte någon kategori med namnet "$1".', 'replacetext_return' => 'Tillbaka till formuläret.', 'replacetext_warning' => '\'\'\'Varning:\'\'\' Det finns {{PLURAL:$1|$1 sida|$1 sidor}} som redan har ersättningssträngen "$2". Om du gör den här ersättningen kommer du inte kunna separera dina ersättningar från den här texten.', 'replacetext_blankwarning' => 'Eftersom ersättningstexten är tom kommer den här handlingen inte kunna upphävas; vill du fortsätta?', 'replacetext_continue' => 'Fortsätt', 'replacetext_editsummary' => 'Textersättning - "$1" till "$2"', 'right-replacetext' => 'Genomför textersättningar på hela wikin', ); /** Swahili (Kiswahili) * @author Stephenwanjau */ $messages['sw'] = array( 'replacetext_continue' => 'Endelea', ); /** Tamil (தமிழ்) * @author Shanmugamp7 */ $messages['ta'] = array( 'replacetext_watchmovedpages' => 'இந்தப் பக்கங்களை கவனிக்கவும்', 'replacetext_replace' => 'மாற்றுக', 'replacetext_continue' => 'தொடரவும்', ); /** Telugu (తెలుగు) * @author Veeven */ $messages['te'] = array( 'replacetext_originaltext' => 'అసలు పాఠ్యం:', 'replacetext_replacementtext' => 'మార్పిడి పాఠ్యం:', 'replacetext_optionalfilters' => 'ఐచ్చిక వడపోతలు:', 'replacetext_cannotmove' => 'ఈ {{PLURAL:$1|పేజీని|$1 పేజీలను}} తరలించలేరు:', 'replacetext_continue' => 'కొనసాగించు', ); /** Thai (ไทย) * @author Ans * @author Passawuth */ $messages['th'] = array( 'replacetext_originaltext' => 'ข้อความดั้งเดิม:', ); /** Tagalog (Tagalog) * @author AnakngAraw */ $messages['tl'] = array( 'replacetext' => 'Palitan ang teksto', 'replacetext-desc' => 'Nagbibigay ng isang [[Special:ReplaceText|natatanging pahina]] upang mapahintulutan ang mga tagapangasiwa na makagawa ng isang baging na pandaidigang hanapin-at-palitan sa ibabaw ng lahat ng mga pahina ng nilalaman ng isang wiki', 'replacetext_docu' => 'Upang mapalitan ang isang bagting ng teksto ng iba pang nasa kahabaan ng lahat ng pangkaraniwang mga pahinang nasa ibabaw ng wiking ito, ipasok ang dalawang piraso ng teksto dito at pindutin pagkatapos ang "{{int:replacetext_continue}}". Susunod na ipapakita naman sa iyo ang isang talaan ng mga pahinang naglalaman ng teksto ng paghanap, at mapipili mo ang mga maaari mong ipamalit dito. Lilitaw ang pangalan mo sa mga kasaysayan ng pahina bilang tagagamit na umaako sa anumang mga pagbabago.', 'replacetext_originaltext' => 'Orihinal na teksto:', 'replacetext_replacementtext' => 'Pamalit na teksto:', 'replacetext_useregex' => 'Gumamit ng pangkaraniwang mga paglalahad', 'replacetext_regexdocu' => '(Halimbawa: mga halaga ng isang "a(.*) c" para sa "{{int:replacetext_originaltext}}" at "ac$1" para sa "{{int:replacetext_replacementtext}}" na papalitan ang "abc" ng "acb".)', 'replacetext_optionalfilters' => 'Mga pansalang maaaring wala:', 'replacetext_categorysearch' => 'Palitan lamang sa loob ng kategorya:', 'replacetext_prefixsearch' => 'Palitan lamang sa loob ng mga pahina may unlapi:', 'replacetext_editpages' => 'Palitan ang teksto sa loob ng mga nilalaman ng pahina', 'replacetext_movepages' => 'Palitan ang tekstong nasa loob ng mga pamagat na pampahina, kapag maaari', 'replacetext_givetarget' => 'Dapat mong tukuyin ang bagting na papalitan.', 'replacetext_nonamespace' => 'Dapat kang pumili ng kahit na isang puwang na pampangalan.', 'replacetext_editormove' => 'Dapat kang pumili ng kahit na isa sa mga mapipiling pagpapalit.', 'replacetext_choosepagesforedit' => "Pakipili ang {{PLURAL:$3|pahina|mga pahina}} kung saan mo naisa na palitan ang '$1' ng '$2':", 'replacetext_choosepagesformove' => 'Palitan ang "$1" ng "$2" sa loob ng {{PLURAL:$3|pangalan ng sumusunod na pahina|mga pangalan ng sumusunod na mga pahina}}:', 'replacetext_cannotmove' => 'Hindi maililipat ang sumusunod na {{PLURAL:$1|pahina|mga pahina}}:', 'replacetext_formovedpages' => 'Para sa mga pahinang inilipat:', 'replacetext_savemovedpages' => 'Sagipin ang lumang mga pamagat bilang mga pampunta patungo sa bagong mga pamagat', 'replacetext_watchmovedpages' => 'Bantayan ang mga pahinang ito', 'replacetext_invertselections' => 'Baligtarin ang mga pagpipilian', 'replacetext_replace' => 'Palitan', 'replacetext_success' => "Ang '$1' ay mapapalitan ng '$2' sa loob ng $3 {{PLURAL:$3|pahina|mga pahina}}.", 'replacetext_noreplacement' => "Walang natagpuang mga pahinang naglalaman ng bagting na '$1'.", 'replacetext_nomove' => 'Walang natagpuang mga pahina na naglalaman ang pamagat ng "$1".', 'replacetext_nosuchcategory' => 'Walang kategoryang umiiral na may pangalang "$1".', 'replacetext_return' => 'Bumalik sa pormularyo.', 'replacetext_warning' => "'''Babala:''' Mayroong {{PLURAL:$1|$1 pahinang naglalaman na|$1 mga pahinang naglalaman na}} ng pamalit na bagting, '$2'. Kapag ginawa mo ang pagpapalit na ito hindi mo na maihihiwalay ang mga pamalit mo mula sa mga bagting na ito.", 'replacetext_blankwarning' => 'Dahil sa walang laman ang bagting ng pamalit, hindi na maibabalik pa sa dati ang gawaing ito/ Naisa mo bang magpatuloy pa?', 'replacetext_continue' => 'Magpatuloy', 'replacetext_editsummary' => "Palitan ang tekso - '$1' papunta sa '$2'", 'right-replacetext' => 'Gumawa ng pagpapalit ng bagting sa buong wiki', ); /** Turkish (Türkçe) * @author Joseph * @author Vito Genovese */ $messages['tr'] = array( 'replacetext' => 'Metni değiştir', 'replacetext-desc' => 'Yöneticilere, bir vikideki tüm içerik sayfalarında bir küresel dizi bul-ve-değiştir yapmalarına izin veren bir [[Special:ReplaceText|özel sayfa]] sağlar', 'replacetext_docu' => "Bu viki üzerindeki tüm sayfalarda bir metin dizgisini diğer bir dizgi ile değiştirmek için, iki metin parçasını girin ve 'Devam' seçeneğini seçin. Sonrasında size arama metnini gösteren sayfaların bir listesi gösterilecek ve değiştirmek istediklerinizi seçebileceksiniz. Adınız, değişiklikleri gerçekleştiren kullanıcı olarak sayfa geçmişlerinde görülecek.", # Fuzzy 'replacetext_originaltext' => 'Orijinal metin:', 'replacetext_replacementtext' => 'Yerine konulacak metin:', 'replacetext_optionalfilters' => 'Opsiyonel filtreler', 'replacetext_categorysearch' => 'Sadece kategoride değiştir:', 'replacetext_prefixsearch' => 'Sadece şu öneke sahip sayfalarda değiştir:', 'replacetext_editpages' => 'Sayfa içeriklerindeki metinleri değiştir', 'replacetext_movepages' => 'Sayfa başlıklarında metni değiştir, mümkün olduğunda', 'replacetext_givetarget' => 'Değiştirilecek dizgiyi belirtmelisiniz.', 'replacetext_nonamespace' => 'En az bir ad alanı seçmelisiniz.', 'replacetext_editormove' => 'Değiştirme seçeneklerinden en az birini seçmelisiniz.', 'replacetext_choosepagesforedit' => "Lütfen, '$1' yerine '$2' koymak istediğiniz {{PLURAL:$3|sayfayı|sayfaları}} seçin:", 'replacetext_choosepagesformove' => 'Aşağıdaki {{PLURAL:$3|sayfanın adındaki|sayfaların adlarındaki}} "$1" bölümünü "$2" ile değiştir:', 'replacetext_cannotmove' => 'Aşağıdaki {{PLURAL:$1|sayfa|sayfalar}} taşınamaz:', 'replacetext_formovedpages' => 'Taşınan sayfalar için:', 'replacetext_savemovedpages' => 'Eski başlıkları yeni başlıklara yönlendirmeler olarak sakla', 'replacetext_watchmovedpages' => 'Bu sayfaları izle', 'replacetext_invertselections' => 'Seçimleri ters çevir', 'replacetext_replace' => 'Değiştir', 'replacetext_success' => '$3 {{PLURAL:$3|sayfada|sayfada}} "$1" ile "$2" değiştirildi.', 'replacetext_noreplacement' => '"$1" dizgisini içeren herhangi bir sayfa bulunamadı.', 'replacetext_nomove' => '"$1" ibaresini içeren isimli sayfa bulunamadı.', 'replacetext_nosuchcategory' => '"$1" adında bir kategori mevcut değil.', 'replacetext_return' => 'Forma dön.', 'replacetext_warning' => '"$2" değiştirme dizgisini halihazırda içeren {{PLURAL:$1|$1 sayfa|$1 sayfa}} mevcut. Bu değişikliği yaparsanız değişikliklerinizi bu dizgilerden ayırma imkanınız olmayacak. Değiştirme işlemine devam etmek ister misiniz?', # Fuzzy 'replacetext_blankwarning' => 'Değiştirme dizgisi boş olduğu için bu işlem geri alınamayacak. Devam etmek istiyor musunuz?', 'replacetext_continue' => 'Devam', 'replacetext_editsummary' => 'Metin değiştir - "$1" yerine "$2"', 'right-replacetext' => 'Vikinin tamamında dizgileri değiştirir', ); /** Ukrainian (українська) * @author AS * @author Prima klasy4na */ $messages['uk'] = array( 'replacetext' => 'Заміна тексту', 'replacetext-desc' => 'Додає [[Special:ReplaceText|спеціальну сторінку]], що дозволяє адміністраторам робити глобальну заміну зазначеного тексту на всіх звичайних сторінках вікі', 'replacetext_docu' => "Для того, щоб замінити один текст на іншій на всіх сторінках вікі, вам треба ввести тут два фрагменти тексту і натиснути кнопку «Продовжити». Після цього вам буде запропонований список всіх сторінок, що містять замінюваний текст, і ви зможете вибрати ті, в яких потрібно виконати заміни. В історії редагувань сторінок, в яких відбудеться заміна тексту, буде вказане ваше ім'я.", # Fuzzy 'replacetext_originaltext' => 'Оригінальний текст:', 'replacetext_replacementtext' => 'Замінити на:', 'replacetext_optionalfilters' => 'Додаткові фільтри:', 'replacetext_categorysearch' => 'Замінити тільки в категорії:', 'replacetext_prefixsearch' => 'Замінити тільки на сторінках, чиї назви починаються на:', 'replacetext_editpages' => 'Заміна тексту у вмісті сторінки', 'replacetext_movepages' => 'Замінити текст у назвах сторінок, якщо можливо', 'replacetext_givetarget' => 'Ви повинні вказати рядок, який потрібно замінити.', 'replacetext_nonamespace' => 'Ви повинні вибрати принаймні один простір назв.', 'replacetext_editormove' => 'Ви повинні вибрати принаймні один варіант заміни.', 'replacetext_choosepagesforedit' => 'Будь ласка, виберіть {{PLURAL:$3|сторінку, в якій|сторінки, в яких}} ви хочете здійснити заміну «$1» на «$2»:', 'replacetext_choosepagesformove' => 'Замінити «$1» на «$2» в {{PLURAL:$3|назві наступної сторінки|назвах наступних сторінок}}:', 'replacetext_cannotmove' => '{{PLURAL:$1|Наступна сторінка не може бути перейменована|Наступні сторінки не можуть бути перейменовані}}:', 'replacetext_formovedpages' => 'Для перейменованих сторінок:', 'replacetext_savemovedpages' => 'Зберегти старі назви як перенаправлення на нові', 'replacetext_watchmovedpages' => 'Спостерігати за цими сторінками', 'replacetext_invertselections' => 'Інвертувати виділення', 'replacetext_replace' => 'Замінити', 'replacetext_success' => '«$1» буде замінений на «$2» на $3 {{PLURAL:$3|сторінці|сторінках|сторінках}}.', 'replacetext_continue' => 'Продовжити', ); /** Urdu (اردو) * @author පසිඳු කාවින්ද */ $messages['ur'] = array( 'replacetext_replacementtext' => 'متبادل متن:', 'replacetext_optionalfilters' => 'اختیاری فلٹر:', 'replacetext_replace' => 'کو تبدیل', ); /** Veps (vepsän kel’) * @author Игорь Бродский */ $messages['vep'] = array( 'replacetext_originaltext' => 'Originaline tekst', 'replacetext_watchmovedpages' => 'Kacelta nened lehtpoled', 'replacetext_return' => 'Pörtas formannoks.', ); /** Vietnamese (Tiếng Việt) * @author Minh Nguyen * @author Vinhtantran */ $messages['vi'] = array( 'replacetext' => 'Thay thế văn bản', 'replacetext-desc' => 'Cung cấp một [[Special:ReplaceText|trang đặc biệt]] để cho phép bảo quản viên thực hiện tìm-kiếm-và-thay-thế thống nhất trên tất cả các trang có nội dung tại một wiki', 'replacetext_docu' => 'Để thay thế một chuỗi ký tự bằng một chuỗi khác trên toàn bộ các trang thông thường tại wiki này, hãy gõ vào hai đoạn văn bản ở đây và sau đó nhấn “{{int:replacetext_continue}}”. Khi đó bạn thấy một danh sách các trang có chứa đoạn ký tự được tìm, và bạn có thể chọn những trang mà bạn muốn thay thế. Tên của bạn sẽ xuất hiện trong lịch sử trang như một thành viên chịu trách nhiệm về bất kỳ thay đổi nào.', 'replacetext_originaltext' => 'Văn bản gốc:', 'replacetext_replacementtext' => 'Văn bản thay thế:', 'replacetext_useregex' => 'Sử dụng biểu thức chính quy', 'replacetext_regexdocu' => '(Ví dụ: Văn bản gốc “a(.*)c” và văn bản thay thế “ac$1” sẽ thay thế “abc” bằng “acb”.)', 'replacetext_optionalfilters' => 'Bộ lọc tùy ý:', 'replacetext_categorysearch' => 'Chỉ thay trong thể loại:', 'replacetext_prefixsearch' => 'Chỉ thay trong những trang với tiền tố:', 'replacetext_editpages' => 'Thay thế văn bản trong nội dung trang', 'replacetext_movepages' => 'Thay văn bản trong tên trang nếu có thể', 'replacetext_givetarget' => 'Bạn cần phải định rõ văn bản để thay thế.', 'replacetext_nonamespace' => 'Cần phải chọn ít nhất một không gian tên.', 'replacetext_editormove' => 'Bạn cần phải chọn ít nhất một trong những tùy chọn thay thế.', 'replacetext_choosepagesforedit' => 'Thay ‘$1’ bằng ‘$2’ trong nội dung của {{PLURAL:$3|trang|những trang}} sau:', 'replacetext_choosepagesformove' => 'Thay “$1” bằng “$2” trong tên của {{PLURAL:$3|trang|các trang}} sau:', 'replacetext_cannotmove' => 'Không có thể di chuyển {{PLURAL:$1|trang|các trang}} sau:', 'replacetext_formovedpages' => 'Đối với trang đã di chuyển:', 'replacetext_savemovedpages' => 'Lưu các tên cũ để đổi hướng đến tên mới', 'replacetext_watchmovedpages' => 'Theo dõi các trang này', 'replacetext_invertselections' => 'Đảo ngược các lựa chọn', 'replacetext_replace' => 'Thay thế', 'replacetext_success' => '“$1” sẽ được thay bằng “$2” trong $3 {{PLURAL:$3|trang|trang}}.', 'replacetext_noreplacement' => 'Không tìm thấy trang nào có chứa chuỗi ‘$1’.', 'replacetext_nomove' => 'Không tìm thấy trang nào với “$1” trong tên.', 'replacetext_nosuchcategory' => 'Không có thể loại với tên “$1”.', 'replacetext_return' => 'Trở lại biểu mẫu.', 'replacetext_warning' => "'''Cảnh báo:''' {{PLURAL:$1|Một trang|$1 trang}} trong lựa chọn đã có chứa chuỗi thay thế, “$2”. Nếu bạn thực hiện thay thế này bạn sẽ không thể phân biệt sự thay thế của bạn với những chuỗi này.", 'replacetext_blankwarning' => 'Vì chuỗi thay thế là khoảng trắng, tác vụ này sẽ không thể hồi lại được; tiếp tục?', 'replacetext_continue' => 'Tiếp tục', 'replacetext_editsummary' => 'Thay thế văn bản - ‘$1’ thành ‘$2’', 'right-replacetext' => 'Thay thế chuỗi ở tất cả wiki', ); /** Volapük (Volapük) * @author Malafaya * @author Smeira */ $messages['vo'] = array( 'replacetext' => 'Plaädön vödemi', 'replacetext-desc' => 'Jafön [[Special:ReplaceText|padi patik]] ad mögükön guvanes sukami e plaädami valöpikis, ninädapadis valik vüka seimik tefölis.', 'replacetext_originaltext' => 'Rigavödem:', 'replacetext_replacementtext' => 'Plaädamavödem:', 'replacetext_movepages' => 'Plaädön vödemi i pö padatiäds, ven mögos', # Fuzzy 'replacetext_choosepagesforedit' => 'Välolös {{PLURAL:$3|padi, su kel|padis, su kels}} vilol plaädön vödemi: „$1“ me vödem: „$2“:', 'replacetext_cannotmove' => '{{PLURAL:$1|Pad|Pads}} fovik no kanons patopätükön:', 'replacetext_replace' => 'Plaädön', 'replacetext_success' => 'Vödem: „$1“ poplaädon dub vödem: „$2“ su {{PLURAL:$3|pad bal|pads $3}}.', 'replacetext_noreplacement' => 'Pads nonik labü vödem: „$1“ petuvons.', 'replacetext_blankwarning' => 'Bi plaädamavödem binon vägik, dun at no kanon pasädunön. Vilol-li fümiko ledunön plaädami?', 'replacetext_continue' => 'Ledunön', 'replacetext_editsummary' => 'Vödemiplaädam - „$1“ ad „$2“', 'right-replacetext' => 'Ledunön vödemiplaädami in vük lölik', ); /** Simplified Chinese (中文(简体)‎) * @author Liangent * @author Onecountry * @author PhiLiP */ $messages['zh-hans'] = array( 'replacetext' => '替换文字', 'replacetext-desc' => '提供[[Special:ReplaceText|特殊页面]]让管理员可以对wiki的所有页面内容执行查找和替换。', 'replacetext_docu' => '要替换此维基内所有页面文字的字串,请将“原文字”及“替换文字”分别填入以下两个栏位之中,然后按“继续”。接下来会列出所有含原文字的页面供你选择在哪些页面进行替换。页面改动历史会显示你是进行此次改动的用户。', # Fuzzy 'replacetext_originaltext' => '原文字', 'replacetext_replacementtext' => '替换文字', 'replacetext_useregex' => '使用正则表达式', 'replacetext_regexdocu' => '(例如:在“{{int:replacetext_originaltext}}”填入“a(.*)c”并在“{{int:replacetext_replacementtext}}”填入“ac$1”可以将“abc”替换为“acb”。)', 'replacetext_optionalfilters' => '可选过滤器:', 'replacetext_categorysearch' => '仅替换该分类中的页面:', 'replacetext_prefixsearch' => '仅替换带该前缀页面:', 'replacetext_editpages' => '仅在页面内容中替换', 'replacetext_movepages' => '可能的话,在页面名称中替换。', 'replacetext_givetarget' => '必须指定查找的字符串', 'replacetext_nonamespace' => '您必须选择至少一个名字空间。', 'replacetext_editormove' => '必须选择至少一个替换选项。', 'replacetext_choosepagesforedit' => '请选择想将“$1”替换成“$2”的{{PLURAL:$3|页面|页面}}。', 'replacetext_choosepagesformove' => '将{{PLURAL:$3|以下页面|以下页面}}中的“$1”替换为“$2”:', 'replacetext_cannotmove' => '无法移动以下{{PLURAL:$1|页面|页面}}:', 'replacetext_formovedpages' => '对以下页面进行了移动:', 'replacetext_savemovedpages' => '重定向至新标题时保留旧标题。', 'replacetext_watchmovedpages' => '监视这些页面', 'replacetext_invertselections' => '反选', 'replacetext_replace' => '替换', 'replacetext_success' => '已在$3个页面中将“$1”替换为“$2”。', 'replacetext_noreplacement' => '无任何页面含有“$1”。', 'replacetext_nomove' => '无任何页面标题含有“$1”。', 'replacetext_nosuchcategory' => '无任何分类名为“$1”。', 'replacetext_return' => '返回表单。', 'replacetext_warning' => '有$1个页面已经包含文字「$2」。如果您执行了替换作业,被替代的文字会跟它们混在一起,变得难以分开原来的文字和被替代的文字。要继续执行替换作业吗?', 'replacetext_blankwarning' => "'''警告:'''因为替换字串为空,这将导致操作无法复原!您要继续吗?", 'replacetext_continue' => '继续', 'replacetext_editsummary' => '替换文字 - 「$1」替换为「$2」', 'right-replacetext' => '对整个wiki进行文字替换。', ); /** Traditional Chinese (中文(繁體)‎) * @author Mark85296341 * @author Roc michael * @author Sheepy * @author Wrightbus */ $messages['zh-hant'] = array( 'replacetext' => '替換文字', 'replacetext-desc' => '提供[[Special:ReplaceText|特殊頁面]]以利管理員以「尋找及替換」的方式更改所有文章頁面內的內容。', 'replacetext_docu' => '要替換此維基內所有頁面文字的字串,請將「原始文字」及「替換的文字」分別填入下面的兩個欄位之中,然後按「繼續」。接下來所有內含原始文字的頁面會被列出,你可以選擇要在那一些頁面進行替換。頁面的改動歷史會顯示你是負責進行這次改動的用戶。', # Fuzzy 'replacetext_originaltext' => '原文字', 'replacetext_replacementtext' => '替換文字', 'replacetext_useregex' => '使用正則表達式', 'replacetext_regexdocu' => '(例如:在“{{int:replacetext_originaltext}}”填入“a(.*)c”並在“{{int:replacetext_replacementtext}}”填入“ac$1”可以將“abc”替換為“acb”。)', 'replacetext_optionalfilters' => '可選過濾器:', 'replacetext_categorysearch' => '僅當頁面在該分類中時替換:', 'replacetext_prefixsearch' => '僅當頁面帶有該前綴時替換:', 'replacetext_editpages' => '僅在頁面內容當中進行替換', 'replacetext_movepages' => '如果可以的話,也替換頁面名稱的字串。', 'replacetext_givetarget' => '必須指定尋找的字符串', 'replacetext_nonamespace' => '您必須選擇最少一個名字空間。', 'replacetext_editormove' => '必須選擇至少一個替換選項。', 'replacetext_choosepagesforedit' => '請選擇想將“$1”替換成“$2”的{{PLURAL:$3|頁面|頁面}}。', 'replacetext_choosepagesformove' => '將{{PLURAL:$3|以下頁面|以下頁面}}中的“$1”替換為“$2”:', 'replacetext_cannotmove' => '無法移動以下{{PLURAL:$1|頁面|頁面}}:', 'replacetext_formovedpages' => '對以下頁面進行了移動:', 'replacetext_savemovedpages' => '重定向至新標題時保留舊標題。', 'replacetext_watchmovedpages' => '監視這些頁面', 'replacetext_invertselections' => '倒選', 'replacetext_replace' => '替換', 'replacetext_success' => '已將$3個頁面內的「$1」替換為「$2」。', 'replacetext_noreplacement' => '因無任何頁面內含有「$1」。', 'replacetext_nomove' => '無任何頁面標題含有“$1”。', 'replacetext_nosuchcategory' => '無任何分類名為“$1”。', 'replacetext_return' => '返回表格。', 'replacetext_warning' => '有$1個頁面已經包含文字「$2」。如果您執行了替換作業,被替代的文字會跟它們混在一起,變得難以分開原來的文字和被替代的文字。要繼續執行替換作業嗎?', 'replacetext_blankwarning' => '因為替換字串是空白的,這將造成難以復原的結果!您要繼續嗎?', 'replacetext_continue' => '繼續', 'replacetext_editsummary' => '替換文字 - 「$1」替換為「$2」', 'right-replacetext' => '對整個維基進行文字替換。', ); /** Chinese (Taiwan) (‪中文(台灣)‬) * @author Roc michael */ $messages['zh-tw'] = array( 'replacetext' => '取代文字', 'replacetext-desc' => '提供[[Special:ReplaceText|特殊頁面]]以利管理員以「尋找及取代」的方式更改所有文章頁面內的內容。', 'replacetext_docu' => '取代儲存在此Wiki系統內所有頁面上的文字字串,請將「原始文字」及「取代的文字」分別填入下面的兩個欄位之中,按下「取代按鈕」後生效,您所作的修改會顯示在「歷史」頁面上,以對您自己編輯行為負責。', 'replacetext_replace' => '取代', 'replacetext_noreplacement' => '因無任何頁面內含有「$1」。', 'replacetext_blankwarning' => '因為取代字串是空白的,這將造成難以復原的結果!您要繼續嗎?', 'replacetext_continue' => '繼續', 'replacetext_editsummary' => '取代文字 - 「$1」 取代為 「$2」', );
gpl-2.0
AaronWo/CampusHand
test/cn/edu/xmu/campushand/menu/CommonButton.java
439
package cn.edu.xmu.campushand.menu; /** * 普通按钮(子按钮) * * @author liufeng * @date 2013-08-08 */ public class CommonButton extends Button { private String type; private String key; public String getType() { return type; } public void setType(String type) { this.type = type; } public String getKey() { return key; } public void setKey(String key) { this.key = key; } }
gpl-2.0
coders-circle/Notifica
android/app/src/main/java/com/toggle/notifica/RoutineFragment.java
4053
package com.toggle.notifica; import android.os.Bundle; import android.os.Parcelable; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentStatePagerAdapter; import android.support.v4.content.ContextCompat; import android.support.v4.view.ViewPager; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.toggle.notifica.database.*; import com.toggle.notifica.database.Period; import java.util.ArrayList; import java.util.Calendar; import java.util.List; public class RoutineFragment extends Fragment { static final int NUM_TABS = 7; static final int NUM_DAYS = 7; static final String[] tabTitles = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}; private RoutineDayFragment mCurrentFragment; SlidingTabLayout tabs; public List<List<Period>> routine; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){ return inflater.inflate(R.layout.fragment_routine, container, false); } @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); // Use routine from database routine = new ArrayList<>(); DbHelper helper = new DbHelper(getContext()); for(int i = 0; i < NUM_DAYS; i++) { // Get periods for current day, ordered by start_time List<Period> periods = Period.query(Period.class, helper, "day=?", new String[]{i + ""}, null, null, "start_time"); // Remove electives that user hasn't selected for (int j=0; j<periods.size(); ++j) { Elective elective = periods.get(j).getSubject(helper).getElective(helper); if (elective == null) continue; if (!elective.selected) { periods.remove(j); --j; } } routine.add(periods); } DaysTabsPagerAdapter adapter = new DaysTabsPagerAdapter(getChildFragmentManager()); ViewPager viewPager = (ViewPager) getActivity().findViewById(R.id.pager_routine); viewPager.setAdapter(adapter); tabs = (SlidingTabLayout) getActivity().findViewById(R.id.routine_tab); tabs.setDistributeEvenly(true); tabs.setCustomTabColorizer(new SlidingTabLayout.TabColorizer() { @Override public int getIndicatorColor(int position) { return ContextCompat.getColor(getContext(), R.color.tabsScrollColor); } }); tabs.setViewPager(viewPager); viewPager.setCurrentItem(Calendar.getInstance().get(Calendar.DAY_OF_WEEK) - 1); } public class DaysTabsPagerAdapter extends FragmentStatePagerAdapter { public DaysTabsPagerAdapter(FragmentManager fm) { super(fm); } @Override public int getCount() { return NUM_TABS; } @Override public CharSequence getPageTitle(int position) { return tabTitles[position]; } @Override public Fragment getItem(int position) { if (position < 0 || position > 6) return null; Fragment fragment = new RoutineDayFragment(); Bundle args = new Bundle(); args.putInt("day", position); fragment.setArguments(args); return fragment; } @Override public void restoreState(Parcelable arg0, ClassLoader arg1) { //do nothing here! no call to super.restoreState(arg0, arg1); } @Override public void setPrimaryItem(ViewGroup container, int position, Object object) { if (mCurrentFragment != object) { mCurrentFragment = (RoutineDayFragment) object; } super.setPrimaryItem(container, position, object); } } }
gpl-2.0
flyapen/UgFlu
flumotion/manager/worker.py
7708
# -*- Mode: Python; test-case-name: flumotion.test.test_manager_worker -*- # vi:si:et:sw=4:sts=4:ts=4 # # Flumotion - a streaming media server # Copyright (C) 2004,2005,2006,2007 Fluendo, S.L. (www.fluendo.com). # All rights reserved. # This file may be distributed and/or modified under the terms of # the GNU General Public License version 2 as published by # the Free Software Foundation. # This file is distributed without any warranty; without even the implied # warranty of merchantability or fitness for a particular purpose. # See "LICENSE.GPL" in the source distribution for more information. # Licensees having purchased or holding a valid Flumotion Advanced # Streaming Server license may use this file in accordance with the # Flumotion Advanced Streaming Server Commercial License Agreement. # See "LICENSE.Flumotion" in the source distribution for more information. # Headers in this file shall remain intact. """ manager-side objects to handle worker clients """ from twisted.internet import defer from flumotion.manager import base from flumotion.common import errors, interfaces, log, registry from flumotion.common import worker, common from flumotion.common.vfs import registerVFSJelly __version__ = "$Rev: 7162 $" class WorkerAvatar(base.ManagerAvatar): """ I am an avatar created for a worker. A reference to me is given when logging in and requesting a worker avatar. I live in the manager. @ivar feedServerPort: TCP port the feed server is listening on @type feedServerPort: int """ logCategory = 'worker-avatar' _portSet = None feedServerPort = None def __init__(self, heaven, avatarId, remoteIdentity, mind, feedServerPort, ports, randomPorts): base.ManagerAvatar.__init__(self, heaven, avatarId, remoteIdentity, mind) self.feedServerPort = feedServerPort self._portSet = worker.PortSet(self.avatarId, ports, randomPorts) self.heaven.workerAttached(self) self.vishnu.workerAttached(self) registerVFSJelly() def getName(self): return self.avatarId def makeAvatarInitArgs(klass, heaven, avatarId, remoteIdentity, mind): def havePorts(res): log.debug('worker-avatar', 'got port information') (_s1, feedServerPort), (_s2, (ports, random)) = res return (heaven, avatarId, remoteIdentity, mind, feedServerPort, ports, random) log.debug('worker-avatar', 'calling mind for port information') d = defer.DeferredList([mind.callRemote('getFeedServerPort'), mind.callRemote('getPorts')], fireOnOneErrback=True) d.addCallback(havePorts) return d makeAvatarInitArgs = classmethod(makeAvatarInitArgs) def onShutdown(self): self.heaven.workerDetached(self) self.vishnu.workerDetached(self) base.ManagerAvatar.onShutdown(self) def reservePorts(self, numPorts): """ Reserve the given number of ports on the worker. @param numPorts: how many ports to reserve @type numPorts: int """ return self._portSet.reservePorts(numPorts) def releasePorts(self, ports): """ Release the given list of ports on the worker. @param ports: list of ports to release @type ports: list of int """ self._portSet.releasePorts(ports) def createComponent(self, avatarId, type, nice, conf): """ Create a component of the given type with the given nice level. @param avatarId: avatarId the component should use to log in @type avatarId: str @param type: type of the component to create @type type: str @param nice: the nice level to create the component at @type nice: int @param conf: the component's config dict @type conf: dict @returns: a deferred that will give the avatarId the component will use to log in to the manager """ self.debug('creating %s (%s) on worker %s with nice level %d', avatarId, type, self.avatarId, nice) defs = registry.getRegistry().getComponent(type) try: entry = defs.getEntryByType('component') # FIXME: use entry.getModuleName() (doesn't work atm?) moduleName = defs.getSource() methodName = entry.getFunction() except KeyError: self.warning('no "component" entry in registry of type %s, %s', type, 'falling back to createComponent') moduleName = defs.getSource() methodName = "createComponent" self.debug('call remote create') return self.mindCallRemote('create', avatarId, type, moduleName, methodName, nice, conf) def getComponents(self): """ Get a list of components that the worker is running. @returns: a deferred that will give the avatarIds running on the worker """ self.debug('getting component list from worker %s' % self.avatarId) return self.mindCallRemote('getComponents') ### IPerspective methods, called by the worker's component def perspective_componentAddMessage(self, avatarId, message): """ Called by the worker to tell the manager to add a given message to the given component. Useful in cases where the component can't report messages itself, for example because it crashed. @param avatarId: avatarId of the component the message is about @type message: L{flumotion.common.messages.Message} """ self.debug('received message from component %s' % avatarId) self.vishnu.componentAddMessage(avatarId, message) class WorkerHeaven(base.ManagerHeaven): """ I interface between the Manager and worker clients. For each worker client I create an L{WorkerAvatar} to handle requests. I live in the manager. """ logCategory = "workerheaven" avatarClass = WorkerAvatar def __init__(self, vishnu): base.ManagerHeaven.__init__(self, vishnu) self.state = worker.ManagerWorkerHeavenState() ### my methods def workerAttached(self, workerAvatar): """ Notify the heaven that the given worker has logged in. @type workerAvatar: L{WorkerAvatar} """ workerName = workerAvatar.getName() if not workerName in self.state.get('names'): # wheee host = workerAvatar.mind.broker.transport.getPeer().host state = worker.ManagerWorkerState(name=workerName, host=host) self.state.append('names', workerName) self.state.append('workers', state) else: self.warning('worker %s was already registered in the heaven', workerName) raise errors.AlreadyConnectedError() def workerDetached(self, workerAvatar): """ Notify the heaven that the given worker has logged out. @type workerAvatar: L{WorkerAvatar} """ workerName = workerAvatar.getName() try: self.state.remove('names', workerName) for state in list(self.state.get('workers')): if state.get('name') == workerName: self.state.remove('workers', state) except ValueError: self.warning('worker %s was never registered in the heaven', workerName)
gpl-2.0
SenseNet/sensenet
src/ContentRepository/Packaging/Steps/SetField.cs
6573
using System; using System.Collections.Generic; using System.Linq; using System.Xml; using SenseNet.ContentRepository; using SenseNet.ContentRepository.Storage; namespace SenseNet.Packaging.Steps { /// <summary> /// Modifies a value of one or more fields on a content. /// </summary> public class SetField : Step { [Annotation("Repository path of the content to be edited.")] public string Content { get; set; } [Annotation("Name of the field to be set.")] public string Name { get; set; } [Annotation("List of field values to be set.")] public string Fields { get; set; } [DefaultProperty] [Annotation("Field value in the same format as in the import .Content files.")] public string Value { get; set; } [Annotation("Whether the field should be overwritten if not empty. Default: true")] public string Overwrite { get; set; } public override void Execute(ExecutionContext context) { context.AssertRepositoryStarted(); Content content; Dictionary<string, string> fieldValues; bool overwrite; ParseParameters(context, out content, out fieldValues, out overwrite); var xDoc = GetFieldXmlDocument(fieldValues); // ReSharper disable once PossibleNullReferenceException var importContext = new ImportContext(xDoc.DocumentElement.ChildNodes, null, false, true, true); var changed = false; foreach (var fieldName in fieldValues.Keys) { if (!overwrite && content.Fields[fieldName].HasValue()) continue; var fieldNode = xDoc.DocumentElement.SelectSingleNode($"//{fieldName}"); content.Fields[fieldName].Import(fieldNode, importContext); changed = true; } if (changed) { Logger.LogMessage($"Updating: {content.Path}"); content.SaveSameVersion(); } else { Logger.LogMessage($"SKIPPED: {content.Path}"); } } protected void ParseParameters(ExecutionContext context, out Content content, out Dictionary<string, string> fieldValues, out bool overwrite) { if (string.IsNullOrEmpty(Content)) throw new PackagingException(SR.Errors.InvalidParameters); var path = context.ResolveVariable(Content) as string; if (RepositoryPath.IsValidPath(path) != RepositoryPath.PathResult.Correct) throw new PackagingException(SR.Errors.InvalidParameters); content = ContentRepository.Content.Load(path); if (content == null) throw new PackagingException("Content not found: " + path); fieldValues = new Dictionary<string, string>(); // either Field or Fields should be filled, but not both if ((string.IsNullOrEmpty(Name) && string.IsNullOrEmpty(Fields)) || (!string.IsNullOrEmpty(Name) && !string.IsNullOrEmpty(Fields))) throw new PackagingException(SR.Errors.InvalidParameters); if (!string.IsNullOrEmpty(Name)) { // simple syntax, single field definition var fieldName = context.ResolveVariable(Name) as string; if (string.IsNullOrEmpty(fieldName) || !content.Fields.ContainsKey(fieldName)) throw new PackagingException($"Field '{fieldName}' not found on content {path}"); fieldValues[fieldName] = context.ResolveVariable(Value) as string; } else { // complex syntax, multiple field values are provided var xDoc = new XmlDocument(); xDoc.LoadXml($"<Fields>{context.ResolveVariable(Fields) as string}</Fields>"); if (xDoc.DocumentElement != null) { foreach (XmlNode fieldNode in xDoc.DocumentElement.ChildNodes) { var fieldName = fieldNode?.Attributes?["name"]?.Value; if (string.IsNullOrEmpty(fieldName)) throw new InvalidStepParameterException("Field name is missing."); if (!content.Fields.ContainsKey(fieldName)) throw new InvalidStepParameterException( $"Content {content.Path} does not have a field with the name {fieldName}."); if (fieldNode.FirstChild == null || fieldNode.ChildNodes.Count > 1) throw new InvalidStepParameterException("Incorrect field xml definition."); fieldValues[fieldName] = fieldNode.FirstChild.InnerXml; } } } overwrite = ParseOverwrite(context); } protected bool ParseOverwrite(ExecutionContext context) { var overwrite = true; var overwriteValue = context.ResolveVariable(Overwrite); if (overwriteValue is bool) { overwrite = (bool)overwriteValue; } else { var overwriteText = overwriteValue as string; if (!string.IsNullOrEmpty(overwriteText)) { bool result; if (bool.TryParse(overwriteText, out result)) overwrite = result; else throw new InvalidParameterException("Value could not be converted to bool: " + overwriteText); } } return overwrite; } /// <summary> /// Constructs an xml document from field values in a format that is recognised by the import API. /// </summary> protected XmlDocument GetFieldXmlDocument(Dictionary<string, string> fieldValues) { // load the values in a fake xml document var xDoc = new XmlDocument(); xDoc.LoadXml($"<Fields>{string.Join(Environment.NewLine, fieldValues.Select(f => $"<{f.Key}>{f.Value}</{f.Key}>"))}</Fields>"); if (xDoc.DocumentElement == null) throw new PackagingException("Invalid field value xml."); return xDoc; } } }
gpl-2.0
sddaniels/wongs-wiivenge
client/LightingConsts.java
890
package client; public class LightingConsts { // light colors public static final float[] white_light = { 1f, 1f, 1f, 1f }; public static final float[] red_light = { 1f, 0f, 0f, 1f }; public static final float[] green_light = { 0.6784f, 1f, 0.1843f, 1f }; public static final float[] lmodel_ambient = { 1.0f, 1.0f, 1.0f, 1f }; public static final float[] light_positionOrig = { 0f, 0f, 0f, 1f }; public static final float[] light_spotDirecOrig = { 0f, 0f, 1f }; public static final float[] light_position0 = { 0f, 3f, 0f, 1f }; public static final float[] light_spotDirec0 = { 1f, 0f, 0f }; public static final float[] light_position1 = { -4.75f, 2f, -9.1f, 1f }; public static final float[] light_spotDirec1 = { 1f, 0f, 0f }; public static final float[] light_position2 = { 4.75f, 2f, -9.1f, 1f }; public static final float[] light_spotDirec2 = { -1f, 0f, 0f }; }
gpl-2.0
ssanglee/capstone
php-5.4.6/ext/xmlrpc/tests/bug61264.phpt
278
--TEST-- Bug #61264: xmlrpc_parse_method_descriptions leaks temporary variable --FILE-- <?php $xml = <<<XML <?xml version="1.0" encoding="utf-8"?> <a> <b>foo</b> </a> XML; var_dump(xmlrpc_parse_method_descriptions($xml)); ?> --EXPECT-- array(1) { ["b"]=> string(3) "foo" }
gpl-2.0
richy27/doodlle-E
administrator/manifests/packages/Social Pinboard Package/script.php
2734
<?php /** * @name Social Pin Board * @version 1.0: com_subinstall.php$ * @since Joomla 1.5&1.6&1.7 * @package apptha * @subpackage com_socialpinboard * @author Contus Support * @copyright Copyright (C) 2011 powered by Apptha * @license GNU/GPL http://www.gnu.org/copyleft/gpl.html */ // Check to ensure this file is included in Joomla! defined('_JEXEC') or die('Restricted access'); // Include the actual subinstaller class jimport('joomla.utilities.error'); jimport('joomla.filesystem.file'); /** * API entry point. Called from main installer. */ class pkg_SocialPinboardPackageInstallerScript { function preflight($type, $parent){ } function install($parent) { } /** * API entry point. Called from main un installer. */ function postflight( $type, $parent ) { echo "<br />"; //show thanks message echo '<p style="font-style:normal;font-size:13px;font-weight:normal; margin-top:10px;margin-left:10px;"><a href="http://www.apptha.com" target="_blank"><img src="components/com_socialpinboard/assets/apptha.gif" alt="Joomla! Apptha Social PinBoard Component Installed Successfully" align="left" />&nbsp;&nbsp;Apptha</a> Social Pin Board</p> <p> Template Social PinBoard Installed Successfully <img src="components/com_socialpinboard/assets/ok.png" alt="Joomla! Apptha Social PinBoard Template" align="left" /> </p> <p> Module Social PinBoard Login Installed Successfully <img src="components/com_socialpinboard/assets/ok.png" alt="Joomla! Apptha Social PinBoard" align="left" /> </p> <p> Module Social PinBoard Header Installed Successfully <img src="components/com_socialpinboard/assets/ok.png" alt="Joomla! Apptha Social PinBoard" align="left" /></p> <p> Module Social PinBoard Activities Installed Successfully <img src="components/com_socialpinboard/assets/ok.png" alt="Joomla! Apptha Social PinBoard" align="left" /></p> <p> Module Social PinBoard Menu Installed Successfully <img src="components/com_socialpinboard/assets/ok.png" alt="Joomla! Apptha Social PinBoard" align="left" /></p> <p> Module Social PinBoard Search Installed Successfully <img src="components/com_socialpinboard/assets/ok.png" alt="Joomla! Apptha Social PinBoard" align="left" /></p> <p style=" width: 410px; "> Plugin Authentication - SocialPinBoardLogin Installed Successfully <img src="components/com_socialpinboard/assets/ok.png" alt="Joomla! Apptha Social PinBoard" align="left" /></p> <p> Plugin Authentication - Apptharedirect Installed Successfully <img src="components/com_socialpinboard/assets/ok.png" alt="Joomla! Apptha Social PinBoard" align="left" /></p><br/>'; } function uninstall() { } }
gpl-2.0
binary10/Netduino
AlternateLightButton/AlternateLightButton/Properties/AssemblyInfo.cs
870
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("AlternateLightButton")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("AlternateLightButton")] [assembly: AssemblyCopyright("Copyright © 2012")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
gpl-2.0
lekenji/eccube
data/Smarty/templates_c/admin/%%F9^F9D^F9DE8AC3%%delivery.tpl.php
6459
<?php /* Smarty version 2.6.27, created on 2014-12-16 19:11:36 compiled from basis/delivery.tpl */ ?> <?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php'); smarty_core_load_plugins(array('plugins' => array(array('modifier', 'script_escape', 'basis/delivery.tpl', 26, false),array('modifier', 'h', 'basis/delivery.tpl', 51, false),)), $this); ?> <form name="form1" id="form1" method="post" action="?"> <input type="hidden" name="<?php echo ((is_array($_tmp=@TRANSACTION_ID_NAME)) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp)); ?> " value="<?php echo ((is_array($_tmp=$this->_tpl_vars['transactionid'])) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp)); ?> " /> <input type="hidden" name="mode" value="edit" /> <input type="hidden" name="deliv_id" value="" /> <div id="basis" class="contents-main"> <div class="btn"> <ul> <li><a class="btn-action" href="javascript:;" name="subm2" onclick="eccube.changeAction('./delivery_input.php'); eccube.setModeAndSubmit('pre_edit','',''); return false;"> <span class="btn-next">配送方法<?php if (((is_array($_tmp=@INPUT_DELIV_FEE)) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp))): ?>・配送料<?php endif; ?>を新規入力</span></a></li> </ul> </div> <table class="list"> <col width="35%" /> <col width="30%" /> <col width="10%" /> <col width="10%" /> <col width="15%" /> <tr> <th>配送業者</th> <th>名称</th> <th>編集</th> <th>削除</th> <th>移動</th> </tr> <?php unset($this->_sections['cnt']); $this->_sections['cnt']['name'] = 'cnt'; $this->_sections['cnt']['loop'] = is_array($_loop=((is_array($_tmp=$this->_tpl_vars['arrDelivList'])) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp))) ? count($_loop) : max(0, (int)$_loop); unset($_loop); $this->_sections['cnt']['show'] = true; $this->_sections['cnt']['max'] = $this->_sections['cnt']['loop']; $this->_sections['cnt']['step'] = 1; $this->_sections['cnt']['start'] = $this->_sections['cnt']['step'] > 0 ? 0 : $this->_sections['cnt']['loop']-1; if ($this->_sections['cnt']['show']) { $this->_sections['cnt']['total'] = $this->_sections['cnt']['loop']; if ($this->_sections['cnt']['total'] == 0) $this->_sections['cnt']['show'] = false; } else $this->_sections['cnt']['total'] = 0; if ($this->_sections['cnt']['show']): for ($this->_sections['cnt']['index'] = $this->_sections['cnt']['start'], $this->_sections['cnt']['iteration'] = 1; $this->_sections['cnt']['iteration'] <= $this->_sections['cnt']['total']; $this->_sections['cnt']['index'] += $this->_sections['cnt']['step'], $this->_sections['cnt']['iteration']++): $this->_sections['cnt']['rownum'] = $this->_sections['cnt']['iteration']; $this->_sections['cnt']['index_prev'] = $this->_sections['cnt']['index'] - $this->_sections['cnt']['step']; $this->_sections['cnt']['index_next'] = $this->_sections['cnt']['index'] + $this->_sections['cnt']['step']; $this->_sections['cnt']['first'] = ($this->_sections['cnt']['iteration'] == 1); $this->_sections['cnt']['last'] = ($this->_sections['cnt']['iteration'] == $this->_sections['cnt']['total']); ?> <tr> <td><?php echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['arrDelivList'][$this->_sections['cnt']['index']]['name'])) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp)))) ? $this->_run_mod_handler('h', true, $_tmp) : smarty_modifier_h($_tmp)); ?> </td> <td><?php echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['arrDelivList'][$this->_sections['cnt']['index']]['service_name'])) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp)))) ? $this->_run_mod_handler('h', true, $_tmp) : smarty_modifier_h($_tmp)); ?> </td> <td align="center"><a href="?" onclick="eccube.changeAction('./delivery_input.php'); eccube.setModeAndSubmit('pre_edit', 'deliv_id', <?php echo ((is_array($_tmp=$this->_tpl_vars['arrDelivList'][$this->_sections['cnt']['index']]['deliv_id'])) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp)); ?> ); return false;"> 編集</a></td> <td align="center"><a href="?" onclick="eccube.setModeAndSubmit('delete', 'deliv_id', <?php echo ((is_array($_tmp=$this->_tpl_vars['arrDelivList'][$this->_sections['cnt']['index']]['deliv_id'])) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp)); ?> ); return false;"> 削除</a></td> <td align="center"> <?php if (((is_array($_tmp=$this->_sections['cnt']['iteration'])) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp)) != 1): ?> <a href="?" onclick="eccube.setModeAndSubmit('up','deliv_id', '<?php echo ((is_array($_tmp=$this->_tpl_vars['arrDelivList'][$this->_sections['cnt']['index']]['deliv_id'])) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp)); ?> '); return false;">上へ</a> <?php endif; ?> <?php if (((is_array($_tmp=$this->_sections['cnt']['iteration'])) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp)) != ((is_array($_tmp=$this->_sections['cnt']['last'])) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp))): ?> <a href="?" onclick="eccube.setModeAndSubmit('down','deliv_id', '<?php echo ((is_array($_tmp=$this->_tpl_vars['arrDelivList'][$this->_sections['cnt']['index']]['deliv_id'])) ? $this->_run_mod_handler('script_escape', true, $_tmp) : smarty_modifier_script_escape($_tmp)); ?> '); return false;">下へ</a> <?php endif; ?> </td> </tr> <?php endfor; endif; ?> </table> </div> </form>
gpl-2.0
Udo/HomeOverlord
mvc/devices/devices.pairhm.php
1521
<?= $this->_getSubmenu2() ?> <h1><?= l10n($_REQUEST['controller'].'.'.$_REQUEST['action']) ?></h1> <div class="description"> </div> <div id="modeindicator"> <input type="button" value="Start" onclick="startPairingMode();"> Pairing Mode <span id="modeindicatorldr" style="display:none;"><img src="icons/ajax-loader.gif" height="10" align="absmiddle"></span> </div> <div id="pairingmodemsg" style="display:none"> Pairing active for <span id="timervalue">0</span> seconds... </div> <br/><br/> <h2>Events</h2> <div id="log" class="pane" style="height: 300px;overflow:auto;padding: 8px;"> </div> <br/><br/> <h2>After Installation</h2> <div> &gt; <a href="<?= actionUrl('pair', 'devices') ?>">pairing finished</a> </div> <script> document.modeIndicatorOriginal = $('#modeindicator').html(); startPairingMode = function() { $('#modeindicatorldr').fadeIn('normal'); $.post('?', { action : 'ajax_pairhmstart', controller : 'devices' }, function(data) { $('#modeindicator').html($('#pairingmodemsg').html()); document.timerValue = data; }); } setInterval(function() { if(document.timerValue == 1) $('#modeindicator').html(document.modeIndicatorOriginal); if(document.timerValue > 0) document.timerValue--; $('#timervalue').text(document.timerValue); }, 1000); messageHandlers.busmessage = function(data) { var msg = data.data; $('#log') .append('<div>'+msg.type+'-'+msg.device+' '+msg.param+'='+msg.value+'</div>') .scrollTop($("#log")[0].scrollHeight); } </script>
gpl-2.0
DotNetAge/dotnetage
src/Foundation/DNA.Mvc.ServiceModel/Security/PermissionLoader.cs
7120
// Copyright (c) 2009-2013 DotNetAge (http://www.dotnetage.com) // Licensed under the GPLv2: http://dotnetage.codeplex.com/license // Project owner : Ray Liang (csharp2002@hotmail.com) using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; using System.Web; using System.Web.Mvc; namespace DNA.Web.ServiceModel { public static class PermissionLoader { // private static IDataContext context; // private static string _targetPath = ""; private static IDataContext context { get { return App.GetService<IDataContext>(); } } public static void Load(string targetPath = "") { string _targetPath = ""; if (string.IsNullOrEmpty(targetPath)) _targetPath = HttpContext.Current.Server.MapPath("~/bin"); else _targetPath = targetPath; string[] files = Directory.GetFiles(_targetPath, "*.dll"); foreach (string file in files) { try { //When using LoadFile will cause could not get CustomAttributes! Assembly assembly = Assembly.LoadFrom(file); AssemblyName asmname = assembly.GetName(); Type[] types = assembly.GetTypes(); var controllers = from c in types where c.BaseType == typeof(Controller) select c; Dictionary<string, string> added = new Dictionary<string, string>(); foreach (Type controller in controllers) { var methods = controller.GetMethods(BindingFlags.Public | BindingFlags.Instance); var actions = from MethodInfo method in methods where (method.GetCustomAttributes(typeof(SecurityActionAttribute), true).Length > 0) select method; foreach (MethodInfo action in actions) { SecurityActionAttribute attr = (SecurityActionAttribute)Attribute.GetCustomAttribute(action, typeof(SecurityActionAttribute)); var instance = context.Permissions.Filter(p => (p.Action.Equals(action.Name, StringComparison.OrdinalIgnoreCase)) && (p.Assembly.Equals(asmname.Name, StringComparison.OrdinalIgnoreCase)) && (p.Controller.Equals(controller.FullName, StringComparison.OrdinalIgnoreCase)) && (p.Title.Equals(attr.Title, StringComparison.OrdinalIgnoreCase))); if (instance.Count() > 0) continue; string _key = asmname.Name + "_" + controller.FullName + "_" + action.Name; if (added.ContainsKey(_key)) { if (added[_key] == attr.Title) continue; } else added.Add(_key, attr.Title); Permission permission = new Permission() { Action = action.Name, Assembly = asmname.Name, Controller = controller.FullName, Title = attr.Title, Description = attr.Description }; PermissionSet pset = null; if (!string.IsNullOrEmpty(attr.PermssionSet)) pset = context.Find<PermissionSet>(p => p.Name.Equals(attr.PermssionSet, StringComparison.OrdinalIgnoreCase)); //var _updateCount = 0; if (pset == null) { pset = new PermissionSet(); pset.Name = attr.PermssionSet; pset.ResbaseName = attr.ResBaseName; pset.TitleResName = attr.PermssionSetResName; pset = context.Add(pset); //_updateCount=context.SaveChanges(); } permission.PermissionSet = pset; context.Permissions.Create(permission); context.SaveChanges(); } } } catch { continue; } } RemoveUsingPermissions(); } private static void RemoveUsingPermissions() { var perms = context.Permissions.All().ToList(); var isChanged = false; foreach (var perm in perms) { var typeStr = perm.Controller + "," + perm.Assembly; //var asm = Assembly.LoadWithPartialName(perm.Assembly); var type = Type.GetType(typeStr); if (type == null) { context.Permissions.Delete(perm); isChanged = true; continue; } var methods = type.GetMethods(BindingFlags.Public | BindingFlags.Instance); var actions = methods.Where(m => m.Name.Equals(perm.Action)); if (actions.Count() == 0) { context.Permissions.Delete(perm); isChanged = true; continue; } var hasAttr = false; foreach (var action in actions) { SecurityActionAttribute attr = Attribute.GetCustomAttribute(action, typeof(SecurityActionAttribute)) as SecurityActionAttribute; if (attr != null) { hasAttr = true; break; } } if (hasAttr) continue; context.Permissions.Delete(perm); isChanged = true; } var permSets = context.All<PermissionSet>(); foreach (var permset in permSets) { if ((permset.Permissions != null) && (permset.Permissions.Count == 0)) { context.Delete(permset); isChanged = true; } } if (isChanged) context.SaveChanges(); } } }
gpl-2.0
hackcraft-sk/swarm
overmind/app/presenters/BaseTournamentPresenter.php
2027
<?php abstract class BaseTournamentPresenter extends BasePresenter { private $selectedTournament = false; public function startup() { parent::startup(); if (isset($this->params["tournament"])) { $tournament = $this->context->model->getTournamentByCode($this->getParameter("tournament")); $this->selectedTournament = $tournament->getId(); } else { $tournaments = $this->context->model->getTournaments(); $tournamentIds = array_keys($tournaments); $tournament = $tournaments[$tournamentIds[0]]; $this->selectedTournament = $tournament->getId(); $this->selectTournamentByCode($tournament->getCode()); } } public function selectTournamentByCode($code) { $this->redirectUrl("http://".$code.".mylifeforai.com"); } public function getSelectedTournamentId() { return $this->selectedTournament; } public function getSelectedTournament() { $tournament = $this->context->model->getTournament($this->getSelectedTournamentId()); if($tournament == null) { $tournaments = $this->context->model->getTournaments(); $tournamentIds = array_keys($tournaments); $this->selectedTournament = $tournamentIds[0]; $tournament = $this->context->model->getTournament($this->getSelectedTournamentId()); } return $tournament; } public function beforeRender() { parent::beforeRender(); $this->template->tournament = $this->getSelectedTournament(); $this->template->tournaments = $this->context->model->getTournaments(); $this->template->liveTime = $this->template->tournament->getTestStartTime(); $this->template->isLive = time() >= $this->template->liveTime; $this->template->activeTournaments = $this->context->model->getActiveTournaments(); $this->template->archivedTournaments = $this->context->model->getArchivedTournaments(); } }
gpl-2.0
zyz963272311/testGitHub
rootbase/src/com/liiwin/qrcode/QRCode.java
3945
package com.liiwin.qrcode; import java.awt.Color; import java.awt.Font; import java.awt.Graphics2D; import java.awt.image.BufferedImage; import java.io.File; import java.io.OutputStream; import javax.imageio.ImageIO; import com.swetake.util.Qrcode; /** * <p>标题: QRCode</p> * <p>功能: </p> * <p>所属模块: ICIP/PSP/AQSIQ</p> * <p>版权: Copyright © 2016 SNSOFT</p> * <p>公司: 北京南北天地科技股份有限公司</p> * <p>创建日期:2016年12月27日 下午2:19:30</p> * <p>类全名:qrcode.QRCode</p> * 作者:赵玉柱 * 初审: * 复审: * 监听使用界面: * @version 8.0 */ public class QRCode { public void encoderQRCode(String content, String imagePath) { int imageTypeIndex = imagePath.indexOf('.'); if (imageTypeIndex <= 0) { throw new RuntimeException("文件没有类型"); } this.encoderRQCode(content, imagePath, "png", 7); } public void encoderQRCode(String content, OutputStream output) { this.encoderQRCode(content, output, "png", 7); } public void encoderQRCode(String content, String imagePath, String imageType) { this.encoderRQCode(content, imagePath, imageType, 7); } public void encoderQRCode(String content, OutputStream output, String imageType) { this.encoderQRCode(content, output, imageType, 7); } /** * @param content * @param imagePath * @param imageType * @param size * @author 赵玉柱 */ private void encoderRQCode(String content, String imagePath, String imageType, int size) { try { BufferedImage bufImg = this.qRCodeCommon(content, imageType, size); File imgFile = new File(imagePath); // 生成二维码QRCode图片 ImageIO.write(bufImg, imageType, imgFile); } catch (Exception e) { e.printStackTrace(); } } /** * @param content * @param output * @param imageType * @param size * @author 赵玉柱 */ private void encoderQRCode(String content, OutputStream output, String imageType, int size) { try { BufferedImage bufImg = this.qRCodeCommon(content, imageType, size); ImageIO.write(bufImg, imageType, output); } catch (Exception e) { e.printStackTrace(); } } /** * @param content * @param imageType * @param size * @return * @author 赵玉柱 */ private BufferedImage qRCodeCommon(String content, String imageType, int size) { BufferedImage bufImage = null; try { Qrcode qrcodeHeader = new Qrcode(); //设置二维码排错率,可选L(7%)、M(15%)、Q(25%)、H(30%) qrcodeHeader.setQrcodeErrorCorrect('M'); qrcodeHeader.setQrcodeEncodeMode('B'); //设置二维码尺寸,1-40 qrcodeHeader.setQrcodeVersion(size); //获得内容的字节数组 byte[] contentByte = content.getBytes("utf-8"); //设置图片尺寸 int imageSize = 67 + 12 * (size - 1); bufImage = new BufferedImage(imageSize, imageSize, BufferedImage.TYPE_INT_RGB); Graphics2D gs = bufImage.createGraphics(); gs.setBackground(Color.WHITE); gs.clearRect(0, 0, imageSize, imageSize); gs.setColor(Color.BLACK); int picoff = 2; if (contentByte.length > 0 && contentByte.length < 800) { boolean[][] codeOut = qrcodeHeader.calQrcode(contentByte); for (int i = 0; i < codeOut.length; i++) { for (int j = 0; j < codeOut.length; j++) { if (codeOut[j][i]) { gs.fillRect(j * 3 + picoff, i * 3 + picoff, 3, 3); } } } } else { throw new Exception("length 不在[0-800]之间"); } gs.setFont(new Font("abd", Font.BOLD, 12)); gs.drawString("dsadsadsa", 0, 0); gs.dispose(); bufImage.flush(); } catch (Exception e) { e.printStackTrace(); } return bufImage; } public static void main(String[] args) { String imagePath = "D://textQRCode.png"; String content = "的撒欢的绝杀的机会萨克讲话的时间啊dsadsadsa"; QRCode handler = new QRCode(); handler.encoderQRCode(content, imagePath, "png"); } }
gpl-2.0
radovanx/artwp
wp-content/themes/arttrip/footer.php
868
<?php /** * The template for displaying the footer. * * Contains the closing of the #content div and all content after. * * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials * * @package arttrip */ ?> </main> <div class="mdl-layout__obfuscator"></div> <footer id="colophon" class="site-footer" role="contentinfo"> <div class="site-info"> <a href="<?php echo esc_url( __( 'https://wordpress.org/', 'arttrip' ) ); ?>"><?php printf( esc_html__( 'Proudly powered by %s', 'arttrip' ), 'WordPress' ); ?></a> <span class="sep"> | </span> <?php printf( esc_html__( 'Theme: %1$s by %2$s.', 'arttrip' ), 'arttrip', '<a href="http://underscores.me/" rel="designer">Radomir Bednar</a>' ); ?> </div><!-- .site-info --> </footer><!-- #colophon --> </div><!-- #page --> <?php wp_footer(); ?> </body> </html>
gpl-2.0
vladzur/radiotray
src/mpris_root.py
1739
# Copyright (C) 2010 behrooz shabani (everplays) <behrooz@rock.com> # # 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 3, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Radio Tray. If not, see <http://www.gnu.org/licenses/>. """/ Object for MPRIS specification interface to radioTray http://wiki.xmms2.xmms.se/wiki/MPRIS#.2F_.28Root.29_object_methods """ import dbus import dbus.service import lib.common as common from SysTray import SysTray INTERFACE_NAME = 'org.freedesktop.MediaPlayer' class RadioTrayMprisRoot(dbus.service.Object): """ / (Root) object methods """ def __init__(self, mediator, bus): dbus.service.Object.__init__(self, bus, '/') self.mediator = mediator @dbus.service.method(INTERFACE_NAME, out_signature="s") def Identity(self): """ Identify the "media player" """ return "%s %s" % (common.APPNAME, common.APPVERSION) @dbus.service.method(INTERFACE_NAME) def Quit(self): """ Makes the "Media Player" exit. """ self.mediator.systray.on_quit(1) @dbus.service.method(INTERFACE_NAME, out_signature="(qq)") def MprisVersion(self): """ Makes the "Media Player" exit. """ return (1, 0)
gpl-2.0
CombatWombat42/Makelangelo
java/src/org/kabeja/parser/DXFEntitiesSectionHandler.java
3939
/* Copyright 2005 Simon Mieth Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.kabeja.parser; import java.util.Hashtable; import java.util.Iterator; import org.kabeja.dxf.DXFDocument; import org.kabeja.dxf.DXFEntity; import org.kabeja.parser.entities.DXFEntityHandler; /** * @author <a href="mailto:simon.mieth@gmx.de>Simon Mieth</a> * * */ public class DXFEntitiesSectionHandler extends AbstractSectionHandler implements DXFSectionHandler, HandlerManager { private static String SECTION_KEY = "ENTITIES"; public static final int ENTITY_START = 0; protected Hashtable<String,Handler> handlers = new Hashtable<String,Handler>(); protected DXFEntityHandler handler = null; protected boolean parseEntity = false; public DXFEntitiesSectionHandler() { } /* * (non-Javadoc) * * @see org.dxf2svg.parser.SectionHandler#getSectionKey() */ public String getSectionKey() { return SECTION_KEY; } /* * (non-Javadoc) * * @see org.dxf2svg.parser.SectionHandler#parseGroup(int, java.lang.String) */ public void parseGroup(int groupCode, DXFValue value) { if (groupCode == ENTITY_START) { if (parseEntity) { if (handler.isFollowSequence()) { //there is a sequence like polyline handler.parseGroup(groupCode, value); return; } else { endEntity(); } } if (handlers.containsKey(value.getValue())) { //get handler for the new entity handler = (DXFEntityHandler) handlers.get(value.getValue()); handler.setDXFDocument(this.doc); handler.startDXFEntity(); parseEntity = true; } else { //no handler found parseEntity = false; } } else if (parseEntity) { handler.parseGroup(groupCode, value); } } /* * (non-Javadoc) * * @see org.dxf2svg.parser.SectionHandler#setDXFDocument(org.dxf2svg.xml.DXFDocument) */ public void setDXFDocument(DXFDocument doc) { this.doc = doc; } /* * (non-Javadoc) * * @see org.dxf2svg.parser.SectionHandler#endParsing() */ public void endSection() { endEntity(); } /* * (non-Javadoc) * * @see org.dxf2svg.parser.SectionHandler#startParsing() */ public void startSection() { parseEntity = false; } protected void endEntity() { if (parseEntity) { handler.endDXFEntity(); DXFEntity entity = handler.getDXFEntity(); doc.addDXFEntity(entity); } } public void addDXFEntityHandler(DXFEntityHandler handler) { handler.setDXFDocument(doc); handlers.put(handler.getDXFEntityName(), handler); } public void addHandler(Handler handler) { addDXFEntityHandler((DXFEntityHandler) handler); } /* (non-Javadoc) * @see de.miethxml.kabeja.parser.Handler#releaseDXFDocument() */ public void releaseDXFDocument() { this.doc = null; Iterator<Handler> i = handlers.values().iterator(); while (i.hasNext()) { Handler handler = i.next(); handler.releaseDXFDocument(); } } }
gpl-2.0
shubhamchaudhary/uiet
cpp/lab/10ptrBase.cpp
1331
/** * Name: Shubham Chaudhary * Lab: OOPS * Date: Apr 22, 2013 * Roll: UE113090 * Program: Access pointers of different classes using diff pointers **/ #include <iostream> using namespace std; class Base{ int iv; public: void BaseInput(){ cin>>iv; } void demo(){ iv=0; cout<<"\nBase: demo= "<<iv; } }; class Der1 : public Base{ int i1; public: void Der1Input(){ cin>>i1; } void demo(){ i1=1; cout<<"\nDer1: demo= "<<i1; } }; class Der2 : public Base{ int i2; public: void Der2Input(){ cin>>i2; } void demo(){ i2=2; cout<<"\nDer2: demo= "<<i2; } }; int main(){ Base objb; Der1 obj1; Der2 obj2; cout<<"\n"; objb.demo(); obj1.demo(); obj2.demo(); Base* ptrb; //~ Der1* ptr1; //~ Der2* ptr2; ptrb=&objb; ptrb->demo(); ptrb=&obj1; ptrb->demo(); ptrb=&obj2; ptrb->demo(); return 0; } /****************** Base: demo= 0 Der1: demo= 1 Der2: demo= 2 Base: demo= 0 Base: demo= 0 Base: demo= 0 ------------------ (program exited with code: 0) *******************/
gpl-2.0
ingran/balzac
custom_feeds/teltonika_luci/applications/luci-mobile_traffic/luasrc/model/cbi/mobile_traffic/configure.lua
1022
local utl = require "luci.util" local sys = require "luci.sys" local moduleVidPid = utl.trim(sys.exec("uci get system.module.vid")) .. ":" .. utl.trim(sys.exec("uci get system.module.pid")) local sim_switch = utl.trim(sys.exec("uci get simcard.rules.switchdata")) function fileExists(path, name) local string = "ls ".. path local h = io.popen(string) local t = h:read("*all") h:close() for i in string.gmatch(t, "%S+") do if i == name then return 1 end end end m = Map("mdcollectd", translate("Mobile Traffic Usage Logging"), translate("")) m.addremove = false s = m:section(NamedSection, "config", "mdcollectd"); s.addremove = false o = s:option(Flag, "traffic", translate("Enable"), translate('Check to enable mobile traffic usage logging (can not be disabled if SIM switch is enabled)')) o.rmempty = false o = s:option(Value, "interval", translate("Interval between records (sec)"), translate("The interval between logging records (minimum 60s)")) o.datatype = "min(60)" o.rmempty = false return m
gpl-2.0
themrkevin/mangubaby
wp-content/plugins/easy-timer/options-page.php
4779
<?php if ((isset($_GET['action'])) && (($_GET['action'] == 'reset') || ($_GET['action'] == 'uninstall'))) { if ((isset($_POST['submit'])) && (check_admin_referer($_GET['page']))) { if ($_GET['action'] == 'reset') { reset_easy_timer(); } else { delete_option('easy_timer'); } } ?> <div class="wrap"> <h2>Easy Timer</h2> <?php if (isset($_POST['submit'])) { echo '<div class="updated"><p><strong>'.($_GET['action'] == 'reset' ? __('Options reset.', 'easy-timer') : __('Options deleted.', 'easy-timer')).'</strong></p></div> <script type="text/javascript">setTimeout(\'window.location = "'.($_GET['action'] == 'reset' ? 'options-general.php?page=easy-timer' : 'plugins.php').'"\', 2000);</script>'; } ?> <?php if (!isset($_POST['submit'])) { ?> <form method="post" action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']); ?>"> <?php wp_nonce_field($_GET['page']); ?> <div class="alignleft actions"> <?php if ($_GET['action'] == 'reset') { _e('Do you really want to reset the options of Easy Timer?', 'easy-timer'); } else { _e('Do you really want to permanently delete the options of Easy Timer?', 'easy-timer'); } ?> <input type="submit" class="button-secondary" name="submit" id="submit" value="<?php _e('Yes', 'easy-timer'); ?>" /> </div> </form><?php } ?> </div><?php } else { if ((isset($_POST['submit'])) && (check_admin_referer($_GET['page']))) { include 'initial-options.php'; foreach ($_POST as $key => $value) { if (is_string($value)) { $_POST[$key] = stripslashes(html_entity_decode(str_replace('&nbsp;', ' ', $value))); } } $_POST['cookies_lifetime'] = (int) $_POST['cookies_lifetime']; if ($_POST['cookies_lifetime'] < 1) { $_POST['cookies_lifetime'] = $initial_options['cookies_lifetime']; } if (!isset($_POST['javascript_enabled'])) { $_POST['javascript_enabled'] = 'no'; } foreach ($initial_options as $key => $value) { if ((isset($_POST[$key])) && ($_POST[$key] != '')) { $options[$key] = $_POST[$key]; } else { $options[$key] = $value; } } update_option('easy_timer', $options); } else { $options = (array) get_option('easy_timer'); } foreach ($options as $key => $value) { if (is_string($value)) { $options[$key] = htmlspecialchars($value); } } ?> <div class="wrap"> <h2 style="float: left;">Easy Timer</h2> <ul class="subsubsub" style="margin: 1.25em 0 1.5em 6em; float: left; white-space: normal;"> <li><a href="http://www.kleor-editions.com/easy-timer"><?php _e('Documentation', 'easy-timer'); ?></a></li> </ul> <div class="clear"></div> <?php if (isset($_POST['submit'])) { echo '<div class="updated"><p><strong>'.__('Settings saved.').'</strong></p></div>'; } ?> <h3><?php _e('Options', 'easy-timer'); ?></h3> <form method="post" action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']); ?>"> <?php wp_nonce_field($_GET['page']); ?> <p><label><?php _e('The', 'easy-timer'); ?> <code>[timer]</code> <?php _e('shortcode is equivalent to', 'easy-timer'); ?>: <select name="default_timer_prefix" id="default_timer_prefix"> <?php $prefixes = array('dhms', 'dhm', 'dh', 'd', 'hms', 'hm', 'h', 'ms', 'm', 's'); foreach ($prefixes as $prefix) { echo '<option value="'.$prefix.'"'.($options['default_timer_prefix'] == $prefix ? ' selected="selected"' : '').'>['.$prefix.'timer]</option>'."\n"; } ?> </select></label>. <a href="http://www.kleor-editions.com/easy-timer/#timer-shortcodes"><?php _e('More informations', 'easy-timer'); ?></a><br /> <?php $prefixes = array('total', 'elapsed', 'total-elapsed', 'remaining', 'total-remaining'); foreach ($prefixes as $prefix) { echo __('The', 'easy-timer').' <code>['.$prefix.'-timer]</code> '.__('shortcode is equivalent to', 'easy-timer').' <code>['.$prefix.'-'.$options['default_timer_prefix'].'timer]</code>.<br />'; } ?></p> <p><label><?php _e('Cookies lifetime (used for relative dates)', 'easy-timer'); ?>: <input type="text" name="cookies_lifetime" id="cookies_lifetime" value="<?php echo $options['cookies_lifetime']; ?>" size="4" /></label> <?php _e('days', 'easy-timer'); ?> <a href="http://www.kleor-editions.com/easy-timer/#relative-dates"><?php _e('More informations', 'easy-timer'); ?></a></p> <p><label><input type="checkbox" name="javascript_enabled" id="javascript_enabled" value="yes"<?php if ($options['javascript_enabled'] == 'yes') { echo ' checked="checked"'; } ?> /> <?php _e('Add JavaScript code', 'easy-timer'); ?><br /></label> <span class="description"><?php _e('If you uncheck this box, Easy Timer will never add any JavaScript code to the pages of your website, but your count up/down timers will not refresh.', 'easy-timer'); ?></span></p> <p class="submit" style="margin: 0 20%;"><input type="submit" class="button-primary" name="submit" id="submit" value="<?php _e('Save Changes'); ?>" /></p> </form> </div> <?php }
gpl-2.0
DoktorMike/neuralnethack
neuralnethack/mlp/QuasiNewton.hh
5541
/*$Id: QuasiNewton.hh 1626 2007-05-08 12:08:19Z michael $*/ /* Copyright (C) 2004 Michael Green neuralnethack 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 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Michael Green <michael@thep.lu.se> */ #ifndef __QuasiNewton_hh__ #define __QuasiNewton_hh__ #include "Trainer.hh" #include <ostream> namespace MultiLayerPerceptron { /**A class representing the implementation of the Trainer interface. * This learning algorithm is called Quasi Newton and * uses second order gradients of the error function. * The weight update rule: * \f[\omega_{t+1}=\omega_t + \alpha_t G_t g_t\f] * Where \f$ G \f$ is an approximation of the inverse Hessian * and \f$ g \f$ is the gradient. */ class QuasiNewton: public Trainer { public: /**Basic constructor. * \param mlp the Mlp to train. * \param data the DataSet to use. * \param error the Error function to use. * \param te the training error at which to stop training. * \param bs the batch size. */ QuasiNewton(Mlp& mlp, DataTools::DataSet& data, Error& error, double te, uint bs); /**Basic destructor. */ ~QuasiNewton(); /**Method used to train an MLP. This uses the Mlp and the DataSet * in the Trainer. */ void train(std::ostream& os); Trainer* clone() const; private: /**Copy constructor. * \param qn the object to copy from. */ QuasiNewton(const QuasiNewton& qn); /**Assignment operator. * \param qn the object to assign from. */ QuasiNewton& operator=(const QuasiNewton& qn); /**Reset all the vectors in the QuasiNewton algorithm. */ void resetVectors(); /**Updates the estimation of the inverse hessian using the DFP * rule. * \f[G_{t+1}=G_t+\frac{\Delta\omega\Delta\omega^T}{\Delta\omega^T\Delta * g} - \frac{G_t\Delta g\Delta g^TG_t}{\Delta g^TG_t\Delta g}\f] */ void updateDfp(); /**Updated the estimation of the inverse hessian using the BFGS * rule. This rule is essentially DFP but adds another term in the * end which gives better performance and is not much more * expensive. */ void updateBfgs(); /**Finds out the step length we want to use with our quasi newton * direction. This calls mnbrak and brent. * \param alpha the step length we want to use. * \return the error function evaluated at alpha. */ float findAlpha(float& alpha); /**Brackets the minima. When algorithm finishes the wanted value * lies between ax and cx i.e. around bx. * \param ax the leftmost value for the x values. * \param bx the middle value for the x values. * \param cx the rightmost value for the x values. * \param fa the value of the function at ax. * \param fb the value of the function at bx. * \param fc the value of the function at cx. */ void mnbrak(float *ax, float *bx, float *cx, float *fa, float *fb, float *fc); /**An implementation of brents line search. When algorithms * finishes the xmin will hold our desired step length. * \param ax the leftmost value for the x values. * \param bx the middle value for the x values. * \param cx the rightmost value for the x values. * \param tol the tolerance. * \param xmin the x value corresponding to the minimum value of * the error function. * \return the error function evaluated at xmin. */ float brent(float ax, float bx, float cx, float tol, float *xmin); /**Calculate the error associated with a certain alfa. * This updated the weights in the Mlp and then calculates the * batch error for the DataSet using the Error function. * \param alfa the quasi newton step length. * \return the error. */ float err(float alfa); /**Checks if the algorithm has converged by inspecting the * gradient. * \deprecated The Trainer interface implements a hasConverged * which has a better measure. * \return true if converged, false otherwise. */ bool converged(); /**The estimation of the inverse Hessian matrix. */ std::vector< std::vector<double> > G; /**The weight vector at t+1. */ std::vector<double> w; /**The weight vector at t. */ std::vector<double> wPrev; /**The gradient vector at t+1. */ std::vector<double> g; /**The gradient vector at t. */ std::vector<double> gPrev; /**The change in the weight vector. */ std::vector<double> dw; /**The change in the gradient vector. */ std::vector<double> dg; /**I will figure out something good to say here. :-)*/ std::vector<double> u; /**Temporary matrix variable. */ std::vector< std::vector<double> > matrixTemp1; /**Temporary matrix variable. */ std::vector< std::vector<double> > matrixTemp2; /**Temporary vector variable. */ std::vector<double> vectorTemp1; /**Temporary vector variable. */ std::vector<double> vectorTemp2; }; } #endif
gpl-2.0
TheTypoMaster/Scaper
openjdk/jdk/test/java/util/Collections/Ser.java
3865
/* * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * CA 95054 USA or visit www.sun.com if you need additional information or * have any questions. */ /** * @test * @bug 4190323 * @summary EMPTY_SET, EMPTY_LIST, and the collections returned by * nCopies and singleton were spec'd to be serializable, but weren't. */ import java.io.*; import java.util.*; public class Ser { public static void main(String[] args) throws Exception { try { ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream(bos); out.writeObject(Collections.EMPTY_SET); out.flush(); ObjectInputStream in = new ObjectInputStream( new ByteArrayInputStream(bos.toByteArray())); if (!Collections.EMPTY_SET.equals(in.readObject())) throw new RuntimeException("empty set Ser/Deser failure."); } catch (Exception e) { throw new RuntimeException("Failed to serialize empty set:" + e); } try { ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream(bos); out.writeObject(Collections.EMPTY_LIST); out.flush(); ObjectInputStream in = new ObjectInputStream( new ByteArrayInputStream(bos.toByteArray())); if (!Collections.EMPTY_LIST.equals(in.readObject())) throw new RuntimeException("empty list Ser/Deser failure."); } catch (Exception e) { throw new RuntimeException("Failed to serialize empty list:" + e); } try { ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream(bos); Set gumby = Collections.singleton("gumby"); out.writeObject(gumby); out.flush(); ObjectInputStream in = new ObjectInputStream( new ByteArrayInputStream(bos.toByteArray())); if (!gumby.equals(in.readObject())) throw new RuntimeException("Singleton Ser/Deser failure."); } catch (Exception e) { throw new RuntimeException("Failed to serialize singleton:" + e); } try { ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream(bos); List gumbies = Collections.nCopies(50, "gumby"); out.writeObject(gumbies); out.flush(); ObjectInputStream in = new ObjectInputStream( new ByteArrayInputStream(bos.toByteArray())); if (!gumbies.equals(in.readObject())) throw new RuntimeException("nCopies Ser/Deser failure."); } catch (Exception e) { throw new RuntimeException("Failed to serialize nCopies:" + e); } } }
gpl-2.0
DIPnet/popgenDB
sims_for_structure_paper/2PopDNAnorec_0.5_1000/2PopDNAnorec_1_963.res/2PopDNAnorec_1_963.js
922
USETEXTLINKS = 1 STARTALLOPEN = 0 WRAPTEXT = 1 PRESERVESTATE = 0 HIGHLIGHT = 1 ICONPATH = 'file:////Users/eric/github/popgenDB/sims_for_structure_paper/2PopDNAnorec_0.5_1000/' //change if the gif's folder is a subfolder, for example: 'images/' foldersTree = gFld("<i>ARLEQUIN RESULTS (2PopDNAnorec_1_963.arp)</i>", "") insDoc(foldersTree, gLnk("R", "Arlequin log file", "Arlequin_log.txt")) aux1 = insFld(foldersTree, gFld("Run of 31/07/18 at 17:02:51", "2PopDNAnorec_1_963.xml#31_07_18at17_02_51")) insDoc(aux1, gLnk("R", "Settings", "2PopDNAnorec_1_963.xml#31_07_18at17_02_51_run_information")) aux2 = insFld(aux1, gFld("Genetic structure (samp=pop)", "2PopDNAnorec_1_963.xml#31_07_18at17_02_51_pop_gen_struct")) insDoc(aux2, gLnk("R", "AMOVA", "2PopDNAnorec_1_963.xml#31_07_18at17_02_51_pop_amova")) insDoc(aux2, gLnk("R", "Pairwise distances", "2PopDNAnorec_1_963.xml#31_07_18at17_02_51_pop_pairw_diff"))
gpl-2.0
HeBIS-VZ/vufind-module-hebis
src/Hebis/Form/PostForm.php
462
<?php namespace Hebis\Form; use Zend\Form\Form; /** * Class PostForm * @package Hebis\Form */ class PostForm extends Form { public function init() { $this->add([ 'name' => 'post', 'type' => PostFieldset::class, ]); $this->add([ 'type' => 'submit', 'name' => 'submit', 'attributes' => [ 'value' => 'Add new Post', ], ]); } }
gpl-2.0
cuongnd/test_pro
media/kendo-ui-core-master/src/cultures/kendo.culture.en-IE.js
2087
(function( window, undefined ) { kendo.cultures["en-IE"] = { name: "en-IE", numberFormat: { pattern: ["-n"], decimals: 2, ",": ",", ".": ".", groupSize: [3], percent: { pattern: ["-n%","n%"], decimals: 2, ",": ",", ".": ".", groupSize: [3], symbol: "%" }, currency: { pattern: ["-$n","$n"], decimals: 2, ",": ",", ".": ".", groupSize: [3], symbol: "€" } }, calendars: { standard: { days: { names: ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"], namesAbbr: ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"], namesShort: ["Su","Mo","Tu","We","Th","Fr","Sa"] }, months: { names: ["January","February","March","April","May","June","July","August","September","October","November","December"], namesAbbr: ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"] }, AM: ["am","am","AM"], PM: ["pm","pm","PM"], patterns: { d: "dd/MM/yyyy", D: "dd MMMM yyyy", F: "dd MMMM yyyy HH:mm:ss", g: "dd/MM/yyyy HH:mm", G: "dd/MM/yyyy HH:mm:ss", m: "d MMMM", M: "d MMMM", s: "yyyy'-'MM'-'dd'T'HH':'mm':'ss", t: "HH:mm", T: "HH:mm:ss", u: "yyyy'-'MM'-'dd HH':'mm':'ss'Z'", y: "MMMM yyyy", Y: "MMMM yyyy" }, "/": "/", ":": ":", firstDay: 1 } } } })(this);
gpl-2.0
st3w/CIS4914
src/com/CIS4914/Blocked/Entities/Entity.java
4378
package com.CIS4914.Blocked.Entities; import com.CIS4914.Blocked.Blocked; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.math.Intersector; import com.badlogic.gdx.math.Rectangle; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.scenes.scene2d.Actor; // StaticEntity is just an Actor with a TextureRegions public class Entity extends Actor { TextureRegion tex; public Vector2 vel; public Vector2 accel; Rectangle hitBox; boolean isMovable; public Entity(Rectangle hitBox, Rectangle texBounds, TextureRegion tex, boolean isMovable) { this.tex = tex; setWidth(texBounds.width); setHeight(texBounds.height); super.setX(texBounds.x + hitBox.width - hitBox.x); super.setY(texBounds.y + hitBox.y); // Fix the hitbox coordinates this.hitBox = hitBox; this.hitBox.setX(texBounds.x); this.hitBox.setY(texBounds.y); this.isMovable = isMovable; vel = new Vector2(); accel = new Vector2(); } public Entity(Rectangle texBounds, TextureRegion tex, boolean isMovable) { this.tex = tex; this.hitBox = texBounds; setWidth(texBounds.width); setHeight(texBounds.height); setBounds(texBounds.x, texBounds.y, texBounds.width, texBounds.height); this.isMovable = isMovable; vel = new Vector2(); accel = new Vector2(); } public Entity(Rectangle texBounds, TextureRegion tex) { this.tex = tex; this.hitBox = texBounds; setWidth(texBounds.width); setHeight(texBounds.height); //setBounds(texBounds.x, texBounds.y, texBounds.width, texBounds.height); isMovable = false; vel = new Vector2(); accel = new Vector2(); } public Entity(TextureRegion tex) { this.tex = tex; this.hitBox = new Rectangle(0, 0, 64, 64); setWidth(64); setHeight(64); setBounds(0, 0, 64, 64); isMovable = false; vel = new Vector2(); accel = new Vector2(); } public Entity() { tex = new TextureRegion(Blocked.manager.get("generic.png", Texture.class)); setWidth(64); setHeight(64); setBounds(0, 0, 64, 64); isMovable = false; vel = new Vector2(); accel = new Vector2(); } public boolean collides(Entity ent2, Rectangle collisionRectangle) { if (ent2.getX() < getX() + getWidth()) { return (Intersector.intersectRectangles(getHitBox(), ent2.getHitBox(), collisionRectangle)); } return false; } public void resolveX(Entity other, Rectangle collisionRectangle, float playerVelX) { if (!other.isMovable()) { if (getX() + getWidth() < other.getX() + other.getWidth()) { setX(getX() - collisionRectangle.width); vel.x = 0; accel.x = 0; } else { setX(other.getX() + other.getWidth()); vel.x = 0; accel.x = 0; } } else { if (getX() + getWidth() < other.getX() + other.getWidth()) { other.setX(other.getX() + collisionRectangle.width); } else { other.setX(other.getX() - collisionRectangle.width); } } } public void resolveY(Entity other, Rectangle collisionRectangle) { if (Math.abs(getY() - other.getY()) > 5f) { if (getY() >= other.getY()) { setY(getY() + collisionRectangle.height); vel.y = 0; accel.y = 0; } else { setY(other.getY() - getHeight()); vel.y = 0; accel.y = 0; } } } public boolean isMovable() { return this.isMovable; } public void setIsMovable(boolean value) { isMovable = value; } public Rectangle getHitBox() { return hitBox; } @Override public void setX(float x) { float tempX = getX(); hitBox.setX(x); super.setX(x - (tempX - super.getX())); } @Override public void setY(float y) { float tempY = getY(); hitBox.setY(y); super.setY(y - (tempY - super.getY())); } @Override public float getX() { return hitBox.getX(); } @Override public float getY() { return hitBox.getY(); } @Override public float getWidth() { return hitBox.width; } @Override public float getHeight() { return hitBox.height; } public float getTextureWidth() { return super.getWidth(); } public float getTextureHeight() { return super.getHeight(); } public float getTextureX() { return super.getX(); } public float getTextureY() { return super.getY(); } }
gpl-2.0
kushvarma/maison
wp-content/themes/simplearticle-v1-01/include/widget/popular-post-widget.php
5319
<?php /** * Plugin Name: Goodlayers Popular Post * Plugin URI: http://goodlayers.com/ * Description: A widget that show popular posts( Specified by comment ). * Version: 1.0 * Author: Goodlayers * Author URI: http://www.goodlayers.com * */ add_action( 'widgets_init', 'gdlr_popular_post_widget' ); if( !function_exists('gdlr_popular_post_widget') ){ function gdlr_popular_post_widget() { register_widget( 'Goodlayers_Popular_Post' ); } } if( !class_exists('Goodlayers_Popular_Post') ){ class Goodlayers_Popular_Post extends WP_Widget{ // Initialize the widget function __construct() { parent::WP_Widget( 'gdlr-popular-post-widget', __('Goodlayers Popular Post Widget','gdlr_translate'), array('description' => __('A widget that show popular posts ( by comment )', 'gdlr_translate'))); } // Output of the widget function widget( $args, $instance ) { global $theme_option; $title = apply_filters( 'widget_title', $instance['title'] ); $category = $instance['category']; $num_fetch = $instance['num_fetch']; // Opening of widget echo $args['before_widget']; // Open of title tag if( !empty($title) ){ echo $args['before_title'] . $title . $args['after_title']; } // Widget Content $current_post = array(get_the_ID()); $query_args = array('post_type' => 'post', 'suppress_filters' => false); $query_args['posts_per_page'] = $num_fetch; $query_args['orderby'] = 'meta_value_num'; $query_args['order'] = 'desc'; $query_args['paged'] = 1; $query_args['category_name'] = $category; $query_args['meta_key'] = '_zilla_likes'; $query_args['ignore_sticky_posts'] = 1; $query_args['post__not_in'] = array(get_the_ID()); $query = new WP_Query( $query_args ); if($query->have_posts()){ echo '<div class="gdlr-recent-post-widget">'; $count = $query->post_count; $last = ''; while($query->have_posts()){ $query->the_post(); $count--; if( $count == 0 ){ $last = 'gdlr-last'; } echo '<div class="recent-post-widget gdlr-style-1 ' . $last . '">'; $thumbnail = gdlr_get_image(get_post_thumbnail_id(), 'thumbnail'); if( !empty($thumbnail) ){ echo '<div class="recent-post-widget-thumbnail"><a href="' . get_permalink() . '" >' . $thumbnail . '</a></div>'; } echo '<div class="recent-post-widget-content">'; echo '<h4 class="recent-post-widget-title"><a href="' . get_permalink() . '" >' . get_the_title() . '</a></h4>'; echo '<div class="recent-post-widget-info">'; echo '<div class="blog-info blog-comment">'; echo '<i class="icon-heart"></i>'; echo get_post_meta( get_the_ID(), '_zilla_likes', true); echo '</div>'; // blog-info echo '</div>'; // recent-post-widget-info echo '</div>'; // recent-post-widget-content echo '<div class="clear"></div>'; echo '</div>'; // recent-post-widget } echo '<div class="clear"></div>'; echo '</div>'; } wp_reset_postdata(); // Closing of widget echo $args['after_widget']; } // Widget Form function form( $instance ) { $title = isset($instance['title'])? $instance['title']: ''; $category = isset($instance['category'])? $instance['category']: ''; $num_fetch = isset($instance['num_fetch'])? $instance['num_fetch']: 3; ?> <!-- Text Input --> <p> <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title :', 'gdlr_translate'); ?></label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /> </p> <!-- Post Category --> <p> <label for="<?php echo $this->get_field_id('category'); ?>"><?php _e('Category :', 'gdlr_translate'); ?></label> <select class="widefat" name="<?php echo $this->get_field_name('category'); ?>" id="<?php echo $this->get_field_id('category'); ?>"> <option value="" <?php if(empty($category)) echo ' selected '; ?>><?php _e('All', 'gdlr_translate') ?></option> <?php $category_list = gdlr_get_term_list('category'); foreach($category_list as $cat_slug => $cat_name){ ?> <option value="<?php echo $cat_slug; ?>" <?php if ($category == $cat_slug) echo ' selected '; ?>><?php echo $cat_name; ?></option> <?php } ?> </select> </p> <!-- Show Num --> <p> <label for="<?php echo $this->get_field_id('num_fetch'); ?>"><?php _e('Num Fetch :', 'gdlr_translate'); ?></label> <input class="widefat" id="<?php echo $this->get_field_id('num_fetch'); ?>" name="<?php echo $this->get_field_name('num_fetch'); ?>" type="text" value="<?php echo $num_fetch; ?>" /> </p> <?php } // Update the widget function update( $new_instance, $old_instance ) { $instance = array(); $instance['title'] = (empty($new_instance['title']))? '': strip_tags($new_instance['title']); $instance['category'] = (empty($new_instance['category']))? '': strip_tags($new_instance['category']); $instance['num_fetch'] = (empty($new_instance['num_fetch']))? '': strip_tags($new_instance['num_fetch']); return $instance; } } } ?>
gpl-2.0
RedHatQE/cfme_tests
cfme/tests/generic_objects/test_instances.py
10568
# -*- coding: utf-8 -*- import fauxfactory import pytest import cfme.rest.gen_data as rest_gen_data from cfme import test_requirements from cfme.base.login import BaseLoggedInPage from cfme.services.myservice import MyService from cfme.utils.appliance import ViaREST from cfme.utils.appliance import ViaUI from cfme.utils.appliance.implementations.ui import navigate_to from cfme.utils.rest import assert_response from cfme.utils.update import update pytestmark = [ test_requirements.generic_objects, ] @pytest.fixture(scope="module") def definition(appliance): with appliance.context.use(ViaREST): definition = appliance.collections.generic_object_definitions.create( name='rest_generic_class{}'.format(fauxfactory.gen_alphanumeric()), description='Generic Object Definition', attributes={'addr01': 'string'}, associations={'services': 'Service'}, methods=['add_vm', 'remove_vm'] ) yield definition if definition.exists: definition.delete() @pytest.fixture(scope="module") def service(appliance): service_name = 'rest_service_{}'.format(fauxfactory.gen_alphanumeric()) rest_service = appliance.rest_api.collections.services.action.create( name=service_name, display=True ) rest_service = rest_service[0] yield rest_service rest_service.action.delete() @pytest.fixture(scope="module") def generic_object(definition, service, appliance): myservice = MyService(appliance, name=service.name) with appliance.context.use(ViaREST): instance = appliance.collections.generic_objects.create( name='rest_generic_instance{}'.format(fauxfactory.gen_alphanumeric()), definition=definition, attributes={'addr01': 'Test Address'}, associations={'services': [myservice]} ) instance.my_service = myservice yield instance if instance.exists: instance.delete() @pytest.fixture(scope="module") def add_generic_object_to_service(appliance, service, generic_object): with appliance.context.use(ViaREST): service.action.add_resource( resource=appliance.rest_api.collections.generic_objects.find_by( name=generic_object.name)[0]._ref_repr() ) assert_response(appliance) return generic_object @pytest.fixture(scope="module") def categories(request, appliance): return rest_gen_data.categories(request, appliance, 3) @pytest.fixture(scope="module") def tags(request, appliance, categories): return rest_gen_data.tags(request, appliance, categories) @pytest.fixture(scope="module") def generic_object_button_group(appliance, definition): def _generic_object_button_group(create_action=True): if create_action: with appliance.context.use(ViaUI): group_name = "button_group_{}".format(fauxfactory.gen_alphanumeric()) group_desc = "Group_button_description_{}".format(fauxfactory.gen_alphanumeric()) groups_buttons = definition.collections.generic_object_groups_buttons generic_object_button_group = groups_buttons.create( name=group_name, description=group_desc, image="fa-user" ) view = appliance.browser.create_view(BaseLoggedInPage) view.flash.assert_no_error() return generic_object_button_group return _generic_object_button_group @pytest.fixture(scope="module") def generic_object_button(appliance, generic_object_button_group, definition): def _generic_object_button(button_group): with appliance.context.use(ViaUI): button_parent = ( generic_object_button_group(button_group) if button_group else definition ) button_name = 'button_{}'.format(fauxfactory.gen_alphanumeric()) button_desc = 'Button_description_{}'.format(fauxfactory.gen_alphanumeric()) generic_object_button = button_parent.collections.generic_object_buttons.create( name=button_name, description=button_desc, image='fa-home', request=fauxfactory.gen_alphanumeric() ) view = appliance.browser.create_view(BaseLoggedInPage) view.flash.assert_no_error() return generic_object_button return _generic_object_button @pytest.mark.sauce @pytest.mark.parametrize('context', [ViaREST, ViaUI]) def test_generic_objects_crud(appliance, context, request): """ Polarion: assignee: jdupuy initialEstimate: 1/4h tags: 5.9 casecomponent: GenericObjects """ with appliance.context.use(context): definition = appliance.collections.generic_object_definitions.create( name='rest_generic_class{}'.format(fauxfactory.gen_alphanumeric()), description='Generic Object Definition', attributes={'addr01': 'string'}, associations={'services': 'Service'} ) assert definition.exists request.addfinalizer(definition.delete) with appliance.context.use(ViaREST): myservices = [] for _ in range(2): service_name = 'rest_service_{}'.format(fauxfactory.gen_alphanumeric()) rest_service = appliance.rest_api.collections.services.action.create( name=service_name, display=True ) rest_service = rest_service[0] request.addfinalizer(rest_service.action.delete) myservices.append(MyService(appliance, name=service_name)) instance = appliance.collections.generic_objects.create( name='rest_generic_instance{}'.format(fauxfactory.gen_alphanumeric()), definition=definition, attributes={'addr01': 'Test Address'}, associations={'services': [myservices[0]]} ) request.addfinalizer(instance.delete) with appliance.context.use(context): if context.name == 'UI': # we need to refresh definition page to update instance count, # as navigation to instance details happens via this page appliance.browser.widgetastic.refresh() assert instance.exists with appliance.context.use(ViaREST): with update(instance): instance.attributes = {'addr01': 'Changed'} instance.associations = {'services': myservices} rest_instance = appliance.rest_api.collections.generic_objects.get(name=instance.name) rest_data = appliance.rest_api.get('{}?associations=services'.format(rest_instance.href)) assert len(rest_data['services']) == 2 assert rest_data['property_attributes']['addr01'] == 'Changed' instance.delete() with appliance.context.use(context): assert not instance.exists @pytest.mark.parametrize('button_group', [True, False], ids=['button_group_with_button', 'single_button']) def test_generic_objects_with_buttons_ui(appliance, request, add_generic_object_to_service, button_group, generic_object_button): """ Tests buttons ui visibility assigned to generic object Metadata: test_flag: ui Polarion: assignee: jdupuy initialEstimate: 1/4h casecomponent: GenericObjects """ instance = add_generic_object_to_service generic_button = generic_object_button(button_group) generic_button_group = generic_button.parent.parent with appliance.context.use(ViaUI): view = navigate_to(instance, 'MyServiceDetails') if button_group: assert view.toolbar.group(generic_button_group.name).custom_button.has_item( generic_button.name) else: assert view.toolbar.button(generic_button.name).custom_button.is_displayed @pytest.mark.parametrize('tag_place', [True, False], ids=['details', 'collection']) def test_generic_objects_tag_ui(appliance, generic_object, tag_place): """Tests assigning and unassigning tags using UI. Metadata: test_flag: ui Polarion: assignee: anikifor initialEstimate: 1/4h casecomponent: GenericObjects """ with appliance.context.use(ViaUI): assigned_tag = generic_object.add_tag(details=tag_place) # TODO uncomment when tags aria added to details # tag_available = instance.get_tags() # assert any(tag.category.display_name == assigned_tag.category.display_name and # tag.display_name == assigned_tag.display_name # for tag in tag_available), 'Assigned tag was not found on the details page' generic_object.remove_tag(assigned_tag, details=tag_place) # TODO uncomment when tags aria added to details # assert not(tag.category.display_name == assigned_tag.category.display_name and # tag.display_name == assigned_tag.display_name # for tag in tag_available), 'Assigned tag was not removed from the details page' def test_generic_objects_tag_rest(appliance, generic_object, tags): """Tests assigning and unassigning tags using REST. Metadata: test_flag: rest Polarion: initialEstimate: 1/4h assignee: pvala casecomponent: Rest caseimportance: high """ tag = tags[0] with appliance.context.use(ViaREST): generic_object.add_tag(tag) tag_available = generic_object.get_tags() assert tag.id in [t.id for t in tag_available], 'Assigned tag was not found' generic_object.remove_tag(tag) tag_available = generic_object.get_tags() assert tag.id not in [t.id for t in tag_available] @pytest.mark.manual @pytest.mark.ignore_stream("5.10") def test_import_export_generic_object(): """ Bugzilla: 1595259 Polarion: assignee: jdupuy initialEstimate: 1/6h caseimportance: high caseposneg: positive testtype: functional startsin: 5.11 casecomponent: GenericObjects testSteps: 1. Import a generic object yaml 2. Create a generic object 3. Export a generic object expectedResults: 1. The generic object should be present in CFME 2. 3. The generic object should be exported to a yaml file """ pass
gpl-2.0
GreenJoey/My-Simple-Programs
java/CP/HackerRank/bigint-example.java
393
import java.math.BigInteger; import java.util.Scanner; class Solution { public static void main(String[] args) { Scanner scan = new Scanner(System.in); BigInteger num1 = BigInteger.valueOf(scan.nextLong()); BigInteger num2 = BigInteger.valueOf(scan.nextLong()); System.out.println(num1.add(num2)); System.out.println(num1.multiply(num2)); } }
gpl-2.0
mariadb-corporation/mariadb-columnstore-engine
utils/funcexp/func_maketime.cpp
4575
/* Copyright (C) 2014 InfiniDB, Inc. 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; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /**************************************************************************** * $Id: func_maketime.cpp 2665 2011-06-01 20:42:52Z rdempsey $ * * ****************************************************************************/ #include <cstdlib> #include <string> #include <iomanip> using namespace std; #include "functor_str.h" #include "funchelpers.h" #include "functioncolumn.h" #include "rowgroup.h" using namespace execplan; #include "dataconvert.h" using namespace dataconvert; namespace funcexp { CalpontSystemCatalog::ColType Func_maketime::operationType(FunctionParm& fp, CalpontSystemCatalog::ColType& resultType) { return resultType; } string Func_maketime::getStrVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull, CalpontSystemCatalog::ColType&) { int64_t hour = 0; int64_t min = 0; int64_t sec = 0; // get hour switch (parm[0]->data()->resultType().colDataType) { case CalpontSystemCatalog::BIGINT: case CalpontSystemCatalog::MEDINT: case CalpontSystemCatalog::SMALLINT: case CalpontSystemCatalog::TINYINT: case CalpontSystemCatalog::INT: case CalpontSystemCatalog::DOUBLE: case CalpontSystemCatalog::FLOAT: case CalpontSystemCatalog::CHAR: case CalpontSystemCatalog::TEXT: case CalpontSystemCatalog::VARCHAR: { double value = parm[0]->data()->getDoubleVal(row, isNull); hour = (int64_t)value; break; } case CalpontSystemCatalog::DECIMAL: case CalpontSystemCatalog::UDECIMAL: { hour = parm[0]->data()->getDecimalVal(row, isNull).toSInt64Round(); break; } default: isNull = true; return ""; } // get minute switch (parm[1]->data()->resultType().colDataType) { case CalpontSystemCatalog::BIGINT: case CalpontSystemCatalog::MEDINT: case CalpontSystemCatalog::SMALLINT: case CalpontSystemCatalog::TINYINT: case CalpontSystemCatalog::INT: case CalpontSystemCatalog::DOUBLE: case CalpontSystemCatalog::FLOAT: case CalpontSystemCatalog::CHAR: case CalpontSystemCatalog::TEXT: case CalpontSystemCatalog::VARCHAR: { double value = parm[1]->data()->getDoubleVal(row, isNull); min = (int64_t)value; break; } case CalpontSystemCatalog::DECIMAL: case CalpontSystemCatalog::UDECIMAL: { min = parm[1]->data()->getDecimalVal(row, isNull).toSInt64Round(); break; } default: isNull = true; return ""; } if (min < 0 || min > 59) { isNull = true; return ""; } // get second switch (parm[2]->data()->resultType().colDataType) { case CalpontSystemCatalog::BIGINT: case CalpontSystemCatalog::MEDINT: case CalpontSystemCatalog::SMALLINT: case CalpontSystemCatalog::TINYINT: case CalpontSystemCatalog::INT: case CalpontSystemCatalog::DOUBLE: case CalpontSystemCatalog::FLOAT: case CalpontSystemCatalog::CHAR: case CalpontSystemCatalog::TEXT: case CalpontSystemCatalog::VARCHAR: { double value = parm[2]->data()->getDoubleVal(row, isNull); sec = (int64_t)value; break; } case CalpontSystemCatalog::DECIMAL: case CalpontSystemCatalog::UDECIMAL: { sec = parm[2]->data()->getDecimalVal(row, isNull).toSInt64Round(); break; } default: isNull = true; return ""; } if (sec < 0 || sec > 59) { isNull = true; return ""; } if (hour > 838) { hour = 838; min = 59; sec = 59; } if (hour < -838) { hour = -838; min = 59; sec = 59; } // in worst case hour is 4 characters (3 digits + '-') so max // string length is 11 (4:2:2 + '\0') char buf[11]; snprintf(buf, 11, "%02d:%02d:%02d", (int)hour, (int)min, (int)sec); return buf; } } // namespace funcexp // vim:ts=4 sw=4:
gpl-2.0
blueliquiddesigns/gravity-forms-pdf-extended
src/assets/js/react/components/Template/TemplateScreenshots.js
795
import PropTypes from 'prop-types' import React from 'react' /** * Display the Template Screenshot for the individual templates (uses different markup - out of our control) * * @package Gravity PDF * @copyright Copyright (c) 2020, Blue Liquid Designs * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License * @since 4.1 */ /** * React Stateless Component * * @since 4.1 */ const TemplateScreenshots = ({ image }) => { const className = (image) ? 'screenshot' : 'screenshot blank' return ( <div className='theme-screenshots'> <div className={className}> {image ? <img src={image} alt='' /> : null} </div> </div> ) } TemplateScreenshots.propTypes = { image: PropTypes.string } export default TemplateScreenshots
gpl-2.0
drupalro/drupal-assoc-8
web/modules/custom/da_view_reference_field/src/Plugin/Field/FieldType/ViewReference.php
1207
<?php namespace Drupal\da_view_reference_field\Plugin\Field\FieldType; use Drupal\Core\Field\FieldItemBase; use Drupal\Core\Field\FieldStorageDefinitionInterface; use Drupal\Core\TypedData\DataDefinition; /** * View reference plugin definition. * * @FieldType( * id = "field_view_reference", * label = @Translation("View Reference"), * module = "da_view_reference_field", * description = @Translation("Render a given view"), * default_widget = "field_view_reference_widget", * default_formatter = "field_view_reference_display" * ) */ class ViewReference extends FieldItemBase { /** * @inheritdoc */ public static function schema(FieldStorageDefinitionInterface $field_definition) { return array( 'columns' => array( 'view_id' => array( 'type' => 'text', 'size' => 'tiny', 'not null' => FALSE, ), ), ); } /** * @inheritdoc */ public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) { $properties['view_id'] = DataDefinition::create('string') ->setLabel(t('View ID')) ->addConstraint('valid_view_display'); return $properties; } }
gpl-2.0
rjbaniel/upoor
wp-content/themes/redoable/functions.php
22462
<?php /* Current version of Redoable */ $current = '1.2'; if (!defined('SHOW_AUTHORS')) define('SHOW_AUTHORS', 'true'); if (!defined('TEMPLATE_DOMAIN')) define('TEMPLATE_DOMAIN','redo_domain'); //////////////////////////////////////////////////////////////////////////////// // load text domain //////////////////////////////////////////////////////////////////////////////// function init_localization( $locale ) { return "en_EN"; } // Uncomment add_filter below to test your localization, make sure to enter the right language code. // add_filter('locale','init_localization'); load_theme_textdomain( TEMPLATE_DOMAIN, TEMPLATEPATH . '/languages/' ); //////////////////////////////////////////////////////////////////////////////// // new thumbnail code for wp 2.9+ //////////////////////////////////////////////////////////////////////////////// if ( function_exists( 'add_theme_support' ) ) { // Added in 2.9 add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 120, 120, true ); // Normal post thumbnails add_image_size( 'single-post-thumbnail', 400, 9999 ); // Permalink thumbnail size } /////////////////////////////////////////////////////////////////////////// // Update Notifications Notice /////////////////////////////////////////////////////////////////////////// if ( !function_exists( 'wdp_un_check' ) ) { add_action( 'admin_notices', 'wdp_un_check', 5 ); add_action( 'network_admin_notices', 'wdp_un_check', 5 ); function wdp_un_check() { if ( !class_exists( 'WPMUDEV_Update_Notifications' ) && current_user_can( 'edit_users' ) ) echo '<div class="error fade"><p>' . __('Please install the latest version of <a href="http://premium.wpmudev.org/project/update-notifications/" title="Download Now &raquo;">our free Update Notifications plugin</a> which helps you stay up-to-date with the most stable, secure versions of WPMU DEV themes and plugins. <a href="http://premium.wpmudev.org/wpmu-dev/update-notifications-plugin-information/">More information &raquo;</a>', 'wpmudev') . '</a></p></div>'; } } //////////////////////////////////////////////////////////////////////////// // browser detect //////////////////////////////////////////////////////////////////////////// add_filter('body_class','browser_body_class'); function browser_body_class($classes) { global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone; if($is_lynx) $classes[] = 'lynx'; elseif($is_gecko) $classes[] = 'gecko'; elseif($is_opera) $classes[] = 'opera'; elseif($is_NS4) $classes[] = 'ns4'; elseif($is_safari) $classes[] = 'safari'; elseif($is_chrome) $classes[] = 'chrome'; elseif($is_IE) $classes[] = 'ie'; else $classes[] = 'unknown'; if($is_iphone) $classes[] = 'iphone'; return $classes; } if ( function_exists( 'register_nav_menus' ) ) { // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'main-nav' => __( 'Main Navigation',TEMPLATE_DOMAIN ) ) ); add_theme_support( 'menus' ); // new nav menus for wp 3.0 /////////////////////////////////////////////////////////////////////////////// // remove open ul to fit the custom bp navigation.php /////////////////////////////////////////////////////////////////////////////// function bp_wp_custom_nav_menu($get_custom_location='', $get_default_menu=''){ $options = array('theme_location' => "$get_custom_location", 'menu_id' => '', 'echo' => false, 'container' => false, 'container_id' => '', 'fallback_cb' => "$get_default_menu"); $menu = wp_nav_menu($options); $menu_list = preg_replace( array( '#^<ul[^>]*>#', '#</ul>$#' ), '', $menu ); return $menu_list; } function revert_wp_menu_page() { //revert back to normal if in wp 3.0 and menu not set ?> <li class="<?php if (is_home()) { ?>home<?php } else { ?>page_item<?php } ?>"> <a href="<?php bloginfo('url'); ?>" title="<?php _e("Home",TEMPLATE_DOMAIN); ?>"><?php _e('Home',TEMPLATE_DOMAIN); ?></a></li> <?php wp_list_pages('title_li=&depth=0'); ?> <?php } function revert_wp_menu_cat() { //revert back to normal if in wp 3.0 and menu not set ?> <?php wp_list_categories('orderby=id&show_count=0&use_desc_for_title=0&title_li='); ?> <?php } function add_wp_menu_drop_js_script() { wp_enqueue_script('dropmenu', get_template_directory_uri() . '/js/dropmenu.js', array('jquery')); wp_enqueue_style('nav', get_template_directory_uri() . '/nav.css', array(), false, 'screen'); } add_action('wp_enqueue_scripts', 'add_wp_menu_drop_js_script'); } //////////////////////////////////////////////////////////////////////////// // wordpress preset and custom background //////////////////////////////////////////////////////////////////////////// if ( function_exists( 'add_theme_support' ) ) { if( !defined( 'CUSTOM_BG_DIR' ) && !defined( 'CUSTOM_BG_URL' ) ) { $handle_path = WP_CONTENT_DIR . '/custom-bg'; $handle_url = WP_CONTENT_URL . '/custom-bg'; } else { $handle_path = CUSTOM_BG_DIR; $handle_url = CUSTOM_BG_URL; } function new_custom_background_cb() { global $handle_path, $handle_url; if( get_background_image() ) { $background = get_background_image(); $color = get_background_color(); if ( ! $background && ! $color ) return; $style = $color ? "background-color: #$color;" : ''; if ( $background ) { $image = " background-image: url('$background');"; $repeat = get_theme_mod( 'background_repeat', 'repeat' ); if ( ! in_array( $repeat, array( 'no-repeat', 'repeat-x', 'repeat-y', 'repeat' ) ) ) $repeat = 'repeat'; $repeat = " background-repeat: $repeat;"; $position = get_theme_mod( 'background_position_x', 'left' ); if ( ! in_array( $position, array( 'center', 'right', 'left' ) ) ) $position = 'left'; $position = " background-position: top $position;"; $attachment = get_theme_mod( 'background_attachment', 'scroll' ); if ( ! in_array( $attachment, array( 'fixed', 'scroll' ) ) ) $attachment = 'scroll'; $attachment = " background-attachment: $attachment;"; $style .= $image . $repeat . $position . $attachment; } } else { $background = get_theme_mod('preset_bg'); $background_position = get_theme_mod('cbackground-position-x'); $background_repeat = get_theme_mod('cbackground-repeat'); $background_attach = get_theme_mod('cbackground-attachment'); $color = get_background_color(); if ( ! $background && ! $color ) return; $style = $color ? "background-color: #$color;" : ''; if ( $background ) { $image = " background-image: url('$handle_url/$background');"; $repeat = " background-repeat: $background_repeat;"; $position = " background-position: top $background_position;"; $attachment = " background-attachment: $background_attach;"; $style .= $image . $repeat . $position . $attachment; } } ?> <style type="text/css"> body { <?php echo trim( $style ); ?> } </style> <?php } function preset_background_images_init() { global $handle_path, $handle_url; if ( $_REQUEST['save'] ) echo '<div id="message" class="updated fade"><p><strong>'. __('Background settings saved.', TEMPLATE_DOMAIN) . '</strong></p></div>'; if ( isset($_REQUEST['reset']) && $_REQUEST['reset'] ) echo '<div id="message" class="updated fade"><p><strong>'. __('Background settings reset.', TEMPLATE_DOMAIN) . '</strong></p></div>'; ?> <div class="wrap" id="custom-background"> <?php screen_icon(); ?> <h2><?php _e('Preset Background'); ?></h2> <div id="preset-bg"> <form method="post" action=""> <?php //echo get_theme_mod('preset_bg'); ?> <?php if ( isset($_POST['preset_bg']) ) { $preset = $_POST['preset_bg']; $preset_position = $_POST['cbackground-position-x']; $preset_repeat = $_POST['cbackground-repeat']; $preset_attach = $_POST['cbackground-attachment']; set_theme_mod('preset_bg', $preset); set_theme_mod('cbackground-position-x', $preset_position); set_theme_mod('cbackground-repeat', $preset_repeat); set_theme_mod('cbackground-attachment', $preset_attach); } ?> <?php if ( isset($_POST['reset']) ) { remove_theme_mod('preset_bg'); remove_theme_mod('cbackground-position-x'); remove_theme_mod('cbackground-repeat'); remove_theme_mod('cbackground-attachment'); } ?> <div class="bgboxwrap"> <div class="updated below-h2" id="message"> <p>Custom Background must be empty in order for the <strong>Preset Background</strong> to work.<?php if( get_background_image() ) { ?><br />You have image uploaded in custom background, <a href="<?php echo admin_url('/themes.php?page=custom-background'); ?>">remove the uploaded background</a> first<?php } ?></p> </div> <strong><?php _e("Choose Image",TEMPLATE_DOMAIN); ?></strong><br /> <label><?php _e("Choose a preset background image",TEMPLATE_DOMAIN); ?></label> </div> <?php if ($handle = opendir($handle_path)) { $pattern="(\.jpg$)|(\.png$)|(\.jpeg$)|(\.gif$)|(\.bmp$)"; //valid image extensions // List all the files while (false !== ($file = readdir($handle))) { $i == $i++ ; if(eregi($pattern, $file)){ ?> <div class="bgbox"> <div class="bgrimg"><img src="<?php echo $handle_url . '/' . $file; ?>" class="img-left" alt="background<?php echo $i; ?>" /></div> <p><input<?php if( get_theme_mod('preset_bg') == $file ) { ?> checked="checked"<?php } ?> name="preset_bg" type="radio" value="<?php echo $file; ?>" />&nbsp;&nbsp;<?php echo $file; ?></p> </div> <?php } } closedir($handle); } ?> <table class="form-table"> <tr valign="top"> <th scope="row"><?php _e( 'Position' ); ?></th> <td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Position' ); ?></span></legend> <label> <input name="cbackground-position-x" type="radio" value="left"<?php checked('left', get_theme_mod('cbackground-position-x', 'left')); ?> /> <?php _e('Left') ?> </label> <label> <input name="cbackground-position-x" type="radio" value="center"<?php checked('center', get_theme_mod('cbackground-position-x', 'center')); ?> /> <?php _e('Center') ?> </label> <label> <input name="cbackground-position-x" type="radio" value="right"<?php checked('right', get_theme_mod('cbackground-position-x', 'right')); ?> /> <?php _e('Right') ?> </label> </fieldset></td> </tr> <tr valign="top"> <th scope="row"><?php _e( 'Repeat' ); ?></th> <td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Repeat' ); ?></span></legend> <label><input type="radio" name="cbackground-repeat" value="no-repeat"<?php checked('no-repeat', get_theme_mod('cbackground-repeat', 'no-repeat')); ?> /> <?php _e('No Repeat'); ?></label> <label><input type="radio" name="cbackground-repeat" value="repeat"<?php checked('repeat', get_theme_mod('cbackground-repeat', 'repeat')); ?> /> <?php _e('Tile'); ?></label> <label><input type="radio" name="cbackground-repeat" value="repeat-x"<?php checked('repeat-x', get_theme_mod('cbackground-repeat', 'repeat-x')); ?> /> <?php _e('Tile Horizontally'); ?></label> <label><input type="radio" name="cbackground-repeat" value="repeat-y"<?php checked('repeat-y', get_theme_mod('cbackground-repeat', 'repeat-y')); ?> /> <?php _e('Tile Vertically'); ?></label> </fieldset></td> </tr> <tr valign="top"> <th scope="row"><?php _e( 'Attachment' ); ?></th> <td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Attachment' ); ?></span></legend> <label> <input name="cbackground-attachment" type="radio" value="scroll" <?php checked('scroll', get_theme_mod('cbackground-attachment', 'scroll')); ?> /> <?php _e('Scroll') ?> </label> <label> <input name="cbackground-attachment" type="radio" value="fixed" <?php checked('fixed', get_theme_mod('cbackground-attachment', 'fixed')); ?> /> <?php _e('Fixed') ?> </label> </fieldset></td> </tr> </table> <br /><br /> <div class="bgboxwrap"> <input name="save" type="submit" class="button-primary sbutton" value="<?php echo esc_attr(__('Save Changes',TEMPLATE_DOMAIN)); ?>" /> </div> <div class="bgboxwrap"> <input name="reset" type="submit" class="button-secondary sbutton" onclick="return confirm('Are you sure you want to reset all saved settings?. This action cannot be restore.')" value="<?php echo esc_attr(__('Reset Settings',TEMPLATE_DOMAIN)); ?>" /> </div> </form> </div> </div> <?php } function default_background_images_css() { ?> <style type="text/css"> #preset-bg { width: 98%; clear:both; float:left; margin: 20px 0px 30px; } #preset-bg label { font-size: 12px; color: #777; } .bgboxwrap { width: 100%; float:left; margin: 0px 0px 15px; } .bgbox { width: 32%; float:left; height: 150px; } .bgrimg { width: 100%; height: 100px; overflow: hidden; } .bgbox img { max-width: 90%; height: auto; } </style> <?php } function add_preset_bg_init() { add_submenu_page( 'themes.php', 'Preset Background Image', 'Preset Background', 'edit_theme_options', 'preset-background', 'preset_background_images_init' ); } // Add support for custom backgrounds add_theme_support( 'custom-background', array('wp-head-callback' => 'new_custom_background_cb')); add_action('admin_head','default_background_images_css'); if(is_dir($handle_path)) { add_action('admin_menu','add_preset_bg_init'); } } //end check //////////////////////////////////////////////////////////////////////////////// // wp 2.7 wp_list_comment //////////////////////////////////////////////////////////////////////////////// function list_comments($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <li <?php comment_class(); ?> id="comment-<?php comment_ID($comment_index); ?>"> <a href="#comment-<?php comment_ID(); ?>" class="counter" title="<?php _e('Permanent Link to this Comment','redo_domain'); ?>"><?php echo $comment_index; ?></a> <span class="commentauthor"><?php if (function_exists('avatar_display_comments')) { ?> <?php avatar_display_comments(get_comment_author_email(),'48',''); ?> <?php } else { ?> <?php if (function_exists('get_avatar')) { echo get_avatar( get_comment_author_email() , 48 ); } ?> <?php } ?>&nbsp;&nbsp; <?php comment_author_link(); ?></span> <small class="comment-meta"> <?php printf('<a href="#comment-%1$s" title="%2$s">%3$s</a>', get_comment_ID(), (function_exists('time_since')? sprintf(__('%s ago.','redo_domain'), time_since(abs(strtotime($comment->comment_date_gmt . " GMT")), time()) ): __('Permanent Link to this Comment','redo_domain') ), sprintf(__('%1$s at %2$s','redo_domain'), get_comment_date(get_option('date_format')), get_comment_time() ) ); ?> <?php if (function_exists('quoter_comment')) { quoter_comment(); } ?> <?php if (function_exists('jal_edit_comment_link')) { jal_edit_comment_link(__('Edit','redo_domain'), '<span class="comment-edit">','</span>', '<em>(Editing)</em>'); } else { edit_comment_link(__('Edit','redo_domain'), '<span class="comment-edit">', '</span>'); } ?> </small> <div class="comment-content"> <?php comment_text(); ?> <p><?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?></p> </div> <?php if ('0' == $comment->comment_approved) { ?><p class="alert"><strong><?php _e('Your comment is awaiting moderation.','redo_domain'); ?></strong></p><?php } ?> <?php } //////////////////////////////////////////////////////////////////////////////// // wp 2.7 wp_list_ping //////////////////////////////////////////////////////////////////////////////// function list_pings($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <li id="comment-<?php comment_ID(); ?>"><?php comment_author_link(); ?> <?php } add_filter('get_comments_number', 'comment_count', 0); function comment_count( $count ) { global $id; $comments_by_split = get_comments('post_id=' . $id); $comments_by_type = &separate_comments($comments_by_split); return count($comments_by_type['comment']); } define('HEADER_TEXTCOLOR', 'ffffff'); define('HEADER_IMAGE_WIDTH', 730); define('HEADER_IMAGE_HEIGHT', 180); define('HEADER_IMAGE', ''); function redo_admin_header_style() { ?> <style type="text/css"> #headimg { height: <?php echo HEADER_IMAGE_HEIGHT; ?>px; width: <?php echo HEADER_IMAGE_WIDTH; ?>px; background-color: #900; } #headimg h1 { font-family:"Century Gothic","Lucida Grande",Verdana,Arial !important; font-size: 38px; font-weight: normal; padding-left: 18px; padding-top: 120px; margin: 0; } #headimg h1 a { color:#<?php header_textcolor() ?>; border: none; text-decoration: none; } #headimg #desc { display: none; background-image: } <?php if ( 'blank' == get_header_textcolor() ) { ?> #headerimg h1, #headerimg #desc { display: none; } #headimg h1 a, #headimg #desc { color:#<?php echo HEADER_TEXTCOLOR ?>; } <?php } ?> </style> <?php } function redo_header_style() { ?> <style type="text/css"> #header_content { background:#900 url(<?php header_image() ?>) center repeat-y; } <?php if ( 'blank' == get_header_textcolor() ) { ?> #header_content #title { display: none; } <?php } else { ?> #header_content h1 a, #header_content h1 a:hover { color: #<?php header_textcolor() ?>; } <?php } ?> </style> <?php } add_theme_support( 'custom-header', array('wp-head-callback' => 'redo_header_style', 'admin-head-callback' => 'redo_admin_header_style')); $themecolors = array( 'bg' => '333333', 'border' => '111111', 'text' => 'eeeeee', 'link' => 'cccccc' ); $content_width = 655; // pixels #require(TEMPLATEPATH . '/options/app/info.php'); function get_redo_ping_type($trackbacktxt = 'Trackback', $pingbacktxt = 'Pingback') { $type = get_comment_type(); switch( $type ) { case 'trackback' : return $trackbacktxt; break; case 'pingback' : return $pingbacktxt; break; } return false; } /* By Mark Jaquith, http://txfx.net */ function redo_nice_category($normal_separator = ', ', $penultimate_separator = ' and ') { $categories = get_the_category(); if (empty($categories)) { _e('Uncategorized','redo_domain'); return; } $thelist = ''; $i = 1; $n = count($categories); foreach ($categories as $category) { if (1 < $i and $i != $n) { $thelist .= $normal_separator; } if (1 < $i and $i == $n) { $thelist .= $penultimate_separator; } $thelist .= '<a href="' . get_category_link($category->cat_ID) . '" title="' . sprintf(__("View all posts in %s"), $category->cat_name) . '">'.$category->cat_name.'</a>'; ++$i; } return apply_filters('the_category', $thelist, $normal_separator); } function redo_body_id() { if (get_option('permalink_structure') != '' and is_page()) { echo "id='" . get_query_var('name') . "'"; } } // Semantic class functions from Sandbox 0.6.1 (http://www.plaintxt.org/themes/sandbox/) // Template tag: echoes semantic classes in the <body> function redo_body_class() { global $wp_query, $current_user; $c = array('wordpress', 'k2'); redo_date_classes(time(), $c); is_home() ? $c[] = 'home' : null; is_archive() ? $c[] = 'archive' : null; is_date() ? $c[] = 'date' : null; is_search() ? $c[] = 'search' : null; is_paged() ? $c[] = 'paged' : null; is_attachment() ? $c[] = 'attachment' : null; is_404() ? $c[] = 'four04' : null; // CSS does not allow a digit as first character if ( is_single() ) { the_post(); $c[] = 'single'; if ( isset($wp_query->post->post_date) ) { redo_date_classes(mysql2date('U', $wp_query->post->post_date), $c, 's-'); } foreach ( (array) get_the_category() as $cat ) { $c[] = 's-category-' . $cat->category_nicename; } $c[] = 's-author-' . get_the_author_login(); rewind_posts(); } else if ( is_author() ) { $author = $wp_query->get_queried_object(); $c[] = 'author'; $c[] = 'author-' . $author->user_nicename; } else if ( is_category() ) { $cat = $wp_query->get_queried_object(); $c[] = 'category'; $c[] = 'category-' . $cat->category_nicename; } else if ( is_page() ) { the_post(); $c[] = 'page'; $c[] = 'page-author-' . get_the_author_login(); rewind_posts(); } if ( $current_user->ID ) $c[] = 'loggedin'; echo join(' ', apply_filters('body_class', $c)); } // Template tag: echoes semantic classes in each post <div> function redo_post_class( $post_count = 1, $post_asides = false ) { global $post; $c = array('hentry', "p$post_count", $post->post_type, $post->post_status); $c[] = 'author-' . get_the_author_login(); foreach ( (array) get_the_category() as $cat ) { $c[] = 'category-' . $cat->category_nicename; } redo_date_classes(mysql2date('U', $post->post_date), $c); if ( $post_asides ) { $c[] = 'redo-asides'; } if ( $post_count & 1 == 1 ) { $c[] = 'alt'; } echo join(' ', apply_filters('post_class', $c)); } // Template tag: echoes semantic classes for a comment <li> function redo_comment_class( $comment_count = 1 ) { global $comment, $post; $c = array($comment->comment_type, "c$comment_count"); if ( $comment->user_id > 0 ) { $user = get_userdata($comment->user_id); $c[] = "byuser commentauthor-$user->user_login"; if ( $comment->user_id === $post->post_author ) { $c[] = 'bypostauthor'; } } redo_date_classes(mysql2date('U', $comment->comment_date), $c, 'c-'); if ( $comment_count & 1 == 1 ) { $c[] = 'alt'; } if ( is_trackback() ) { $c[] = 'trackback'; } echo join(' ', apply_filters('comment_class', $c)); } // Adds four time- and date-based classes to an array // with all times relative to GMT (sometimes called UTC) function redo_date_classes($t, &$c, $p = '') { $t = $t + (get_option('gmt_offset') * 3600); $c[] = $p . 'y' . gmdate('Y', $t); // Year $c[] = $p . 'm' . gmdate('m', $t); // Month $c[] = $p . 'd' . gmdate('d', $t); // Day $c[] = $p . 'h' . gmdate('h', $t); // Hour } // Register the sidebar - This allows for multiple sidebars to be used. if(function_exists('register_sidebars')) { register_sidebars(1, array('before_widget' => '<div id="%1$s" class="module %2$s">','after_widget' => '</div>')); } // this ends the admin page ?>
gpl-2.0
cbedoy/WAYGRAM
TMessagesProj/src/main/java/org/telegram/messenger/FileLoader.java
49306
/* * This is the source code of Telegram for Android v. 1.3.2. * It is licensed under GNU GPL v. 2 or later. * You should have received a copy of the license in this archive (see LICENSE). * * Copyright Nikolai Kudashov, 2013. */ package org.telegram.messenger; import android.app.ActivityManager; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Matrix; import android.media.ExifInterface; import android.net.Uri; import android.os.Build; import android.os.ParcelFileDescriptor; import org.telegram.objects.MessageObject; import org.telegram.ui.ApplicationLoader; import org.telegram.ui.Views.ImageReceiver; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileDescriptor; import java.io.FileOutputStream; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedList; import java.util.Queue; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.Semaphore; public class FileLoader { public LruCache memCache; public static volatile DispatchQueue cacheOutQueue = new DispatchQueue("cacheOutQueue"); public static volatile DispatchQueue fileLoaderQueue = new DispatchQueue("fileUploadQueue"); private String ignoreRemoval = null; private ConcurrentHashMap<String, CacheImage> imageLoading; private HashMap<Integer, CacheImage> imageLoadingByKeys; private Queue<FileLoadOperation> operationsQueue; private Queue<FileLoadOperation> runningOperation; private final int maxConcurentLoadingOpertaionsCount = 2; private Queue<FileUploadOperation> uploadOperationQueue; private ConcurrentHashMap<String, FileUploadOperation> uploadOperationPaths; private ConcurrentHashMap<String, FileUploadOperation> uploadOperationPathsEnc; private int currentUploadOperationsCount = 0; private Queue<FileLoadOperation> loadOperationQueue; private Queue<FileLoadOperation> audioLoadOperationQueue; private Queue<FileLoadOperation> photoLoadOperationQueue; private ConcurrentHashMap<String, FileLoadOperation> loadOperationPaths; private int currentLoadOperationsCount = 0; private int currentAudioLoadOperationsCount = 0; private int currentPhotoLoadOperationsCount = 0; public static long lastCacheOutTime = 0; public ConcurrentHashMap<String, Float> fileProgresses = new ConcurrentHashMap<String, Float>(); private long lastProgressUpdateTime = 0; private HashMap<String, Integer> BitmapUseCounts = new HashMap<String, Integer>(); int lastImageNum; public static final int FileDidUpload = 10000; public static final int FileDidFailUpload = 10001; public static final int FileUploadProgressChanged = 10002; public static final int FileLoadProgressChanged = 10003; public static final int FileDidLoaded = 10004; public static final int FileDidFailedLoad = 10005; public class VMRuntimeHack { private Object runtime = null; private Method trackAllocation = null; private Method trackFree = null; public boolean trackAlloc(long size) { if (runtime == null) return false; try { Object res = trackAllocation.invoke(runtime, size); return (res instanceof Boolean) ? (Boolean)res : true; } catch (IllegalArgumentException e) { return false; } catch (IllegalAccessException e) { return false; } catch (InvocationTargetException e) { return false; } } public boolean trackFree(long size) { if (runtime == null) return false; try { Object res = trackFree.invoke(runtime, size); return (res instanceof Boolean) ? (Boolean)res : true; } catch (IllegalArgumentException e) { return false; } catch (IllegalAccessException e) { return false; } catch (InvocationTargetException e) { return false; } } @SuppressWarnings("unchecked") public VMRuntimeHack() { boolean success = false; try { Class cl = Class.forName("dalvik.system.VMRuntime"); Method getRt = cl.getMethod("getRuntime", new Class[0]); runtime = getRt.invoke(null, new Object[0]); trackAllocation = cl.getMethod("trackExternalAllocation", new Class[] {long.class}); trackFree = cl.getMethod("trackExternalFree", new Class[] {long.class}); success = true; } catch (Exception e) { FileLog.e("tmessages", e); } if (!success) { runtime = null; trackAllocation = null; trackFree = null; } } } public VMRuntimeHack runtimeHack = null; private class CacheImage { public String key; final public ArrayList<ImageReceiver> imageViewArray = new ArrayList<ImageReceiver>(); public FileLoadOperation loadOperation; public void addImageView(ImageReceiver imageView) { synchronized (imageViewArray) { boolean exist = false; for (Object v : imageViewArray) { if (v == imageView) { exist = true; break; } } if (!exist) { imageViewArray.add(imageView); } } } public void removeImageView(Object imageView) { synchronized (imageViewArray) { for (int a = 0; a < imageViewArray.size(); a++) { Object obj = imageViewArray.get(a); if (obj == null || obj == imageView) { imageViewArray.remove(a); a--; } } } } public void callAndClear(Bitmap image) { synchronized (imageViewArray) { if (image != null) { for (Object imgView : imageViewArray) { if (imgView instanceof ImageReceiver) { ((ImageReceiver)imgView).setImageBitmap(image, key); } } } } fileLoaderQueue.postRunnable(new Runnable() { @Override public void run() { synchronized (imageViewArray) { imageViewArray.clear(); } loadOperation = null; } }); } public void cancelAndClear() { if (loadOperation != null) { loadOperation.cancel(); loadOperation = null; } synchronized (imageViewArray) { imageViewArray.clear(); } } } public void incrementUseCount(String key) { Integer count = BitmapUseCounts.get(key); if (count == null) { BitmapUseCounts.put(key, 1); } else { BitmapUseCounts.put(key, count + 1); } } public boolean decrementUseCount(String key) { Integer count = BitmapUseCounts.get(key); if (count == null) { return true; } if (count == 1) { BitmapUseCounts.remove(key); return true; } else { BitmapUseCounts.put(key, count - 1); } return false; } public void removeImage(String key) { BitmapUseCounts.remove(key); memCache.remove(key); } /*class BitmapWorkerTask extends AsyncTask<Integer, Void, Bitmap> { private CacheImage cacheImage; private Bitmap bitmap; private int data = 0; public BitmapWorkerTask(ArrayList<WeakReference<View>> arr) { // Use a WeakReference to ensure the ImageView can be garbage collected imageViewReference = new WeakReference<ImageView>(imageView); } // Decode image in background. @Override protected Bitmap doInBackground(Integer... params) { data = params[0]; return decodeSampledBitmapFromResource(getResources(), data, 100, 100)); } // Once complete, see if ImageView is still around and set bitmap. @Override protected void onPostExecute(Bitmap bitmap) { if (imageViewReference != null && bitmap != null) { final ImageView imageView = imageViewReference.get(); if (imageView != null) { imageView.setImageBitmap(bitmap); } } } }*/ private static volatile FileLoader Instance = null; public static FileLoader getInstance() { FileLoader localInstance = Instance; if (localInstance == null) { synchronized (FileLoader.class) { localInstance = Instance; if (localInstance == null) { Instance = localInstance = new FileLoader(); } } } return localInstance; } public FileLoader() { int cacheSize = Math.min(15, ((ActivityManager) ApplicationLoader.applicationContext.getSystemService(Context.ACTIVITY_SERVICE)).getMemoryClass() / 7) * 1024 * 1024; if (Build.VERSION.SDK_INT < 11) { runtimeHack = new VMRuntimeHack(); cacheSize = 1024 * 1024 * 3; } memCache = new LruCache(cacheSize) { @Override protected int sizeOf(String key, Bitmap bitmap) { if(Build.VERSION.SDK_INT < 12) { return bitmap.getRowBytes() * bitmap.getHeight(); } else { return bitmap.getByteCount(); } } @Override protected void entryRemoved(boolean evicted, String key, Bitmap oldBitmap, Bitmap newBitmap) { if (ignoreRemoval != null && key != null && ignoreRemoval.equals(key)) { return; } Integer count = BitmapUseCounts.get(key); if (count == null || count == 0) { if (runtimeHack != null) { runtimeHack.trackAlloc(oldBitmap.getRowBytes() * oldBitmap.getHeight()); } if (Build.VERSION.SDK_INT < 11) { if (!oldBitmap.isRecycled()) { oldBitmap.recycle(); } } } } }; imageLoading = new ConcurrentHashMap<String, CacheImage>(); imageLoadingByKeys = new HashMap<Integer, CacheImage>(); operationsQueue = new LinkedList<FileLoadOperation>(); runningOperation = new LinkedList<FileLoadOperation>(); uploadOperationQueue = new LinkedList<FileUploadOperation>(); uploadOperationPaths = new ConcurrentHashMap<String, FileUploadOperation>(); uploadOperationPathsEnc = new ConcurrentHashMap<String, FileUploadOperation>(); loadOperationPaths = new ConcurrentHashMap<String, FileLoadOperation>(); loadOperationQueue = new LinkedList<FileLoadOperation>(); audioLoadOperationQueue = new LinkedList<FileLoadOperation>(); photoLoadOperationQueue = new LinkedList<FileLoadOperation>(); } public void cancelUploadFile(final String location, final boolean enc) { fileLoaderQueue.postRunnable(new Runnable() { @Override public void run() { if (!enc) { FileUploadOperation operation = uploadOperationPaths.get(location); if (operation != null) { uploadOperationQueue.remove(operation); operation.cancel(); } } else { FileUploadOperation operation = uploadOperationPathsEnc.get(location); if (operation != null) { uploadOperationQueue.remove(operation); operation.cancel(); } } } }); } public boolean isInCache(String key) { return memCache.get(key) != null; } public void uploadFile(final String location, final boolean encrypted) { fileLoaderQueue.postRunnable(new Runnable() { @Override public void run() { if (encrypted) { if (uploadOperationPathsEnc.containsKey(location)) { return; } } else { if (uploadOperationPaths.containsKey(location)) { return; } } FileUploadOperation operation = new FileUploadOperation(location, encrypted); if (encrypted) { uploadOperationPathsEnc.put(location, operation); } else { uploadOperationPaths.put(location, operation); } operation.delegate = new FileUploadOperation.FileUploadOperationDelegate() { @Override public void didFinishUploadingFile(FileUploadOperation operation, final TLRPC.InputFile inputFile, final TLRPC.InputEncryptedFile inputEncryptedFile) { fileLoaderQueue.postRunnable(new Runnable() { @Override public void run() { Utilities.stageQueue.postRunnable(new Runnable() { @Override public void run() { NotificationCenter.getInstance().postNotificationName(FileDidUpload, location, inputFile, inputEncryptedFile); fileProgresses.remove(location); } }); if (encrypted) { uploadOperationPathsEnc.remove(location); } else { uploadOperationPaths.remove(location); } currentUploadOperationsCount--; if (currentUploadOperationsCount < 2) { FileUploadOperation operation = uploadOperationQueue.poll(); if (operation != null) { currentUploadOperationsCount++; operation.start(); } } } }); } @Override public void didFailedUploadingFile(final FileUploadOperation operation) { fileLoaderQueue.postRunnable(new Runnable() { @Override public void run() { Utilities.stageQueue.postRunnable(new Runnable() { @Override public void run() { fileProgresses.remove(location); if (operation.state != 2) { NotificationCenter.getInstance().postNotificationName(FileDidFailUpload, location, encrypted); } } }); if (encrypted) { uploadOperationPathsEnc.remove(location); } else { uploadOperationPaths.remove(location); } currentUploadOperationsCount--; if (currentUploadOperationsCount < 2) { FileUploadOperation operation = uploadOperationQueue.poll(); if (operation != null) { currentUploadOperationsCount++; operation.start(); } } } }); } @Override public void didChangedUploadProgress(FileUploadOperation operation, final float progress) { if (operation.state != 2) { fileProgresses.put(location, progress); } long currentTime = System.currentTimeMillis(); if (lastProgressUpdateTime == 0 || lastProgressUpdateTime < currentTime - 500) { lastProgressUpdateTime = currentTime; Utilities.RunOnUIThread(new Runnable() { @Override public void run() { NotificationCenter.getInstance().postNotificationName(FileUploadProgressChanged, location, progress, encrypted); } }); } } }; if (currentUploadOperationsCount < 2) { currentUploadOperationsCount++; operation.start(); } else { uploadOperationQueue.add(operation); } } }); } public void cancelLoadFile(final TLRPC.Video video, final TLRPC.PhotoSize photo, final TLRPC.Document document, final TLRPC.Audio audio) { if (video == null && photo == null && document == null && audio == null) { return; } fileLoaderQueue.postRunnable(new Runnable() { @Override public void run() { String fileName = null; if (video != null) { fileName = MessageObject.getAttachFileName(video); } else if (photo != null) { fileName = MessageObject.getAttachFileName(photo); } else if (document != null) { fileName = MessageObject.getAttachFileName(document); } else if (audio != null) { fileName = MessageObject.getAttachFileName(audio); } if (fileName == null) { return; } FileLoadOperation operation = loadOperationPaths.get(fileName); if (operation != null) { if (audio != null) { audioLoadOperationQueue.remove(operation); } else if (photo != null) { photoLoadOperationQueue.remove(operation); } else { loadOperationQueue.remove(operation); } operation.cancel(); } } }); } public boolean isLoadingFile(final String fileName) { final Semaphore semaphore = new Semaphore(0); final Boolean[] result = new Boolean[1]; fileLoaderQueue.postRunnable(new Runnable() { @Override public void run() { result[0] = loadOperationPaths.containsKey(fileName); semaphore.release(); } }); try { semaphore.acquire(); } catch (Exception e) { FileLog.e("tmessages", e); } return result[0]; } public void loadFile(final TLRPC.Video video, final TLRPC.PhotoSize photo, final TLRPC.Document document, final TLRPC.Audio audio) { fileLoaderQueue.postRunnable(new Runnable() { @Override public void run() { String fileName = null; if (video != null) { fileName = MessageObject.getAttachFileName(video); } else if (photo != null) { fileName = MessageObject.getAttachFileName(photo); } else if (document != null) { fileName = MessageObject.getAttachFileName(document); } else if (audio != null) { fileName = MessageObject.getAttachFileName(audio); } if (fileName == null || fileName.contains("" + Integer.MIN_VALUE)) { return; } if (loadOperationPaths.containsKey(fileName)) { return; } FileLoadOperation operation = null; if (video != null) { operation = new FileLoadOperation(video); operation.totalBytesCount = video.size; } else if (photo != null) { operation = new FileLoadOperation(photo.location); operation.totalBytesCount = photo.size; operation.needBitmapCreate = false; } else if (document != null) { operation = new FileLoadOperation(document); operation.totalBytesCount = document.size; } else if (audio != null) { operation = new FileLoadOperation(audio); operation.totalBytesCount = audio.size; } final String arg1 = fileName; loadOperationPaths.put(fileName, operation); operation.delegate = new FileLoadOperation.FileLoadOperationDelegate() { @Override public void didFinishLoadingFile(FileLoadOperation operation) { Utilities.RunOnUIThread(new Runnable() { @Override public void run() { NotificationCenter.getInstance().postNotificationName(FileLoadProgressChanged, arg1, 1.0f); } }); Utilities.RunOnUIThread(new Runnable() { @Override public void run() { NotificationCenter.getInstance().postNotificationName(FileDidLoaded, arg1); } }); fileLoaderQueue.postRunnable(new Runnable() { @Override public void run() { loadOperationPaths.remove(arg1); if (audio != null) { currentAudioLoadOperationsCount--; if (currentAudioLoadOperationsCount < 2) { FileLoadOperation operation = audioLoadOperationQueue.poll(); if (operation != null) { currentAudioLoadOperationsCount++; operation.start(); } } } else if (photo != null) { currentPhotoLoadOperationsCount--; if (currentPhotoLoadOperationsCount < 2) { FileLoadOperation operation = photoLoadOperationQueue.poll(); if (operation != null) { currentPhotoLoadOperationsCount++; operation.start(); } } } else { currentLoadOperationsCount--; if (currentLoadOperationsCount < 2) { FileLoadOperation operation = loadOperationQueue.poll(); if (operation != null) { currentLoadOperationsCount++; operation.start(); } } } } }); fileProgresses.remove(arg1); } @Override public void didFailedLoadingFile(FileLoadOperation operation) { fileProgresses.remove(arg1); if (operation.state != 2) { Utilities.RunOnUIThread(new Runnable() { @Override public void run() { NotificationCenter.getInstance().postNotificationName(FileDidFailedLoad, arg1); } }); } fileLoaderQueue.postRunnable(new Runnable() { @Override public void run() { loadOperationPaths.remove(arg1); if (audio != null) { currentAudioLoadOperationsCount--; if (currentAudioLoadOperationsCount < 2) { FileLoadOperation operation = audioLoadOperationQueue.poll(); if (operation != null) { currentAudioLoadOperationsCount++; operation.start(); } } } else if (photo != null) { currentPhotoLoadOperationsCount--; if (currentPhotoLoadOperationsCount < 2) { FileLoadOperation operation = photoLoadOperationQueue.poll(); if (operation != null) { currentPhotoLoadOperationsCount++; operation.start(); } } } else { currentLoadOperationsCount--; if (currentLoadOperationsCount < 2) { FileLoadOperation operation = loadOperationQueue.poll(); if (operation != null) { currentLoadOperationsCount++; operation.start(); } } } } }); } @Override public void didChangedLoadProgress(FileLoadOperation operation, final float progress) { if (operation.state != 2) { fileProgresses.put(arg1, progress); } long currentTime = System.currentTimeMillis(); if (lastProgressUpdateTime == 0 || lastProgressUpdateTime < currentTime - 500) { lastProgressUpdateTime = currentTime; Utilities.RunOnUIThread(new Runnable() { @Override public void run() { NotificationCenter.getInstance().postNotificationName(FileLoadProgressChanged, arg1, progress); } }); } } }; if (audio != null) { if (currentAudioLoadOperationsCount < 2) { currentAudioLoadOperationsCount++; operation.start(); } else { audioLoadOperationQueue.add(operation); } } else if (photo != null) { if (currentPhotoLoadOperationsCount < 2) { currentPhotoLoadOperationsCount++; operation.start(); } else { photoLoadOperationQueue.add(operation); } } else { if (currentLoadOperationsCount < 2) { currentLoadOperationsCount++; operation.start(); } else { loadOperationQueue.add(operation); } } } }); } Bitmap imageFromKey(String key) { if (key == null) { return null; } return memCache.get(key); } public void clearMemory() { memCache.evictAll(); } public void cancelLoadingForImageView(final ImageReceiver imageView) { if (imageView == null) { return; } fileLoaderQueue.postRunnable(new Runnable() { @Override public void run() { Integer TAG = imageView.TAG; if (TAG == null) { imageView.TAG = TAG = lastImageNum; lastImageNum++; if (lastImageNum == Integer.MAX_VALUE) { lastImageNum = 0; } } CacheImage ei = imageLoadingByKeys.get(TAG); if (ei != null) { imageLoadingByKeys.remove(TAG); ei.removeImageView(imageView); if (ei.imageViewArray.size() == 0) { checkOperationsAndClear(ei.loadOperation); ei.cancelAndClear(); imageLoading.remove(ei.key); } } } }); } public Bitmap getImageFromMemory(TLRPC.FileLocation url, ImageReceiver imageView, String filter, boolean cancel) { return getImageFromMemory(url, null, imageView, filter, cancel); } public Bitmap getImageFromMemory(String url, ImageReceiver imageView, String filter, boolean cancel) { return getImageFromMemory(null, url, imageView, filter, cancel); } public Bitmap getImageFromMemory(TLRPC.FileLocation url, String httpUrl, ImageReceiver imageView, String filter, boolean cancel) { if (url == null && httpUrl == null) { return null; } String key; if (httpUrl != null) { key = Utilities.MD5(httpUrl); } else { key = url.volume_id + "_" + url.local_id; } if (filter != null) { key += "@" + filter; } Bitmap img = imageFromKey(key); if (imageView != null && img != null && cancel) { cancelLoadingForImageView(imageView); } return img; } private void performReplace(String oldKey, String newKey) { Bitmap b = memCache.get(oldKey); if (b != null) { ignoreRemoval = oldKey; memCache.remove(oldKey); memCache.put(newKey, b); ignoreRemoval = null; } Integer val = BitmapUseCounts.get(oldKey); if (val != null) { BitmapUseCounts.put(newKey, val); BitmapUseCounts.remove(oldKey); } } public void replaceImageInCache(final String oldKey, final String newKey) { Utilities.RunOnUIThread(new Runnable() { @Override public void run() { ArrayList<String> arr = memCache.getFilterKeys(oldKey); if (arr != null) { for (String filter : arr) { performReplace(oldKey + "@" + filter, newKey + "@" + filter); } } else { performReplace(oldKey, newKey); } } }); } public void loadImage(final String url, final ImageReceiver imageView, final String filter, final boolean cancel) { loadImage(null, url, imageView, filter, cancel, 0); } public void loadImage(final TLRPC.FileLocation url, final ImageReceiver imageView, final String filter, final boolean cancel) { loadImage(url, null, imageView, filter, cancel, 0); } public void loadImage(final TLRPC.FileLocation url, final ImageReceiver imageView, final String filter, final boolean cancel, final int size) { loadImage(url, null, imageView, filter, cancel, size); } public void loadImage(final TLRPC.FileLocation url, final String httpUrl, final ImageReceiver imageView, final String filter, final boolean cancel, final int size) { if ((url == null && httpUrl == null) || imageView == null || (url != null && !(url instanceof TLRPC.TL_fileLocation) && !(url instanceof TLRPC.TL_fileEncryptedLocation))) { return; } fileLoaderQueue.postRunnable(new Runnable() { @Override public void run() { String key; String fileName = null; if (httpUrl != null) { key = Utilities.MD5(httpUrl); } else { key = url.volume_id + "_" + url.local_id; fileName = key + ".jpg"; } if (filter != null) { key += "@" + filter; } Integer TAG = imageView.TAG; if (TAG == null) { TAG = imageView.TAG = lastImageNum; lastImageNum++; if (lastImageNum == Integer.MAX_VALUE) lastImageNum = 0; } boolean added = false; boolean addToByKeys = true; CacheImage alreadyLoadingImage = imageLoading.get(key); if (cancel) { CacheImage ei = imageLoadingByKeys.get(TAG); if (ei != null) { if (ei != alreadyLoadingImage) { ei.removeImageView(imageView); if (ei.imageViewArray.size() == 0) { checkOperationsAndClear(ei.loadOperation); ei.cancelAndClear(); imageLoading.remove(ei.key); } } else { addToByKeys = false; added = true; } } } if (alreadyLoadingImage != null && addToByKeys) { alreadyLoadingImage.addImageView(imageView); imageLoadingByKeys.put(TAG, alreadyLoadingImage); added = true; } if (!added) { final CacheImage img = new CacheImage(); img.key = key; img.addImageView(imageView); imageLoadingByKeys.put(TAG, img); imageLoading.put(key, img); final String arg2 = key; final String arg3 = fileName; FileLoadOperation loadOperation; if (httpUrl != null) { loadOperation = new FileLoadOperation(httpUrl); } else { loadOperation = new FileLoadOperation(url); } loadOperation.totalBytesCount = size; loadOperation.filter = filter; loadOperation.delegate = new FileLoadOperation.FileLoadOperationDelegate() { @Override public void didFinishLoadingFile(final FileLoadOperation operation) { if (operation.totalBytesCount != 0) { fileProgresses.remove(arg3); } fileLoaderQueue.postRunnable(new Runnable() { @Override public void run() { if (arg3 != null) { loadOperationPaths.remove(arg3); } for (ImageReceiver v : img.imageViewArray) { imageLoadingByKeys.remove(v.TAG); } checkOperationsAndClear(img.loadOperation); imageLoading.remove(arg2); } }); Utilities.RunOnUIThread(new Runnable() { @Override public void run() { img.callAndClear(operation.image); if (operation.image != null && memCache.get(arg2) == null) { memCache.put(arg2, operation.image); } NotificationCenter.getInstance().postNotificationName(FileDidLoaded, arg3); } }); } @Override public void didFailedLoadingFile(final FileLoadOperation operation) { fileLoaderQueue.postRunnable(new Runnable() { @Override public void run() { if (arg3 != null) { loadOperationPaths.remove(arg3); } for (ImageReceiver view : img.imageViewArray) { imageLoadingByKeys.remove(view.TAG); imageLoading.remove(arg2); checkOperationsAndClear(operation); } } }); Utilities.RunOnUIThread(new Runnable() { @Override public void run() { img.callAndClear(null); } }); if (operation.totalBytesCount != 0) { final String arg1 = operation.location.volume_id + "_" + operation.location.local_id + ".jpg"; fileProgresses.remove(arg1); if (operation.state != 2) { Utilities.RunOnUIThread(new Runnable() { @Override public void run() { NotificationCenter.getInstance().postNotificationName(FileDidFailedLoad, arg1); } }); } } } @Override public void didChangedLoadProgress(FileLoadOperation operation, final float progress) { if (operation.totalBytesCount != 0) { final String arg1 = operation.location.volume_id + "_" + operation.location.local_id + ".jpg"; if (operation.state != 2) { fileProgresses.put(arg1, progress); } long currentTime = System.currentTimeMillis(); if (lastProgressUpdateTime == 0 || lastProgressUpdateTime < currentTime - 50) { lastProgressUpdateTime = currentTime; Utilities.RunOnUIThread(new Runnable() { @Override public void run() { NotificationCenter.getInstance().postNotificationName(FileLoadProgressChanged, arg1, progress); } }); } } } }; img.loadOperation = loadOperation; if (runningOperation.size() < maxConcurentLoadingOpertaionsCount) { loadOperation.start(); runningOperation.add(loadOperation); } else { operationsQueue.add(loadOperation); } if (fileName != null) { loadOperationPaths.put(fileName, loadOperation); } } } }); } private void checkOperationsAndClear(FileLoadOperation operation) { operationsQueue.remove(operation); runningOperation.remove(operation); while (runningOperation.size() < maxConcurentLoadingOpertaionsCount && operationsQueue.size() != 0) { FileLoadOperation loadOperation = operationsQueue.poll(); runningOperation.add(loadOperation); loadOperation.start(); } } public static Bitmap loadBitmap(String path, Uri uri, float maxWidth, float maxHeight) { BitmapFactory.Options bmOptions = new BitmapFactory.Options(); bmOptions.inJustDecodeBounds = true; FileDescriptor fileDescriptor = null; ParcelFileDescriptor parcelFD = null; if (path == null && uri != null && uri.getScheme() != null) { String imageFilePath = null; if (uri.getScheme().contains("file")) { path = uri.getPath(); } else { try { path = Utilities.getPath(uri); } catch (Exception e) { FileLog.e("tmessages", e); } } } if (path != null) { BitmapFactory.decodeFile(path, bmOptions); } else if (uri != null) { boolean error = false; try { parcelFD = ApplicationLoader.applicationContext.getContentResolver().openFileDescriptor(uri, "r"); fileDescriptor = parcelFD.getFileDescriptor(); BitmapFactory.decodeFileDescriptor(fileDescriptor, null, bmOptions); } catch (Exception e) { FileLog.e("tmessages", e); try { if (parcelFD != null) { parcelFD.close(); } } catch (Exception e2) { FileLog.e("tmessages", e2); } return null; } } float photoW = bmOptions.outWidth; float photoH = bmOptions.outHeight; float scaleFactor = Math.max(photoW / maxWidth, photoH / maxHeight); if (scaleFactor < 1) { scaleFactor = 1; } bmOptions.inJustDecodeBounds = false; bmOptions.inSampleSize = (int)scaleFactor; String exifPath = null; if (path != null) { exifPath = path; } else if (uri != null) { exifPath = Utilities.getPath(uri); } Matrix matrix = null; if (exifPath != null) { ExifInterface exif; try { exif = new ExifInterface(exifPath); int orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, 1); matrix = new Matrix(); switch (orientation) { case ExifInterface.ORIENTATION_ROTATE_90: matrix.postRotate(90); break; case ExifInterface.ORIENTATION_ROTATE_180: matrix.postRotate(180); break; case ExifInterface.ORIENTATION_ROTATE_270: matrix.postRotate(270); break; } } catch (Exception e) { FileLog.e("tmessages", e); } } Bitmap b = null; if (path != null) { try { b = BitmapFactory.decodeFile(path, bmOptions); if (b != null) { b = Bitmap.createBitmap(b, 0, 0, b.getWidth(), b.getHeight(), matrix, true); } } catch (Exception e) { FileLog.e("tmessages", e); FileLoader.getInstance().memCache.evictAll(); if (b == null) { b = BitmapFactory.decodeFile(path, bmOptions); } if (b != null) { b = Bitmap.createBitmap(b, 0, 0, b.getWidth(), b.getHeight(), matrix, true); } } } else if (uri != null) { try { b = BitmapFactory.decodeFileDescriptor(fileDescriptor, null, bmOptions); if (b != null) { b = Bitmap.createBitmap(b, 0, 0, b.getWidth(), b.getHeight(), matrix, true); } } catch (Exception e) { FileLog.e("tmessages", e); } finally { try { if (parcelFD != null) { parcelFD.close(); } } catch (Exception e) { FileLog.e("tmessages", e); } } } return b; } public static TLRPC.PhotoSize scaleAndSaveImage(Bitmap bitmap, float maxWidth, float maxHeight, int quality, boolean cache) { if (bitmap == null) { return null; } float photoW = bitmap.getWidth(); float photoH = bitmap.getHeight(); if (photoW == 0 || photoH == 0) { return null; } float scaleFactor = Math.max(photoW / maxWidth, photoH / maxHeight); Bitmap scaledBitmap = Bitmap.createScaledBitmap(bitmap, (int)(photoW / scaleFactor), (int)(photoH / scaleFactor), true); TLRPC.TL_fileLocation location = new TLRPC.TL_fileLocation(); location.volume_id = Integer.MIN_VALUE; location.dc_id = Integer.MIN_VALUE; location.local_id = UserConfig.lastLocalId; UserConfig.lastLocalId--; TLRPC.PhotoSize size; if (!cache) { size = new TLRPC.TL_photoSize(); } else { size = new TLRPC.TL_photoCachedSize(); } size.location = location; size.w = (int)(photoW / scaleFactor); size.h = (int)(photoH / scaleFactor); try { if (!cache) { String fileName = location.volume_id + "_" + location.local_id + ".jpg"; final File cacheFile = new File(Utilities.getCacheDir(), fileName); FileOutputStream stream = new FileOutputStream(cacheFile); scaledBitmap.compress(Bitmap.CompressFormat.JPEG, quality, stream); size.size = (int)stream.getChannel().size(); } else { ByteArrayOutputStream stream = new ByteArrayOutputStream(); scaledBitmap.compress(Bitmap.CompressFormat.JPEG, quality, stream); size.bytes = stream.toByteArray(); size.size = size.bytes.length; } if (Build.VERSION.SDK_INT < 11) { if (scaledBitmap != bitmap) { scaledBitmap.recycle(); } } return size; } catch (Exception e) { return null; } } }
gpl-2.0
KodekPL/jWorldProtector
src/jcraft/wp/ProtectorPlugin.java
3485
package jcraft.wp; import java.io.File; import java.util.logging.Level; import jcraft.wp.commands.ProtectorCommands; import jcraft.wp.commands.RegionCommands; import jcraft.wp.config.PluginConfig; import jcraft.wp.listener.BlockListener; import jcraft.wp.listener.EntityListener; import jcraft.wp.listener.PlayerListener; import jcraft.wp.listener.RegionListener; import jcraft.wp.listener.WorldListener; import jcraft.wp.region.flag.RegionFlagManager; import jcraft.wp.worldedit.WorldEditHandler; import org.bukkit.Location; import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; public class ProtectorPlugin extends JavaPlugin { public static File CONFIG_FILE, WORLDS_DIR, REGIONS_DIR; private static ProtectorPlugin plugin; private static PluginConfig pluginConfig; private static WorldsManager worldsManager; private static RegionFlagManager flagsManager; private static WorldEditHandler worldEditHandler; @Override public void onEnable() { plugin = this; CONFIG_FILE = new File(this.getDataFolder(), "config.yml"); WORLDS_DIR = new File(this.getDataFolder(), "worlds"); REGIONS_DIR = new File(this.getDataFolder(), "regions"); this.getDataFolder().mkdirs(); WORLDS_DIR.mkdirs(); REGIONS_DIR.mkdirs(); pluginConfig = new PluginConfig(CONFIG_FILE); pluginConfig.load(); pluginConfig.save(); flagsManager = new RegionFlagManager(); worldsManager = new WorldsManager(); worldsManager.loadWorlds(); worldEditHandler = new WorldEditHandler(this.getServer().getPluginManager().getPlugin("WorldEdit")); this.getServer().getPluginManager().registerEvents(new WorldListener(), this); this.getServer().getPluginManager().registerEvents(new BlockListener(), this); this.getServer().getPluginManager().registerEvents(new EntityListener(), this); this.getServer().getPluginManager().registerEvents(new PlayerListener(), this); this.getServer().getPluginManager().registerEvents(new RegionListener(), this); this.getCommand("worldprotector").setExecutor(new ProtectorCommands()); this.getCommand("region").setExecutor(new RegionCommands()); } public static ProtectorPlugin getPlugin() { return plugin; } public static PluginConfig getPluginConfig() { return pluginConfig; } public static WorldsManager getWorldsManager() { return worldsManager; } public static RegionFlagManager getRegionFlagManager() { return flagsManager; } public static WorldEditHandler getWorldEdit() { return worldEditHandler; } public static void log(Level level, String message) { plugin.getLogger().log(level, message); } public static Player getOnlinePlayer(String name) { for (Player player : getPlugin().getServer().getOnlinePlayers()) { if (player.getName().equalsIgnoreCase(name)) { return player; } } return null; } public boolean canInteract(Player player, Location location) { final WorldInstance config = ProtectorPlugin.getWorldsManager().getWorldInstance(location.getWorld().getName()); if (config == null) { return true; } return config.getRegionContainer().canInteract(player, location.getX(), location.getY(), location.getZ()); } }
gpl-2.0
generalelectrix/wiggles
view/public/core/NewShow.js
769
import { view as view_1, update as update_1, initModel as initModel_1 } from "./SimpleEditor"; import { errorIfEmpty } from "./Util"; import { InputType } from "./Bootstrap"; import { ResponseFilter, ServerCommand } from "./Types"; export function initModel() { return initModel_1("New", "Name for new show:", errorIfEmpty, InputType.Text); } export function update() { return function (message) { return function (model) { return update_1(message, model); }; }; } export function view(model, onComplete, dispatch, dispatchServer) { var onOk = function onOk(name) { var command = new ServerCommand("NewShow", [name]); dispatchServer([new ResponseFilter("All", []), command]); }; return view_1("", model, onOk, onComplete, dispatch); }
gpl-2.0
joansmith/openmicroscopy
components/tools/OmeroWeb/omeroweb/webgateway/urls.py
15598
#!/usr/bin/env python # -*- coding: utf-8 -*- # # webgateway/urls.py - django application url handling configuration # # Copyright (c) 2007, 2008, 2009 Glencoe Software, Inc. All rights reserved. # # This software is distributed under the terms described by the LICENCE file # you can find at the root of the distribution bundle, which states you are # free to use it only for non commercial purposes. # If the file is missing please request a copy by contacting # jason@glencoesoftware.com. # # Author: Carlos Neves <carlos(at)glencoesoftware.com> from django.conf.urls import url, patterns webgateway = url(r'^$', 'webgateway.views.index', name="webgateway") """ Returns a main prefix """ annotations = url(r'^annotations/(?P<objtype>[\w.]+)/(?P<objid>\d+)/$', 'webgateway.views.annotations', name="webgateway_annotations") """ Retrieve annotations for object specified by object type and identifier, optionally traversing object model graph. """ table_query = url(r'^table/(?P<fileid>\d+)/query/$', 'webgateway.views.table_query', name="webgateway_table_query") """ Query a table specified by fileid """ object_table_query = url( r'^table/(?P<objtype>[\w.]+)/(?P<objid>\d+)/query/$', 'webgateway.views.object_table_query', name="webgateway_object_table_query") """ Query bulk annotations table attached to an object specified by object type and identifier, optionally traversing object model graph. """ render_image = ( r'^render_image/(?P<iid>[0-9]+)/(?:(?P<z>[0-9]+)/)?(?:(?P<t>[0-9]+)/)?$', 'webgateway.views.render_image') """ Returns a jpeg of the OMERO image. See L{views.render_image}. Rendering settings can be specified in the request parameters. See L{views.getImgDetailsFromReq} for details. Params in render_image/<iid>/<z>/<t>/ are: - iid: Image ID - z: Z index - t: T index """ render_image_region = ( r'^render_image_region/(?P<iid>[0-9]+)/(?P<z>[0-9]+)/(?P<t>[0-9]+)/$', 'webgateway.views.render_image_region') """ Returns a jpeg of the OMERO image, rendering only a region specified in query string as region=x,y,width,height. E.g. region=0,512,256,256 See L{views.render_image_region}. Rendering settings can be specified in the request parameters. Params in render_image/<iid>/<z>/<t>/ are: - iid: Image ID - z: Z index - t: T index """ render_split_channel = ( r'^render_split_channel/(?P<iid>[0-9]+)/(?P<z>[0-9]+)/(?P<t>[0-9]+)/$', 'webgateway.views.render_split_channel') """ Returns a jpeg of OMERO Image with channels split into different panes in a grid. See L{views.render_split_channel}. Rendering settings can be specified in the request parameters (as above). Params in render_split_channel/<iid>/<z>/<t> are: - iid: Image ID - z: Z index - t: T index """ render_row_plot = ( r'^render_row_plot/(?P<iid>[0-9]+)/(?P<z>[0-9]+)/(?P<t>[0-9]+)/' '(?P<y>[0-9]+)/(?:(?P<w>[0-9]+)/)?$', 'webgateway.views.render_row_plot') """ Returns a gif graph of pixel values for a row of an image plane. See L{views.render_row_plot}. Channels can be turned on/off using request. E.g. c=-1,2,-3,-4 Params in render_row_plot/<iid>/<z>/<t>/<y>/<w> are: - iid: Image ID - z: Z index - t: T index - y: Y position of pixel row - w: Optional line width of plot """ render_col_plot = ( r'^render_col_plot/(?P<iid>[0-9]+)/(?P<z>[0-9]+)/(?P<t>[0-9]+)' '/(?P<x>[0-9]+)/(?:(?P<w>[0-9]+)/)?$', 'webgateway.views.render_col_plot') """ Returns a gif graph of pixel values for a column of an image plane. See L{views.render_col_plot}. Channels can be turned on/off using request. E.g. c=-1,2,-3,-4 Params in render_col_plot/<iid>/<z>/<t>/<x>/<w> are: - iid: Image ID - z: Z index - t: T index - x: X position of pixel column - w: Optional line width of plot """ render_thumbnail = url( r'^render_thumbnail/(?P<iid>[0-9]+)' '/(?:(?P<w>[0-9]+)/)?(?:(?P<h>[0-9]+)/)?$', 'webgateway.views.render_thumbnail') """ Returns a thumbnail jpeg of the OMERO Image, optionally scaled to max-width and max-height. See L{views.render_thumbnail}. Uses current rendering settings. Query string can be used to specify Z or T section. E.g. ?z=10. Params in render_thumbnail/<iid>/<w>/<h> are: - iid: Image ID - w: Optional max width - h: Optional max height """ render_roi_thumbnail = ( r'^render_roi_thumbnail/(?P<roiId>[0-9]+)/?$', 'webgateway.views.render_roi_thumbnail') """ Returns a thumbnail jpeg of the OMERO ROI. See L{views.render_roi_thumbnail}. Uses current rendering settings. """ render_shape_thumbnail = ( r'^render_shape_thumbnail/(?P<shapeId>[0-9]+)/?$', 'webgateway.views.render_shape_thumbnail') """ Returns a thumbnail jpeg of the OMERO Shape. See L{views.render_shape_thumbnail}. Uses current rendering settings. """ render_birds_eye_view = ( r'^render_birds_eye_view/(?P<iid>[0-9]+)/(?:(?P<size>[0-9]+)/)?$', 'webgateway.views.render_birds_eye_view') """ Returns a bird's eye view JPEG of the OMERO Image. See L{views.render_birds_eye_view}. Uses current rendering settings. Params in render_birds_eye_view/<iid>/ are: - iid: Image ID - size: Maximum size of the longest side of the resulting bird's eye view. """ render_ome_tiff = (r'^render_ome_tiff/(?P<ctx>[^/]+)/(?P<cid>[0-9]+)/$', 'webgateway.views.render_ome_tiff') """ Generates an OME-TIFF of an Image (or zip for multiple OME-TIFFs) and returns the file or redirects to a temp file location. See L{views.render_ome_tiff} Params in render_ome_tiff/<ctx>/<cid> are: - ctx: The container context. 'p' for Project, 'd' for Dataset or 'i' Image. - cid: ID of container. """ render_movie = ( r'^render_movie/(?P<iid>[0-9]+)/(?P<axis>[zt])/(?P<pos>[0-9]+)/$', 'webgateway.views.render_movie') """ Generates a movie file from the image, spanning Z or T frames. See L{views.render_movie} Returns the file or redirects to temp file location. Params in render_movie/<iid>/<axis>/<pos> are: - iid: Image ID - axis: 'z' or 't' dimension that movie plays - pos: The T index (for 'z' movie) or Z index (for 't' movie) """ # json methods... listProjects_json = (r'^proj/list/$', 'webgateway.views.listProjects_json') """ json method: returning list of all projects available to current user. See L{views.listProjects_json} . List of E.g. {"description": "", "id": 651, "name": "spim"} """ projectDetail_json = (r'^proj/(?P<pid>[0-9]+)/detail/$', 'webgateway.views.projectDetail_json') """ json method: returns details of specified Project. See L{views.projectDetail_json}. Returns E.g {"description": "", "type": "Project", "id": 651, "name": "spim"} - webgateway/proj/<pid>/detail params are: - pid: Project ID """ listDatasets_json = (r'^proj/(?P<pid>[0-9]+)/children/$', 'webgateway.views.listDatasets_json') """ json method: returns list of Datasets belonging to specified Project. See L{views.listDatasets_json}. Returns E.g list of {"child_count": 4, "description": "", "type": "Dataset", "id": 901, "name": "example"} - webgateway/proj/<pid>/children params are: - pid: Project ID """ datasetDetail_json = (r'^dataset/(?P<did>[0-9]+)/detail/$', 'webgateway.views.datasetDetail_json') """ json method: returns details of specified Dataset. See L{views.datasetDetail_json}. Returns E.g {"description": "", "type": "Dataset", "id": 901, "name": "example"} - webgateway/dataset/<did>/detail params are: - did: Dataset ID """ webgateway_listimages_json = url( r'^dataset/(?P<did>[0-9]+)/children/$', 'webgateway.views.listImages_json', name="webgateway_listimages_json") """ json method: returns list of Images belonging to specified Dataset. See L{views.listImages_json}. Returns E.g list of {"description": "", "author": "Will Moore", "date": 1291325060.0, "thumb_url": "/webgateway/render_thumbnail/4701/", "type": "Image", "id": 4701, "name": "spim.png"} - webgateway/dataset/<did>/children params are: - did: Dataset ID - request variables: - thumbUrlPrefix: view key whose reverse url is to be used as prefix for thumb_url instead of default webgateway.views.render_thumbnail - tiled: if set with anything other than an empty string will add information on whether each image is tiled on this server """ webgateway_listwellimages_json = url( r'^well/(?P<did>[0-9]+)/children/$', 'webgateway.views.listWellImages_json', name="webgateway_listwellimages_json") """ json method: returns list of Images belonging to specified Well. See L{views.listWellImages_json}. Returns E.g list of {"description": "", "author": "Will Moore", "date": 1291325060.0, "thumb_url": "/webgateway/render_thumbnail/4701/", "type": "Image", "id": 4701, "name": "spim.png"} - webgateway/well/<did>/children params are: - did: Well ID """ webgateway_plategrid_json = url( r'^plate/(?P<pid>[0-9]+)/(?:(?P<field>[0-9]+)/)?$', 'webgateway.views.plateGrid_json', name="webgateway_plategrid_json") """ """ imageData_json = (r'^imgData/(?P<iid>[0-9]+)/(?:(?P<key>[^/]+)/)?$', 'webgateway.views.imageData_json') """ json method: returns details of specified Image. See L{views.imageData_json}. Returns E.g {"description": "", "type": "Dataset", "id": 901, "name": "example"} - webgateway/imgData/<iid>/<key> params are: - did: Dataset ID - key: Optional key of selected attributes to return. E.g. meta, pixel_range, rdefs, split_channel, size etc """ wellData_json = url(r'^wellData/(?P<wid>[0-9]+)/$', 'webgateway.views.wellData_json', name='webgateway_wellData_json') """ json method: returns details of specified Well. See L{views.wellData_json}. - webgateway/wellData/<wid>/ params are: - wid: Well ID """ webgateway_search_json = url(r'^search/$', 'webgateway.views.search_json', name="webgateway_search_json") """ json method: returns search results. All parameters in request. See L{views.search_json} """ get_rois_json = url(r'^get_rois_json/(?P<imageId>[0-9]+)/$', 'webgateway.views.get_rois_json', name='webgateway_get_rois_json') """ gets all the ROIs for an Image as json. Image-ID is request: imageId=123 [{'id':123, 'shapes':[{'type':'Rectangle', 'theZ':5, 'theT':0, 'x':250, 'y':100, 'width':10 'height':45} ] """ get_shape_json = url( r'^get_shape_json/(?P<roiId>[0-9]+)/(?P<shapeId>[0-9]+)/$', 'webgateway.views.get_shape_json', name='webgateway_get_shape_json') """ gets a Shape as json. ROI-ID, Shape-ID is request: roiId=123 and shapeId=123 {'type':'Rectangle', 'theZ':5, 'theT':0, 'x':250, 'y':100, 'width':10, 'height':45} """ full_viewer = url(r'^img_detail/(?P<iid>[0-9]+)/$', "webgateway.views.full_viewer", name="webgateway_full_viewer") """ Returns html page displaying full image viewer and image details, rendering settings etc. See L{views.full_viewer}. - webgateway/img_detail/<iid>/ params are: - iid: Image ID. """ save_image_rdef_json = (r'^saveImgRDef/(?P<iid>[0-9]+)/$', 'webgateway.views.save_image_rdef_json') """ Saves rendering definition (from request parameters) on the image. See L{views.save_image_rdef_json}. For rendering parameters, see L{views.getImgDetailsFromReq} for details. Returns 'true' if worked OK. - webgateway/saveImgRDef/<iid>/ params are: - iid: Image ID. """ get_image_rdef_json = (r'^getImgRDef/$', 'webgateway.views.get_image_rdef_json') """ Gets rendering definition from the 'session' if saved. Returns json dict of 'c', 'm', 'z', 't'. """ list_compatible_imgs_json = (r'^compatImgRDef/(?P<iid>[0-9]+)/$', 'webgateway.views.list_compatible_imgs_json') """ json method: returns list of IDs for images that have channels compatible with the specified image, such that rendering settings can be copied from the image to those returned. Images are selected from the same project that the specified image is in. - webgateway/compatImgRDef/<iid>/ params are: - iid: Image ID. """ copy_image_rdef_json = (r'^copyImgRDef/$', 'webgateway.views.copy_image_rdef_json') """ Copy the rendering settings from one image to a list of images, specified in request by 'fromid' and list of 'toids'. See L{views.copy_image_rdef_json} """ reset_rdef_json = url(r'^resetRDef/$', 'webgateway.views.reset_rdef_json', name="reset_rdef_json") """ Reset the images within specified objects to their rendering settings at import time" Objects defined in request by E.g. totype=dataset&toids=1&toids=2 """ reset_owners_rdef_json = url(r'^applyOwnersRDef/$', 'webgateway.views.reset_rdef_json', {'toOwners': True}, name="reset_owners_rdef_json") """ Apply the owner's rendering settings to the specified objects. Objects defined in request by E.g. totype=dataset&toids=1&toids=2 """ webgateway_su = url(r'^su/(?P<user>[^/]+)/$', 'webgateway.views.su', name="webgateway_su") """ Admin method to switch to the specified user, identified by username: <user> Returns 'true' if switch went OK. """ download_as = url(r'^download_as/(?:(?P<iid>[0-9]+)/)?$', 'webgateway.views.download_as', name="download_as") archived_files = url(r'^archived_files/download/(?:(?P<iid>[0-9]+)/)?$', 'webgateway.views.archived_files', name="archived_files") """ This url will download the Original Image File(s) archived at import time. If it's a single file, this will be downloaded directly. For multiple files, they are assembled into a zip file on the fly, and this is downloaded. """ original_file_paths = url(r'^original_file_paths/(?P<iid>[0-9]+)/$', 'webgateway.views.original_file_paths', name="original_file_paths") """ Get a json dict of original file paths. 'repo' is a list of path/name strings for original files in managed repo 'client' is a list of paths for original files on the client when imported """ urlpatterns = patterns( '', webgateway, render_image, render_image_region, render_split_channel, render_row_plot, render_col_plot, render_roi_thumbnail, render_shape_thumbnail, render_thumbnail, render_birds_eye_view, render_ome_tiff, render_movie, # Template views # JSON methods listProjects_json, projectDetail_json, listDatasets_json, datasetDetail_json, webgateway_listimages_json, webgateway_listwellimages_json, webgateway_plategrid_json, imageData_json, wellData_json, webgateway_search_json, get_rois_json, get_shape_json, # image viewer full_viewer, # rendering def methods save_image_rdef_json, get_image_rdef_json, list_compatible_imgs_json, copy_image_rdef_json, reset_rdef_json, reset_owners_rdef_json, download_as, # download archived_files archived_files, original_file_paths, # switch user webgateway_su, # bulk annotations annotations, table_query, object_table_query, # Debug stuff )
gpl-2.0
drenteria/SistemaMigranha
src/main/java/edu/uniandes/ecos/arquisoft/view/ConsoleView.java
1297
package edu.uniandes.ecos.arquisoft.view; import java.sql.Date; import edu.uniandes.ecos.arquisoft.model.Genero; import edu.uniandes.ecos.arquisoft.model.Paciente; import edu.uniandes.ecos.arquisoft.model.TipoIdentificacion; import edu.uniandes.ecos.arquisoft.service.GestionPacientes; public class ConsoleView { public static void main(String[] args) { try{ Paciente elPaciente = new Paciente(); elPaciente.setNombresPaciente("Juan"); elPaciente.setApellidosPaciente("Renteria"); elPaciente.setDocIdentificacion(Long.valueOf("1028489628")); elPaciente.setDireccionResidencia("Kr 78K 40S 93 In 15 Ap 203"); elPaciente.setTelefonoFijo("+5714537964"); elPaciente.setTelefonoMovil("+573012649514"); elPaciente.setFechaNacimiento(Date.valueOf("2009-03-25")); elPaciente.setGeneroPaciente(Genero.MASCULINO); elPaciente.setTipoIdPaciente(TipoIdentificacion.NUIP); elPaciente.setFechaNacimiento(Date.valueOf("1985-05-07")); elPaciente.setGeneroPaciente(Genero.MASCULINO); elPaciente.setTipoIdPaciente(TipoIdentificacion.CEDULA_CIUDADANIA); GestionPacientes gestorPaciente = new GestionPacientes(); gestorPaciente.registrarPaciente(elPaciente); System.exit(0); } catch (Exception ex){ ex.printStackTrace(); System.exit(1); } } }
gpl-2.0
nextgis/nextgislogger
app/src/main/java/com/nextgis/logger/UI/fragment/NGIDSettingsFragment.java
2388
/* * ***************************************************************************** * Project: NextGIS Logger * Purpose: Productive data logger for Android * Author: Stanislav Petriakov, becomeglory@gmail.com * ***************************************************************************** * Copyright © 2017 NextGIS * * 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 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * ***************************************************************************** */ package com.nextgis.logger.ui.fragment; import android.Manifest; import android.os.Bundle; import android.preference.PreferenceFragment; import com.nextgis.logger.R; import com.nextgis.logger.ui.activity.NGIDSettingsActivity; import com.nextgis.logger.ui.activity.ProgressBarActivity; import com.nextgis.logger.util.ApkDownloader; public class NGIDSettingsFragment extends PreferenceFragment { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (getArguments() != null && getArguments().containsKey("updater")) { if (ProgressBarActivity.hasStoragePermissions(getActivity())) ApkDownloader.check(getActivity(), true); else { String[] permissions = new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}; ProgressBarActivity.requestPermissions(getActivity(), R.string.permissions_title, R.string.permissions_storage, ProgressBarActivity.PERMISSION_STORAGE, permissions); } return; } addPreferencesFromResource(R.xml.preferences_ngid); NGIDSettingsActivity activity = (NGIDSettingsActivity) getActivity(); activity.fillAccountPreferences(getPreferenceScreen()); } }
gpl-2.0
nabnut/zabbix2.0-cookies
frontends/php/include/events.inc.php
12098
<?php /* ** Zabbix ** Copyright (C) 2001-2013 Zabbix SIA ** ** 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 of the License, or ** (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ function event_source2str($sourceid) { switch ($sourceid) { case EVENT_SOURCE_TRIGGERS: return _('Triggers'); case EVENT_SOURCE_DISCOVERY: return _('Discovery'); default: return _('Unknown'); } } function get_tr_event_by_eventid($eventid) { $sql = 'SELECT e.*,t.triggerid,t.description,t.expression,t.priority,t.status,t.type'. ' FROM events e,triggers t'. ' WHERE e.eventid='.$eventid. ' AND e.object='.EVENT_OBJECT_TRIGGER. ' AND t.triggerid=e.objectid'; return DBfetch(DBselect($sql)); } function get_events_unacknowledged($db_element, $value_trigger = null, $value_event = null, $ack = false) { $elements = array('hosts' => array(), 'hosts_groups' => array(), 'triggers' => array()); get_map_elements($db_element, $elements); if (empty($elements['hosts_groups']) && empty($elements['hosts']) && empty($elements['triggers'])) { return 0; } $config = select_config(); $options = array( 'nodeids' => get_current_nodeid(), 'output' => API_OUTPUT_SHORTEN, 'monitored' => 1, 'skipDependent' => 1, 'limit' => $config['search_limit'] + 1 ); if (!is_null($value_trigger)) { $options['filter'] = array('value' => $value_trigger); } if (!empty($elements['hosts_groups'])) { $options['groupids'] = array_unique($elements['hosts_groups']); } if (!empty($elements['hosts'])) { $options['hostids'] = array_unique($elements['hosts']); } if (!empty($elements['triggers'])) { $options['triggerids'] = array_unique($elements['triggers']); } $triggerids = API::Trigger()->get($options); return API::Event()->get(array( 'countOutput' => 1, 'triggerids' => zbx_objectValues($triggerids, 'triggerid'), 'filter' => array( 'value_changed' => TRIGGER_VALUE_CHANGED_YES, 'value' => is_null($value_event) ? array(TRIGGER_VALUE_TRUE, TRIGGER_VALUE_FALSE) : $value_event, 'acknowledged' => $ack ? 1 : 0 ), 'object' => EVENT_OBJECT_TRIGGER, 'nopermissions' => true )); } function get_next_event($currentEvent, array $eventList = array(), $showUnknown = false) { $nextEvent = false; foreach ($eventList as $event) { // check only the events belonging to the same object // find the event with the smallest eventid but greater than the current event id if ($event['object'] == $currentEvent['object'] && bccomp($event['objectid'], $currentEvent['objectid']) == 0 && (bccomp($event['eventid'], $currentEvent['eventid']) === 1 && (!$nextEvent || bccomp($event['eventid'], $nextEvent['eventid']) === -1))) { $nextEvent = $event; } } if ($nextEvent) { return $nextEvent; } $sql = 'SELECT e.*'. ' FROM events e'. ' WHERE e.objectid='.$currentEvent['objectid']. ' AND e.eventid>'.$currentEvent['eventid']. ' AND e.object='.$currentEvent['object']. ($showUnknown ? '' : ' AND e.value_changed='.TRIGGER_VALUE_CHANGED_YES). ' ORDER BY e.object,e.objectid,e.eventid'; return DBfetch(DBselect($sql, 1)); } function make_event_details($event, $trigger) { $config = select_config(); $table = new CTableInfo(); $table->addRow(array(_('Event'), CEventHelper::expandDescription(array_merge($trigger, $event)))); $table->addRow(array(_('Time'), zbx_date2str(_('d M Y H:i:s'), $event['clock']))); if ($config['event_ack_enable']) { // to make resulting link not have hint with acknowledges $event['acknowledges'] = count($event['acknowledges']); $ack = getEventAckState($event, true); $table->addRow(array(_('Acknowledged'), $ack)); } return $table; } function make_small_eventlist($startEvent) { $config = select_config(); $table = new CTableInfo(); $table->setHeader(array( _('Time'), _('Status'), _('Duration'), _('Age'), $config['event_ack_enable'] ? _('Ack') : null, // if we need to chow acks _('Actions') )); $clock = $startEvent['clock']; $options = array( 'triggerids' => $startEvent['objectid'], 'eventid_till' => $startEvent['eventid'], 'output' => API_OUTPUT_EXTEND, 'select_acknowledges' => API_OUTPUT_COUNT, 'sortfield' => 'eventid', 'sortorder' => ZBX_SORT_DOWN, 'limit' => 20 ); $events = API::Event()->get($options); $sortFields = array( array('field' => 'clock', 'order' => ZBX_SORT_DOWN), array('field' => 'eventid', 'order' => ZBX_SORT_DOWN) ); CArrayHelper::sort($events, $sortFields); $actions = getEventActionsStatHints(zbx_objectValues($events, 'eventid')); foreach ($events as $event) { $lclock = $clock; $duration = zbx_date2age($lclock, $event['clock']); $clock = $event['clock']; if (bccomp($startEvent['eventid'],$event['eventid']) == 0 && $nextevent = get_next_event($event, $events, true)) { $duration = zbx_date2age($nextevent['clock'], $clock); } elseif (bccomp($startEvent['eventid'], $event['eventid']) == 0) { $duration = zbx_date2age($clock); } $eventStatusSpan = new CSpan(trigger_value2str($event['value'])); // add colors and blinking to span depending on configuration and trigger parameters addTriggerValueStyle( $eventStatusSpan, $event['value'], $event['clock'], $event['acknowledged'] ); $ack = getEventAckState($event, true); $table->addRow(array( new CLink( zbx_date2str(_('d M Y H:i:s'), $event['clock']), 'tr_events.php?triggerid='.$event['objectid'].'&eventid='.$event['eventid'], 'action' ), $eventStatusSpan, $duration, zbx_date2age($event['clock']), $config['event_ack_enable'] ? $ack : null, isset($actions[$event['eventid']]) ? $actions[$event['eventid']] : SPACE )); } return $table; } function make_popup_eventlist($triggerId, $eventId) { $config = select_config(); $table = new CTableInfo(); $table->setAttribute('style', 'width: 400px;'); // if acknowledges are turned on, we show 'ack' column if ($config['event_ack_enable']) { $table->setHeader(array(_('Time'), _('Status'), _('Duration'), _('Age'), _('Ack'))); } else { $table->setHeader(array(_('Time'), _('Status'), _('Duration'), _('Age'))); } $events = API::Event()->get(array( 'output' => API_OUTPUT_EXTEND, 'triggerids' => $triggerId, 'eventid_till' => $eventId, 'filter' => array( 'object' => EVENT_OBJECT_TRIGGER, 'value_changed' => TRIGGER_VALUE_CHANGED_YES ), 'nopermissions' => true, 'select_acknowledges' => API_OUTPUT_COUNT, 'sortfield' => 'eventid', 'sortorder' => ZBX_SORT_DOWN, 'limit' => ZBX_WIDGET_ROWS )); $lclock = time(); foreach ($events as $event) { $duration = zbx_date2age($lclock, $event['clock']); $lclock = $event['clock']; $eventStatusSpan = new CSpan(trigger_value2str($event['value'])); // add colors and blinking to span depending on configuration and trigger parameters addTriggerValueStyle($eventStatusSpan, $event['value'], $event['clock'], $event['acknowledged']); $table->addRow(array( zbx_date2str(_('d M Y H:i:s'), $event['clock']), $eventStatusSpan, $duration, zbx_date2age($event['clock']), getEventAckState($event, false, false) )); } return $table; } /** * Create element with event acknowledges info. * If $event has subarray 'acknowledges', returned link will have hint with acknowledges. * * @param array $event event data * @param int $event['value_changed'] * @param int $event['acknowledged'] * @param int $event['eventid'] * @param int $event['objectid'] * @param array $event['acknowledges'] * @param bool|string $backUrl if true, add backurl param to link with current page file name * @param bool $isLink if true, return link otherwise span * @param array $params additional params for link * * @return array|CLink|CSpan|null|string */ function getEventAckState($event, $backUrl = false, $isLink = true, $params = array()) { $config = select_config(); if (!$config['event_ack_enable']) { return null; } if ($event['value_changed'] == TRIGGER_VALUE_CHANGED_NO) { return SPACE; } if ($isLink) { if (!empty($backUrl)) { if (is_bool($backUrl)) { global $page; $backurl = '&backurl='.$page['file']; } else { $backurl = '&backurl='.$backUrl; } } else { $backurl = ''; } $additionalParams = ''; foreach ($params as $key => $value) { $additionalParams .= '&'.$key.'='.$value; } if ($event['acknowledged'] == 0) { $ack = new CLink(_('No'), 'acknow.php?eventid='.$event['eventid'].'&triggerid='.$event['objectid'].$backurl.$additionalParams, 'disabled'); } else { $ackLink = new CLink(_('Yes'), 'acknow.php?eventid='.$event['eventid'].'&triggerid='.$event['objectid'].$backurl.$additionalParams, 'enabled'); if (is_array($event['acknowledges'])) { $ackLinkHints = makeAckTab($event); if (!empty($ackLinkHints)) { $ackLink->setHint($ackLinkHints, '', '', false); } $ack = array($ackLink, ' ('.count($event['acknowledges']).')'); } else { $ack = array($ackLink, ' ('.$event['acknowledges'].')'); } } } else { if ($event['acknowledged'] == 0) { $ack = new CSpan(_('No'), 'on'); } else { $ack = array(new CSpan(_('Yes'), 'off'), ' ('.(is_array($event['acknowledges']) ? count($event['acknowledges']) : $event['acknowledges']).')'); } } return $ack; } function getLastEvents($options) { if (!isset($options['limit'])) { $options['limit'] = 15; } $triggerOptions = array( 'filter' => array(), 'skipDependent' => 1, 'selectHosts' => array('hostid', 'host'), 'output' => API_OUTPUT_EXTEND, 'sortfield' => 'lastchange', 'sortorder' => ZBX_SORT_DOWN, 'limit' => $options['triggerLimit'] ); $eventOptions = array( 'output' => API_OUTPUT_EXTEND, 'filter' => array( 'object' => EVENT_OBJECT_TRIGGER, 'value_changed' => TRIGGER_VALUE_CHANGED_YES ), 'sortfield' => 'eventid', 'sortorder' => ZBX_SORT_DOWN ); if (isset($options['eventLimit'])) { $eventOptions['limit'] = $options['eventLimit']; } if (isset($options['nodeids'])) { $triggerOptions['nodeids'] = $options['nodeids']; } if (isset($options['priority'])) { $triggerOptions['filter']['priority'] = $options['priority']; } if (isset($options['monitored'])) { $triggerOptions['monitored'] = $options['monitored']; } if (isset($options['lastChangeSince'])) { $triggerOptions['lastChangeSince'] = $options['lastChangeSince']; $eventOptions['time_from'] = $options['lastChangeSince']; } if (isset($options['value'])) { $triggerOptions['filter']['value'] = $options['value']; $eventOptions['value'] = $options['value']; } // triggers $triggers = API::Trigger()->get($triggerOptions); $triggers = zbx_toHash($triggers, 'triggerid'); // events $eventOptions['triggerids'] = zbx_objectValues($triggers, 'triggerid'); $events = API::Event()->get($eventOptions); $sortClock = array(); $sortEvent = array(); foreach ($events as $enum => $event) { if (!isset($triggers[$event['objectid']])) { continue; } $events[$enum]['trigger'] = $triggers[$event['objectid']]; $events[$enum]['host'] = reset($events[$enum]['trigger']['hosts']); $sortClock[$enum] = $event['clock']; $sortEvent[$enum] = $event['eventid']; //expanding description for the state where event was $merged_event = array_merge($event, $triggers[$event['objectid']]); $events[$enum]['trigger']['description'] = CEventHelper::expandDescription($merged_event); } array_multisort($sortClock, SORT_DESC, $sortEvent, SORT_DESC, $events); return $events; }
gpl-2.0
dienerpiske/Sabia
SabiaApp/bing.py
3579
""" /* * ---------------------------------------------------------------------------- * "THE BEER-WARE LICENSE" (Revision 43): * <neerajkumar@outlook.com> wrote this file. As long as you retain this notice you * can do whatever you want with this stuff. If we meet some day, and you think * this stuff is worth it, you can buy me a beer in return. * If you are reading this in the second half the the 21st century, then I am at * an age which won't allow me to metabolize any kind of alcohol, so please * treat yourself with a beer on my behalf. * -Neeraj Kumar * ---------------------------------------------------------------------------- */ """ import datetime import math import json from SabiaApp import retry import time import urllib import urllib2 SCOPE_URL='http://api.microsofttranslator.com' OAUTH_URL='https://datamarket.accesscontrol.windows.net/v2/OAuth2-13' AZURE_TRANSLATE_API_URL='http://api.microsofttranslator.com/V2/Ajax.svc/Translate?%s' GRANT_CLIENT_CREDENTIALS_ONLY='client_credentials' class MicrosoftTranslatorClient(object): """Handles authentication and translation for Microsoft Translator API. Arguments: client_id: The client_id for your azure application (as a string) client_secret: The client secret for your azure application (as a string) """ def __init__(self, client_id, client_secret): self.client_id = client_id self.client_secret = client_secret self.last_auth_token_refresh=None self.auth_token = self.__GetAuthenticationToken() @retry.retry(Exception, tries=3, delay=5, backoff=2) def __GetAuthenticationToken(self): """Gets the authentication token for your app from azure marketplace.""" auth_args = { 'client_id': self.client_id, 'client_secret': self.client_secret, 'scope': SCOPE_URL, 'grant_type': GRANT_CLIENT_CREDENTIALS_ONLY } self.auth_token = json.loads(urllib2.urlopen(OAUTH_URL,data=urllib.urlencode(auth_args)).read()) if self.auth_token: self.last_auth_token_refresh = datetime.datetime.now() return self.auth_token else: return None @retry.retry(Exception, tries=3, delay=5, backoff=2) def TranslateText(self, unicode_string, from_lang_code, to_lang_code): """Translates a given text from given language to target language. This function tries to translate the text thrice, and if no translations could be done returns an empty string. Arguments: unicode_string: The string to transalte in unicode format. from_lang_code: The source language code. to_lang_code: The destination language code. Returns: Translated string if succesful, ""(empty string) otherwise. """ self.translated_text = "" # Whenever there is a translate request, check if our token in still valid. # if valid, then its all good, continue to next step # if not, then get the authentication token again. now = datetime.datetime.now() if (now - self.last_auth_token_refresh).seconds > 550 : if not self.__GetAuthenticationToken(): return "Text could not be translated due to a recurring authentication error." translate_packet = { 'text': unicode_string, 'to': to_lang_code, 'from': from_lang_code } headers = { 'Authorization': 'Bearer '+ self.auth_token['access_token'] } translate_req = urllib2.Request(AZURE_TRANSLATE_API_URL % urllib.urlencode(translate_packet), headers=headers) return urllib2.urlopen(translate_req).read()
gpl-2.0
kol4ak/cross-media
sites/all/amodules/yashare/js/yashare.automatic.js
179
/*global Drupal: false, jQuery: false */ /*jslint devel: true, browser: true, maxerr: 50, indent: 2 */ (function($) { "use strict"; Drupal.yashare.initialize(); })(jQuery);
gpl-2.0
dustints/katello
app/controllers/katello/repositories_controller.rb
2133
# # Copyright 2014 Red Hat, Inc. # # This software is licensed to you under the GNU General Public # License as published by the Free Software Foundation; either version # 2 of the License (GPLv2) or (at your option) any later version. # There is NO WARRANTY for this software, express or implied, # including the implied warranties of MERCHANTABILITY, # NON-INFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. You should # have received a copy of GPLv2 along with this software; if not, see # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. module Katello class RepositoriesController < Katello::ApplicationController include KatelloUrlHelper respond_to :html, :js before_filter :authorize before_filter :find_repository, :except => [:auto_complete_library] def rules read_any_test = lambda{Provider.any_readable?(current_organization)} org_edit = lambda{current_organization.redhat_manageable?} { :enable_repo => org_edit, :auto_complete_library => read_any_test } end def enable_repo @repository.enabled = params[:repo] == "1" @repository.save! product_content = @repository.product.product_content_by_id(@repository.content_id) render :json => {:id => @repository.id, :can_disable_repo_set => product_content.can_disable?} end def auto_complete_library # retrieve and return a list (array) of repo names in library that contain the 'term' that was passed in term = Util::Search.filter_input params[:term] name = 'name:' + term name_query = name + ' OR ' + name + '*' ids = Repository.readable(current_organization.library).collect{|r| r.id} repos = Repository.search do query {string name_query} filter "and", [ {:terms => {:id => ids}}, {:terms => {:enabled => [true]}} ] end render :json => (repos.map do |repo| label = _("%{repo} (Product: %{product})") % {:repo => repo.name, :product => repo.product} {:id => repo.id, :label => label, :value => repo.name} end) end protected def find_repository @repository = Repository.find(params[:id]) end end end
gpl-2.0
cuongnd/test_pro
libraries/legacy/response/response.php
6456
<?php /** * @package Joomla.Legacy * @subpackage Response * * @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('_JEXEC') or die(__FILE__); JLog::add('JResponse is deprecated.', JLog::WARNING, 'deprecated'); /** * JResponse Class. * * This class serves to provide the Joomla Platform with a common interface to access * response variables. This includes header and body. * * @package Joomla.Legacy * @subpackage Response * @since 11.1 * @deprecated 4.0 Use JApplicationWeb instead */ class JResponse { /** * @var array Body * @since 11.1 * @deprecated 4.0 */ protected static $body = array(); /** * @var boolean Cachable * @since 11.1 * @deprecated 4.0 */ protected static $cachable = false; /** * @var array Headers * @since 11.1 * @deprecated 4.0 */ protected static $headers = array(); /** * Set/get cachable state for the response. * * If $allow is set, sets the cachable state of the response. Always returns current state. * * @param boolean $allow True to allow browser caching. * * @return boolean True if browser caching should be allowed * * @since 11.1 * @deprecated 4.0 Use JApplicationWeb::allowCache() instead */ public static function allowCache($allow = null) { return JFactory::getApplication()->allowCache($allow); } /** * Set a header. * * If $replace is true, replaces any headers already defined with that $name. * * @param string $name The name of the header to set. * @param string $value The value of the header to set. * @param boolean $replace True to replace any existing headers by name. * * @return void * * @since 11.1 * @deprecated 4.0 Use JApplicationWeb::setHeader() instead */ public static function setHeader($name, $value, $replace = false) { JFactory::getApplication()->setHeader($name, $value, $replace); } /** * Return array of headers. * * @return array * * @since 11.1 * @deprecated 4.0 Use JApplicationWeb::getHeaders() instead */ public static function getHeaders() { return JFactory::getApplication()->getHeaders(); } /** * Clear headers. * * @return void * * @since 11.1 * @deprecated 4.0 Use JApplicationWeb::clearHeaders() instead */ public static function clearHeaders() { JFactory::getApplication()->clearHeaders(); } /** * Send all headers. * * @return void * * @since 11.1 * @deprecated 4.0 Use JApplicationWeb::sendHeaders() instead */ public static function sendHeaders() { JFactory::getApplication()->sendHeaders(); } /** * Set body content. * * If body content already defined, this will replace it. * * @param string $content The content to set to the response body. * * @return void * * @since 11.1 * @deprecated 4.0 Use JApplicationWeb::setBody() instead */ public static function setBody($content) { JFactory::getApplication()->setBody($content); } /** * Prepend content to the body content * * @param string $content The content to prepend to the response body. * * @return void * * @since 11.1 * @deprecated 4.0 Use JApplicationWeb::prependBody() instead */ public static function prependBody($content) { JFactory::getApplication()->prependBody($content); } /** * Append content to the body content * * @param string $content The content to append to the response body. * * @return void * * @since 11.1 * @deprecated 4.0 Use JApplicationWeb::appendBody() instead */ public static function appendBody($content) { JFactory::getApplication()->appendBody($content); } /** * Return the body content * * @param boolean $toArray Whether or not to return the body content as an array of strings or as a single string; defaults to false. * * @return string array * * @since 11.1 * @deprecated 4.0 Use JApplicationWeb::getBody() instead */ public static function getBody($toArray = false) { return JFactory::getApplication()->getBody($toArray); } /** * Sends all headers prior to returning the string * * @param boolean $compress If true, compress the data * * @return string * * @since 11.1 * @deprecated 4.0 Use JApplicationCms::toString() instead */ public static function toString($compress = false) { return JFactory::getApplication()->toString($compress); } /** * Compress the data * * Checks the accept encoding of the browser and compresses the data before * sending it to the client. * * @param string $data Content to compress for output. * * @return string compressed data * * @note Replaces _compress method in 11.1 * @since 11.1 * @deprecated 4.0 Use JApplicationWeb::compress() instead */ protected static function compress($data) { $encoding = self::clientEncoding(); if (!$encoding) { return $data; } if (!extension_loaded('zlib') || ini_get('zlib.output_compression')) { return $data; } if (headers_sent()) { return $data; } if (connection_status() !== 0) { return $data; } // Ideal level $level = 4; /* $size = strlen($data); $crc = crc32($data); $gzdata = "\x1f\x8b\x08\x00\x00\x00\x00\x00"; $gzdata .= gzcompress($data, $level); $gzdata = substr($gzdata, 0, strlen($gzdata) - 4); $gzdata .= pack("V",$crc) . pack("V", $size); */ $gzdata = gzencode($data, $level); self::setHeader('Content-Encoding', $encoding); // Header will be removed at 4.0 if (JFactory::getConfig()->get('MetaVersion', 0) && defined('JVERSION')) { self::setHeader('X-Content-Encoded-By', 'Joomla! ' . JVERSION); } return $gzdata; } /** * Check, whether client supports compressed data * * @return boolean * * @since 11.1 * @note Replaces _clientEncoding method from 11.1 * @deprecated 4.0 Use JApplicationWebClient instead */ protected static function clientEncoding() { if (!isset($_SERVER['HTTP_ACCEPT_ENCODING'])) { return false; } $encoding = false; if (false !== strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) { $encoding = 'gzip'; } if (false !== strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'x-gzip')) { $encoding = 'x-gzip'; } return $encoding; } }
gpl-2.0
tuyenln/liquidation
wp-content/plugins/woocommerce-simple-auctions/classes/woocommerce-simple-auctions-shortcode-my-auctions.php
3202
<?php /** * Shortcode [woocommerce_simple_auctions_my_auctions] * */ class WC_Shortcode_Simple_Auction_My_Auctions { /** * Get shortcode content * * @access public * @param array $atts * @return string * */ public static function get( $atts ) { global $woocommerce; return $woocommerce->shortcode_wrapper( array( __CLASS__, 'output' ), $atts ); } /** * Output shortcode * * @access public * @param array $atts * @return void * */ public static function output( $atts ) { global $woocommerce, $wpdb; if ( ! is_user_logged_in() ) return; $user_id = get_current_user_id(); $postids = array(); $userauction = $wpdb->get_results("SELECT DISTINCT auction_id FROM ".$wpdb->prefix."simple_auction_log WHERE userid = $user_id ",ARRAY_N ); if(isset($userauction) && !empty($userauction)){ foreach ($userauction as $auction) { $postids []= $auction[0]; } } ?> <div class="simple-auctions active-auctions clearfix"> <h2><?php _e( 'Active auctions', 'wc_simple_auctions' ); ?></h2> <?php $args = array( 'post__in' => $postids , 'post_type' => 'product', 'posts_per_page' => '-1', 'tax_query' => array( array( 'taxonomy' => 'product_type', 'field' => 'slug', 'terms' => 'auction' ) ), 'meta_query' => array( array( 'key' => '_auction_closed', 'compare' => 'NOT EXISTS' ) ), 'auction_arhive' => TRUE, 'show_past_auctions' => TRUE, ); //var_dump($args); $activeloop = new WP_Query( $args ); //var_dump($activeloop); if ( $activeloop->have_posts() ) { woocommerce_product_loop_start(); while ( $activeloop->have_posts() ):$activeloop->the_post(); woocommerce_get_template_part( 'content', 'product' ); endwhile; woocommerce_product_loop_end(); } else { _e("You are not participating in auction.","wc_simple_auctions" ); } wp_reset_postdata(); ?> </div> <div class="simple-auctions active-auctions clearfix"> <h2><?php _e( 'Won auctions', 'wc_simple_auctions' ); ?></h2> <?php $args = array( 'post_type' => 'product', 'posts_per_page' => '-1', 'meta_query' => array( array( 'key' => '_auction_closed', 'value' => '2', ), array( 'key' => '_auction_current_bider', 'value' => $user_id, ) ), 'show_past_auctions' => TRUE, 'auction_arhive' => TRUE, ); $winningloop = new WP_Query( $args ); if ( $winningloop->have_posts() ) { woocommerce_product_loop_start(); while ( $winningloop->have_posts()): $winningloop->the_post() ; woocommerce_get_template_part( 'content', 'product' ); endwhile; woocommerce_product_loop_end(); } else { _e("You did not win any auctions yet.","wc_simple_auctions" ); } wp_reset_postdata(); echo "</div>"; } }
gpl-2.0
inex/IXP-Manager
database/migrations/2020_02_06_204608_create_docstore_files.php
642
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateDocstoreFiles extends Migration { /** * Run the migrations. * * @return void */ public function up() { // 2021-03-06 BOD: Migration no longer required as included in 2020_06_01_143931_database_schema_at_end_v5 // Migration file kept for anyone upgrading so that their database table of migration states remains consistent. } /** * Reverse the migrations. * * @return void */ public function down() { } }
gpl-2.0
TeoTwawki/VirtualDub
src/disasm/source/encoder_tracedec.cpp
2852
#include <vector> #include "ruleset.h" #define iterate_forward(type, obj, it) if(0);else for(type::const_iterator it = (obj).begin(), it##End = (obj).end(); it != it##End; ++it) void dump_tracedec(std::vector<char>& dst, const tRuleSystem& rulesys) { long decomp_bytes = 0; long packed_bytes = 0; dst.resize(72, 0); dst.push_back(rulesys.size()); iterate_forward(tRuleSystem, rulesys, it) { const ruleset& rs = *it; std::vector<std::pair<uint8, uint8> > last_match[4]; std::string last_result[4]; iterate_forward(std::list<rule>, rs.rules, itRule) { const rule& r = *itRule; int prematch, postmatch; int i, x, ibest; int l = (int)r.match_stream.size(); ibest = 0; prematch = postmatch = 0; for(i=0; i<4; ++i) { int l2 = (int)last_match[i].size(); if (l2 > l) l2 = l; int tprematch = std::mismatch(last_match[i].begin(), last_match[i].begin() + l2, r.match_stream.begin()).first - last_match[i].begin(); int tpostmatch = std::mismatch(last_match[i].rbegin(), last_match[i].rbegin() + l2, r.match_stream.rbegin()).first - last_match[i].rbegin(); if (tprematch+tpostmatch > prematch+postmatch) { prematch = tprematch; postmatch = tpostmatch; ibest = i; } } if (prematch > 7) prematch = 7; if (postmatch > 7) postmatch = 7; if (postmatch > l - prematch) postmatch = l - prematch; dst.push_back(ibest*64 + postmatch*8 + prematch); dst.push_back(1+l - prematch - postmatch); for(x=prematch; x<l - postmatch; ++x) { dst.push_back(r.match_stream[x].first); dst.push_back(r.match_stream[x].second); } decomp_bytes += l*2+1; std::rotate(last_match, last_match+3, last_match+4); last_match[0] = r.match_stream; uint8 flags = 0; if (r.is_66) flags = 0x80; else if (r.is_67) flags = 0x81; else if (r.is_f2) flags = 0x82; else if (r.is_f3) flags = 0x83; else { if (r.is_call) flags |= 0x01; if (r.is_jcc) flags |= 0x02; if (r.is_jump) flags |= 0x04; if (r.is_return) flags |= 0x08; if (r.is_invalid) flags |= 0x10; if (r.is_imm8) flags |= 0x20; if (r.is_imm16) flags |= 0x40; if (r.is_imm32) flags |= 0x60; } dst.push_back(flags); ++decomp_bytes; } dst.push_back(0); dst.push_back(0); decomp_bytes += 2; } #ifndef _M_AMD64 static const char header[64]="[02|02] VirtualDub tracedec module (IA32:P4/Athlon V1.05)\r\n\x1A"; #else static const char header[64]="[02|02] VirtualDub tracedec module (AMD64:EM64T/A64 V1.0)\r\n\x1A"; #endif memcpy(&dst[0], header, 64); packed_bytes = dst.size() - 72; memcpy(&dst[64], &packed_bytes, 4); decomp_bytes += (rulesys.size()+1)*sizeof(void *); memcpy(&dst[68], &decomp_bytes, 4); }
gpl-2.0
daltonnyx/Vinabits_OM
Vinabits_OM_2017.Module.Web/Controllers/Navigation/NewActionNavigationViewController.Designer.cs
1014
namespace Vinabits_OM_2017.Module.Web.Controllers { partial class NewActionNavigationViewController { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Component Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { } #endregion } }
gpl-2.0
dawidcieszynski/Aero2ReloadService
Aero2ReloadService/CustomDevices/HuaweiE355.cs
3213
namespace Aero2Reload.Service.CustomDevices { using System; using System.Net; using System.Threading; using Aero2Reload.Service.Loggers; using RestSharp; public class HuaweiE355 { private readonly Logger eventLog; public HuaweiE355(Logger eventLog) { this.eventLog = eventLog; } public int Restart() { var restClient = new RestClient { CookieContainer = new CookieContainer() }; var homeResponse = restClient.Execute(new HuaweiE355HomeRequest()); if (homeResponse.ResponseStatus == ResponseStatus.Error) { // brak odpowiedzi od routera return 0; } var loginResponse = restClient.Execute(new HuaweiE355LoginRequest()); if (!loginResponse.Content.Contains("<response>OK</response>")) { this.eventLog.Error("B³¹d logowania do HuaweiE355 (admin, admin)"); return 0; } var statusResponse = restClient.Execute<HuaweiE355StatusResponseBody>(new HuaweiE355StatusRequest()); if (statusResponse.ResponseStatus == ResponseStatus.Error) { // brak odpowiedzi od routera return 0; } int result = 0; if (statusResponse.Data.ConnectionStatus == HuaweiE355ConnectionStatus.Connected) { var disconnectResponse = restClient.Execute(new HuaweiE355DisconnectRequest()); if (!disconnectResponse.Content.Contains("<response>OK</response>")) { this.eventLog.Error("B³¹d roz³¹czania HuaweiE355"); return 0; } const int WaitingForDisconnectionTimeout = 1000 * 5; var timeoutTickCount = Environment.TickCount + WaitingForDisconnectionTimeout; do { statusResponse = restClient.Execute<HuaweiE355StatusResponseBody>(new HuaweiE355StatusRequest()); } while (statusResponse.Data.ConnectionStatus != HuaweiE355ConnectionStatus.Disconnected && Environment.TickCount < timeoutTickCount); result = 1; } if (statusResponse.Data.ConnectionStatus == HuaweiE355ConnectionStatus.Disconnected) { var connectResponse = restClient.Execute(new HuaweiE355ConnectRequest()); if (!connectResponse.Content.Contains("<response>OK</response>")) { this.eventLog.Error("B³¹d ³¹czenia HuaweiE355"); return 0; } do { Thread.Sleep(1000); statusResponse = restClient.Execute<HuaweiE355StatusResponseBody>(new HuaweiE355StatusRequest()); } while (statusResponse.Data.ConnectionStatus != HuaweiE355ConnectionStatus.Connected); result = 1; } return result; } } }
gpl-2.0
guryev-skol/opt_coils
src_sie/src_coupling/src_quadraturemex/coupling_qmex/QuadScat2Coil_ompmex.cpp
8795
#include "mex.h" #include <math.h> #include "matrix.h" #include <complex> #include <omp.h> #include "stdint.h" using namespace std; void Coupling ( const double r1[3], const double r2[3], const double r3[3], const double r_obs[3], const double ko, const int Np_2D, const double Z1[], const double Z2[], const double Z3[], const double wp[], complex<double> GJ_1[3], complex<double> GJ_2[3], complex<double> GJ_3[3] ); /* the gateway function */ void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { // ------------------------------------------------------------------------------ // // Receives: // R1 - double 3 x NE vector with the positions of the first vertex of each element // R2 - double 3 x NE vector with the positions of the second vertex of each element // R3 - double 3 x NE vector with the positions of the third vertex of each element // NE - number of elements // RO - double 3 x NO vector with the positions of the observation points // NO - number of observation points // IDX - 3 x NE integers with the index of each edge of each element (incidence of I) // MULT - 3 x NE doubles with the multiplier (+1 or -1) of each edge of each element (contribution of I) // NC - number of Coil edges // K0 - wave number // NP_2D - data for quadrature rule // Z1 - more data for quadrature // Z2 - and more // Z3 - and yet some more // WP - more? // J - NCx3 complex numbers with current components at each observation point // // // Returns: // V - NC complex with each component of the field in each of the NC edges // // // NOTE: all I/O are treated as vectors, and ordering in column major format // for the coordinates, index and mult, the ordering is for ii point, x = R[3*ii], y = R[3*ii+1], z = R[3*ii+2] // // MATLAB CALL: // [V] = mexQuadScat2Coil(R1,R2,R3,NE,RO,NO,IDX,MULT,NC,K0,NP_2D,Z1,Z2,Z3,WP,J) // // ---------------------------------------------------------------------------- // some initial declarations if (nrhs != 16){ mexErrMsgIdAndTxt( "MATLAB:xtimesy:invalidNumInputs", "QuadCoil2Scat_mex - 16 inputs required!"); } // ---------------------------------------------------------------------------- // declarations // aux vars int NPROC = 1; int64_t ii = 0, jj = 0, shift = 0; double auxreal = 0.0, auximag = 0.0; // point to data in vectors R double* R1 = mxGetPr(prhs[0]); double* R2 = mxGetPr(prhs[1]); double* R3 = mxGetPr(prhs[2]); int64_t NE = (int64_t) mxGetScalar(prhs[3]); double* RO = mxGetPr(prhs[4]); int64_t NO = (int64_t) mxGetScalar(prhs[5]); // pointer to the indexes double* IDXdouble = mxGetPr(prhs[6]); // get complex index vector!!! // pointer to the multipliers double* MULT = mxGetPr(prhs[7]); // get complex index vector!!! // get the scalar input NC int64_t NC = (int64_t) mxGetScalar(prhs[8]); // get the scalar input K0 double K0 = mxGetScalar(prhs[9]); // get the scalar input NP int NP_2D = (int) mxGetScalar(prhs[10]); // create a pointer to w,u,v double* Z1 = mxGetPr(prhs[11]); double* Z2 = mxGetPr(prhs[12]); double* Z3 = mxGetPr(prhs[13]); double* WP = mxGetPr(prhs[14]); // pointer to the body currents double * Jreal = mxGetPr(prhs[15]); double * Jimag = mxGetPi(prhs[15]); // this is for the computation of each coupling entry complex<double> GJ_1[3], GJ_2[3], GJ_3[3]; double r1[3], r2[3], r3[3], r_obs[3]; int64_t IDXlocal[3]; // index local double MULTlocal[3]; // local multiplier // for the output matrix V double *Vreal, *Vimag; // allocate space for the NC complex vector // allocate MATLAB size for the outputs, and assign pointer plhs[0] = mxCreateDoubleMatrix(NC, 1, mxCOMPLEX); // this initializes to 0 Vreal = mxGetPr(plhs[0]); Vimag = mxGetPi(plhs[0]); // ---------------------------------------------------------------------------- // We are finally good to do some computations... // NPROC = omp_get_num_procs(); // get number of processors in machine omp_set_num_threads(NPROC); // set number of threads to maximum // make sure that if the imaginary part of J is zero, this does not break if (Jimag == NULL){ Jimag = (double*) calloc (3*NO,sizeof(double)); // just zero array } #pragma omp parallel for \ default(shared) private(r_obs,r1,r2,r3,GJ_1,GJ_2,GJ_3,IDXlocal,MULTlocal,shift,jj,ii,auxreal,auximag) for(ii = 0; ii < NE; ii++){ // loop on the number of elements // get the coordinates of the element points r1[0] = R1[3*ii]; // x coordinate r1[1] = R1[3*ii+1]; // y coordinate r1[2] = R1[3*ii+2]; // z coordinate r2[0] = R2[3*ii]; // x coordinate r2[1] = R2[3*ii+1]; // y coordinate r2[2] = R2[3*ii+2]; // z coordinate r3[0] = R3[3*ii]; // x coordinate r3[1] = R3[3*ii+1]; // y coordinate r3[2] = R3[3*ii+2]; // z coordinate // get the index of the different edges IDXlocal[0] = (int64_t) IDXdouble[3*ii]; // index of first edge IDXlocal[1] = (int64_t) IDXdouble[3*ii+1]; // index of second edge IDXlocal[2] = (int64_t) IDXdouble[3*ii+2]; // index of third edge // get the positive or negative multiplier MULTlocal[0] = MULT[3*ii]; // multiplier of first edge MULTlocal[1] = MULT[3*ii+1]; // multiplier of second edge MULTlocal[2] = MULT[3*ii+2]; // multiplier of third edge for(jj = 0; jj < NO; jj++){ // loop on the number of observation points // get the coordinates of the observation point r_obs[0] = RO[3*jj]; // x coordinate r_obs[1] = RO[3*jj+1]; // y coordinate r_obs[2] = RO[3*jj+2]; // z coordinate // Call the C-subroutine for each case Coupling ( r1, r2, r3, r_obs, K0, NP_2D, Z1, Z2, Z3, WP, GJ_1, GJ_2, GJ_3 ); // apply the product according to the output case // in matlab: // Vout(idx1,1) = Vout(idx1,1) + mult(1)*(Gcoup(1,1)*Vin(jj,1) + Gcoup(1,2)*Vin(jj,2) + Gcoup(1,3)*Vin(jj,3)); % first edge // first edge if (IDXlocal[0] > 0){ // we have non external edge shift = IDXlocal[0] - 1; // recall matlab indexes start in 1 // first component auxreal = Jreal[jj]*real(GJ_1[0]) - Jimag[jj]*imag(GJ_1[0]); auximag = Jreal[jj]*imag(GJ_1[0]) + Jimag[jj]*real(GJ_1[0]); // second component auxreal += Jreal[NO+jj]*real(GJ_1[1]) - Jimag[NO+jj]*imag(GJ_1[1]); auximag += Jreal[NO+jj]*imag(GJ_1[1]) + Jimag[NO+jj]*real(GJ_1[1]); // third component auxreal += Jreal[2*NO+jj]*real(GJ_1[2]) - Jimag[2*NO+jj]*imag(GJ_1[2]); auximag += Jreal[2*NO+jj]*imag(GJ_1[2]) + Jimag[2*NO+jj]*real(GJ_1[2]); // weight and assign contribution to edge #pragma omp atomic Vreal[shift] += MULTlocal[0]*auxreal; #pragma omp atomic Vimag[shift] += MULTlocal[0]*auximag; } // second edge if (IDXlocal[1] > 0){ // we have non external edge shift = IDXlocal[1] - 1; // recall matlab indexes start in 1 // first component auxreal = Jreal[jj]*real(GJ_2[0]) - Jimag[jj]*imag(GJ_2[0]); auximag = Jreal[jj]*imag(GJ_2[0]) + Jimag[jj]*real(GJ_2[0]); // second component auxreal += Jreal[NO+jj]*real(GJ_2[1]) - Jimag[NO+jj]*imag(GJ_2[1]); auximag += Jreal[NO+jj]*imag(GJ_2[1]) + Jimag[NO+jj]*real(GJ_2[1]); // third component auxreal += Jreal[2*NO+jj]*real(GJ_2[2]) - Jimag[2*NO+jj]*imag(GJ_2[2]); auximag += Jreal[2*NO+jj]*imag(GJ_2[2]) + Jimag[2*NO+jj]*real(GJ_2[2]); // weight and assign contribution to edge #pragma omp atomic Vreal[shift] += MULTlocal[1]*auxreal; #pragma omp atomic Vimag[shift] += MULTlocal[1]*auximag; } // third edge if (IDXlocal[2] > 0){ // we have non external edge shift = IDXlocal[2] - 1; // recall matlab indexes start in 1 // first component auxreal = Jreal[jj]*real(GJ_3[0]) - Jimag[jj]*imag(GJ_3[0]); auximag = Jreal[jj]*imag(GJ_3[0]) + Jimag[jj]*real(GJ_3[0]); // second component auxreal += Jreal[NO+jj]*real(GJ_3[1]) - Jimag[NO+jj]*imag(GJ_3[1]); auximag += Jreal[NO+jj]*imag(GJ_3[1]) + Jimag[NO+jj]*real(GJ_3[1]); // third component auxreal += Jreal[2*NO+jj]*real(GJ_3[2]) - Jimag[2*NO+jj]*imag(GJ_3[2]); auximag += Jreal[2*NO+jj]*imag(GJ_3[2]) + Jimag[2*NO+jj]*real(GJ_3[2]); // weight and assign contribution to edge #pragma omp atomic Vreal[shift] += MULTlocal[2]*auxreal; #pragma omp atomic Vimag[shift] += MULTlocal[2]*auximag; } } // end for jj } // end for ii // ---------------------------------------------------------------------------- // And it is done... // }
gpl-2.0
mxabierto/fonden
Gruntfile.js
11871
'use strict'; module.exports = function ( grunt ) { var appConfig = { app : 'app', dist : 'dist', livereload : 35729 }; require( 'load-grunt-tasks' )( grunt ); require( 'time-grunt' )( grunt ); grunt.initConfig({ config : appConfig, cdnify : { dist : { html : '<%= config.dist %>/*.html' } }, concurrent : { dist : [ 'less', 'imagemin', 'svgmin' ], server : [ 'less' ] }, connect : { options : { port : 9000, hostname : 'localhost', livereload : '<%= config.livereload %>' }, dev : { options : { open : true, middleware : function ( connect ) { return [ connect().use( '/bower_components', connect.static( './bower_components' ) ), connect().use( '/fonts', connect.static( './bower_components/bootstrap/fonts' ) ), connect.static( appConfig.app ) ]; } } }, test : { options : { port : 9001, middleware : function ( connect ) { return [ connect().use( '/bower_components', connect.static( './bower_components' ) ), connect().use( '/js', connect.static( 'instrumented/app/js' ) ), connect.static( appConfig.app ) ]; } } } }, copy : { dist : { files : [{ expand : true, dot : true, cwd : '<%= config.app %>', dest : '<%= config.dist %>', src : [ '*.{ico,png,txt}', '.htaccess', '*.html', 'partials/{,*/}*.html', 'img/{,*/}*.{webp}', 'css/{,*/}*.css', 'data/{,*/}*.*', 'CNAME' ] }, { expand : true, flatten : true, cwd : '.', src : 'bower_components/bootstrap/fonts/*', dest : '<%= config.dist %>/fonts' }, { expand : true, cwd : '.', src : 'bower_components/requirejs/require.js', dest : '<%= config.dist %>' }] } }, coveralls : { options : { force : true }, target : { src : 'test/reports/lcov.info' } }, clean : { dist: { files: [{ dot : true, src : [ '.tmp', '<%= config.dist %>/{,*/}*', '!<%= config.dist %>/.git{,*/}*' ] }] }, server : [ '.tmp', '<%= config.app %>/css', 'instrumented', 'test/coverage', 'test/reports' ] }, eslint : { src : [ 'Gruntfile.js', '<%= config.app %>/js/{,*/}*.js', '!<%= config.app %>/js/lib/*.js' ] }, filerev : { dist : { src : [ '<%= config.dist %>/js/vendor.js', '<%= config.dist %>/css/{,*/}*.css', '<%= config.dist %>/img/{,*/}*.{png,jpg,jpeg,gif,webp,svg}' ] } }, 'gh-pages' : { options : { base : '<%= config.dist %>' }, src : [ '**' ] }, htmlmin : { dist : { options: { collapseWhitespace : true, conservativeCollapse : true, collapseBooleanAttributes : true, removeCommentsFromCDATA : true, removeOptionalTags : true }, files : [{ expand : true, cwd : '<%= config.dist %>', src : [ '*.html', 'partials/{,*/}*.html' ], dest : '<%= config.dist %>' }] } }, imagemin : { dist : { files : [{ expand : true, cwd : '<%= config.app %>/img', src : '{,*/}*.{png,jpg,jpeg,gif}', dest : '<%= config.dist %>/img' }] } }, instrument : { files : [ '<%= config.app %>/js/**/*.js', '!<%= config.app %>/js/lib/*.js' ], options : { lazy : true, basePath : 'instrumented' } }, less : { development : { options : { compress : true, yuicompress : true, optimization : 2 }, files : { '<%= config.app %>/css/style.css' : '<%= config.app %>/less/style.less' } } }, makeReport : { src : 'test/coverage/**/*.json', options : { type : 'lcov', dir : 'test/reports', print : 'detail' } }, ngAnnotate : { dist : { files : [{ expand : true, cwd : '.tmp/concat/scripts', src : ['*.js', '!oldieshim.js'], dest : '.tmp/concat/scripts' }] } }, postcss : { options : { map : false, processors : [ require( 'autoprefixer-core' )({ browsers : 'last 8 versions' }) ] }, dist : { src : '<%= config.app %>/css/*.css' } }, protractorCoverage : { options : { configFile : 'test/protractor.conf.js', noColor : false, coverageDir : 'test/coverage', args : { browser : 'firefox' } }, test : { options : { configFile : 'test/protractor.conf.js', args : {} } } }, protractorWebdriver : { test : { path : 'node_modules/protractor/bin/', command : 'webdriver-manager start' } }, requirejs : { compile : { options : { baseUrl : '<%= config.app %>/js', mainConfigFile : '<%= config.app %>/js/main.js', name : 'main', out : '<%= config.dist %>/js/main.js', preserveLicenseComments : false, removeCombined : true } } }, svgmin : { dist : { files : [{ expand : true, cwd : '<%= config.app %>/img', src : '{,*/}*.svg', dest : '<%= config.dist %>/img' }] } }, usemin : { html : [ '<%= config.dist %>/{,*/}*.html', '<%= config.dist %>/partials/{,*/}*.html' ], css : [ '<%= config.dist %>/css/{,*/}*.css' ], options : { assetsDirs : [ '<%= config.dist %>', '<%= config.dist %>/img', '<%= config.dist %>/css' ] } }, useminPrepare : { html : '<%= config.app %>/index.html', options : { dest : '<%= config.dist %>', flow : { html: { steps : { js : ['concat', 'uglify'], css : ['cssmin'] }, post: {} } } } }, watch : { styles : { files : [ '<%= config.app %>/less/**/*.less' ], tasks : [ 'less', 'postcss' ], options : { spawn : false, livereload : '<%= config.livereload %>' } }, js : { files : [ '<%= config.app %>/js/**/*.js' ], options : { spawn : false, livereload : '<%= config.livereload %>' } } }, wiredep : { app : { src : [ '<%= config.app %>/index.html' ], exclude : [ 'require.js' ], ignorePath : /\.\.\// } } }); grunt.task.renameTask( 'protractor_coverage', 'protractorCoverage' ); grunt.task.renameTask( 'protractor_webdriver', 'protractorWebdriver' ); grunt.loadNpmTasks( 'gruntify-eslint' ); grunt.registerTask( 'build', [ 'clean:dist', 'wiredep', 'useminPrepare', 'concurrent:dist', 'postcss', 'concat', 'ngAnnotate', 'requirejs', 'copy:dist', 'cdnify', 'uglify', 'filerev', 'usemin', 'htmlmin' ]); grunt.registerTask( 'publish', [ 'build', 'gh-pages' ]); grunt.registerTask( 'report', [ 'coveralls' ]); grunt.registerTask( 'serve', [ 'clean:server', 'wiredep', 'concurrent:server', 'postcss', 'connect:dev', 'watch' ]); grunt.registerTask( 'test', [ 'clean:server', 'eslint', 'wiredep', 'concurrent:server', 'postcss', 'instrument', 'connect:test', 'protractorWebdriver:test', 'protractorCoverage:test', 'makeReport' ]); };
gpl-2.0
jiangxincode/thesis
hadoop/src/edu/sunyuanshuai/sharememoryinnerproduct/HDFSOperator.java
571
package edu.sunyuanshuai.sharememoryinnerproduct; /* * <author>孙远帅</author> * <date>2012/10/26</date> * <email>sunyuanshuai@Gmail.com</email> */ import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; public class HDFSOperator { public static boolean deleteDir(String dir) throws IOException { Configuration conf = new Configuration(); FileSystem fs = FileSystem.get(conf); boolean result = fs.delete(new Path(dir), true); fs.close(); return result; } }
gpl-2.0
ThomasXBMC/XCSoar
src/Math/KalmanFilter1d.hpp
3792
/* Copyright_License { XCSoar Glide Computer - http://www.xcsoar.org/ Copyright (C) 2000-2015 The XCSoar Project A detailed list of copyright holders can be found in the file "AUTHORS". 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 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. } */ #ifndef XCSOAR_KALMAN_FILTER_1D_HPP #define XCSOAR_KALMAN_FILTER_1D_HPP /** * A Kalman filter that estimates a one-dimensional quantity "x" and * its rate of change. Observations are of the one-dimensional * quantity itself. Rate of change is assumed to be perturbed by * Gaussian noise with a configurable variance. There are assumed to * be no control inputs. * * The notation, arithmetic, and the model itself borrow from the "truck" * example on this version of the Wikipedia page for Kalman filters: * http://en.wikipedia.org/w/index.php?title=Kalman_filter&oldid=484054295 * This implementation is devised from public domain code available here: * https://code.google.com/p/pressure-altimeter/ */ class KalmanFilter1d { // The state we are tracking, namely: double x_abs_; // The absolute quantity x. double x_vel_; // The rate of change of x, in x units per second squared. // Covariance matrix for the state. double p_abs_abs_; double p_abs_vel_; double p_vel_vel_; // The variance of the acceleration noise input to the system model, in units // per second squared. double var_x_accel_; public: // Constructors: the first allows you to supply the variance of the // acceleration noise input to the system model in x units per second squared; // the second constructor assumes a variance of 1.0. KalmanFilter1d(double var_x_accel); KalmanFilter1d(); // The following three methods reset the filter. All of them assign a huge // variance to the tracked absolute quantity and a var_x_accel_ variance to // its derivative, so the very next measurement will essentially be copied // directly into the filter. Still, we provide methods that allow you to // specify initial settings for the filter's tracked state. // // NOTE: "x_abs_value" is meant to connote the value of the absolute quantity // x, not the absolute value of x. void Reset(); void Reset(double x_abs_value); void Reset(double x_abs_value, double x_vel_value); /** * Sets the variance of the acceleration noise input to the system model in * x units per second squared. */ void SetAccelerationVariance(double var_x_accel) { var_x_accel_ = var_x_accel; } /** * Updates state given a direct sensor measurement of the absolute * quantity x, the variance of that measurement, and the interval * since the last measurement in seconds. This interval must be * greater than 0; for the first measurement after a Reset(), it's * safe to use 1.0. */ void Update(double z_abs, double var_z_abs, double dt); // Getters for the state and its covariance. double GetXAbs() const { return x_abs_; } double GetXVel() const { return x_vel_; } double GetCovAbsAbs() const { return p_abs_abs_; } double GetCovAbsVel() const { return p_abs_vel_; } double GetCovVelVel() const { return p_vel_vel_; } }; #endif
gpl-2.0
rex-xxx/mt6572_x201
sdk/lint/libs/lint_checks/src/com/android/tools/lint/checks/OnClickDetector.java
9327
/* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.tools.lint.checks; import static com.android.SdkConstants.ATTR_ON_CLICK; import com.android.annotations.NonNull; import com.android.tools.lint.client.api.LintDriver; import com.android.tools.lint.detector.api.Category; import com.android.tools.lint.detector.api.ClassContext; import com.android.tools.lint.detector.api.Context; import com.android.tools.lint.detector.api.Detector.ClassScanner; import com.android.tools.lint.detector.api.Issue; import com.android.tools.lint.detector.api.LayoutDetector; import com.android.tools.lint.detector.api.LintUtils; import com.android.tools.lint.detector.api.Location; import com.android.tools.lint.detector.api.Location.Handle; import com.android.tools.lint.detector.api.Scope; import com.android.tools.lint.detector.api.Severity; import com.android.tools.lint.detector.api.Speed; import com.android.tools.lint.detector.api.XmlContext; import com.google.common.base.Joiner; import org.objectweb.asm.Opcodes; import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.tree.MethodNode; import org.w3c.dom.Attr; import org.w3c.dom.Node; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.EnumSet; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * Checks for missing onClick handlers */ public class OnClickDetector extends LayoutDetector implements ClassScanner { /** Missing onClick handlers */ public static final Issue ISSUE = Issue.create( "OnClick", //$NON-NLS-1$ "Ensures that onClick attribute values refer to real methods", "The `onClick` attribute value should be the name of a method in this View's context " + "to invoke when the view is clicked. This name must correspond to a public method " + "that takes exactly one parameter of type `View`.\n" + "\n" + "Must be a string value, using '\\;' to escape characters such as '\\n' or " + "'\\uxxxx' for a unicode character.", Category.CORRECTNESS, 10, Severity.ERROR, OnClickDetector.class, EnumSet.of(Scope.ALL_RESOURCE_FILES, Scope.CLASS_FILE)); private Map<String, Location.Handle> mNames; private Map<String, List<String>> mSimilar; private boolean mHaveBytecode; /** Constructs a new {@link OnClickDetector} */ public OnClickDetector() { } @Override public @NonNull Speed getSpeed() { return Speed.FAST; } @Override public void afterCheckProject(@NonNull Context context) { if (mNames != null && mNames.size() > 0 && mHaveBytecode) { List<String> names = new ArrayList<String>(mNames.keySet()); Collections.sort(names); LintDriver driver = context.getDriver(); for (String name : names) { Handle handle = mNames.get(name); Object clientData = handle.getClientData(); if (clientData instanceof Node) { if (driver.isSuppressed(ISSUE, (Node) clientData)) { continue; } } Location location = handle.resolve(); String message = String.format( "Corresponding method handler 'public void %1$s(android.view.View)' not found", name); List<String> similar = mSimilar != null ? mSimilar.get(name) : null; if (similar != null) { Collections.sort(similar); message = message + String.format(" (did you mean %1$s ?)", Joiner.on(", ").join(similar)); } context.report(ISSUE, location, message, null); } } } // ---- Implements XmlScanner ---- @Override public Collection<String> getApplicableAttributes() { return Collections.singletonList(ATTR_ON_CLICK); } @Override public void visitAttribute(@NonNull XmlContext context, @NonNull Attr attribute) { String value = attribute.getValue(); if (value.isEmpty() || value.trim().isEmpty()) { context.report(ISSUE, attribute, context.getLocation(attribute), "onClick attribute value cannot be empty", null); } else if (!value.equals(value.trim())) { context.report(ISSUE, attribute, context.getLocation(attribute), "There should be no whitespace around attribute values", null); } else { if (mNames == null) { mNames = new HashMap<String, Location.Handle>(); } Handle handle = context.parser.createLocationHandle(context, attribute); handle.setClientData(attribute); // Replace unicode characters with the actual value since that's how they // appear in the ASM signatures if (value.contains("\\u")) { //$NON-NLS-1$ Pattern pattern = Pattern.compile("\\\\u(\\d\\d\\d\\d)"); //$NON-NLS-1$ Matcher matcher = pattern.matcher(value); StringBuilder sb = new StringBuilder(value.length()); int remainder = 0; while (matcher.find()) { sb.append(value.substring(0, matcher.start())); String unicode = matcher.group(1); int hex = Integer.parseInt(unicode, 16); sb.append((char) hex); remainder = matcher.end(); } sb.append(value.substring(remainder)); value = sb.toString(); } mNames.put(value, handle); } } // ---- Implements ClassScanner ---- @SuppressWarnings("rawtypes") @Override public void checkClass(@NonNull ClassContext context, @NonNull ClassNode classNode) { if (mNames == null) { // No onClick attributes in the XML files return; } mHaveBytecode = true; List methodList = classNode.methods; for (Object m : methodList) { MethodNode method = (MethodNode) m; boolean rightArguments = method.desc.equals("(Landroid/view/View;)V"); //$NON-NLS-1$ if (!mNames.containsKey(method.name)) { if (rightArguments) { // See if there's a possible typo instead for (String n : mNames.keySet()) { if (LintUtils.editDistance(n, method.name) <= 2) { recordSimilar(n, classNode, method); break; } } } continue; } // TODO: Validate class hierarchy: should extend a context method // Longer term, also validate that it's in a layout that corresponds to // the given activity if (rightArguments){ // Found: remove from list to be checked mNames.remove(method.name); // Make sure the method is public if ((method.access & Opcodes.ACC_PUBLIC) == 0) { Location location = context.getLocation(method, classNode); String message = String.format( "On click handler %1$s(View) must be public", method.name); context.report(ISSUE, location, message, null); } else if ((method.access & Opcodes.ACC_STATIC) != 0) { Location location = context.getLocation(method, classNode); String message = String.format( "On click handler %1$s(View) should not be static", method.name); context.report(ISSUE, location, message, null); } if (mNames.isEmpty()) { mNames = null; return; } } } } private void recordSimilar(String name, ClassNode classNode, MethodNode method) { if (mSimilar == null) { mSimilar = new HashMap<String, List<String>>(); } List<String> list = mSimilar.get(name); if (list == null) { list = new ArrayList<String>(); mSimilar.put(name, list); } String signature = ClassContext.createSignature(classNode.name, method.name, method.desc); list.add(signature); } }
gpl-2.0