repo_name
stringlengths 4
116
| path
stringlengths 4
379
| size
stringlengths 1
7
| content
stringlengths 3
1.05M
| license
stringclasses 15
values |
---|---|---|---|---|
shelan/jdk9-mirror | langtools/test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java | 21666 | /*
* Copyright (c) 2013, 2014, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 8005091 8009686 8025633 8026567
* @summary Make sure that type annotations are displayed correctly
* @author Bhavesh Patel
* @library ../lib
* @ignore 8006735 output type annotations in javadoc
* @build JavadocTester
* @run main TestTypeAnnotations
*/
public class TestTypeAnnotations extends JavadocTester {
public static void main(String... args) throws Exception {
TestTypeAnnotations tester = new TestTypeAnnotations();
tester.runTests();
}
@Test
void test() {
javadoc("-d", "out",
"-sourcepath", testSrc,
"-private",
"typeannos");
checkExit(Exit.OK);
// Test for type annotations on Class Extends (ClassExtends.java).
checkOutput("typeannos/MyClass.html", true,
"extends <a href=\"../typeannos/ClassExtA.html\" title=\"annotation "
+ "in typeannos\">@ClassExtA</a> <a href=\"../typeannos/ParameterizedClass.html\" "
+ "title=\"class in typeannos\">ParameterizedClass</a><<a href=\""
+ "../typeannos/ClassExtB.html\" title=\"annotation in typeannos\">"
+ "@ClassExtB</a> java.lang.String>",
"implements <a href=\"../typeannos/ClassExtB.html\" title=\""
+ "annotation in typeannos\">@ClassExtB</a> java.lang.CharSequence, "
+ "<a href=\"../typeannos/ClassExtA.html\" title=\"annotation in "
+ "typeannos\">@ClassExtA</a> <a href=\"../typeannos/ParameterizedInterface.html\" "
+ "title=\"interface in typeannos\">ParameterizedInterface</a><"
+ "<a href=\"../typeannos/ClassExtB.html\" title=\"annotation in "
+ "typeannos\">@ClassExtB</a> java.lang.String></pre>");
checkOutput("typeannos/MyInterface.html", true,
"extends <a href=\"../typeannos/ClassExtA.html\" title=\"annotation "
+ "in typeannos\">@ClassExtA</a> <a href=\"../typeannos/"
+ "ParameterizedInterface.html\" title=\"interface in typeannos\">"
+ "ParameterizedInterface</a><<a href=\"../typeannos/ClassExtA.html\" "
+ "title=\"annotation in typeannos\">@ClassExtA</a> java.lang.String>, "
+ "<a href=\"../typeannos/ClassExtB.html\" title=\"annotation in "
+ "typeannos\">@ClassExtB</a> java.lang.CharSequence</pre>");
// Test for type annotations on Class Parameters (ClassParameters.java).
checkOutput("typeannos/ExtendsBound.html", true,
"class <span class=\"typeNameLabel\">ExtendsBound<K extends <a "
+ "href=\"../typeannos/ClassParamA.html\" title=\"annotation in "
+ "typeannos\">@ClassParamA</a> java.lang.String></span>");
checkOutput("typeannos/ExtendsGeneric.html", true,
"<pre>class <span class=\"typeNameLabel\">ExtendsGeneric<K extends "
+ "<a href=\"../typeannos/ClassParamA.html\" title=\"annotation in "
+ "typeannos\">@ClassParamA</a> <a href=\"../typeannos/Unannotated.html\" "
+ "title=\"class in typeannos\">Unannotated</a><<a href=\""
+ "../typeannos/ClassParamB.html\" title=\"annotation in typeannos\">"
+ "@ClassParamB</a> java.lang.String>></span>");
checkOutput("typeannos/TwoBounds.html", true,
"<pre>class <span class=\"typeNameLabel\">TwoBounds<K extends <a href=\""
+ "../typeannos/ClassParamA.html\" title=\"annotation in typeannos\">"
+ "@ClassParamA</a> java.lang.String,V extends <a href=\"../typeannos/"
+ "ClassParamB.html\" title=\"annotation in typeannos\">@ClassParamB"
+ "</a> java.lang.String></span>");
checkOutput("typeannos/Complex1.html", true,
"class <span class=\"typeNameLabel\">Complex1<K extends <a href=\"../"
+ "typeannos/ClassParamA.html\" title=\"annotation in typeannos\">"
+ "@ClassParamA</a> java.lang.String & java.lang.Runnable></span>");
checkOutput("typeannos/Complex2.html", true,
"class <span class=\"typeNameLabel\">Complex2<K extends java.lang."
+ "String & <a href=\"../typeannos/ClassParamB.html\" title=\""
+ "annotation in typeannos\">@ClassParamB</a> java.lang.Runnable></span>");
checkOutput("typeannos/ComplexBoth.html", true,
"class <span class=\"typeNameLabel\">ComplexBoth<K extends <a href=\""
+ "../typeannos/ClassParamA.html\" title=\"annotation in typeannos\""
+ ">@ClassParamA</a> java.lang.String & <a href=\"../typeannos/"
+ "ClassParamA.html\" title=\"annotation in typeannos\">@ClassParamA"
+ "</a> java.lang.Runnable></span>");
// Test for type annotations on fields (Fields.java).
checkOutput("typeannos/DefaultScope.html", true,
"<pre><a href=\"../typeannos/Parameterized.html\" title=\"class in "
+ "typeannos\">Parameterized</a><<a href=\"../typeannos/FldA.html\" "
+ "title=\"annotation in typeannos\">@FldA</a> java.lang.String,<a "
+ "href=\"../typeannos/FldB.html\" title=\"annotation in typeannos\">"
+ "@FldB</a> java.lang.String> bothTypeArgs</pre>",
"<pre><a href=\"../typeannos/FldA.html\" title=\"annotation in "
+ "typeannos\">@FldA</a> java.lang.String <a href=\"../typeannos/"
+ "FldB.html\" title=\"annotation in typeannos\">@FldB</a> [] "
+ "array1Deep</pre>",
"<pre>java.lang.String[] <a href=\"../typeannos/FldB.html\" "
+ "title=\"annotation in typeannos\">@FldB</a> [] array2SecondOld</pre>",
"<pre><a href=\"../typeannos/FldD.html\" title=\"annotation in "
+ "typeannos\">@FldD</a> java.lang.String <a href=\"../typeannos/"
+ "FldC.html\" title=\"annotation in typeannos\">@FldC</a> <a href=\""
+ "../typeannos/FldA.html\" title=\"annotation in typeannos\">@FldA"
+ "</a> [] <a href=\"../typeannos/FldC.html\" title=\"annotation in "
+ "typeannos\">@FldC</a> <a href=\"../typeannos/FldB.html\" title=\""
+ "annotation in typeannos\">@FldB</a> [] array2Deep</pre>");
checkOutput("typeannos/ModifiedScoped.html", true,
"<pre>public final <a href=\"../typeannos/Parameterized.html\" "
+ "title=\"class in typeannos\">Parameterized</a><<a href=\"../"
+ "typeannos/FldA.html\" title=\"annotation in typeannos\">@FldA</a> "
+ "<a href=\"../typeannos/Parameterized.html\" title=\"class in "
+ "typeannos\">Parameterized</a><<a href=\"../typeannos/FldA.html\" "
+ "title=\"annotation in typeannos\">@FldA</a> java.lang.String,<a "
+ "href=\"../typeannos/FldB.html\" title=\"annotation in typeannos\">"
+ "@FldB</a> java.lang.String>,<a href=\"../typeannos/FldB.html\" "
+ "title=\"annotation in typeannos\">@FldB</a> java.lang.String> "
+ "nestedParameterized</pre>",
"<pre>public final <a href=\"../typeannos/FldA.html\" "
+ "title=\"annotation in typeannos\">@FldA</a> java.lang.String[][] "
+ "array2</pre>");
// Test for type annotations on method return types (MethodReturnType.java).
checkOutput("typeannos/MtdDefaultScope.html", true,
"<pre>public <T> <a href=\"../typeannos/MRtnA.html\" "
+ "title=\"annotation in typeannos\">@MRtnA</a> java.lang.String"
+ " method()</pre>",
"<pre><a href=\"../typeannos/MRtnA.html\" title=\"annotation in "
+ "typeannos\">@MRtnA</a> java.lang.String <a href=\"../typeannos/"
+ "MRtnA.html\" title=\"annotation in typeannos\">@MRtnA</a> [] <a "
+ "href=\"../typeannos/MRtnB.html\" title=\"annotation in typeannos\">"
+ "@MRtnB</a> [] array2Deep()</pre>",
"<pre><a href=\"../typeannos/MRtnA.html\" title=\"annotation in "
+ "typeannos\">@MRtnA</a> java.lang.String[][] array2()</pre>");
checkOutput("typeannos/MtdModifiedScoped.html", true,
"<pre>public final <a href=\"../typeannos/MtdParameterized.html\" "
+ "title=\"class in typeannos\">MtdParameterized</a><<a href=\"../"
+ "typeannos/MRtnA.html\" title=\"annotation in typeannos\">@MRtnA</a> "
+ "<a href=\"../typeannos/MtdParameterized.html\" title=\"class in "
+ "typeannos\">MtdParameterized</a><<a href=\"../typeannos/MRtnA."
+ "html\" title=\"annotation in typeannos\">@MRtnA</a> java.lang."
+ "String,<a href=\"../typeannos/MRtnB.html\" title=\"annotation in "
+ "typeannos\">@MRtnB</a> java.lang.String>,<a href=\"../typeannos/"
+ "MRtnB.html\" title=\"annotation in typeannos\">@MRtnB</a> java."
+ "lang.String> nestedMtdParameterized()</pre>");
// Test for type annotations on method type parameters (MethodTypeParameters.java).
checkOutput("typeannos/UnscopedUnmodified.html", true,
"<pre><K extends <a href=\"../typeannos/MTyParamA.html\" title=\""
+ "annotation in typeannos\">@MTyParamA</a> java.lang.String>"
+ " void methodExtends()</pre>",
"<pre><K extends <a href=\"../typeannos/MTyParamA.html\" title=\""
+ "annotation in typeannos\">@MTyParamA</a> <a href=\"../typeannos/"
+ "MtdTyParameterized.html\" title=\"class in typeannos\">"
+ "MtdTyParameterized</a><<a href=\"../typeannos/MTyParamB.html\" "
+ "title=\"annotation in typeannos\">@MTyParamB</a> java.lang.String"
+ ">> void nestedExtends()</pre>");
checkOutput("typeannos/PublicModifiedMethods.html", true,
"<pre>public final <K extends <a href=\"../typeannos/"
+ "MTyParamA.html\" title=\"annotation in typeannos\">@MTyParamA</a> "
+ "java.lang.String> void methodExtends()</pre>",
"<pre>public final <K extends <a href=\"../typeannos/"
+ "MTyParamA.html\" title=\"annotation in typeannos\">@MTyParamA</a> "
+ "java.lang.String,V extends <a href=\"../typeannos/MTyParamA.html\" "
+ "title=\"annotation in typeannos\">@MTyParamA</a> <a href=\"../"
+ "typeannos/MtdTyParameterized.html\" title=\"class in typeannos\">"
+ "MtdTyParameterized</a><<a href=\"../typeannos/MTyParamB.html\" "
+ "title=\"annotation in typeannos\">@MTyParamB</a> java.lang.String"
+ ">> void dual()</pre>");
// Test for type annotations on parameters (Parameters.java).
checkOutput("typeannos/Parameters.html", true,
"<pre>void unannotated(<a href=\"../typeannos/"
+ "ParaParameterized.html\" title=\"class in typeannos\">"
+ "ParaParameterized</a><java.lang.String,java.lang.String>"
+ " a)</pre>",
"<pre>void nestedParaParameterized(<a href=\"../typeannos/"
+ "ParaParameterized.html\" title=\"class in typeannos\">"
+ "ParaParameterized</a><<a href=\"../typeannos/ParamA.html\" "
+ "title=\"annotation in typeannos\">@ParamA</a> <a href=\"../"
+ "typeannos/ParaParameterized.html\" title=\"class in typeannos\">"
+ "ParaParameterized</a><<a href=\"../typeannos/ParamA.html\" "
+ "title=\"annotation in typeannos\">@ParamA</a> java.lang.String,"
+ "<a href=\"../typeannos/ParamB.html\" title=\"annotation in "
+ "typeannos\">@ParamB</a> java.lang.String>,<a href=\"../"
+ "typeannos/ParamB.html\" title=\"annotation in typeannos\">@ParamB"
+ "</a> java.lang.String> a)</pre>",
"<pre>void array2Deep(<a href=\"../typeannos/ParamA.html\" "
+ "title=\"annotation in typeannos\">@ParamA</a> java.lang.String "
+ "<a href=\"../typeannos/ParamA.html\" title=\"annotation in "
+ "typeannos\">@ParamA</a> [] <a href=\"../typeannos/ParamB.html\" "
+ "title=\"annotation in typeannos\">@ParamB</a> [] a)</pre>");
// Test for type annotations on throws (Throws.java).
checkOutput("typeannos/ThrDefaultUnmodified.html", true,
"<pre>void oneException()\n"
+ " throws <a href=\"../typeannos/ThrA.html\" title=\""
+ "annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>",
"<pre>void twoExceptions()\n"
+ " throws <a href=\"../typeannos/ThrA.html\" title=\""
+ "annotation in typeannos\">@ThrA</a> java.lang.RuntimeException,\n"
+ " <a href=\"../typeannos/ThrA.html\" title=\""
+ "annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>");
checkOutput("typeannos/ThrPublicModified.html", true,
"<pre>public final void oneException(java.lang.String a)\n"
+ " throws <a href=\"../typeannos/ThrA.html\" "
+ "title=\"annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>",
"<pre>public final void twoExceptions(java.lang.String a)\n"
+ " throws <a href=\"../typeannos/ThrA.html\" "
+ "title=\"annotation in typeannos\">@ThrA</a> java.lang.RuntimeException,\n"
+ " <a href=\"../typeannos/ThrA.html\" "
+ "title=\"annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>");
checkOutput("typeannos/ThrWithValue.html", true,
"<pre>void oneException()\n"
+ " throws <a href=\"../typeannos/ThrB.html\" title=\""
+ "annotation in typeannos\">@ThrB</a>(<a href=\"../typeannos/"
+ "ThrB.html#value--\">value</a>=\"m\") java.lang.Exception</pre>",
"<pre>void twoExceptions()\n"
+ " throws <a href=\"../typeannos/ThrB.html\" title=\""
+ "annotation in typeannos\">@ThrB</a>(<a href=\"../typeannos/"
+ "ThrB.html#value--\">value</a>=\"m\") java.lang.RuntimeException,\n"
+ " <a href=\"../typeannos/ThrA.html\" title=\""
+ "annotation in typeannos\">@ThrA</a> java.lang.Exception</pre>");
// Test for type annotations on type parameters (TypeParameters.java).
checkOutput("typeannos/TestMethods.html", true,
"<pre><K,V extends <a href=\"../typeannos/TyParaA.html\" title=\""
+ "annotation in typeannos\">@TyParaA</a> java.lang.String> "
+ "void secondAnnotated()</pre>");
// Test for type annotations on wildcard type (Wildcards.java).
checkOutput("typeannos/BoundTest.html", true,
"<pre>void wcExtends(<a href=\"../typeannos/MyList.html\" "
+ "title=\"class in typeannos\">MyList</a><? extends <a href=\""
+ "../typeannos/WldA.html\" title=\"annotation in typeannos\">@WldA"
+ "</a> java.lang.String> l)</pre>",
"<pre><a href=\"../typeannos/MyList.html\" title=\"class in "
+ "typeannos\">MyList</a><? super <a href=\"../typeannos/WldA.html\" "
+ "title=\"annotation in typeannos\">@WldA</a> java.lang.String>"
+ " returnWcSuper()</pre>");
checkOutput("typeannos/BoundWithValue.html", true,
"<pre>void wcSuper(<a href=\"../typeannos/MyList.html\" title=\""
+ "class in typeannos\">MyList</a><? super <a href=\"../typeannos/"
+ "WldB.html\" title=\"annotation in typeannos\">@WldB</a>(<a href=\""
+ "../typeannos/WldB.html#value--\">value</a>=\"m\") java.lang."
+ "String> l)</pre>",
"<pre><a href=\"../typeannos/MyList.html\" title=\"class in "
+ "typeannos\">MyList</a><? extends <a href=\"../typeannos/WldB."
+ "html\" title=\"annotation in typeannos\">@WldB</a>(<a href=\"../"
+ "typeannos/WldB.html#value--\">value</a>=\"m\") java.lang.String"
+ "> returnWcExtends()</pre>");
// Test for receiver annotations (Receivers.java).
checkOutput("typeannos/DefaultUnmodified.html", true,
"<pre>void withException(<a href=\"../typeannos/RcvrA.html\" "
+ "title=\"annotation in typeannos\">@RcvrA</a> "
+ "DefaultUnmodified this)\n"
+ " throws java."
+ "lang.Exception</pre>",
"<pre>java.lang.String nonVoid(<a href=\"../typeannos/RcvrA."
+ "html\" title=\"annotation in typeannos\">@RcvrA</a> <a href=\"../"
+ "typeannos/RcvrB.html\" title=\"annotation in typeannos\">@RcvrB"
+ "</a>(<a href=\"../typeannos/RcvrB.html#value--\">value</a>=\"m\")"
+ " DefaultUnmodified this)</pre>",
"<pre><T extends java.lang.Runnable> void accept("
+ "<a href=\"../typeannos/RcvrA.html\" title=\"annotation in "
+ "typeannos\">@RcvrA</a> DefaultUnmodified this,\n"
+ " T r)\n"
+ " throws java.lang.Exception</pre>");
checkOutput("typeannos/PublicModified.html", true,
"<pre>public final java.lang.String nonVoid(<a href=\""
+ "../typeannos/RcvrA.html\" title=\"annotation in typeannos\">"
+ "@RcvrA</a> PublicModified this)</pre>",
"<pre>public final <T extends java.lang.Runnable> "
+ "void accept(<a href=\"../typeannos/RcvrA.html\" title=\""
+ "annotation in typeannos\">@RcvrA</a> PublicModified this,\n"
+ " T r)\n"
+ " throws java.lang.Exception</pre>");
checkOutput("typeannos/WithValue.html", true,
"<pre><T extends java.lang.Runnable> void accept("
+ "<a href=\"../typeannos/RcvrB.html\" title=\"annotation in "
+ "typeannos\">@RcvrB</a>(<a href=\"../typeannos/RcvrB.html#value--\">"
+ "value</a>=\"m\") WithValue this,\n"
+ " T r)\n"
+ " throws java.lang.Exception</pre>");
checkOutput("typeannos/WithFinal.html", true,
"<pre>java.lang.String nonVoid(<a href=\"../typeannos/RcvrB."
+ "html\" title=\"annotation in typeannos\">@RcvrB</a>(<a href=\"../"
+ "typeannos/RcvrB.html#value--\">value</a>=\"m\") WithFinal"
+ " this)</pre>");
checkOutput("typeannos/WithBody.html", true,
"<pre>void field(<a href=\"../typeannos/RcvrA.html\" title=\""
+ "annotation in typeannos\">@RcvrA</a> WithBody this)</pre>");
checkOutput("typeannos/Generic2.html", true,
"<pre>void test2(<a href=\"../typeannos/RcvrA.html\" title=\""
+ "annotation in typeannos\">@RcvrA</a> Generic2<X> this)</pre>");
}
}
| gpl-2.0 |
LeraB/Boat-theme | template-parts/content-none.php | 1118 | <?php
/**
* Template part for displaying a message that posts cannot be found
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package Boat
*/
?>
<section class="no-results not-found">
<header class="page-header">
<h1 class="page-title"><?php esc_html_e( 'Nothing Found', 'boat' ); ?></h1>
</header><!-- .page-header -->
<div class="page-content">
<?php
if ( is_home() && current_user_can( 'publish_posts' ) ) : ?>
<p><?php printf( wp_kses( __( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'boat' ), array( 'a' => array( 'href' => array() ) ) ), esc_url( admin_url( 'post-new.php' ) ) ); ?></p>
<?php elseif ( is_search() ) : ?>
<p><?php esc_html_e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'boat' ); ?></p>
<?php
get_search_form();
else : ?>
<p><?php esc_html_e( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', 'boat' ); ?></p>
<?php
get_search_form();
endif; ?>
</div><!-- .page-content -->
</section><!-- .no-results -->
| gpl-2.0 |
fozziethebeat/C-Cat | core/src/main/java/gov/llnl/ontology/mapreduce/table/NYT03Table.java | 315 | package gov.llnl.ontology.mapreduce.table;
/**
* A subclass of {@link TrinidadTable} which simply has the name "nyt03".
*
* @author Keith Stevens
*/
public class NYT03Table extends TrinidadTable {
/**
* Returns {@code nyt03}.
*/
public String tableName() {
return "nyt03";
}
}
| gpl-2.0 |
shimpe/frescobaldi | frescobaldi_app/midiinput/elements.py | 5175 | """
Elements that can be inserted by MIDI events
"""
from PyQt4.QtCore import Qt
from PyQt4.QtGui import QApplication
import ly.pitch
class Note:
LastPitch = ly.pitch.Pitch()
def __init__(self, midinote, notemapping):
# get correct note 0...11 = c...b
# and octave corresponding to octave modifiers ',' & '''
self._midinote = midinote
self._octave, self._note = divmod(midinote, 12)
self._octave -= 4
self._pitch = ly.pitch.Pitch(notemapping[self._note][0], notemapping[self._note][1], self._octave)
def output(self, relativemode=False, language='nederlands'):
if relativemode:
# makeRelative changes pitch, so we need temporary variables for note and octave
lastnote = self._pitch.note
lastoctave = self._pitch.octave
self._pitch.makeRelative(Note.LastPitch)
Note.LastPitch.note = lastnote
Note.LastPitch.octave = lastoctave
# also octavecheck if Shift is held
return self._pitch.output(language) + (('='+ly.pitch.octaveToString(self._octave)) if QApplication.keyboardModifiers() & Qt.SHIFT else '')
def midinote(self):
return self._midinote
class Chord(object):
def __init__(self):
self._notes = list()
def add(self, note):
self._notes.append(note)
def output(self, relativemode=False, language='nederlands'):
if len(self._notes) == 1: # only one note, no chord
return self._notes[0].output(relativemode, language)
else: # so we have a chord, print <chord>
sortednotes = sorted(self._notes, key=lambda note: note.midinote())
chord = ''
# temporary variables, to reset LastPitch after this chord
lastnote = sortednotes[0]._pitch.note
lastoctave = sortednotes[0]._pitch.octave
for n in sortednotes:
chord += n.output(relativemode, language) + ' '
Note.LastPitch.note = lastnote
Note.LastPitch.octave = lastoctave
return '<' + chord[:-1] + '>' # strip last space
class NoteMappings:
def to_sharp(self, note, alteration):
if alteration==0.5:
return (note, alteration)
return (note-1 if note > 0 else 6, 0.5)
def to_flat(self, note, alteration):
if alteration==-0.5:
return (note, alteration)
return (note+1 if note <6 else 0, -0.5)
def __init__(self):
self.key_order_sharp = [6, 1, 8, 3, 10, 5, 0]
self.key_order_flat = [10, 3, 8, 1, 6, 11, 4]
self.sharps = [(0, 0), # c
(0, 0.5), # cis
(1, 0), # d
(1, 0.5), # dis
(2, 0), # e
(3, 0), # f
(3, 0.5), # fis
(4, 0), # g
(4, 0.5), # gis
(5, 0), # a
(5, 0.5), # ais
(6, 0)] # b
self.flats = [(0, 0), # c
(1, -0.5), # des
(1, 0), # d
(2, -0.5), # es
(2, 0), # e
(3, 0), # f
(4, -0.5), # ges
(4, 0), # g
(5, -0.5), # aes
(5, 0), # a
(6, -0.5), # bes
(6, 0)] # b
# Construct all possible mappings using some replacement logic
self.sharp_mappings = []
self.flat_mappings = []
for i in range(len(self.key_order_flat)-1, -1, -1):
flatmap = list(self.flats) # copy existing list
sharpmap = list(self.sharps) # copy existing list
for k in self.key_order_flat[:i+1]:
flatmap[k] = self.to_flat(*flatmap[k])
sharpmap[k] = self.to_flat(*sharpmap[k])
self.flat_mappings.append(flatmap)
self.sharp_mappings.append(sharpmap)
self.sharp_mappings.append(self.sharps) # Append C major signature -> no key alteration
self.flat_mappings.append(self.flats) # Append C major signature -> no key alteration
for i in range(len(self.key_order_sharp)):
flatmap = list(self.flats) # copy existing list
sharpmap = list(self.sharps) # copy existing list
for k in self.key_order_sharp[:i+1]:
flatmap[k] = self.to_sharp(*flatmap[k])
sharpmap[k] = self.to_sharp(*sharpmap[k])
self.flat_mappings.append(flatmap)
self.sharp_mappings.append(sharpmap)
class NoteMapping:
mappings = NoteMappings()
def __init__(self, keysignature, sharps=True):
if sharps:
self.mapping = NoteMapping.mappings.sharp_mappings[keysignature]
else:
self.mapping = NoteMapping.mappings.flat_mappings[keysignature]
def __len__(self):
return len(self.mapping)
def __getitem__(self, index):
return self.mapping[index]
| gpl-2.0 |
redeanisioteixeira/aew_github | library/Zend/Soap/Wsdl/Strategy/ArrayOfTypeComplex.php | 4695 | <?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Soap
* @subpackage Wsdl
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: ArrayOfTypeComplex.php 1 2016-05-25 16:47:26Z admin $
*/
require_once "Zend/Soap/Wsdl/Strategy/DefaultComplexType.php";
class Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex extends Zend_Soap_Wsdl_Strategy_DefaultComplexType
{
protected $_inProcess = array();
/**
* Add an ArrayOfType based on the xsd:complexType syntax if type[] is detected in return value doc comment.
*
* @param string $type
* @return string tns:xsd-type
*/
public function addComplexType($type)
{
if(in_array($type, $this->_inProcess)) {
require_once "Zend/Soap/Wsdl/Exception.php";
throw new Zend_Soap_Wsdl_Exception("Infinite recursion, cannot nest '".$type."' into itsself.");
}
$this->_inProcess[$type] = $type;
$nestingLevel = $this->_getNestedCount($type);
if($nestingLevel > 1) {
require_once "Zend/Soap/Wsdl/Exception.php";
throw new Zend_Soap_Wsdl_Exception(
"ArrayOfTypeComplex cannot return nested ArrayOfObject deeper than ".
"one level. Use array object properties to return deep nested data.
");
}
$singularType = $this->_getSingularPhpType($type);
if(!class_exists($singularType)) {
require_once "Zend/Soap/Wsdl/Exception.php";
throw new Zend_Soap_Wsdl_Exception(sprintf(
"Cannot add a complex type %s that is not an object or where ".
"class could not be found in 'DefaultComplexType' strategy.", $type
));
}
if($nestingLevel == 1) {
// The following blocks define the Array of Object structure
$xsdComplexTypeName = $this->_addArrayOfComplexType($singularType, $type);
} else {
$xsdComplexTypeName = $singularType;
}
// The array for the objects has been created, now build the object definition:
if(!in_array($singularType, $this->getContext()->getTypes())) {
parent::addComplexType($singularType);
}
unset($this->_inProcess[$type]);
return "tns:".$xsdComplexTypeName;
}
protected function _addArrayOfComplexType($singularType, $type)
{
$dom = $this->getContext()->toDomDocument();
$xsdComplexTypeName = $this->_getXsdComplexTypeName($singularType);
if(!in_array($xsdComplexTypeName, $this->getContext()->getTypes())) {
$complexType = $dom->createElement('xsd:complexType');
$complexType->setAttribute('name', $xsdComplexTypeName);
$complexContent = $dom->createElement("xsd:complexContent");
$complexType->appendChild($complexContent);
$xsdRestriction = $dom->createElement("xsd:restriction");
$xsdRestriction->setAttribute('base', 'soap-enc:Array');
$complexContent->appendChild($xsdRestriction);
$xsdAttribute = $dom->createElement("xsd:attribute");
$xsdAttribute->setAttribute("ref", "soap-enc:arrayType");
$xsdAttribute->setAttribute("wsdl:arrayType", sprintf("tns:%s[]", $singularType));
$xsdRestriction->appendChild($xsdAttribute);
$this->getContext()->getSchema()->appendChild($complexType);
$this->getContext()->addType($xsdComplexTypeName);
}
return $xsdComplexTypeName;
}
protected function _getXsdComplexTypeName($type)
{
return sprintf('ArrayOf%s', $type);
}
/**
* From a nested defintion with type[], get the singular PHP Type
*
* @param string $type
* @return string
*/
protected function _getSingularPhpType($type)
{
return str_replace("[]", "", $type);
}
/**
* Return the array nesting level based on the type name
*
* @param string $type
* @return integer
*/
protected function _getNestedCount($type)
{
return substr_count($type, "[]");
}
} | gpl-2.0 |
ncareol/nidas | src/nidas/apps/ublox.cc | 22708 | // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 4; -*-
// vim: set shiftwidth=4 softtabstop=4 expandtab:
/*
********************************************************************
** NIDAS: NCAR In-situ Data Acquistion Software
**
** 2006, Copyright University Corporation for Atmospheric Research
**
** 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.
**
** The LICENSE.txt file accompanying this software contains
** a copy of the GNU General Public License. If it is not found,
** write to the Free Software Foundation, Inc.,
** 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
**
********************************************************************
*/
/*
Configure a Ublox GPS via I2C.
The Ublox 6Q has 3 boot-time configuration pins:
CFG_COM0, CFG_COM1 and CFG_GPS0. See the NEO 6 data sheet.
On the HAT board for the ISFS RaspberryPi2 these
pins are at 3.3V, which results in the following settings:
CFG_COM0=1, CFG_COM1=1: NMEA, 9600 baud
CFG_GPS0=1, max performance mode.
*/
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <linux/i2c-dev.h>
#include <cstdlib>
#include <string.h>
#include <stdint.h>
#include <errno.h>
#include <ctype.h>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <map>
#include <vector>
#include <nidas/util/IOException.h>
using namespace std;
#define MSECS_PER_SEC (1000)
#define USECS_PER_SEC (1000 * 1000)
namespace n_u = nidas::util;
class ublox_pkt
{
public:
ublox_pkt(uint8_t uclass, uint8_t id, uint16_t paylen);
ublox_pkt(uint16_t paylen);
~ublox_pkt();
uint8_t sync1() const { return _pkt[0]; }
uint8_t sync2() const { return _pkt[1]; }
uint8_t uclass() const { return _pkt[2]; }
uint8_t id() const { return _pkt[3]; }
uint8_t* payload() const { return _pkt + 6; }
// set the payload
void payload(void* ptr) { memcpy(payload(), ptr, _paylen); }
// total length of packet
int16_t len() const { return _paylen + 8; }
// pointer to beginning of packet
char* beginp() const { return (char*) _pkt; }
// pointer to one-past-the end
char* endp() const { return beginp() + len(); }
// length of payload as found in packet
int16_t paylen() const
{
return ((uint16_t) _pkt[5] << 8) + _pkt[4];
}
// pointer to first byte of checksum
uint8_t* cksump() const { return (uint8_t*)beginp() + _paylen + 6; }
// compute checksum
void cksum();
private:
int16_t _paylen;
uint8_t* _pkt;
// no copying
ublox_pkt(const ublox_pkt&);
// no assignment
ublox_pkt& operator = (const ublox_pkt&);
};
ublox_pkt::ublox_pkt(uint8_t uclass, uint8_t id, uint16_t paylen):
_paylen(paylen), _pkt(new uint8_t[len()])
{
memset(_pkt, 0, len());
_pkt[0] = 0xb5; // sync 1
_pkt[1] = 0x62; // sync 2
_pkt[2] = uclass;
_pkt[3] = id;
_pkt[4] = (_paylen & 0xff);
_pkt[5] = (_paylen & 0xff00) >> 8;
}
ublox_pkt::ublox_pkt(uint16_t paylen):
_paylen(paylen), _pkt(new uint8_t[len()])
{
memset(_pkt, 0, len());
}
ublox_pkt::~ublox_pkt()
{
delete [] _pkt;
}
void ublox_pkt::cksum()
{
unsigned char ck_a = 0, ck_b = 0;
for (uint8_t* cp = _pkt + 2 ; cp < cksump(); cp++) {
ck_a += *cp;
ck_b += ck_a;
}
cksump()[0] = ck_a;
cksump()[1] = ck_b;
}
/**
* Ubox IDs for standard NMEA messages
*/
enum NMEA_ID {
GGA, // 0x00
GLL, // 0x01
GSA, // 0x02
GSV, // 0x03
RMC, // 0x04
VTG, // 0x05
GRS, // 0x06
GST, // 0x07
ZDA, // 0x08
GBS, // 0x09
DTM, // 0x0a
GPQ=0x40,
TXT=0x41
};
class ublox {
public:
ublox();
~ublox();
int parseRunstring(int argc, char** argv);
static int usage(const char* argv0);
int run() throw();
void write_smbus(const ublox_pkt& pkt) throw(n_u::IOException);
void write_smbus(const string& str) throw(n_u::IOException);
void write_rdwr(const ublox_pkt& pkt) throw(n_u::IOException);
void write_rdwr(const string& str) throw(n_u::IOException);
void read_rdwr_simple(string& str) throw(n_u::IOException);
void read_rdwr_simple2(string& str) throw(n_u::IOException);
void read_rdwr(string& str) throw(n_u::IOException);
string read_smbus() throw(n_u::IOException);
int read_byte() throw(n_u::IOException);
int read_byte_data(unsigned char reg) throw(n_u::IOException);
void write_byte(unsigned char b) throw(n_u::IOException);
void write_byte_data(unsigned char b, unsigned char reg) throw(n_u::IOException);
void reset() throw(n_u::IOException);
void config_port() throw(n_u::IOException);
void set_rate(int rate) throw(n_u::IOException);
void config_ubx() throw(n_u::IOException);
void config_nmea(enum NMEA_ID id, bool enable) throw(n_u::IOException);
/**
* Send a "$PUBX,40,..." proprietory message to enable/disable
* NMEA messages.
*/
void config_nmea(const string&, bool enable) throw(n_u::IOException);
void config_nmea_all_targets(enum NMEA_ID id, bool enable) throw(n_u::IOException);
static string nmea_cksum(const string& msg);
private:
string progname;
string _name;
unsigned short _addr;
int _fd;
map<string,enum NMEA_ID> _nmea_map;
vector<string> _enable_msgs;
vector<string> _disable_msgs;
bool _readback;
};
ublox::ublox():progname(),_name(),_addr(0), _fd(-1),
_nmea_map(), _enable_msgs(), _disable_msgs(),
_readback(false)
{
_nmea_map["GGA"] = GGA;
_nmea_map["GLL"] = GLL;
_nmea_map["GSA"] = GSA;
_nmea_map["GSV"] = GSV;
_nmea_map["RMC"] = RMC;
_nmea_map["VTG"] = VTG;
_nmea_map["GRS"] = GRS;
_nmea_map["GST"] = GST;
_nmea_map["ZDA"] = ZDA;
_nmea_map["GBS"] = GBS;
_nmea_map["DTM"] = DTM;
_nmea_map["GPQ"] = GPQ;
_nmea_map["TXT"] = TXT;
}
ublox::~ublox()
{
if (_fd >= 0) close(_fd);
}
enum reset_type
{
HOTSTART,
WARMSTART,
COLDSTART = 0xffff
};
void ublox::set_rate(int rate) throw(n_u::IOException)
{
ublox_pkt pkt(0x06, 0x08, 6); // CFG-RST packet
struct cfg_rate {
uint16_t measRate;
uint16_t navRate;
uint16_t timeRef;
} payload;
payload.measRate = 1000 / rate; // milliseconds/sample
payload.navRate = 1; // milliseconds/sample
payload.timeRef = 0; // milliseconds/sample
pkt.payload(&payload);
pkt.cksum();
write_rdwr(pkt);
}
void ublox::reset() throw(n_u::IOException)
{
ublox_pkt pkt(0x06, 0x04, 4); // CFG-RST packet
struct rst {
uint16_t navBbrMask;
uint8_t resetMode;
uint8_t res;
} payload;
payload.navBbrMask = HOTSTART;
payload.resetMode = 0x9; // controlled GPS start
payload.res = 0x0;
pkt.payload(&payload);
pkt.cksum();
write_smbus(pkt);
}
void ublox::config_port() throw(n_u::IOException)
{
ublox_pkt msg(0x06, 0x00, 20); // CFG-PRT packet
/**
* UBX payload packets.
*/
struct cfg_prt_payload {
unsigned char portID;
unsigned char res0[3];
unsigned int mode;
unsigned int res1;
unsigned short inProtoMask;
unsigned short outProtoMask;
unsigned short flags;
unsigned short res2;
} ppay;
memset(&ppay,0,sizeof(ppay));
ppay.portID = 0x0; // DDC
ppay.mode = 0x42; // i2c address
ppay.inProtoMask = 0x3; // NMEA and UBX
ppay.outProtoMask = 0x3; // NMEA and UBX
msg.payload(&ppay);
msg.cksum();
write_smbus(msg);
usleep(USECS_PER_SEC / 4);
read_smbus();
}
void ublox::config_nmea(const string& msg, bool enable) throw(n_u::IOException)
{
ostringstream ost;
ost << "$PUBX,40," << msg << ',' <<
(int) enable << ',' << (int) enable << ',' << (int) enable << ',' <<
(int) enable << ',' << (int) enable << ',' << 0;
string cs = nmea_cksum(ost.str());
ost << '*' << cs << "\r\n";
#ifdef DEBUG
cerr << "config_nmea, ost=" << ost.str() << endl;
#endif
#define WRITE_RDWR
#ifdef WRITE_RDWR
write_rdwr(ost.str());
#else
write_smbus(ost.str());
#endif
}
void ublox::config_ubx() throw(n_u::IOException)
{
int portId = 0; // port id is 0 for DDC (I2C)
string inputProtMask = "0003"; // 2=NMEA, 1=UBX
string outputProtMask = "0002"; // 2=NMEA, 1=UBX
string baud = "100000"; // does it matter for DDC (I2C)?
int autobaud = 0; // shouldn't matter for DDC (I2C)
ostringstream ost;
ost << "$PUBX,41," << portId << ',' <<
inputProtMask << ',' <<
outputProtMask << ',' <<
baud << ',' <<
autobaud;
cerr << "ost=" << ost.str() << endl;
string cs = nmea_cksum(ost.str());
ost << '*' << cs << "\r\n";
cerr << "config_ubx, ost=" << ost.str() << endl;
write_rdwr(ost.str());
}
void ublox::config_nmea_all_targets(enum NMEA_ID id, bool enable) throw(n_u::IOException)
{
ublox_pkt pkt(0x06, 0x01, 8);
pkt.payload()[0] = 0xf0;
pkt.payload()[1] = id;
for (int i = 2; i < 8; i++) pkt.payload()[i] = enable;
pkt.cksum();
write_smbus(pkt);
usleep(USECS_PER_SEC / 4);
read_smbus();
}
void ublox::config_nmea(enum NMEA_ID id, bool enable) throw(n_u::IOException)
{
ublox_pkt pkt(0x06, 0x01, 3);
pkt.payload()[0] = 0xf0;
pkt.payload()[1] = id;
pkt.payload()[2] = enable;
pkt.cksum();
write_smbus(pkt);
usleep(USECS_PER_SEC / 4);
read_smbus();
}
string ublox::nmea_cksum(const string& msg)
{
string::const_iterator cp = msg.begin();
if (*cp == '$') cp++;
char calcsum = 0;
for ( ; cp < msg.end(); ) calcsum ^= *cp++;
ostringstream ost;
ost << hex << setfill('0') << setw(2) << (unsigned int) calcsum;
return ost.str();
}
void ublox::write_rdwr(const string& str) throw(n_u::IOException)
{
struct i2c_msg rdwr_msgs[2];
struct i2c_rdwr_ioctl_data rdwr_data;
rdwr_msgs[0].addr = _addr;
rdwr_msgs[0].flags = 0; // write
rdwr_msgs[0].len = str.length();
rdwr_msgs[0].buf = (char*) str.c_str();
rdwr_data.msgs = rdwr_msgs;
rdwr_data.nmsgs = 1;
int res = ioctl(_fd, I2C_RDWR, &rdwr_data );
if (res < 0) {
ostringstream ost;
ost << "I2C_RDWR, write 1 msg, len=" << str.length();
throw n_u::IOException(_name, ost.str(), errno);
}
#ifdef DEBUG
cerr << "write_rdwr(str), ioctl 1 res=" << res << endl; // 1
#endif
}
short len_swab(const char* cp)
{
return ((unsigned char)cp[0] << 8) +
(unsigned char)cp[1];
}
void ublox::read_rdwr_simple(string& str) throw(n_u::IOException)
{
struct i2c_msg rdwr_msgs[3];
struct i2c_rdwr_ioctl_data rdwr_data;
int res;
unsigned char reg = 0xff;
rdwr_msgs[0].addr = _addr;
rdwr_msgs[0].flags = 0; // write
rdwr_msgs[0].len = 1;
rdwr_msgs[0].buf = (char*)®
char buffer[8192];
memset(buffer,0,sizeof(buffer));
rdwr_msgs[1].addr = _addr;
rdwr_msgs[1].flags = I2C_M_RD; // read
rdwr_msgs[1].len = 8192;
rdwr_msgs[1].buf = buffer;
rdwr_data.msgs = rdwr_msgs;
rdwr_data.nmsgs = 2;
res = ioctl(_fd, I2C_RDWR, &rdwr_data );
if (res < 0) {
ostringstream ost;
ost << "I2C_RDWR, write/read";
throw n_u::IOException(_name, ost.str(), errno);
}
int l = 0;
for (const char* cp = buffer; *cp != 0xff && *cp; cp++,l++)
cerr << *cp << ' ';
cerr << endl;
cerr << "l=" << l << endl;
str.assign(buffer,l);
}
void ublox::read_rdwr_simple2(string& str) throw(n_u::IOException)
{
struct i2c_msg rdwr_msgs[1];
struct i2c_rdwr_ioctl_data rdwr_data;
int res;
char buffer[32];
memset(buffer,0,sizeof(buffer));
rdwr_msgs[0].addr = _addr;
rdwr_msgs[0].flags = I2C_M_RD; // read
rdwr_msgs[0].len = 32;
rdwr_msgs[0].buf = buffer;
rdwr_data.msgs = rdwr_msgs;
rdwr_data.nmsgs = 1;
res = ioctl(_fd, I2C_RDWR, &rdwr_data );
if (res < 0) {
ostringstream ost;
ost << "I2C_RDWR, read 1 msg";
throw n_u::IOException(_name, ost.str(), errno);
}
int l = 0;
for (const char* cp = buffer;
cp < buffer + sizeof(buffer) && *cp != 0xff && *cp; cp++,l++) {
if (isprint(*cp)) cerr << *cp << ' ';
else cerr << "\\x" << setw(2) << setfill('0') << hex <<
(int)*cp << dec << ' ';
}
cerr << endl;
cerr << "l=" << l << endl;
str.assign(buffer,l);
}
void ublox::read_rdwr(string& str) throw(n_u::IOException)
{
struct i2c_msg rdwr_msgs[3];
struct i2c_rdwr_ioctl_data rdwr_data;
int res;
unsigned char reg = 0xfd;
rdwr_msgs[0].addr = _addr;
rdwr_msgs[0].flags = 0; // write
rdwr_msgs[0].len = 1;
rdwr_msgs[0].buf = (char*)®
char buffer[8192];
memset(buffer,0,sizeof(buffer));
rdwr_msgs[1].addr = _addr;
rdwr_msgs[1].flags = I2C_M_RD; // read
rdwr_msgs[1].len = 8192;
rdwr_msgs[1].buf = buffer;
rdwr_data.msgs = rdwr_msgs;
rdwr_data.nmsgs = 2;
res = ioctl(_fd, I2C_RDWR, &rdwr_data );
if (res < 0) {
ostringstream ost;
ost << "I2C_RDWR, write/read";
throw n_u::IOException(_name, ost.str(), errno);
}
cerr << "read_rdwr(str), ioctl 2 res=" << res << endl; // 2
short len = len_swab(buffer);
cerr << "read_rdwr(str), ioctl 2 len=" << len << endl; //
cerr << "received: ";
int l = 0;
for (const char* cp = buffer + 2; *cp != 0xff && *cp; cp++,l++) {
if (isprint(*cp)) cerr << *cp << ' ';
else cerr << "\\x" << setw(2) << setfill('0') << hex <<
(int)*cp << dec << ' ';
}
cerr << endl;
cerr << "l=" << l << endl;
str.assign(buffer,l);
}
void ublox::write_rdwr(const ublox_pkt& pkt) throw(n_u::IOException)
{
struct i2c_msg rdwr_msgs[2];
struct i2c_rdwr_ioctl_data rdwr_data;
rdwr_msgs[0].addr = _addr;
rdwr_msgs[0].flags = 0; // write
rdwr_msgs[0].len = pkt.len();
rdwr_msgs[0].buf = pkt.beginp();
rdwr_data.msgs = rdwr_msgs;
rdwr_data.nmsgs = 1;
int res = ioctl(_fd, I2C_RDWR, &rdwr_data );
if (res < 0) {
ostringstream ost;
ost << "I2C_RDWR, write 1 msg, len=" << pkt.len();
throw n_u::IOException(_name, ost.str(), errno);
}
ublox_pkt ack(2);
unsigned char reg = 0xfd;
rdwr_msgs[0].addr = _addr;
rdwr_msgs[0].flags = 0; // write
rdwr_msgs[0].len = 1;
rdwr_msgs[0].buf = (char*)®
rdwr_msgs[1].addr = _addr;
rdwr_msgs[1].flags = I2C_M_RD; // read
rdwr_msgs[1].len = ack.len();
rdwr_msgs[1].buf = ack.beginp();
rdwr_data.msgs = rdwr_msgs;
rdwr_data.nmsgs = 2;
res = ioctl(_fd, I2C_RDWR, &rdwr_data );
if (res < 0) {
ostringstream ost;
ost << "I2C_RDWR, write/read";
throw n_u::IOException(_name, ost.str(), errno);
}
cerr << hex << "sync1=" << (unsigned int)ack.sync1() <<
", sync2=" << (unsigned int)ack.sync2() <<
", uclass=" << (unsigned int)ack.uclass() <<
", id=" << (unsigned int)ack.id() <<
", payload[0]=" << (unsigned int)ack.payload()[0] <<
", payload[1]=" << (unsigned int)ack.payload()[1] << dec << endl;
#ifdef READ_BACK
#endif
}
void ublox::write_smbus(const string& str) throw(n_u::IOException)
{
string::const_iterator cp = str.begin();
int res = 0;
for ( ; cp != str.end(); cp++,res++) {
write_byte(*cp);
}
}
void ublox::write_smbus(const ublox_pkt& pkt) throw(n_u::IOException)
{
char *mp = pkt.beginp();
for (int i = 0; mp < pkt.endp(); mp++,i++) {
cerr << "write byte " << i << "=" << hex <<
(unsigned int) *mp << dec << endl;
write_byte_data((unsigned char)*mp, 0);
}
}
string ublox::read_smbus() throw(n_u::IOException)
{
string res;
#ifdef READ_LEN_REGS
unsigned char reg = 0xfd;
int c1 = read_byte_data(reg);
int c2 = read_byte();
if ((c1 & 0xff) != 0xff && (c2 & 0xff) != 0xff) {
int len = ((c1 & 0xff) << 8) + (c2 & 0xff);
cerr << "response len " << len << endl;
for (int i = 0; i < len; i++) {
int db = read_byte();
cerr << "read: byte " << i << "=" << hex <<
(unsigned int)(db & 0xff) << dec << endl;
}
}
else {
cerr << "read: no len info from 0xfd, 0xfe" << endl;
for (int i = 0; ; i++) {
int db = read_byte();
cerr << "read: byte " << i << "=" << hex <<
(unsigned int)(db & 0xff) << dec << endl;
if ((db & 0xff) == 0xff) break;
}
}
#else
for (int i = 0; ; i++) {
int db = read_byte();
#ifdef DEBUG
cerr << "read: byte " << i << "=" << hex <<
(unsigned int)(db & 0xff) << dec << endl;
#endif
if ((db & 0xff) == 0xff) break;
res.push_back((char)(db & 0xff));
}
#endif
return res;
}
int ublox::read_byte() throw(n_u::IOException)
{
int res = i2c_smbus_read_byte(_fd);
if (res < 0)
throw n_u::IOException(_name,"i2c_smbus_read_byte",errno);
return res;
}
int ublox::read_byte_data(unsigned char reg) throw(n_u::IOException)
{
int res = i2c_smbus_read_byte_data(_fd,reg);
if (res < 0) {
ostringstream ost;
ost << "i2c_smbus_read_byte_data, reg=" << hex << (unsigned int) reg;
throw n_u::IOException(_name, ost.str(), errno);
}
return res;
}
void ublox::write_byte(unsigned char b) throw(n_u::IOException)
{
int res = i2c_smbus_write_byte(_fd, b);
if (res < 0)
throw n_u::IOException(_name, "i2c_smbus_write_byte", errno);
}
void ublox::write_byte_data(unsigned char b, unsigned char reg) throw(n_u::IOException)
{
int res = i2c_smbus_write_byte_data(_fd, reg, b);
if (res < 0) {
ostringstream ost;
ost << "i2c_smbus_write_byte_data, reg=" << hex << (unsigned int) reg;
throw n_u::IOException(_name, ost.str(), errno);
}
}
int ublox::parseRunstring(int argc, char** argv)
{
progname = argv[0];
int iarg = 1;
for ( ; iarg < argc; iarg++) {
string arg = argv[iarg];
if (arg == "-d") {
if (++iarg == argc) return usage(argv[0]);
_disable_msgs.push_back(argv[iarg]);
}
else if (arg == "-e") {
if (++iarg == argc) return usage(argv[0]);
_enable_msgs.push_back(argv[iarg]);
}
else if (arg == "-r") {
_readback = true;
}
else {
if (_name.length() == 0) _name = argv[iarg];
else if (_addr == 0) _addr = strtol(argv[iarg], NULL, 0);
}
}
if (_name.length() == 0) return usage(argv[0]);
if (_addr < 3 || _addr > 255) {
cerr << "i2caddr out of range" << endl;
return usage(argv[0]);
}
return 0;
}
int ublox::usage(const char* argv0)
{
cerr << "\
Usage: " << argv0 << "i2cdev i2caddr [-d msg] [-e msg]...\n\
i2cdev: name of I2C bus to open, e.g. /dev/i2c-1\n\
i2caddr: address of I2C device, usually in hex: e.g. 0x42\n\
-d msg: a NMEA message to disable\n\
-e msg: a NMEA message to enabl\n\
\n\
msg is one of: GGA, GLL, GSA, GSV, RMC, VTG, GRS, GST, ZDA, GBS, DTM, GPQ, TXT\n\
" << endl;
return 1;
}
int ublox::run() throw()
{
int result = 0;
try {
_fd = open(_name.c_str(), O_RDWR);
if (_fd < 0)
throw n_u::IOException(_name, "open", errno);
if (ioctl(_fd, I2C_TIMEOUT, 60* MSECS_PER_SEC / 10) < 0) {
ostringstream ost;
ost << "ioctl(,I2C_TIMEOUT,)";
throw n_u::IOException(_name, ost.str(), errno);
}
if (ioctl(_fd, I2C_SLAVE, _addr) < 0) {
ostringstream ost;
ost << "ioctl(,I2C_SLAVE," << hex << _addr << ")";
throw n_u::IOException(_name, ost.str(), errno);
}
#ifdef DO_THIS
// config_ubx();
sleep(1);
set_rate(1);
sleep(1);
#endif
int ntry = 5;
for (unsigned int i = 0; i < _disable_msgs.size(); i++) {
for (int j = 1; j <= ntry; j++) {
try {
config_nmea(_disable_msgs[i], false);
break;
}
catch (const n_u::IOException& e) {
if (j == ntry) throw e;
usleep(USECS_PER_SEC/4);
}
}
if (_readback) {
for (int i = 0; i < 4; i++) {
usleep(USECS_PER_SEC / 2);
string str = read_smbus();
if (str.length()) cout << str;
}
}
else usleep(USECS_PER_SEC / 4);
}
for (unsigned int i = 0; i < _enable_msgs.size(); i++) {
for (int j = 1; j <= ntry; j++) {
try {
config_nmea(_enable_msgs[i], true);
break;
}
catch (const n_u::IOException& e) {
if (j == ntry) throw e;
usleep(USECS_PER_SEC/4);
}
}
if (_readback) {
for (int i = 0; i < 4; i++) {
usleep(USECS_PER_SEC / 2);
string str = read_smbus();
if (str.length()) cout << str;
}
}
else usleep(USECS_PER_SEC / 4);
}
// #define READ_BACK
#ifdef READ_BACK
for (int i = 0; i < 20; i++) {
usleep(USECS_PER_SEC / 4);
// #define DO_READ_RDWR
#ifdef DO_READ_RDWR
string str;
read_rdwr(str);
cerr << "string, len=" << str.length() << "," << str << endl;
#else
string str = read_smbus();
#ifdef DEBUG
cerr << "string=" << str << endl;
#endif
#endif
}
#endif
}
catch(n_u::IOException& ioe) {
cerr << "Error: " << ioe.what() << endl;
result = 1;
}
return result;
}
int main(int argc, char** argv)
{
ublox ub;
int res;
if ((res = ub.parseRunstring(argc,argv)) != 0) return res;
return ub.run();
}
| gpl-2.0 |
jeffgdotorg/opennms | features/telemetry/protocols/bmp/adapter/src/main/java/org/opennms/netmgt/telemetry/protocols/bmp/adapter/openbmp/proto/SubsequentAddressFamilyIdentifier.java | 3882 | /*******************************************************************************
* This file is part of OpenNMS(R).
*
* Copyright (C) 2020 The OpenNMS Group, Inc.
* OpenNMS(R) is Copyright (C) 1999-2020 The OpenNMS Group, Inc.
*
* OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.
*
* OpenNMS(R) 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.
*
* OpenNMS(R) 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 OpenNMS(R). If not, see:
* http://www.gnu.org/licenses/
*
* For more information contact:
* OpenNMS(R) Licensing <[email protected]>
* http://www.opennms.org/
* http://www.opennms.com/
*******************************************************************************/
package org.opennms.netmgt.telemetry.protocols.bmp.adapter.openbmp.proto;
import java.util.Arrays;
public enum SubsequentAddressFamilyIdentifier {
RESERVED("Reserved"),
RESERVED_FOR_PRIVATE_USE("Reserved for Private Use"),
UNASSIGNED("Unassigned"),
UNICAST_FORWARDING(1, "Network Layer Reachability Information used for unicast forwarding"),
MULTICAST_FORWARDING(2, "Network Layer Reachability Information used for multicast forwarding"),
NLRI(4, "Network Layer Reachability Information (NLRI) with MPLS Label"),
MCAST_VPN(5, "MCAST-VPN"),
DYNAMIC_PLACEMENT_MULTI_SEGMENT_PSEUDOWIRES(6, "Network Layer Reachability Information used for Dynamic Placement of Multi-Segment Pseudowires"),
ENCAPSULATION_SAFI(7, "Encapsulation SAFI"),
MCAST_VPLS(8, "MCAST-VPLS"),
TUNNEL_SAFI(64, "Tunnel SAFI"),
VPLS(65, "Virtual Private LAN Service (VPLS)"),
BGP_MDT_SAFI(66, "BGP MDT SAFI"),
BGP_4OVER6_SAFI(67, "BGP 4over6 SAFI"),
BGP_6OVER4_SAFI(68, "BGP 6over4 SAFI"),
LAYER1_VPN_AUTO_DISCOVERY(69, "Layer-1 VPN auto-discovery information"),
BGP_EVPNS(70, "BGP EVPNs"),
BGP_LS(71, "BGP-LS"),
BGP_LS_VPN(72, "BGP-LS-VPN"),
SR_TE_POLICY_SAFI(73, "SR TE Policy SAFI"),
SD_WAN_CAP(74, "SD-WAN Capabilities"),
MPLS_LABELED_VPN_ADDRESS(128, "MPLS-labeled VPN address"),
MULTICAST_FOR_BGP_MPLS_VPNS(129, "Multicast for BGP/MPLS IP Virtual Private Networks (VPNs)"),
ROUTE_TARGET_CONSTRAINS(132, "Route Target constrains"),
IPV4_FLOW_SPEC(133, "IPv4 dissemination of flow specification rules"),
VPN4V_FLOW_SPEC(134, "VPNv4 dissemination of flow specification rules"),
VPN_AUTO_DISCOVERY(140, "VPN auto-discovery");
private int code;
private String description;
SubsequentAddressFamilyIdentifier(final int code, final String description) {
this.code = code;
this.description = description;
}
SubsequentAddressFamilyIdentifier(final String description) {
this.code = -1;
this.description = description;
}
public static SubsequentAddressFamilyIdentifier from(final int code) {
if (code == 0 || code == 3 || code == 255 || (code >= 141 && code <= 240)) {
return RESERVED;
}
if ((code >= 9 && code <= 63) || (code >= 75 && code <= 127)) {
return UNASSIGNED;
}
if (code >= 241 && code <= 254) {
return RESERVED_FOR_PRIVATE_USE;
}
return Arrays.stream(values()).filter(e -> e.code == code).findFirst().get();
}
public int getCode() {
return code;
}
public String getDescription() {
return description;
}
}
| gpl-2.0 |
w7cook/batch-javac | test/civet/pontis/eligibility/An_Eligibility.java | 154 | package pontis.eligibility;
import pontis.event.An_Event;
public interface An_Eligibility {
public boolean isEligible(An_Event theEvent);
}
| gpl-2.0 |
tkpb/Telegram | TMessagesProj/src/main/java/org/telegram/ui/Components/StickerEmptyView.java | 14467 | package org.telegram.ui.Components;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.content.Context;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import org.telegram.messenger.AndroidUtilities;
import org.telegram.messenger.ImageLocation;
import org.telegram.messenger.MediaDataController;
import org.telegram.messenger.NotificationCenter;
import org.telegram.messenger.UserConfig;
import org.telegram.tgnet.TLRPC;
import org.telegram.ui.ActionBar.Theme;
public class StickerEmptyView extends FrameLayout implements NotificationCenter.NotificationCenterDelegate {
public final static int STICKER_TYPE_SEARCH = 1;
public final static int STICKER_TYPE_NO_CONTACTS = 0;
private LinearLayout linearLayout;
public BackupImageView stickerView;
private LoadingStickerDrawable stubDrawable;
private RadialProgressView progressBar;
public final TextView title;
public final TextView subtitle;
private final String stickerSetName = "tg_placeholders";
private boolean progressShowing;
private int stickerType;
public final View progressView;
int keyboardSize;
int currentAccount = UserConfig.selectedAccount;
Runnable showProgressRunnable = new Runnable() {
@Override
public void run() {
if (progressView != null) {
if (progressView.getVisibility() != View.VISIBLE) {
progressView.setVisibility(View.VISIBLE);
progressView.setAlpha(0f);
}
progressView.animate().setListener(null).cancel();
progressView.animate().alpha(1f).setDuration(150).start();
} else {
progressBar.animate().alpha(1f).scaleY(1f).scaleX(1f).setDuration(150).start();
}
}
};
private boolean animateLayoutChange;
public StickerEmptyView(@NonNull Context context, View progressView, int type) {
super(context);
this.progressView = progressView;
stickerType = type;
linearLayout = new LinearLayout(context) {
@Override
public void setVisibility(int visibility) {
if (getVisibility() == View.GONE && visibility == View.VISIBLE) {
setSticker();
stickerView.getImageReceiver().startAnimation();
} else if (visibility == View.GONE) {
stickerView.getImageReceiver().clearImage();
}
super.setVisibility(visibility);
}
};
linearLayout.setOrientation(LinearLayout.VERTICAL);
stickerView = new BackupImageView(context);
stickerView.setOnClickListener(view -> stickerView.getImageReceiver().startAnimation());
String svg;
if (type == 1) {
svg = "M503.1,302.3c-2-20-21.4-29.8-42.4-30.7c13.8-56.8-8.2-121-52.8-164.1C321.6,24,190,51.3,131.7,146.2\n" +
"\tc-21.2-30.5-65-34.3-91.1-7.6c-30,30.6-18.4,82.7,22.5,97.3c-4.7,2.4-6.4,7.6-5.7,12.4c-14.2,10.5-19,28.5-5.1,42.4\n" +
"\tc-5.4,15,13.2,28.8,26.9,18.8c10.5,6.9,21,15,27.8,28.8c-17.1,55.3-8.5,79.4,8.5,98.7v0c47.5,53.8,235.6,45.3,292.2,11.5\n" +
"\tc22.6-13.5,39.5-34.6,30.4-96.8C459.1,322.1,505.7,328.5,503.1,302.3z M107.4,234c0.1,2.8,0.2,5.8,0.4,8.8c-7-2.5-14-3.6-20.5-3.6\n" +
"\tC94.4,238.6,101.2,236.9,107.4,234z";
} else {
svg = ContactsEmptyView.svg;
}
stubDrawable = new LoadingStickerDrawable(stickerView, svg, AndroidUtilities.dp(130), AndroidUtilities.dp(130));
stickerView.setImageDrawable(stubDrawable);
title = new TextView(context);
title.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
title.setTag(Theme.key_windowBackgroundWhiteBlackText);
title.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText));
title.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 20);
title.setGravity(Gravity.CENTER);
subtitle = new TextView(context);
subtitle.setTag(Theme.key_windowBackgroundWhiteGrayText);
subtitle.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteGrayText));
subtitle.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14);
subtitle.setGravity(Gravity.CENTER);
linearLayout.addView(stickerView, LayoutHelper.createLinear(130, 130, Gravity.CENTER_HORIZONTAL));
linearLayout.addView(title, LayoutHelper.createLinear(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER_HORIZONTAL, 0, 12, 0, 0));
linearLayout.addView(subtitle, LayoutHelper.createLinear(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER_HORIZONTAL, 0, 8, 0, 0));
addView(linearLayout, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER, 56, 0, 56, 30));
if (progressView == null) {
progressBar = new RadialProgressView(context);
progressBar.setAlpha(0);
progressBar.setScaleY(0.5f);
progressBar.setScaleX(0.5f);
addView(progressBar, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER));
}
}
private int lastH;
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
super.onLayout(changed, left, top, right, bottom);
if (animateLayoutChange && lastH > 0 && lastH != getMeasuredHeight()) {
float y = (lastH - getMeasuredHeight()) / 2f;
linearLayout.setTranslationY(linearLayout.getTranslationY() + y);
linearLayout.animate().translationY(0).setInterpolator(CubicBezierInterpolator.DEFAULT).setDuration(250);
if (progressBar != null) {
progressBar.setTranslationY(progressBar.getTranslationY() + y);
progressBar.animate().translationY(0).setInterpolator(CubicBezierInterpolator.DEFAULT).setDuration(250);
}
}
lastH = getMeasuredHeight();
}
public void setColors(String titleKey, String subtitleKey, String key1, String key2) {
title.setTag(titleKey);
title.setTextColor(Theme.getColor(titleKey));
subtitle.setTag(subtitleKey);
subtitle.setTextColor(Theme.getColor(subtitleKey));
stubDrawable.setColors(key1, key2);
}
@Override
public void setVisibility(int visibility) {
if (getVisibility() != visibility) {
if (visibility == VISIBLE) {
if (progressShowing) {
linearLayout.animate().alpha(0f).scaleY(0.8f).scaleX(0.8f).setDuration(150).start();
progressView.setVisibility(VISIBLE);
progressView.setAlpha(1f);
//showProgressRunnable.run();
} else {
linearLayout.animate().alpha(1f).scaleY(1f).scaleX(1f).setDuration(150).start();
if (progressView != null) {
progressView.animate().setListener(null).cancel();
progressView.animate().setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
progressView.setVisibility(View.GONE);
}
}).alpha(0f).setDuration(150).start();
} else {
progressBar.animate().alpha(0f).scaleY(0.5f).scaleX(0.5f).setDuration(150).start();
}
stickerView.getImageReceiver().startAnimation();
}
}
}
super.setVisibility(visibility);
if (getVisibility() == VISIBLE) {
setSticker();
} else {
lastH = 0;
linearLayout.setAlpha(0f);
linearLayout.setScaleX(0.8f);
linearLayout.setScaleY(0.8f);
if (progressView != null) {
progressView.animate().setListener(null).cancel();
progressView.animate().setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
progressView.setVisibility(View.GONE);
}
}).alpha(0f).setDuration(150).start();
} else {
progressBar.setAlpha(0f);
progressBar.setScaleX(0.5f);
progressBar.setScaleY(0.5f);
}
stickerView.getImageReceiver().stopAnimation();
stickerView.getImageReceiver().clearImage();
}
}
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
if (getVisibility() == VISIBLE) {
setSticker();
}
NotificationCenter.getInstance(currentAccount).addObserver(this, NotificationCenter.diceStickersDidLoad);
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
NotificationCenter.getInstance(currentAccount).removeObserver(this, NotificationCenter.diceStickersDidLoad);
}
private void setSticker() {
TLRPC.TL_messages_stickerSet set = MediaDataController.getInstance(currentAccount).getStickerSetByName(stickerSetName);
if (set == null) {
set = MediaDataController.getInstance(currentAccount).getStickerSetByEmojiOrName(stickerSetName);
}
if (set != null && set.documents.size() >= 2) {
TLRPC.Document document = set.documents.get(stickerType);
ImageLocation imageLocation = ImageLocation.getForDocument(document);
stickerView.setImage(imageLocation, "130_130", "tgs", stubDrawable, set);
stickerView.getImageReceiver().setAutoRepeat(2);
} else {
MediaDataController.getInstance(currentAccount).loadStickersByEmojiOrName(stickerSetName, false, set == null);
stickerView.setImageDrawable(stubDrawable);
}
}
@Override
public void didReceivedNotification(int id, int account, Object... args) {
if (id == NotificationCenter.diceStickersDidLoad) {
String name = (String) args[0];
if (stickerSetName.equals(name) && getVisibility() == VISIBLE) {
setSticker();
}
}
}
public void setKeyboardHeight(int keyboardSize, boolean animated) {
if (this.keyboardSize != keyboardSize) {
if (getVisibility() != View.VISIBLE) {
animated = false;
}
this.keyboardSize = keyboardSize;
float y = -(keyboardSize >> 1) + (keyboardSize > 0 ? AndroidUtilities.dp(20) : 0);
if (animated) {
linearLayout.animate().translationY(y).setInterpolator(CubicBezierInterpolator.DEFAULT).setDuration(250);
if (progressBar != null) {
progressBar.animate().translationY(y).setInterpolator(CubicBezierInterpolator.DEFAULT).setDuration(250);
}
} else {
linearLayout.setTranslationY(y);
if (progressBar != null) {
progressBar.setTranslationY(y);
}
}
}
}
public void showProgress(boolean show) {
showProgress(show, true);
}
public void showProgress(boolean show, boolean animated) {
if (progressShowing != show) {
progressShowing = show;
if (getVisibility() != View.VISIBLE) {
return;
}
if (animated) {
if (show) {
linearLayout.animate().alpha(0f).scaleY(0.8f).scaleX(0.8f).setDuration(150).start();
showProgressRunnable.run();
} else {
linearLayout.animate().alpha(1f).scaleY(1f).scaleX(1f).setDuration(150).start();
if (progressView != null) {
progressView.animate().setListener(null).cancel();
progressView.animate().setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
progressView.setVisibility(View.GONE);
}
}).alpha(0).setDuration(150).start();
} else {
progressBar.animate().alpha(0f).scaleY(0.5f).scaleX(0.5f).setDuration(150).start();
}
stickerView.getImageReceiver().startAnimation();
}
} else {
if (show) {
linearLayout.animate().cancel();
linearLayout.setAlpha(0);
linearLayout.setScaleX(0.8f);
linearLayout.setScaleY(0.8f);
if (progressView != null) {
progressView.animate().setListener(null).cancel();
progressView.setAlpha(1);
progressView.setVisibility(View.VISIBLE);
} else {
progressBar.setAlpha(1f);
progressBar.setScaleX(1f);
progressBar.setScaleY(1f);
}
} else {
linearLayout.animate().cancel();
linearLayout.setAlpha(1f);
linearLayout.setScaleX(1f);
linearLayout.setScaleY(1f);
if (progressView != null) {
progressView.animate().setListener(null).cancel();
progressView.setVisibility(View.GONE);
} else {
progressBar.setAlpha(0f);
progressBar.setScaleX(0.5f);
progressBar.setScaleY(0.5f);
}
}
}
}
}
public void setAnimateLayoutChange(boolean animate) {
this.animateLayoutChange = animate;
}
}
| gpl-2.0 |
trasher/glpi | inc/appliancetype.class.php | 1476 | <?php
/**
* ---------------------------------------------------------------------
* GLPI - Gestionnaire Libre de Parc Informatique
* Copyright (C) 2015-2021 Teclib' and contributors.
*
* http://glpi-project.org
*
* based on GLPI - Gestionnaire Libre de Parc Informatique
* Copyright (C) 2003-2014 by the INDEPNET Development Team.
*
* ---------------------------------------------------------------------
*
* LICENSE
*
* This file is part of GLPI.
*
* GLPI 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.
*
* GLPI 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 GLPI. If not, see <http://www.gnu.org/licenses/>.
* ---------------------------------------------------------------------
*/
if (!defined('GLPI_ROOT')) {
die("Sorry. You can't access this file directly");
}
class ApplianceType extends CommonDropdown {
static function getTypeName($nb = 0) {
return _n('Appliance type', 'Appliance types', $nb);
}
static function getIcon() {
return Appliance::getIcon();
}
}
| gpl-2.0 |
dlitz/resin | modules/jpa/src/javax/persistence/spi/PersistenceUnitInfo.java | 3088 | /*
* Copyright (c) 1998-2011 Caucho Technology -- all rights reserved
*
* This file is part of Resin(R) Open Source
*
* Each copy or derived work must preserve the copyright notice and this
* notice unmodified.
*
* Resin Open Source 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.
*
* Resin Open Source 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, or any warranty
* of NON-INFRINGEMENT. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License
* along with Resin Open Source; if not, write to the
*
* Free Software Foundation, Inc.
* 59 Temple Place, Suite 330
* Boston, MA 02111-1307 USA
*
* @author Scott Ferguson
*/
package javax.persistence.spi;
import javax.persistence.SharedCacheMode;
import javax.persistence.ValidationMode;
import javax.sql.DataSource;
import java.net.URL;
import java.util.List;
import java.util.Properties;
/**
* Container interface when creating an EntityManagerFactory.
*/
public interface PersistenceUnitInfo {
/**
* Returns the name.
*/
public String getPersistenceUnitName();
/**
* Returns the full class name of the persistence provider.
*/
public String getPersistenceProviderClassName();
/**
* Returns the transaction handling.
*/
public PersistenceUnitTransactionType getTransactionType();
/**
* Returns the jta-enabled data source.
*/
public DataSource getJtaDataSource();
/**
* Returns the non-jta-enabled data source.
*/
public DataSource getNonJtaDataSource();
/**
* Returns the mapping file names. The files are resource-loadable
* from the classpath.
*/
public List<String> getMappingFileNames();
/**
* Returns the list of jars for the managed classes.
*/
public List<URL> getJarFileUrls();
/**
* Returns the root persistence unit.
*/
public URL getPersistenceUnitRootUrl();
/**
* Returns the list of managed classes.
*/
public List<String> getManagedClassNames();
/**
* Returns true if only listed classes are allowed.
*/
public boolean excludeUnlistedClasses();
/**
* @since JPA 2.0
*/
public SharedCacheMode getSharedCacheMode();
/**
* @since JPA 2.0
*/
public ValidationMode getValidationMode();
/**
* Returns a properties object.
*/
public Properties getProperties();
public String getPersistenceXMLSchemaVersion();
/**
* Returns the classloader the provider should use to load classes,
* resources or URLs.
*/
public ClassLoader getClassLoader();
/**
* Adds a class transformer.
*/
public void addTransformer(ClassTransformer transformer);
/**
* Returns a temporary class loader.
*/
public ClassLoader getNewTempClassLoader();
}
| gpl-2.0 |
amankatoch/guidetobe | db/migrate/20140211132532_add_review_count_to_suppliers.rb | 326 | class AddReviewCountToSuppliers < ActiveRecord::Migration
def up
add_column :suppliers, :reviews_count, :integer, default: 0, null: false
Supplier.find_each(select: 'id') do |result|
Supplier.reset_counters(result.id, :reviews)
end
end
def down
remove_column :suppliers, :reviews_count
end
end
| gpl-2.0 |
seewindcn/tortoisehg | src/tortoisehg/hgqt/grep.py | 30355 | # grep.py - Working copy and history search
#
# Copyright 2010 Steve Borho <[email protected]>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2, incorporated herein by reference.
import os
import re
from mercurial import ui, hg, error, commands, match, util, subrepo
from tortoisehg.hgqt import htmlui, visdiff, qtlib, htmldelegate, thgrepo, cmdui, settings
from tortoisehg.hgqt import filedialogs, fileview
from tortoisehg.util import paths, hglib, thread2
from tortoisehg.util.i18n import _
from PyQt4.QtCore import *
from PyQt4.QtGui import *
# This widget can be embedded in any application that would like to
# provide search features
class SearchWidget(QWidget, qtlib.TaskWidget):
'''Working copy and repository search widget'''
showMessage = pyqtSignal(str)
progress = pyqtSignal(str, object, str, str, object)
revisionSelected = pyqtSignal(int)
def __init__(self, repoagent, upats, parent=None, **opts):
QWidget.__init__(self, parent)
self._repoagent = repoagent
self.thread = None
mainvbox = QVBoxLayout()
mainvbox.setSpacing(6)
hbox = QHBoxLayout()
hbox.setMargin(2)
le = QLineEdit()
if hasattr(le, 'setPlaceholderText'): # Qt >= 4.7
le.setPlaceholderText(_('### regular expression search pattern ###'))
else:
lbl = QLabel(_('Regexp:'))
lbl.setBuddy(le)
hbox.addWidget(lbl)
chk = QCheckBox(_('Ignore case'))
bt = QPushButton(_('Search'))
bt.setDefault(True)
f = bt.font()
f.setWeight(QFont.Bold)
bt.setFont(f)
cbt = QPushButton(_('Stop'))
cbt.setEnabled(False)
cbt.clicked.connect(self.stopClicked)
hbox.addWidget(le, 1)
hbox.addWidget(chk)
hbox.addWidget(bt)
hbox.addWidget(cbt)
incle = QLineEdit()
excle = QLineEdit()
working = QRadioButton(_('Working Copy'))
revision = QRadioButton(_('Revision'))
history = QRadioButton(_('All History'))
singlematch = QCheckBox(_('Report only the first match per file'))
follow = QCheckBox(_('Follow copies and renames'))
recurse = QCheckBox(_('Recurse into subrepositories'))
revle = QLineEdit()
grid = QGridLayout()
grid.addWidget(working, 0, 0)
grid.addWidget(recurse, 0, 1)
grid.addWidget(history, 1, 0)
grid.addWidget(revision, 2, 0)
grid.addWidget(revle, 2, 1)
grid.addWidget(singlematch, 0, 3)
grid.addWidget(follow, 0, 4)
ilabel = QLabel(_('Includes:'))
ilabel.setBuddy(incle)
elabel = QLabel(_('Excludes:'))
elabel.setBuddy(excle)
ehelpstr = _('Comma separated list of exclusion file patterns. '
'Exclusion patterns are applied after inclusion patterns.')
ihelpstr = _('Comma separated list of inclusion file patterns. '
'By default, the entire repository is searched.')
if hasattr(incle, 'setPlaceholderText'): # Qt >= 4.7
incle.setPlaceholderText(u' '.join([u'###', ihelpstr, u'###']))
else:
incle.setToolTip(ihelpstr)
if hasattr(excle, 'setPlaceholderText'): # Qt >= 4.7
excle.setPlaceholderText(u' '.join([u'###', ehelpstr, u'###']))
else:
excle.setToolTip(ehelpstr)
grid.addWidget(ilabel, 1, 2)
grid.addWidget(incle, 1, 3, 1, 2)
grid.addWidget(elabel, 2, 2)
grid.addWidget(excle, 2, 3, 1, 2)
grid.setColumnStretch(3, 1)
grid.setColumnStretch(1, 0)
frame = QFrame()
frame.setFrameStyle(QFrame.StyledPanel)
revision.toggled.connect(self._onRevisionToggled)
history.toggled.connect(singlematch.setDisabled)
revle.setEnabled(False)
revle.returnPressed.connect(self.runSearch)
excle.returnPressed.connect(self.runSearch)
incle.returnPressed.connect(self.runSearch)
bt.clicked.connect(self.runSearch)
recurse.setChecked(True)
working.setChecked(True)
working.toggled.connect(self._updateRecurse)
history.toggled.connect(self._updateFollow)
incle.textChanged.connect(self._updateFollow)
excle.textChanged.connect(self._updateFollow)
mainvbox.addLayout(hbox)
frame.setLayout(grid)
mainvbox.addWidget(frame)
tv = MatchTree(repoagent, self)
tv.revisionSelected.connect(self.revisionSelected)
tv.setColumnHidden(COL_REVISION, True)
tv.setColumnHidden(COL_USER, True)
mainvbox.addWidget(tv)
le.returnPressed.connect(self.runSearch)
repo = repoagent.rawRepo()
self.tv, self.regexple, self.chk, self.recurse = tv, le, chk, recurse
self.incle, self.excle, self.revle = incle, excle, revle
self.wctxradio, self.ctxradio, self.aradio = working, revision, history
self.singlematch, self.follow, self.eframe = singlematch, follow, frame
self.searchbutton, self.cancelbutton = bt, cbt
self.regexple.setFocus()
if 'rev' in opts or 'all' in opts:
self.setSearch(upats[0], **opts)
elif len(upats) >= 1:
le.setText(upats[0])
if len(upats) > 1:
incle.setText(','.join(upats[1:]))
chk.setChecked(opts.get('ignorecase', False))
repoid = hglib.shortrepoid(repo)
s = QSettings()
sh = list(s.value('grep/search-'+repoid).toStringList())
ph = list(s.value('grep/paths-'+repoid).toStringList())
self.pathshistory = [p for p in ph if p]
self.searchhistory = [s for s in sh if s]
self.setCompleters()
mainvbox.setContentsMargins(0, 0, 0, 0)
self.setLayout(mainvbox)
self._updateRecurse()
self._updateFollow()
@property
def repo(self):
return self._repoagent.rawRepo()
def setCompleters(self):
comp = QCompleter(self.searchhistory, self)
QShortcut(QKeySequence('CTRL+D'), comp.popup(),
self.onSearchCompleterDelete)
self.regexple.setCompleter(comp)
comp = QCompleter(self.pathshistory, self)
QShortcut(QKeySequence('CTRL+D'), comp.popup(),
self.onPathCompleterDelete)
self.incle.setCompleter(comp)
self.excle.setCompleter(comp)
def onSearchCompleterDelete(self):
'CTRL+D pressed in search completer popup window'
text = self.regexple.completer().currentCompletion()
if text and text in self.searchhistory:
self.searchhistory.remove(text)
self.setCompleters()
self.showMessage.emit(_('"%s" removed from search history') % text)
def onPathCompleterDelete(self):
'CTRL+D pressed in path completer popup window'
text = self.incle.completer().currentCompletion()
if text and text in self.pathshistory:
self.pathshistory.remove(text)
self.setCompleters()
self.showMessage.emit(_('"%s" removed from path history') % text)
def addHistory(self, search, incpaths, excpaths):
if search:
usearch = hglib.tounicode(search)
if usearch in self.searchhistory:
self.searchhistory.remove(usearch)
self.searchhistory = [usearch] + self.searchhistory[:9]
for p in incpaths + excpaths:
up = hglib.tounicode(p)
if up in self.pathshistory:
self.pathshistory.remove(up)
self.pathshistory = [up] + self.pathshistory[:9]
self.setCompleters()
def setRevision(self, rev):
'Repowidget is forwarding a selected revision'
if isinstance(rev, int):
self.revle.setText(str(rev))
@pyqtSlot(bool)
def _onRevisionToggled(self, checked):
self.revle.setEnabled(checked)
if checked:
self.revle.selectAll()
self.revle.setFocus()
@pyqtSlot()
def _updateRecurse(self):
checked = self.wctxradio.isChecked()
try:
wctx = self.repo[None]
if '.hgsubstate' in wctx:
self.recurse.setEnabled(checked)
else:
self.recurse.setEnabled(False)
self.recurse.setChecked(False)
except util.Abort:
self.recurse.setEnabled(False)
self.recurse.setChecked(False)
@pyqtSlot()
def _updateFollow(self):
slowpath = bool(self.incle.text() or self.excle.text())
self.follow.setEnabled(self.aradio.isChecked() and not slowpath)
if slowpath:
self.follow.setChecked(False)
def setSearch(self, upattern, **opts):
self.regexple.setText(upattern)
if opts.get('all'):
self.aradio.setChecked(True)
elif opts.get('rev'):
self.ctxradio.setChecked(True)
self.revle.setText(opts['rev'])
def stopClicked(self):
if self.thread and self.thread.isRunning():
self.thread.cancel()
self.thread.wait(2000)
def keyPressEvent(self, event):
if (event.key() == Qt.Key_Escape
and self.thread and self.thread.isRunning()):
self.stopClicked()
else:
return super(SearchWidget, self).keyPressEvent(event)
def canExit(self):
'Repowidget is closing, can we quit?'
if self.thread and self.thread.isRunning():
return False
return True
def saveSettings(self, s):
repoid = hglib.shortrepoid(self.repo)
s.setValue('grep/search-'+repoid, self.searchhistory)
s.setValue('grep/paths-'+repoid, self.pathshistory)
@pyqtSlot()
def runSearch(self):
"""Run search for the current pattern in background thread"""
if self.thread and self.thread.isRunning():
return
model = self.tv.model()
model.reset()
pattern = hglib.fromunicode(self.regexple.text())
if not pattern:
return
try:
icase = self.chk.isChecked()
regexp = re.compile(pattern, icase and re.I or 0)
except Exception, inst:
msg = _('grep: invalid match pattern: %s\n') % \
hglib.tounicode(str(inst))
self.showMessage.emit(msg)
return
self.tv.setSortingEnabled(False)
self.tv.pattern = pattern
self.tv.icase = icase
self.regexple.selectAll()
inc = hglib.fromunicode(self.incle.text())
if inc: inc = map(str.strip, inc.split(','))
exc = hglib.fromunicode(self.excle.text())
if exc: exc = map(str.strip, exc.split(','))
rev = hglib.fromunicode(self.revle.text()).strip()
self.addHistory(pattern, inc or [], exc or [])
if self.wctxradio.isChecked():
self.tv.setColumnHidden(COL_REVISION, True)
self.tv.setColumnHidden(COL_USER, True)
ctx = self.repo[None]
self.thread = CtxSearchThread(self.repo, regexp, ctx, inc, exc,
self.singlematch.isChecked(),
self.recurse.isChecked())
elif self.ctxradio.isChecked():
self.tv.setColumnHidden(COL_REVISION, True)
self.tv.setColumnHidden(COL_USER, True)
try:
ctx = self.repo[rev or '.']
except error.RepoError, e:
msg = _('grep: %s\n') % hglib.tounicode(str(e))
self.showMessage.emit(msg)
return
self.thread = CtxSearchThread(self.repo, regexp, ctx, inc, exc,
self.singlematch.isChecked(),
False)
else:
assert self.aradio.isChecked()
self.tv.setColumnHidden(COL_REVISION, False)
self.tv.setColumnHidden(COL_USER, False)
self.thread = HistorySearchThread(self.repo, pattern, icase,
inc, exc,
follow=self.follow.isChecked())
self.showMessage.emit('')
self.regexple.setEnabled(False)
self.searchbutton.setEnabled(False)
self.cancelbutton.setEnabled(True)
self.thread.finished.connect(self.searchfinished)
self.thread.showMessage.connect(self.showMessage)
self.thread.progress.connect(self.progress)
self.thread.matchedRow.connect(
lambda wrapper: model.appendRow(*wrapper.data))
self.thread.start()
def searchfinished(self):
self.cancelbutton.setEnabled(False)
self.searchbutton.setEnabled(True)
self.regexple.setEnabled(True)
self.regexple.setFocus()
count = self.tv.model().rowCount(None)
if count:
for col in xrange(COL_TEXT):
self.tv.resizeColumnToContents(col)
self.tv.setSortingEnabled(True)
if self.thread.completed == False:
# do not overwrite error message on failure
pass
elif count:
self.showMessage.emit(_('%d matches found') % count)
else:
self.showMessage.emit(_('No matches found'))
class DataWrapper(object):
def __init__(self, data):
self.data = data
class HistorySearchThread(QThread):
'''Background thread for searching repository history'''
matchedRow = pyqtSignal(DataWrapper)
showMessage = pyqtSignal(str)
progress = pyqtSignal(str, object, str, str, object)
def __init__(self, repo, pattern, icase, inc, exc, follow):
super(HistorySearchThread, self).__init__()
self.repo = hg.repository(repo.ui, repo.root)
self.pattern = pattern
self.icase = icase
self.inc = inc
self.exc = exc
self.follow = follow
self.completed = False
def cancel(self):
if self.isRunning() and hasattr(self, 'thread_id'):
try:
thread2._async_raise(self.thread_id, KeyboardInterrupt)
except ValueError:
pass
def run(self):
haskbf = settings.hasExtension('kbfiles')
haslf = settings.hasExtension('largefiles')
self.thread_id = int(QThread.currentThreadId())
def emitrow(row):
w = DataWrapper(row)
self.matchedRow.emit(w)
def emitprog(topic, pos, item, unit, total):
self.progress.emit(topic, pos, item, unit, total)
class incrui(ui.ui):
fullmsg = ''
def write(self, msg, *args, **opts):
self.fullmsg += msg
if self.fullmsg.count('\0') >= 6:
try:
fname, line, rev, addremove, user, text, tail = \
self.fullmsg.split('\0', 6)
if haslf and thgrepo.isLfStandin(fname):
raise ValueError
if (haslf or haskbf) and thgrepo.isBfStandin(fname):
raise ValueError
text = hglib.tounicode(text)
text = Qt.escape(text)
text = '<b>%s</b> <span>%s</span>' % (addremove, text)
fname = hglib.tounicode(fname)
user = hglib.tounicode(user)
row = [fname, int(rev), int(line), user, text]
emitrow(row)
except ValueError:
pass
self.fullmsg = tail
def progress(topic, pos, item='', unit='', total=None):
emitprog(topic, pos, item, unit, total)
cwd = os.getcwd()
os.chdir(self.repo.root)
self.progress.emit(*cmdui.startProgress(_('Searching'), _('history')))
try:
# hg grep [-i] -afn regexp
opts = {'all':True, 'user':True, 'follow':self.follow,
'rev':[], 'line_number':True, 'print0':True,
'ignore_case':self.icase, 'include':self.inc,
'exclude':self.exc}
u = incrui()
commands.grep(u, self.repo, self.pattern, **opts)
except Exception, e:
self.showMessage.emit(str(e))
except KeyboardInterrupt:
self.showMessage.emit(_('Interrupted'))
self.progress.emit(*cmdui.stopProgress(_('Searching')))
os.chdir(cwd)
self.completed = True
class CtxSearchThread(QThread):
'''Background thread for searching a changectx'''
matchedRow = pyqtSignal(object)
showMessage = pyqtSignal(str)
progress = pyqtSignal(str, object, str, str, object)
def __init__(self, repo, regexp, ctx, inc, exc, once, recurse):
super(CtxSearchThread, self).__init__()
self.repo = hg.repository(repo.ui, repo.root)
self.regexp = regexp
self.ctx = ctx
self.inc = inc
self.exc = exc
self.once = once
self.recurse = recurse
self.canceled = False
self.completed = False
def cancel(self):
self.canceled = True
def run(self):
def badfn(f, msg):
e = hglib.tounicode("%s: %s" % (matchfn.rel(f), msg))
self.showMessage.emit(e)
self.hu = htmlui.htmlui()
try:
# generate match function relative to repo root
matchfn = match.match(self.repo.root, '', [], self.inc, self.exc)
matchfn.bad = badfn
self.searchRepo(self.ctx, '', matchfn)
self.completed = True
except Exception, e:
self.showMessage.emit(hglib.tounicode(str(e)))
def searchRepo(self, ctx, prefix, matchfn):
topic = _('Searching')
unit = _('files')
total = len(ctx.manifest())
count = 0
haskbf = settings.hasExtension('kbfiles')
haslf = settings.hasExtension('largefiles')
for wfile in ctx: # walk manifest
if self.canceled:
break
if haslf and thgrepo.isLfStandin(wfile):
continue
if (haslf or haskbf) and thgrepo.isBfStandin(wfile):
continue
self.progress.emit(topic, count, wfile, unit, total)
count += 1
if not matchfn(wfile):
continue
try:
data = ctx[wfile].data() # load file data
except EnvironmentError:
self.showMessage.emit(_('Skipping %s, unable to read') %
hglib.tounicode(wfile))
continue
if util.binary(data):
continue
for i, line in enumerate(data.splitlines()):
pos = 0
for m in self.regexp.finditer(line): # perform regexp
self.hu.write(line[pos:m.start()], label='ui.status')
self.hu.write(line[m.start():m.end()], label='grep.match')
pos = m.end()
if pos:
self.hu.write(line[pos:], label='ui.status')
path = os.path.join(prefix, wfile)
row = [hglib.tounicode(path), i + 1, ctx.rev(), None,
hglib.tounicode(self.hu.getdata()[0])]
w = DataWrapper(row)
self.matchedRow.emit(w)
if self.once:
break
self.progress.emit(topic, None, '', '', None)
if ctx.rev() is None and self.recurse:
for s in ctx.substate:
if not matchfn(s):
continue
sub = ctx.sub(s)
if isinstance(sub, subrepo.hgsubrepo):
newprefix = os.path.join(prefix, s)
self.searchRepo(sub._repo[None], newprefix, lambda x: True)
COL_PATH = 0
COL_LINE = 1
COL_REVISION = 2 # Hidden if ctx
COL_USER = 3 # Hidden if ctx
COL_TEXT = 4
class MatchTree(QTableView):
revisionSelected = pyqtSignal(int)
contextmenu = None
def __init__(self, repoagent, parent):
QTableView.__init__(self, parent)
self._repoagent = repoagent
self.pattern = None
self.icase = False
self.embedded = parent.parent() is not None
self.selectedRows = ()
self.delegate = htmldelegate.HTMLDelegate(self)
self.setDragDropMode(QTableView.DragOnly)
self.setItemDelegateForColumn(COL_TEXT, self.delegate)
self.setSelectionMode(QTableView.ExtendedSelection)
self.setSelectionBehavior(QAbstractItemView.SelectRows)
self.setContextMenuPolicy(Qt.CustomContextMenu)
self.setShowGrid(False)
vh = self.verticalHeader()
vh.hide()
vh.setDefaultSectionSize(20)
self.horizontalHeader().setStretchLastSection(True)
self._filedialogs = qtlib.DialogKeeper(MatchTree._createFileDialog,
MatchTree._genFileDialogKey,
self)
self.actions = {}
self.contextmenu = QMenu(self)
for key, name, func, shortcut in (
('edit', _('Vi&ew File'), self.onViewFile, 'CTRL+E'),
('ctx', _('&View Changeset'), self.onViewChangeset, 'CTRL+V'),
('vdiff', _('&Diff to Parent'), self.onVisualDiff, 'CTRL+D'),
('ann', _('Annotate &File'), self.onAnnotateFile, 'CTRL+F')):
action = QAction(name, self)
action.triggered.connect(func)
action.setShortcut(QKeySequence(shortcut))
self.actions[key] = action
self.addAction(action)
self.contextmenu.addAction(action)
self.activated.connect(self.onRowActivated)
self.customContextMenuRequested.connect(self.menuRequest)
self.setModel(MatchModel(repoagent, self))
self.selectionModel().selectionChanged.connect(self.onSelectionChanged)
@property
def repo(self):
return self._repoagent.rawRepo()
def menuRequest(self, point):
if not self.selectionModel().selectedRows():
return
point = self.viewport().mapToGlobal(point)
self.contextmenu.exec_(point)
def onSelectionChanged(self, selected, deselected):
selrows = []
wctxonly = True
allhistory = False
for index in self.selectionModel().selectedRows():
path, line, rev, user, text = self.model().getRow(index)
if rev is not None:
wctxonly = False
if user is not None:
allhistory = True
selrows.append((rev, path, line))
self.selectedRows = selrows
self.actions['ctx'].setEnabled(not wctxonly and self.embedded)
self.actions['vdiff'].setEnabled(allhistory)
def onRowActivated(self, index):
saved = self.selectedRows
path, line, rev, user, text = self.model().getRow(index)
self.selectedRows = [(rev, path, line)]
self.onAnnotateFile()
self.selectedRows = saved
def onAnnotateFile(self):
repo = self.repo
seen = set()
for rev, upath, line in self.selectedRows:
path = hglib.fromunicode(upath)
# Only open one annotate instance per file
if path in seen:
continue
else:
seen.add(path)
if rev is None and path not in repo[None]:
abs = repo.wjoin(path)
root = paths.find_root(abs)
if root and abs.startswith(root):
uroot = hglib.tounicode(root)
srepoagent = self._repoagent.subRepoAgent(uroot)
path = abs[len(root)+1:]
self._openAnnotateDialog(srepoagent, rev, path, line)
else:
continue
else:
self._openAnnotateDialog(self._repoagent, rev, path, line)
def _openAnnotateDialog(self, repoagent, rev, path, line):
if rev is None:
repo = repoagent.rawRepo()
rev = repo['.'].rev()
dlg = self._filedialogs.open(repoagent, path)
dlg.setFileViewMode(fileview.AnnMode)
dlg.goto(rev)
dlg.showLine(line)
dlg.setSearchPattern(hglib.tounicode(self.pattern))
dlg.setSearchCaseInsensitive(self.icase)
def _createFileDialog(self, repoagent, path):
return filedialogs.FileLogDialog(repoagent, path)
def _genFileDialogKey(self, repoagent, path):
repo = repoagent.rawRepo()
return repo.wjoin(path)
def onViewChangeset(self):
for rev, path, line in self.selectedRows:
self.revisionSelected.emit(int(rev))
return
def onViewFile(self):
repo, ui, pattern = self.repo, self.repo.ui, self.pattern
seen = set()
for rev, upath, line in self.selectedRows:
path = hglib.fromunicode(upath)
# Only open one editor instance per file
if path in seen:
continue
else:
seen.add(path)
if rev is None:
qtlib.editfiles(repo, [path], line, pattern, self)
else:
base, _ = visdiff.snapshot(repo, [path], repo[rev])
files = [os.path.join(base, path)]
qtlib.editfiles(repo, files, line, pattern, self)
def onVisualDiff(self):
rows = self.selectedRows[:]
repo, ui = self.repo, self.repo.ui
while rows:
defer = []
crev = rows[0][0]
files = set([rows[0][1]])
for rev, path, line in rows[1:]:
if rev == crev:
files.add(path)
else:
defer.append([rev, path, line])
if crev is not None:
dlg = visdiff.visualdiff(ui, repo,
map(hglib.fromunicode, files),
{'change':crev})
if dlg:
dlg.exec_()
rows = defer
class MatchModel(QAbstractTableModel):
def __init__(self, repoagent, parent):
QAbstractTableModel.__init__(self, parent)
self._repoagent = repoagent
self.rows = []
self.headers = (_('File'), _('Line'), _('Rev'), _('User'),
_('Match Text'))
def rowCount(self, parent=QModelIndex()):
return len(self.rows)
def columnCount(self, parent=QModelIndex()):
return len(self.headers)
def data(self, index, role=Qt.DisplayRole):
if not index.isValid():
return QVariant()
if role == Qt.DisplayRole:
return QVariant(self.rows[index.row()][index.column()])
return QVariant()
def headerData(self, col, orientation, role=Qt.DisplayRole):
if role != Qt.DisplayRole or orientation != Qt.Horizontal:
return QVariant()
else:
return QVariant(self.headers[col])
def flags(self, index):
flags = Qt.ItemIsSelectable | Qt.ItemIsEnabled | Qt.ItemIsDragEnabled
return flags
def mimeTypes(self):
return ['text/uri-list']
def mimeData(self, indexes):
snapshots = {}
for index in indexes:
if index.column() != 0:
continue
path, line, rev, user, text = self.rows[index.row()]
if rev not in snapshots:
snapshots[rev] = [path]
else:
snapshots[rev].append(path)
urls = []
for rev, paths in snapshots.iteritems():
if rev is not None:
repo = self._repoagent.rawRepo()
lpaths = map(hglib.fromunicode, paths)
lbase, _ = visdiff.snapshot(repo, lpaths, repo[rev])
base = hglib.tounicode(lbase)
else:
base = self._repoagent.rootPath()
for p in paths:
urls.append(QUrl.fromLocalFile(os.path.join(base, p)))
m = QMimeData()
m.setUrls(urls)
return m
def sort(self, col, order):
self.layoutAboutToBeChanged.emit()
self.rows.sort(key=lambda x: x[col],
reverse=(order == Qt.DescendingOrder))
self.layoutChanged.emit()
## Custom methods
def appendRow(self, *args):
l = len(self.rows)
self.beginInsertRows(QModelIndex(), l, l)
self.rows.append(args)
self.endInsertRows()
self.layoutChanged.emit()
def reset(self):
self.beginRemoveRows(QModelIndex(), 0, len(self.rows)-1)
self.rows = []
self.endRemoveRows()
self.layoutChanged.emit()
def getRow(self, index):
assert index.isValid()
return self.rows[index.row()]
class SearchDialog(QDialog):
def __init__(self, repoagent, upats, parent=None, **opts):
super(SearchDialog, self).__init__(parent)
self.setWindowFlags(Qt.Window)
self.setWindowIcon(qtlib.geticon('view-filter'))
self.setWindowTitle(_('TortoiseHg Search'))
outervbox = QVBoxLayout()
outervbox.setContentsMargins(5, 5, 5, 0)
self.setLayout(outervbox)
self._searchwidget = SearchWidget(repoagent, upats, parent=self, **opts)
outervbox.addWidget(self._searchwidget)
self._stbar = cmdui.ThgStatusBar()
outervbox.addWidget(self._stbar)
self._searchwidget.showMessage.connect(self._stbar.showMessage)
self._searchwidget.progress.connect(self._stbar.progress)
self.resize(800, 550)
def closeEvent(self, event):
if not self._searchwidget.canExit():
self._searchwidget.stopClicked()
event.ignore()
return
self._searchwidget.saveSettings(QSettings())
super(SearchDialog, self).closeEvent(event)
def setSearch(self, upattern, **opts):
self._searchwidget.setSearch(upattern, **opts)
@pyqtSlot()
def runSearch(self):
self._searchwidget.runSearch()
| gpl-2.0 |
SuperSaiyaan/paytmbigbo | wp-content/plugins/wp-exec-php/contactuscom/views/priv-uix.php | 11079 | <?php
/**
*
* CONTACT FORM BY CONTACTUS.COM
*
* Initialization Plugin Public Tabs / login / signup
* @since 5.0 First time this was introduced into plugin.
* @author ContactUs.com <[email protected]>
* @copyright 2014 ContactUs.com Inc.
* Company : contactus.com
* Updated : 20140602
* */
?>
<?php
$cUsCF_api = new cUsComAPI_CF(); //CONTACTUS.COM API
//delete_option('cUsCF_settings_intro_hints');
$options = get_option('cUsCF_settings_userData'); //get the values, wont work the first time
$formOptions = get_option('cUsCF_settings_FORM');//GET THE NEW FORM OPTIONS
$form_key = get_option('cUsCF_settings_form_key');
$default_deep_link = get_option('cUsCF_settings_default_deep_link_view');
$showHints = get_option('cUsCF_settings_intro_hints'); //intro hints
$cus_version = $formOptions['cus_version'];
$boolTab = $formOptions['tab_user'];
$boolBackLink = get_option('cUsCF_switch_backlink');
$cUs_API_Account = $aryUserCredentials['API_Account'];
$cUs_API_Key = $aryUserCredentials['API_Key'];
$cUsCF_API_getFormKeys = $cUsCF_api->getFormKeysData($cUs_API_Account, $cUs_API_Key); //api hook;
update_option('cUsCF_settings_FORMS', $cUsCF_API_getFormKeys);
$default_deep_link = $cUsCF_api->parse_deeplink ( $default_deep_link );
if( !strlen($default_deep_link) ){
$default_deep_link = $cUsCF_api->getDefaultDeepLink( $cUsCF_API_getFormKeys ); // get a default deeplink
update_option('cUsCF_settings_default_deep_link_view', $default_deep_link );
}
$acount = $default_deep_link.'?pageID=7';
$reports = $default_deep_link.'?pageID=12';
$upgrade = $default_deep_link.'?pageID=82';
$createform = $default_deep_link.'?pageID=81&id=0&do=addnew&formType=';
$partnerID = $cUsCF_api->get_partner_id($default_deep_link);
$cus_CRED_url = cUsCF_PARTNER_URL . '/index.php?loginName='.$cUs_API_Account.'&userPsswd='.urlencode($cUs_API_Key);
define('cUsCF_CRED_URL', $cus_CRED_url);
//echo $chataui = cUsCF_PARTNER_URL . '/'.$partnerID . '/';
//print_r($aryUserCredentials);
?>
<div class="row">
<div class="col-sm-12">
<div class="row" id="menuPanel">
<div class="col-xs-8 col-md-10 col-lg-9 noPadding">
<div id="menu">
<div id="menuWrapper">
<ul id="tabs" data-tabs="tabs">
<li>
<a href="#tabs1" role="button" id="cu_nav_forms" class="btn forms-color" data-toggle="tab">
<span class="icon-suitcase white"></span><span class="hidden-sm hidden-xs"> Forms</span>
</a>
</li>
<li>
<a href="#tabs2" role="button" id="cu_nav_page" class="btn chat-color" data-toggle="tab">
<span class="icon-layout white"></span><span class="hidden-sm hidden-xs"> Form/Page Selection</span>
</a>
</li>
<li>
<a id="cu_nav_docu" href="http://help.contactus.com/hc/en-us/sections/200204997-Contact-Form-Plugin-for-Wordpress-Documentation" role="button" class="btn contacts-color" target="_blank">
<span class="icon-book white"></span><span class="hidden-sm hidden-xs"> Documentation</span>
</a>
</li>
<!-- li>
<a id="cu_nav_customization" href="<?php echo cUsCF_CRED_URL; ?>&confirmed=1&redir_url=<?php echo urlencode(cUsCF_PARTNER_URL .'/'. $partnerID.'/en/forms/'); ?>" role="button" class="btn btn-yellow tooltips" target="_blank" title="Opens ContactUs.com admin panel in new window" data-placement="right">
<span class="icon-brush white"></span><span class="hidden-sm hidden-xs"> Form Customization</span>
</a>
</li -->
<li>
<a id="cu_nav_contacts" href="<?php echo cUsCF_CRED_URL; ?>&confirmed=1&redir_url=<?php echo urlencode(cUsCF_PARTNER_URL .'/'. $partnerID.'/en/contacts/showContacts/latestSubmissions/'); ?>" role="button" class="btn btn-yellow tooltips" target="_blank" title="Opens ContactUs.com admin panel in new window" data-placement="right">
<span class="icon-users white"></span><span class="hidden-sm hidden-xs"> Contacts</span>
</a>
</li>
</ul>
</div>
<div id="menuToggleButton">
<a id="toggleCollapsedMenu" href="#" role="button" class="btn chat-color"><span class="white justify"></span></a>
</div>
</div>
</div>
<div class="col-xs-4 col-md-2 col-lg-3 noPadding">
<div id="gravatar" class="pull-right" style="color: #ffffff">
<img src="https://secure.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?s=50&d=mm&r=g" height="50px" width="50px">
</div>
<div class="btn-group pull-right" id="userMenu">
<button class="btn dropdown-toggle usermenu-color" role="button" data-toggle="dropdown">
<span class="white user hidden-sm hidden-xs hidden-md"></span><span class="hidden-sm hidden-xs hidden-md">Account</span><span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li>
<a class="logout" target="_blank" href="<?php echo cUsCF_CRED_URL; ?>&confirmed=1&redir_url=<?php echo urlencode(cUsCF_PARTNER_URL .'/'. $partnerID.'/en/account/accountSettings'); ?>"><span class="icon-cog"></span> Account Settings </a>
</li>
<li>
<a class="logout" target="_blank" href="<?php echo cUsCF_CRED_URL; ?>&confirmed=1&redir_url=<?php echo urlencode(cUsCF_PARTNER_URL .'/'. $partnerID.'/en/account/changePassword'); ?>"><span class="icon-lock"></span> Change Password </a>
</li>
<!-- li>
<a class="logout" target="_blank" href="https://admin.contactus.com/partners/<?php echo $partnerID; ?>/en/billing"><span class="credit_card"></span> Billing Settings </a>
</li -->
<li>
<a class="logout" target="_blank" href="<?php echo cUsCF_CRED_URL; ?>&confirmed=1&redir_url=<?php echo urlencode(cUsCF_PARTNER_URL .'/'. $partnerID.'/en/plans'); ?>"><span class="icon-chart-bar"></span> Plans </a>
</li>
<li>
<a class="logout" target="_blank" href="<?php echo cUsCF_CRED_URL; ?>&confirmed=1&redir_url=<?php echo urlencode(cUsCF_PARTNER_URL .'/'. $partnerID.'/en/account/usage'); ?>"><span class="icon-chart-line"></span> Usage </a>
</li>
<li>
<a class="logout" target="_blank" href="<?php echo cUsCF_CRED_URL; ?>&confirmed=1&redir_url=<?php echo urlencode(cUsCF_PARTNER_URL .'/'. $partnerID.'/en/account/api'); ?>"><span class="icon-key"></span> API </a>
</li>
<li>
<a class="logout" target="_blank" href="<?php echo cUsCF_CRED_URL; ?>&confirmed=1&redir_url=<?php echo urlencode(cUsCF_PARTNER_URL .'/'. $partnerID.'/en/account/returningLeadAlert'); ?>"><span class="icon-attention"></span> Returning Lead Alert </a>
</li>
<!-- li>
<a class="logout" target="_blank" href="https://admin.contactus.com/partners/<?php echo $partnerID; ?>/en/account/manageUsers"><span class="group"></span> Manage Users </a>
</li>
<li>
<a class="logout" target="_blank" href="https://admin.contactus.com/partners/<?php echo $partnerID; ?>/en/account/managePermissions"><span class="group"></span> Manage Permissions </a>
</li -->
<li>
<a class="logout LogoutUser tooltips" data-placement="left" href="javascript:;" title="Unlink ContactUs.com Account with WordPress Plugin"><span class="icon-logout"></span> Unlink Account </a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12 tab-content" id="my-tab-content">
<div id="tabs1" class="tab-pane active">
<div class="row">
<div class="col-sm-8">
<?php
/*
* My Forms
* @since 1.0
*/
require_once( cUsCF_DIR . 'views/my-forms.php');
?>
</div>
<div class="col-sm-4 sidebar">
<?php
/*
* SIDEBAR & SUPPORT
* @since 1.0
*/
include( cUsCF_DIR . 'views/sidebar.php');
?>
</div>
</div>
</div>
<div id="tabs2" class="tab-pane">
<div class="row">
<div class="col-sm-8">
<?php
/*
* LOGIN FORM
* @since 1.0
*/
require_once( cUsCF_DIR . 'views/form-placement.php');
?>
</div>
<div class="col-sm-4 sidebar">
<?php
/*
* SIDEBAR & SUPPORT
* @since 1.0
*/
include( cUsCF_DIR . 'views/sidebar.php');
?>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<hr/>
<div class="pull-left">
<span class="loading"></span>
<label>ContactUs.com link:</label>
<input type="checkbox" class="checkbox_backlink" name="checkbox_backlink" id="checkbox_backlink" <?php echo( $boolBackLink || !strlen($boolBackLink) ) ? 'checked': ''; ?>>
</div>
</div>
</div>
<script>
var home_url = '<?php echo get_option('home'); ?>';
</script>
<?php
if(!empty($cUs_API_Account)){
if(!strlen($showHints) || $showHints == 1) { ?>
<script>
jQuery(document).ready(function($) {
startIntro();
});
</script>
<?php }
}
?> | gpl-2.0 |
miguelinux/vbox | src/VBox/Runtime/generic/cdrom-generic.cpp | 2790 | /* $Id: cdrom-generic.cpp $ */
/** @file
* IPRT - CD/DVD/BD-ROM Drive, Generic.
*/
/*
* Copyright (C) 2012-2015 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* you can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
/*********************************************************************************************************************************
* Header Files *
*********************************************************************************************************************************/
#include <iprt/cdrom.h>
#include "internal/iprt.h"
#include <iprt/assert.h>
#include <iprt/err.h>
RTDECL(int) RTCdromOpen(const char *psz, uint32_t fFlags, PRTCDROM phCdrom)
{
return VERR_NOT_IMPLEMENTED;
}
RTDECL(uint32_t) RTCdromRetain(RTCDROM hCdrom)
{
AssertFailedReturn(UINT32_MAX);
}
RTDECL(uint32_t) RTCdromRelease(RTCDROM hCdrom)
{
AssertFailedReturn(UINT32_MAX);
}
RTDECL(int) RTCdromQueryMountPoint(RTCDROM hCdrom, char *pszMountPoint, size_t cbMountPoint)
{
AssertFailedReturn(VERR_NOT_IMPLEMENTED);
}
RTDECL(int) RTCdromUnmount(RTCDROM hCdrom)
{
AssertFailedReturn(VERR_NOT_IMPLEMENTED);
}
RTDECL(int) RTCdromEject(RTCDROM hCdrom, bool fForce)
{
AssertFailedReturn(VERR_NOT_IMPLEMENTED);
}
RTDECL(int) RTCdromLock(RTCDROM hCdrom)
{
AssertFailedReturn(VERR_NOT_IMPLEMENTED);
}
RTDECL(int) RTCdromUnlock(RTCDROM hCdrom)
{
AssertFailedReturn(VERR_NOT_IMPLEMENTED);
}
RTDECL(unsigned) RTCdromCount(void)
{
return 0;
}
RTDECL(int) RTCdromOrdinalToName(unsigned iCdrom, char *pszName, size_t cbName)
{
if (cbName)
*pszName = '\0';
return VERR_OUT_OF_RANGE;
}
RTDECL(int) RTCdromOpenByOrdinal(unsigned iCdrom, uint32_t fFlags, PRTCDROM phCdrom)
{
return VERR_OUT_OF_RANGE;
}
| gpl-2.0 |
turbhrus/XCSoar | src/Screen/ContainerWindow.hpp | 4738 | /*
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_SCREEN_CONTAINER_WINDOW_HXX
#define XCSOAR_SCREEN_CONTAINER_WINDOW_HXX
#include "Screen/PaintWindow.hpp"
#ifndef USE_GDI
#include "Screen/Custom/WList.hpp"
#endif
#ifdef USE_GDI
class Brush;
#else
class WindowReference;
#endif
/**
* A container for more #Window objects. It is also derived from
* #PaintWindow, because you might want to paint a border between the
* child windows.
*/
class ContainerWindow : public PaintWindow {
protected:
#ifndef USE_GDI
friend class WindowList;
WindowList children;
/**
* The active child window is used to find the focused window. If
* this attribute is nullptr, then the focused window is not an
* (indirect) child window of this one.
*/
Window *active_child;
/**
* The child window which captures the mouse.
*/
Window *capture_child;
public:
ContainerWindow();
virtual ~ContainerWindow();
#endif /* !USE_GDI */
protected:
#ifndef USE_GDI
void OnDestroy() override;
void OnCancelMode() override;
bool OnMouseMove(PixelScalar x, PixelScalar y, unsigned keys) override;
bool OnMouseDown(PixelScalar x, PixelScalar y) override;
bool OnMouseUp(PixelScalar x, PixelScalar y) override;
bool OnMouseDouble(PixelScalar x, PixelScalar y) override;
bool OnMouseWheel(PixelScalar x, PixelScalar y, int delta) override;
#ifdef HAVE_MULTI_TOUCH
bool OnMultiTouchDown() override;
bool OnMultiTouchUp() override;
#endif
void OnPaint(Canvas &canvas) override;
#else /* USE_GDI */
virtual const Brush *OnChildColor(Window &window, Canvas &canvas);
LRESULT OnMessage(HWND hWnd, UINT message,
WPARAM wParam, LPARAM lParam) override;
virtual void OnPaint(gcc_unused Canvas &canvas) {}
#endif
public:
#ifndef USE_GDI
void AddChild(Window &child);
void RemoveChild(Window &child);
gcc_pure
bool HasChild(const Window &w) const {
return children.Contains(w);
}
/**
* Like Invalidate(), but if the specified window is covered by a
* sibling, this method is a no-op.
*/
void InvalidateChild(const Window &child);
void BringChildToTop(Window &child) {
children.BringToTop(child);
InvalidateChild(child);
}
void BringChildToBottom(Window &child) {
children.BringToBottom(child);
Invalidate();
}
/**
* Locate a child window by its relative coordinates.
*/
gcc_pure
Window *ChildAt(PixelScalar x, PixelScalar y) {
return children.FindAt(x, y);
}
/**
* Locates the child which should get a mouse event. Prefers the
* captured child.
*/
gcc_pure
Window *EventChildAt(PixelScalar x, PixelScalar y);
void SetActiveChild(Window &child);
void SetFocus() override;
void ClearFocus() override;
/**
* Override the Window::GetFocusedWindow() method, and search in
* the active child window.
*/
gcc_pure
Window *GetFocusedWindow() override;
gcc_pure
WindowReference GetFocusedWindowReference();
void SetChildCapture(Window *window);
void ReleaseChildCapture(Window *window);
void ClearCapture() override;
protected:
gcc_pure
Window *FindNextControl(Window *reference);
gcc_pure
Window *FindPreviousControl(Window *reference);
public:
#endif /* !USE_GDI */
/**
* Sets the keyboard focus on the first descendant window which has
* the WindowStyle::tab_stop() attribute.
*
* @return true if the focus has been moved
*/
bool FocusFirstControl();
/**
* Sets the keyboard focus on the next descendant window which has
* the WindowStyle::tab_stop() attribute.
*
* @return true if the focus has been moved
*/
bool FocusNextControl();
/**
* Sets the keyboard focus on the previous descendant window which
* has the WindowStyle::tab_stop() attribute.
*
* @return true if the focus has been moved
*/
bool FocusPreviousControl();
};
#endif
| gpl-2.0 |
ger4003/int14_ger_joomla | components/com_listbingo/views/ads/view.html.php | 8466 | <?php
/**
* Joomla! 1.5 component LISTBINGO
*
* @version $Id: view.html.php 2010-01-10 00:57:37 svn $
* @author gobingoo.com
* @package Joomla
* @subpackage LISTBINGO
* @license GNU/GPL
*
* A classified ad component from gobingoo.com.
*
* @code Bruce
*
*/
// no direct access
defined ( '_JEXEC' ) or die ( 'Restricted access' );
gbimport ( "gobingoo.template" );
/**
* HTML View class for the Listbingo component
*/
class ListbingoViewAds extends GTemplate {
function display($tpl = null) {
global $mainframe, $option, $listitemid;
$country = 0;
$region = 0;
$user = JFactory::getUser ();
$configmodel = gbimport ( "listbingo.model.configuration" );
$params = $configmodel->getParams ();
$menus = & JSite::getMenu ();
$menu = $menus->getActive ();
$pathway = & $mainframe->getPathWay ();
$query = "index.php?option=$option&task=ads&time=" . time () . "&Itemid=$listitemid";
$mainframe->setUserState ( "hereiam", base64_encode ( $query ) );
$countrymodel = gbimport ( "listbingo.model.country" );
$regionmodel = gbimport ( "listbingo.model.region" );
$country = $countrymodel->getCurrentCountry ( $params );
$region = $regionmodel->getCurrentRegion ( $params );
$countrytitle = $countrymodel->getCountryTitle ( $params );
$regiontitle = $regionmodel->getRegionTitle ( $params );
$forceads = $params->get ( 'force_ads', 0 );
if ($country != 0 && $region != 0) {
gbimport ( "gobingoo.currency" );
$filter = new stdClass ();
$catid = JRequest::getInt ( 'catid', 0 );
$filter->limit = JRequest::getInt ( 'limit', $params->get ( 'ads_per_page', 10 ) );
$filter->limitstart = JRequest::getInt ( 'limitstart', 0 );
$filter->category_id = $catid;
$filter->searchtxt = JRequest::getVar ( 'q', '' );
$filter->alpha = JFilterOutput::cleanText ( substr ( JRequest::getVar ( 'alpha', '' ), 0, 6 ) );
$filter->checkExpiryDate = 1;
$order = $mainframe->getUserStateFromRequest ( $option . 'adsfilter_order', 'order', $params->get ( 'layout_ordering' ), 'cmd' );
$filter->order_dir = $mainframe->getUserStateFromRequest ( $option . 'adsfilter_order_Dir', 'dir', '', 'word' );
$orderingtype = strtolower ( JFilterOutput::cleanText ( JRequest::getVar ( 'orderingtype', '' ) ) );
if (! empty ( $orderingtype )) {
if ($orderingtype == "desc") {
$orderingtype = "asc";
} else {
$orderingtype = "desc";
}
} else {
$orderingtype = "desc";
}
$filter->orderingtype = $orderingtype;
switch ($order) {
case 'latest' :
$filter->order = "a.created_date $orderingtype";
break;
case 'price' :
$filter->order = "a.price $orderingtype";
break;
default :
$filter->order = "a.ordering $orderingtype";
break;
}
$model = gbimport ( "listbingo.model.ad" );
$filter->country = $country > 0 ? $country : 0;
$filter->region = $region > 0 ? $region : 0;
$filter->regiontitle = $regiontitle;
$filter->expiry_days = $params->get ( 'expiry_days' );
$filter->access = ( int ) $user->get ( 'aid', 0 );
$filter->price_from = JRequest::getVar ( 'searchpricefrom', '' );
$filter->price_from = JRequest::getVar ( 'searchpriceto', '' );
$filter->params = $params;
$rows = $model->getListWithInfobar ( true, $filter );
//Add searches to queue for futher navigation
if (count ( $rows ) > 1) {
gbimport ( "listbingo.searchqueue" );
$queue = new SearchQueue ();
$queue->loadFromObjects ( $rows );
$queue->save ();
}
$total = $model->getListCountForSearch ( true, $filter );
jimport ( 'joomla.html.pagination' );
$pagenav = new JPagination ( $total, $filter->limitstart, $filter->limit );
/*
* shows category lists
*/
$catfilter = new stdClass ();
$catfilter->order = $mainframe->getUserStateFromRequest ( $option . 'listfilter_order', 'order', 'c.title', 'cmd' );
$catfilter->order_dir = $mainframe->getUserStateFromRequest ( $option . 'listfilter_order_Dir', 'dir', '', 'word' );
$catfilter->country = $country;
$catfilter->region = $region;
$catfilter->countrytitle = $countrytitle;
$catfilter->regiontitle = $regiontitle;
$catfilter->catid = $catid;
$catfilter->access = ( int ) $user->get ( 'aid', 0 );
$catmodel = gbimport ( "listbingo.model.category" );
$childcategories = $catmodel->getListForProduct ( true, $catfilter );
if (! is_array ( $childcategories )) {
$childcategories = array ($childcategories );
}
$category = $model->load ( $catid );
if (is_object ( $menu )) {
$menu_params = new JParameter ( $menu->params );
if (! $menu_params->get ( 'page_title' )) {
if ($category) {
$params->set ( 'page_title', $category->title );
} else {
$params->set ( 'page_title', JText::_ ( "CATEGORY" ) );
}
}
} else {
if ($category) {
$params->set ( 'page_title', $category->title );
} else {
$params->set ( 'page_title', JText::_ ( "CATEGORY" ) );
}
}
/**
* Work on Pathways here
*/
/*if ($category) {
$parents = $catmodel->getParentlist ( $catid );
for($p = 0; $p < count ( $parents ); $p ++) {
// Do not add the above and root categories when coming from a directory view
$pathway->addItem ( $this->escape ( $parents [$p]->title ), JRoute::_ ( 'index.php?option=' . $option . '&task=categories&catid=' . $parents [$p]->categoryslug ) );
}
}*/
/*
* shows related category lists
*/
$relatedtable = & JTable::getInstance ( 'relatedcategory' );
$relatedtable->id = $catid;
$relatedcat = $relatedtable->getRelatedCategoryLists ();
$db = JFactory::getDBO ();
$nulldate = $db->getNullDate ();
$userid = $user->get ( 'id' );
$document = & JFactory::getDocument ();
if (isset ( $childcategories [0] ) && $catid) {
$document->setTitle ( html_entity_decode ( $childcategories [0]->title ) );
$document->setMetadata ( 'keywords', html_entity_decode ( $childcategories [0]->title ) );
$desc = GHelper::trunchtml ( trim ( strip_tags ( html_entity_decode ( $childcategories [0]->description ) ) ), 200 );
}
if (isset ( $rows ) && count ( $rows ) > 0) {
foreach ( $rows as &$row ) {
$row->title = JFilterOutput::cleanText ( $row->title );
$row->id = JFilterOutput::cleanText ( $row->id );
$row->address1 = JFilterOutput::cleanText ( $row->address1 );
$row->address2 = JFilterOutput::cleanText ( $row->address2 );
$row->price = JFilterOutput::cleanText ( $row->price );
}
}
JFilterOutput::objectHTMLSafe ( $pagenav );
JFilterOutput::objectHTMLSafe ( $filter );
JFilterOutput::objectHTMLSafe ( $params );
JFilterOutput::objectHTMLSafe ( $indcount );
JFilterOutput::objectHTMLSafe ( $childcategories );
JFilterOutput::objectHTMLSafe ( $relatedcat );
JFilterOutput::objectHTMLSafe ( $user );
GApplication::triggerEvent ( 'onBeforeListDisplay', array (&$rows, &$params ) );
if (empty ( $filter->searchtxt )) {
$filter->searchtxt = JText::_ ( 'ALL' );
}
$menus = &JSite::getMenu ();
$menu = $menus->getActive ();
$menu_params = new JParameter ( $menu->params );
if ($menu_params && $menu_params->get('list_layout')!="") {
$params->set ( 'default_listing_layout', $menu_params->get ( 'list_layout' ) );
}
$this->assignRef ( 'rows', $rows );
$this->assignRef ( 'pagination', $pagenav );
$this->assignRef ( 'filter', $filter );
$this->assignRef ( 'params', $params );
$this->assignRef ( 'indcount', $indcount );
$this->assignRef ( 'categories', $childcategories );
$this->assignRef ( 'relatedcat', $relatedcat );
$this->assign ( 'user', $user );
$this->assign ( 'userid', $userid );
$this->assign ( 'guest', $user->guest );
$this->assign ( 'nulldate', $nulldate );
parent::display ( $tpl );
GApplication::triggerEvent ( 'onAfterListDisplay', array (&$rows, &$params ) );
} else {
$redirlink = JRoute::_ ( "index.php?option=$option&task=regions&Itemid=$listitemid&time=" . time (), false );
GApplication::redirect ( $redirlink );
}
}
function searchDisplay($tpl = null) {
parent::display ( $tpl );
}
function customDisplay($tpl = null) {
parent::display ( $tpl );
}
}
?>
| gpl-2.0 |
Tramber/YOMS | src/Oms.Client/Framework/Themes/ThemeManager.cs | 2408 | using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Windows;
namespace Oms.Client.Framework.Themes
{
[Export(typeof(IThemeManager))]
public class ThemeManager : IThemeManager
{
public event EventHandler CurrentThemeChanged;
private ResourceDictionary _applicationResourceDictionary;
private readonly ITheme[] _themes;
public IEnumerable<ITheme> Themes
{
get { return _themes; }
}
public ITheme CurrentTheme { get; private set; }
[ImportingConstructor]
public ThemeManager([ImportMany] ITheme[] themes)
{
_themes = themes;
}
public bool SetCurrentTheme(string name)
{
var theme = _themes.FirstOrDefault(x => x.Name == name);
if (theme == null)
return false;
CurrentTheme = theme;
if (_applicationResourceDictionary == null)
{
_applicationResourceDictionary = new ResourceDictionary();
Application.Current.Resources.MergedDictionaries.Add(_applicationResourceDictionary);
}
_applicationResourceDictionary.BeginInit();
_applicationResourceDictionary.MergedDictionaries.Clear();
var windowResourceDictionary = Application.Current.MainWindow.Resources.MergedDictionaries[0];
windowResourceDictionary.BeginInit();
windowResourceDictionary.MergedDictionaries.Clear();
foreach (var uri in theme.ApplicationResources)
_applicationResourceDictionary.MergedDictionaries.Add(new ResourceDictionary
{
Source = uri
});
foreach (var uri in theme.MainWindowResources)
windowResourceDictionary.MergedDictionaries.Add(new ResourceDictionary
{
Source = uri
});
_applicationResourceDictionary.EndInit();
windowResourceDictionary.EndInit();
RaiseCurrentThemeChanged(EventArgs.Empty);
return true;
}
private void RaiseCurrentThemeChanged(EventArgs args)
{
var handler = CurrentThemeChanged;
if (handler != null)
handler(this, args);
}
}
} | gpl-2.0 |
SaiPradeepDandem/javafx-demos | src/main/java/com/ezest/javafx/demogallery/webview/WebViewAutoHeightAdjust2.java | 6400 | package com.ezest.javafx.demogallery.webview;
import javafx.application.Application;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.concurrent.Worker.State;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Cursor;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.Separator;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.StackPaneBuilder;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebEvent;
import javafx.scene.web.WebView;
import javafx.stage.Screen;
import javafx.stage.Stage;
import netscape.javascript.JSObject;
import com.javafx.experiments.scenicview.ScenicView;
public class WebViewAutoHeightAdjust2 extends Application {
public static final String JQUERY_URL = WebViewAutoHeightAdjust2.class.getResource("/scripts/jquery-1.7.2.js").toExternalForm();
public static final String MYJS_URL = WebViewAutoHeightAdjust2.class.getResource("/scripts/myscript.js").toExternalForm();
Stage stage;
Scene scene;
StackPane root;
public static void main(String[] args) {
Application.launch(args);
}
@Override
public void start(Stage stage) throws Exception {
this.stage = stage;
configureScene();
configureStage();
VBox vb = new VBox();
vb.setMaxWidth(700);
StackPane header = StackPaneBuilder.create().style("-fx-background-color:orange;").prefHeight(50).build();
StackPane footer = StackPaneBuilder.create().style("-fx-background-color:orange;").children(new Label("Footer")).prefHeight(50).build();
final WebView webView = new WebView();
webView.setMaxWidth(730);
final WebEngine webEngine = webView.getEngine();
webEngine.loadContent(getReplacedContent("FX"));
webEngine.setOnAlert(new EventHandler<WebEvent<String>>() {
@Override
public void handle(WebEvent<String> event) {
double height = Double.parseDouble(event.getData());
webView.setPrefHeight(height+2);
webView.setMinHeight(height+2);
webView.setMaxHeight(height+2);
}
});
webEngine.getLoadWorker().stateProperty().addListener(
new ChangeListener<State>(){
@Override
public void changed(ObservableValue<? extends State> ov, State oldState, State newState) {
if(newState == State.SUCCEEDED){
JSObject window = (JSObject)webEngine.executeScript("window");
window.setMember("app", new JavaApplication());
}
}
});
JSObject window = (JSObject)webEngine.executeScript("window");
window.setMember("app", new JavaApplication());
StackPane container = new StackPane();
container.setAlignment(Pos.TOP_LEFT);
container.getChildren().addAll(webView);
vb.getChildren().addAll(header,container, footer);
ScrollPane sp = new ScrollPane();
sp.setContent(vb);
root.getChildren().add(sp);
}
private void configureStage(){
stage.setTitle(this.getClass().getSimpleName());
stage.setX(0);
stage.setY(0);
stage.setWidth(Screen.getPrimary().getVisualBounds().getWidth());
stage.setHeight(Screen.getPrimary().getVisualBounds().getHeight());
stage.setScene(this.scene);
stage.show();
}
private void configureScene(){
root = new StackPane();
root.setAlignment(Pos.TOP_LEFT);
root.setPadding(new Insets(15));
BorderPane bp = new BorderPane();
bp.setBottom(getBottom());
bp.setCenter(root);
bp.autosize();
this.scene = new Scene(bp, Color.LINEN);
scene.getStylesheets().add("styles/template.css");
}
private Node getBottom() {
StackPane sp = new StackPane();
sp.setMinHeight(25);
sp.setAlignment(Pos.TOP_RIGHT);
ImageView image = new ImageView(new Image(getClass().getResourceAsStream("/images/mglass.gif")));
image.setCursor(Cursor.HAND);
image.setTranslateX(-5);
image.setTranslateY(3);
image.setOnMouseClicked(new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent paramT) {
ScenicView.show(scene);
}
});
sp.getChildren().addAll(new Separator(),image);
return sp;
}
private String getReplacedContent(String text){
String s = getMainContent();
String r ="<html><head><style>body{ color:#635564; font-size:13px; font-family:verdana; background:#FFF3A4; margin:0px;padding:0px;}</style>";
r = r+"<script src=\""+JQUERY_URL+"\"></script>" ;
r = r+"<script>"+
"$(window).ready(function() {" +
"reAdjustHeight();"+
"}); " +
" function reAdjustHeight(){"+
"alert($(\"#pageBody\").height());" +
" }"+
" function addMore(){"+
"document.getElementById('pageBody').innerHTML = 'AAA<br> '+document.getElementById('pageBody').innerHTML;"+
"alert($(\"#pageBody\").height()); "+
" }";
r = r+"</script></head><body><div id='pageBody'>";
while(s.indexOf(text)>-1){
String a = s.substring(0,(s.indexOf(text)+text.length()));
r = r + a.replace(text, "<span style='background:#74A726;color:#FFFFFF;'>"+text+"</span>");
s = s.substring((s.indexOf(text)+text.length()));
}
if(s.length()>0){
r = r + s;
}
r = r + "</div></body></html>";
return r;
}
private String getMainContent(){
String str="";
for (int i = 0; i < 1; i++) {
str = str +"<h1>The JavaFX Advantage for Swing Developers</h1><br><a onclick='addMore();'>For</a> more than 10 years, application developers have found Swing to be a highly effective toolkit for building graphical user interfaces (GUIs) and adding interactivity to Java applications. However, some of today's most popular GUI features cannot be easily implemented by using Swing.JavaFX is designed to provide applications with such sophisticated GUI";
}
return str;
}
class WebContainer extends StackPane{
public WebContainer(){
super();
}
}
public class JavaApplication {
public void adjustWebViewHgt() {
System.out.println("Hi");
}
}
}
| gpl-2.0 |
bhavikavaru/wordpress-with-woocommerce | wp-content/plugins/voucherpress/voucherpress.js | 4033 | jQuery(document).ready(function(){
vp_set_preview_font();
jQuery("#voucherthumbs img").bind("click", vp_set_preview);
jQuery(".checkbox").bind("click", vp_set_template_deleted);
jQuery("#font").bind("change", vp_set_preview_font);
jQuery("#name").bind("keyup", vp_limit_text);
jQuery("#text").bind("keyup", vp_limit_text);
jQuery("#terms").bind("keyup", vp_limit_text);
jQuery("#previewbutton").bind("click", vp_preview_voucher);
jQuery("#savebutton").bind("click", vp_save_voucher);
jQuery("a.templatepreview").bind("click", vp_new_window);
vp_hide_form_options();
jQuery("#randomcodes").bind("click", vp_check_random);
jQuery("#sequentialcodes").bind("click", vp_check_sequential);
jQuery("#customcodes").bind("click", vp_check_custom);
jQuery("#singlecode").bind("click", vp_check_single);
jQuery("#showshortcodes").bind("click", vp_toggle_shortcodes);
jQuery("#delete").bind("change", vp_toggle_deletion);
});
function vp_toggle_deletion(e) {
if(this.checked) {
jQuery("#previewbutton").hide();
jQuery("#savebutton").val("Delete voucher");
} else {
jQuery("#previewbutton").show();
jQuery("#savebutton").val("Save");
}
}
function vp_toggle_shortcodes(e) {
jQuery("#shortcodes").toggle();
e.preventDefault();
return false;
}
function vp_hide_form_options() {
jQuery(".hider").hide();
}
function vp_check_random(e) {
vp_hide_form_options();
if (this.checked) {
vp_show_random();
}
}
function vp_show_random() {
jQuery("#codelengthline").show();
jQuery("#codeprefixline").show();
jQuery("#codesuffixline").show();
}
function vp_check_sequential(e) {
vp_hide_form_options();
if (this.checked) {
vp_show_sequential();
}
}
function vp_show_sequential() {
jQuery("#codeprefixline").show();
jQuery("#codesuffixline").show();
}
function vp_check_custom(e) {
vp_hide_form_options();
if (this.checked) {
vp_show_custom();
}
}
function vp_show_custom() {
jQuery("#customcodelistline").show();
jQuery("#codeprefixline").hide();
jQuery("#codesuffixline").hide();
}
function vp_check_single(e) {
vp_hide_form_options();
if (this.checked) {
vp_show_single();
}
}
function vp_show_single() {
jQuery("#singlecodetextline").show();
jQuery("#codeprefixline").hide();
jQuery("#codesuffixline").hide();
}
function vp_new_window(e) {
jQuery(this).attr("target", "_blank");
}
function vp_preview_voucher(e) {
var form = jQuery("#voucherform");
form.attr("action", form.attr("action") + "&preview=voucher");
form.attr("target", "_blank");
form.submit();
}
function vp_save_voucher(e) {
var form = jQuery("#voucherform");
form.attr("action", form.attr("action").replace("&preview=voucher", ""));
form.attr("target", "");
form.submit();
}
function vp_set_preview(e) {
var id = this.id.replace("template_", "");
var preview = "url(" + vp_siteurl + "/wp-content/plugins/voucherpress/templates/" + id + "_preview.jpg)";
jQuery("#voucherpreview").css("background-image", preview);
jQuery("#template").val(id);
}
function vp_set_template_deleted(e) {
var td = jQuery(this).parent().get(0);
var tr = jQuery(td).parent().get(0);
jQuery(tr).toggleClass("deleted");
}
function vp_set_preview_font(e) {
var font = jQuery("#font :selected").val();
jQuery("#voucherpreview h2 textarea").attr("class", font);
jQuery("#voucherpreview p textarea").attr("class", font);
jQuery("#voucherpreview p").attr("class", font);
}
function vp_limit_text(e) {
var limit = 30;
var el = jQuery(this);
if (el.attr("id") == "text") limit = 200;
if (el.attr("id") == "terms") limit = 300;
var length = el.val().length;
if (parseFloat(length) >= parseFloat(limit)) {
// if this is a character key, stop it being entered
var key = vp_keycode(e) || e.code;
if (key != 8 && key != 46 && key != 37 && key != 39) {
el.val(el.val().substr(0, limit));
e.preventDefault(); e.stopPropagation(); return false;
}
}
}
// return the keycode for this event
function vp_keycode(e) {
if (window.event) {
return window.event.keyCode;
} else if (e) {
return e.which;
} else {
return false;
}
} | gpl-2.0 |
michalpipa/ezpublish-kernel | eZ/Publish/Core/Search/Solr/Content/SortClauseVisitor/MapLocationDistance.php | 3595 | <?php
/**
* File containing the SortClauseVisitor\MapLocationDistance class
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
* @version //autogentag//
*/
namespace eZ\Publish\Core\Search\Solr\Content\SortClauseVisitor;
use eZ\Publish\Core\Search\Solr\Content\SortClauseVisitor;
use eZ\Publish\API\Repository\Values\Content\Query\SortClause;
use eZ\Publish\Core\Search\Common\FieldNameResolver;
use eZ\Publish\API\Repository\Values\Content\Query\CustomFieldInterface;
use eZ\Publish\Core\Base\Exceptions\InvalidArgumentException;
/**
* Visits the sortClause tree into a Solr query
*/
class MapLocationDistance extends SortClauseVisitor
{
/**
* Name of the field type's indexed field that criterion can handle.
*
* @var string
*/
protected $fieldName;
/**
* Field map
*
* @var \eZ\Publish\Core\Search\Common\FieldNameResolver
*/
protected $fieldNameResolver;
/**
* Create from field map and field name
*
* @param \eZ\Publish\Core\Search\Common\FieldNameResolver $fieldNameResolver
* @param string $fieldName
*/
public function __construct( FieldNameResolver $fieldNameResolver, $fieldName )
{
$this->fieldNameResolver = $fieldNameResolver;
$this->fieldName = $fieldName;
}
/**
* Get sort field name
*
* @param \eZ\Publish\API\Repository\Values\Content\Query\SortClause $sortClause
* @param string $contentTypeIdentifier
* @param string $fieldDefinitionIdentifier
* @param string $name
*
* @return array
*/
protected function getSortFieldName(
SortClause $sortClause,
$contentTypeIdentifier,
$fieldDefinitionIdentifier,
$name = null
)
{
return $this->fieldNameResolver->getSortFieldName(
$sortClause,
$contentTypeIdentifier,
$fieldDefinitionIdentifier,
$name
);
}
/**
* CHeck if visitor is applicable to current sortClause
*
* @param \eZ\Publish\API\Repository\Values\Content\Query\SortClause $sortClause
*
* @return boolean
*/
public function canVisit( SortClause $sortClause )
{
return $sortClause instanceof SortClause\MapLocationDistance;
}
/**
* Map field value to a proper Solr representation
*
* @throws \eZ\Publish\Core\Base\Exceptions\InvalidArgumentException If no sortable fields are found for the given sort clause target.
*
* @param \eZ\Publish\API\Repository\Values\Content\Query\SortClause $sortClause
*
* @return string
*/
public function visit( SortClause $sortClause )
{
/** @var \eZ\Publish\API\Repository\Values\Content\Query\SortClause\Target\MapLocationTarget $target */
$target = $sortClause->targetData;
$fieldName = $this->getSortFieldName(
$sortClause,
$target->typeIdentifier,
$target->fieldIdentifier,
$this->fieldName
);
if ( $fieldName === null )
{
throw new InvalidArgumentException(
"\$sortClause->targetData",
"No searchable fields found for the given sort clause target ".
"'{$target->fieldIdentifier}' on '{$target->typeIdentifier}'."
);
}
return "geodist({$fieldName},{$target->latitude},{$target->longitude})" . $this->getDirection( $sortClause );
}
}
| gpl-2.0 |
Gorehide/kengo | kengo/html/paginador.php | 989 | <div class="pager" id="pager">
<form>
<table border="0" align="center">
<tr>
<td><a href="#" title="primero"><img class="first" src="imagenes/first.png"/></a></td>
<td><a href="#" title="anterior"><img class="prev" src="imagenes/prev.png"/></a></td>
<td><input type="text" class="pagedisplay" readonly="readonly"/></td>
<td><a href="#" title="siguiente"><img class="next" src="imagenes/next.png"/></a></td>
<td><a href="#" title="último"><img class="last" src="imagenes/last.png"/></a></td>
<td class="pagiseli">
<select class="pagesize" class="dd">
<option value="10" selected="selected">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="40">40</option>
</select>
</td>
</tr>
</table>
</form>
</div> | gpl-2.0 |
leebird/legonlp | annotation/evaluation.py | 2937 | class Evaluation(object):
def __init__(self):
pass
@classmethod
def calculate(cls, user_set, golden_set, verbose=False):
golden_num = len(golden_set)
tp = len(golden_set & user_set)
fp = len(user_set - golden_set)
fn = len(golden_set - user_set)
precision = tp * 1.0 / (tp + fp) if tp + fp > 0 else 0
recall = tp * 1.0 / (tp + fn) if tp + fn > 0 else 0
fscore = 2 * precision * recall / (precision + recall) if precision + recall > 0 else 0
print('all relations:', golden_num)
print("%-10s %-10s %10s" % ('precision', 'recall', 'f1-score'))
print("%-10.2f %-10.2f %10.2f" % (precision, recall, fscore))
if verbose:
print()
print('TP:')
for t in sorted(user_set & golden_set, key=lambda a: a[0]):
print(t)
print()
print('FP:')
for t in sorted(user_set - golden_set, key=lambda a: a[0]):
print(t)
print()
print('FN:')
for t in sorted(golden_set - user_set, key=lambda a: a[0]):
print(t)
print()
print('FN:')
print('\n'.join(set([str(t[0]) for t in golden_set - user_set])))
@classmethod
def get_entity_category_set(cls, docid, annotation, category):
entity_set = set()
entities = annotation.get_entity_category(category)
for entity in entities:
entity_set.add((docid, str(entity)))
return entity_set
@classmethod
def get_event_category_set(cls, docid, annotation, category):
event_set = set()
events = annotation.get_event_category(category)
for event in events:
event_set.add((docid, str(event)))
return event_set
@classmethod
def evaluate(cls, user_annotation, gold_annotation, entity_category=None, event_category=None):
user_set, gold_set = set(), set()
if entity_category is not None and len(entity_category) > 0:
for category in entity_category:
for docid, annotation in user_annotation.items():
user_set = user_set.union(cls.get_entity_category_set(docid, annotation, category))
for docid, annotation in gold_annotation.items():
gold_set = gold_set.union(cls.get_entity_category_set(docid, annotation, category))
if event_category is not None and len(event_category) > 0:
for category in event_category:
for docid, annotation in user_annotation.items():
user_set.union(cls.get_event_category_set(docid, annotation, category))
for docid, annotation in gold_annotation.items():
gold_set.union(cls.get_event_category_set(docid, annotation, category))
cls.calculate(user_set, gold_set)
| gpl-2.0 |
tayjay/PlayerAugments | src/main/java/com/tayjay/playeraugments/augment/Augment.java | 1909 | package com.tayjay.playeraugments.augment;
import com.tayjay.playeraugments.reference.Reference;
import com.tayjay.playeraugments.util.LogHelper;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.client.resources.I18n;
import net.minecraft.util.IIcon;
import java.util.ArrayList;
import java.util.List;
/**
* Created by tayjm_000 on 2015-10-18.
*/
public class Augment
{
private String augmentName;
private int augmentId;
private int typeId;
private String augmentType;
private int tier;
private final String[] types = {"brain","eye","skull","skeleton","arm","heart","energy","leg","dna","special"};
private List<String> temp = new ArrayList<String>();
private IIcon icon;
//private String unlocalizedName;
public Augment(int id,String name,int tier, int typeId)
{
this.augmentName = name;
this.augmentId = id;
this.tier = tier;
this.typeId = typeId;
this.augmentType = types[typeId];
AugmentRegistry.register(this);
}
public String getUnlocalizedName()
{
return "augment."+augmentType+"."+augmentName;
}
public int getAugmentId()
{
return augmentId;
}
public int getTypeId()
{
return typeId;
}
public String getAugmentType()
{
return augmentType;
}
public int getTier()
{
return tier;
}
public String getAugmentName()
{
return augmentName;
}
public String[] getTypes()
{
return types;
}
public IIcon getIcon()
{
if(icon!=null)
{
return icon;
}
LogHelper.error(augmentName+"\'s icon is null!");
return null;
}
public void registerIcon(IIconRegister iconRegister)
{
icon = iconRegister.registerIcon(Reference.MOD_ID_LOWER+":"+augmentName);
}
}
| gpl-2.0 |
Opencontent/ezodf | classes/ezooconverter.php | 21802 | <?php
//
// Definition of eZOoconverter class
//
// Created on: <21-Jan-2005 09:52:07 bf>
//
// ## BEGIN COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
// SOFTWARE NAME: eZ Publish
// SOFTWARE RELEASE: 3.9.x
// COPYRIGHT NOTICE: Copyright (C) 1999-2014 eZ Systems AS
// SOFTWARE LICENSE: GNU General Public License v2.0
// NOTICE: >
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2.0 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 version 2.0 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.
//
//
// ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
//
/*! \file ezooconverter.php
*/
/*!
\class eZOoconverter ezooconverter.php
\brief The class handles the conversion from eZ Publish objects to OO documents using the eZOOGenerator class
*/
class eZOOConverter
{
/*!
Constructor
*/
function __construct()
{
}
/*!
Converts the eZ Publish object with the given node id into an OpenOffice.org Writer document.
The filename to the generated file is returned.
*/
static function objectToOO( $nodeID )
{
$node = eZContentObjectTreeNode::fetch( $nodeID );
if ( !is_object( $node ) )
{
return false;
}
$ooGenerator = new eZOOGenerator();
$object = $node->attribute( 'object' );
$attributes = $object->contentObjectAttributes();
$supportedDatatypes = array( 'ezstring', 'eztext', 'ezxmltext', 'ezimage', 'ezdate', 'ezdatetime', 'ezmatrix' );
$odfINI = eZINI::instance( 'odf.ini' );
$ClassMappingToHeader = ( $odfINI->variable( 'ODFExport', 'ClassAttributeMappingToHeader' ) == 'enabled' ) ? true : false;
// @bf 2008-08-21: Fetch the current class identifier and the .ini settings for the enabled attributes for this
$classIdentifier = $object->contentClassIdentifier();
$enabledClassAttributes = $odfINI->hasVariable( $classIdentifier, 'Attribute' ) ? $odfINI->variable( $classIdentifier, 'Attribute' ) : array();
foreach ( $attributes as $attribute )
{
$datatype = $attribute->attribute( 'data_type_string' );
$identifier = $attribute->attribute( "contentclass_attribute_identifier" );
if ( !in_array( $datatype, $supportedDatatypes ) )
{
eZDebug::writeError( "Attribute '$identifier' with unsupported datatype '$datatype' for OO conversion" );
continue;
}
// @bf 2008-08-21: Only export attribute if it is enabled
if ( !array_key_exists( $identifier, $enabledClassAttributes ) )
{
continue;
}
if( !$ClassMappingToHeader )
{
$ooGenerator->startSection( $identifier );
}
else
{
$ooGenerator->startClassMapHeader( $identifier );
}
switch ( $datatype )
{
case "ezstring":
{
$text = trim( $attribute->content() );
if ( $text != "" )
{
$ooGenerator->addHeader( $text );
}
} break;
case "eztext":
{
$ooGenerator->addParagraph( $attribute->content() );
} break;
case "ezxmltext":
{
$xmlData = $attribute->attribute( 'data_text' );
$dom = new DOMDocument( '1.0', 'UTF-8' );
$dom->preserveWhiteSpace = false;
$success = $dom->loadXML( $xmlData );
if ( $success )
{
$root = $dom->documentElement;
foreach ( $root->childNodes as $node )
{
self::handleNode( $node, $ooGenerator );
}
}
else
{
eZDebug::writeError( "Unable to load XML data for attribute '$identifier'" );
}
} break;
case "ezimage":
{
$originalImage = $attribute->content()->attribute( 'original' );
$fileHandler = eZClusterFileHandler::instance( $originalImage['url'] );
$uniqueFile = $fileHandler->fetchUnique();
$imageArray = array( "FileName" => $uniqueFile,
"Alignment" => "center",
"DisplayWidth" => $originalImage['width'],
"DisplayHeight" => $originalImage['height'] );
$ooGenerator->addImage( $imageArray );
} break;
case "ezdate":
{
$date = $attribute->content();
$ooGenerator->addParagraph( $date->attribute( "day" ) . "/" . $date->attribute( "month" ) . "/" . $date->attribute( "year" ) );
} break;
case "ezdatetime":
{
$date = $attribute->content();
$ooGenerator->addParagraph( $date->attribute( "day" ) . "/" . $date->attribute( "month" ) . "/" . $date->attribute( "year" ) . " " . $date->attribute( "hour" ) . ":" . $date->attribute( "minute" ) );
} break;
case "ezmatrix":
{
$matrix = $attribute->content();
$columns = $matrix->attribute( "columns" );
$ooGenerator->startTable();
foreach ( $columns['sequential'] as $column )
{
$ooGenerator->addParagraph( $column['name'] );
$ooGenerator->nextCell();
}
$ooGenerator->nextRow( "defaultstyle" );
$rows = $matrix->attribute( "rows" );
foreach ( $rows['sequential'] as $row )
{
foreach ( $row['columns'] as $cell )
{
$ooGenerator->addParagraph( $cell );
$ooGenerator->nextCell();
}
$ooGenerator->nextRow( "defaultstyle" );
}
$ooGenerator->endTable();
} break;
}
if( !$ClassMappingToHeader )
{
$ooGenerator->endSection();
}
}
return $ooGenerator->writeDocument();
}
/*!
\private
Internal function to handle an eZXMLText node and convert it to OO format
*/
static function handleNode( $node, $generator, $level = 0 )
{
switch ( $node->localName )
{
case "section":
{
foreach ( $node->childNodes as $childNode )
{
self::handleNode( $childNode, $generator, $level + 1 );
}
} break;
case "header":
{
if ( $level == 0 )
$level = 1;
$paragraphParameters = array();
$prevLineBreak = false;
foreach ( $node->childNodes as $childNode )
{
$return = eZOOConverter::handleInlineNode( $childNode, $generator, $prevLineBreak );
$paragraphParameters = array_merge( $paragraphParameters, $return['paragraph_parameters'] );
$prevLineBreak = ( $childNode->nodeType === XML_ELEMENT_NODE &&
$childNode->localName === 'line' );
}
$generator->addHeader( trim( $node->nodeValue ), $level, $paragraphParameters );
} break;
case "ul":
case "ol":
{
self::handleInlineNode( $node, $generator, $level );
} break;
case "paragraph":
{
$paragraphParameters = array();
$imageArray = array();
$prevLineBreak = false;
foreach ( $node->childNodes as $child )
{
$return = self::handleInlineNode( $child, $generator, $prevLineBreak );
$paragraphParameters = array_merge( $paragraphParameters, $return['paragraph_parameters'] );
$imageArray = array_merge( $imageArray, $return['image_array'] );
$prevLineBreak = ( $child->nodeType === XML_ELEMENT_NODE &&
$child->localName === 'line' );
}
foreach ( $imageArray as $image )
{
$generator->addImage( $image );
}
if ( !empty( $paragraphParameters ) && isset( $GLOBALS['CustomTagStyle'] ) and $GLOBALS['CustomTagStyle'] != false )
{
array_unshift( $paragraphParameters, $GLOBALS['CustomTagStyle'] );
}
call_user_func_array( array( $generator, "addParagraph" ), $paragraphParameters );
} break;
default:
{
eZDebug::writeError( "Unsupported node for document conversion: " . $node->localName );
}
}
}
/*!
Handles an inline node.
Parameter $prevLineBreak added by Alex because it was used but not defined.
*/
static function handleInlineNode( $child, $generator, $prevLineBreak = false )
{
$paragraphParameters = array();
$imageArray = array();
switch ( $child->localName )
{
case "line":
{
// @todo: (Alex) check why this is needed here and not after the next line
if ( $prevLineBreak )
{
$paragraphParameters[] = array( eZOOGenerator::LINE, '' );
}
// Todo: support inline tags
$paragraphParameters[] = array( eZOOGenerator::TEXT, $child->textContent );
foreach ( $child->childNodes as $lineChild )
{
if ( $lineChild->localName == 'embed' )
{
// Only support objects of image class for now
$object = eZContentObject::fetch( $lineChild->getAttribute( "object_id" ) );
if ( $object && $object->canRead() )
{
$classIdentifier = $object->attribute( "class_identifier" );
// Todo: read class identifiers from configuration
if ( $classIdentifier == "image" )
{
$imageSize = $lineChild->getAttribute( 'size' );
if ( $imageSize == "" )
$imageSize = "large";
$imageAlignment = $lineChild->getAttribute( 'align' );
if ( $imageAlignment == "" )
$imageAlignment = "center";
$dataMap = $object->dataMap();
$imageAttribute = $dataMap['image'];
$imageHandler = $imageAttribute->content();
$originalImage = $imageHandler->attribute( 'original' );
$fileHandler = eZClusterFileHandler::instance( $originalImage['url'] );
$uniqueFile = $fileHandler->fetchUnique();
$displayImage = $imageHandler->attribute( $imageSize );
$displayWidth = $displayImage['width'];
$displayHeight = $displayImage['height'];
$imageArray[] = array( "FileName" => $uniqueFile,
"Alignment" => $imageAlignment,
"DisplayWidth" => $displayWidth,
"DisplayHeight" => $displayHeight );
}
}
else
{
eZDebug::writeError( "Image (object_id = " . $child->getAttribute( 'object_id' ) . " ) could not be used (does not exist or due to insufficient privileges)" );
}
}
}
} break;
// text nodes
case "":
{
$paragraphParameters[] = array( eZOOGenerator::TEXT, $child->textContent );
} break;
case "link":
{
$href = $child->getAttribute( 'href' );
if ( !$href )
{
$url_id = $child->getAttribute( 'url_id' );
if ( $url_id )
{
$eZUrl = eZURL::fetch( $url_id );
if ( is_object( $eZUrl ) )
{
$href = $eZUrl->attribute( 'url' );
}
}
}
$paragraphParameters[] = array( eZOOGenerator::LINK, $href, $child->textContent );
} break;
case "emphasize":
case "strong":
{
$style = $child->localName == 'strong' ? 'bold' : 'italic';
$paragraphParameters[] = array( eZOOGenerator::STYLE_START, $style );
foreach ( $child->childNodes as $inlineNode )
{
$return = self::handleInlineNode( $inlineNode );
$paragraphParameters = array_merge( $paragraphParameters, $return['paragraph_parameters'] );
}
$paragraphParameters[] = array( eZOOGenerator::STYLE_STOP );
} break;
case "literal":
{
$literalContent = $child->textContent;
$literalContentArray = explode( "\n", $literalContent );
foreach ( $literalContentArray as $literalLine )
{
$generator->addParagraph( "Preformatted_20_Text", htmlspecialchars( $literalLine ) );
}
} break;
case "custom":
{
$customTagName = $child->getAttribute( 'name' );
// Check if the custom tag is inline
$ini = eZINI::instance( 'content.ini' );
$isInlineTagList = $ini->variable( 'CustomTagSettings', 'IsInline' );
$isInline = ( array_key_exists( $customTagName, $isInlineTagList ) && $isInlineTagList[$customTagName] );
// Handle inline custom tags
if ( $isInline )
{
$paragraphParameters[] = array( eZOOGenerator::STYLE_START, "eZCustominline_20_$customTagName" );
$paragraphParameters[] = array( eZOOGenerator::TEXT, $child->textContent );
$paragraphParameters[] = array( eZOOGenerator::STYLE_STOP );
}
else
{
$GLOBALS['CustomTagStyle'] = "eZCustom_20_$customTagName";
foreach ( $child->childNodes as $customParagraph )
{
// Alex 2008-06-03: changed $level (3rd argument) to $prevLineBreak
self::handleNode( $customParagraph, $generator, $prevLineBreak );
}
$GLOBALS['CustomTagStyle'] = false;
}
} break;
case "ol":
case "ul":
{
$listType = $child->localName == "ol" ? "ordered" : "unordered";
$generator->startList( $listType );
foreach ( $child->childNodes as $listItem )
{
foreach ( $listItem->childNodes as $childNode )
{
if ( $childNode->nodeType == XML_TEXT_NODE )
{
$generator->addParagraph( $childNode->textContent );
}
else
{
// Alex 2008-06-03: changed $level (3rd argument) to $prevLineBreak
self::handleNode( $childNode, $generator, $prevLineBreak );
}
}
$generator->nextListItem();
}
$generator->endList();
} break;
case "table":
{
$generator->startTable();
$rows = 1;
foreach ( $child->childNodes as $row )
{
foreach ( $row->childNodes as $cell )
{
// Set the correct col span
$colSpan = $cell->getAttribute( "colspan" );
if ( is_numeric( $colSpan ) )
{
$generator->setCurrentColSpan( $colSpan );
}
// Check for table header
if ( $cell->localName == 'th' and $rows == 1 )
{
$generator->setIsInsideTableHeading( true );
}
// If the cell is empty, create a dummy so the cell is properly exported
if ( !$cell->hasChildNodes() )
{
$dummy = $cell->ownerDocument->createElement( "paragraph" );
$cell->appendChild( $dummy );
// Alex 2008-06-03: changed $level (3rd argument) to $prevLineBreak
eZOOConverter::handleNode( $dummy, $generator, $prevLineBreak );
}
eZDebug::writeDebug( $cell->ownerDocument->saveXML( $cell ), 'ezxmltext table cell' );
foreach ( $cell->childNodes as $cellNode )
{
// Alex 2008-06-03: changed $level (3rd argument) to $prevLineBreak
self::handleNode( $cellNode, $generator, $prevLineBreak );
}
$generator->nextCell();
}
$generator->nextRow();
++$rows;
}
$generator->endTable();
} break;
case 'object':
case 'embed':
{
$objectID = $child->localName == 'embed' ? $child->getAttribute( "object_id" ) : $child->getAttribute( "id" );
// Only support objects of image class for now
$object = eZContentObject::fetch( $objectID );
if ( $object && $object->canRead() )
{
$classIdentifier = $object->attribute( "class_identifier" );
// Todo: read class identifiers from configuration
if ( $classIdentifier == "image" )
{
$imageSize = $child->getAttribute( 'size' );
$imageAlignment = $child->getAttribute( 'align' );
$dataMap = $object->dataMap();
$imageAttribute = $dataMap['image'];
$imageHandler = $imageAttribute->content();
$originalImage = $imageHandler->attribute( 'original' );
$fileHandler = eZClusterFileHandler::instance( $originalImage['url'] );
$uniqueFile = $fileHandler->fetchUnique();
$displayImage = $imageHandler->attribute( $imageSize );
$displayWidth = $displayImage['width'];
$displayHeight = $displayImage['height'];
$imageArray[] = array( "FileName" => $uniqueFile,
"Alignment" => $imageAlignment,
"DisplayWidth" => $displayWidth,
"DisplayHeight" => $displayHeight );
}
}
else
{
eZDebug::writeError( "Image (object_id = " . $child->getAttribute( 'object_id' ) . " ) could not be used (does not exist or insufficient privileges)");
}
} break;
default:
{
eZDebug::writeError( "Unsupported node at this level" . $child->localName );
}
}
return array ( "paragraph_parameters" => $paragraphParameters,
"image_array" => $imageArray );
}
}
?>
| gpl-2.0 |
bfrss/bfrss | include/db-prefs.php | 335 | <?php
require_once "db.php";
function get_pref($pref_name, $user_id = false, $die_on_error = false)
{
return Db_Prefs::get()->read($pref_name, $user_id, $die_on_error);
}
function set_pref($pref_name, $value, $user_id = false, $strip_tags = true)
{
return Db_Prefs::get()->write($pref_name, $value, $user_id, $strip_tags);
}
| gpl-2.0 |
Barbatos/BatailleSpatiale | src/old_client/Joueur.cpp | 443 | #include "Joueur.hpp"
Joueur::Joueur(sf::Int32 _id, std::string _nom, sf::Int32 _energie, sf::Int32 _materiaux) :
id(_id), nom(_nom), energie(_energie), materiaux(_materiaux) {
}
const std::string& Joueur::getNom() const {
return nom;
}
const sf::Int32& Joueur::getId() const {
return id;
}
sf::Packet& operator >>(sf::Packet& paquet, Joueur& joueur) {
return paquet >> joueur.id >> joueur.nom >> joueur.energie >> joueur.materiaux;
}
| gpl-2.0 |
leoloso/PoP | layers/Legacy/Schema/packages/migrate-everythingelse/migrate/plugins/pop-addrelatedposts-processors/library/processors/controls/load.php | 91 | <?php
require_once 'controlbuttongroups.php';
require_once 'dropdownbutton-controls.php';
| gpl-2.0 |
pablanco/taskManager | Android/FlexibleClient/src/com/artech/android/ViewHierarchyVisitor.java | 3575 | package com.artech.android;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import android.view.View;
import android.view.ViewGroup;
import com.artech.utils.Cast;
public class ViewHierarchyVisitor
{
/**
* Gets all the Views of type viewType present in the hierarchy starting at root.
* Hierarchy traversal is preorder so parents will always appear before children in result.
* @param viewType Type of views to locate.
* @param root View hierarchy.
*/
public static <TView> List<TView> getViews(Class<TView> viewType, View root)
{
List<TView> list = new ArrayList<TView>();
if (viewType != null && root != null)
visit(viewType, root, list);
return list;
}
private static <TView> void visit(Class<TView> viewType, View view, List<TView> accum)
{
if (viewType.isInstance(view))
accum.add(viewType.cast(view));
for (View child : getViewWithChildren(view).getCustomViewChildren())
visit(viewType, child, accum);
}
/**
* Gets the first View in the parent hierarchy that is of the desired type.
* @param viewType Type of view to locate.
* @param view Child to get parent from.
* @return The first view of the specified type that contains the supplied view directly or indirectly, otherwise null.
*/
public static <TView> TView getParent(Class<TView> viewType, View view)
{
if (view == null)
return null;
if (viewType.isInstance(view))
return viewType.cast(view);
View parent = Cast.as(View.class, view.getParent());
return getParent(viewType, parent);
}
/**
* Similar to View.findViewWithTag(), but can specify a tag key for calling getTag() on each View.
* @param root Root view.
* @param key Tag key.
* @param tagValue Tag value.
* @return The first view found with the specified tag (compared using equals()).
*/
public static View findViewWithTag(View root, int key, Object tagValue)
{
if (tagValue == null)
return null;
Object viewTag = root.getTag(key);
if (tagValue.equals(viewTag))
return root;
// Special case for string tags, use case insensitive matching (necessary for control names in particular).
if (tagValue instanceof String && viewTag instanceof String && ((String)tagValue).equalsIgnoreCase((String)viewTag))
return root;
for (View child : getViewWithChildren(root).getCustomViewChildren())
{
View found = findViewWithTag(child, key, tagValue);
if (found != null)
return found;
}
return null;
}
private static ICustomViewChildrenProvider getViewWithChildren(View view)
{
if (view instanceof ICustomViewChildrenProvider)
return (ICustomViewChildrenProvider)view;
return new BaseViewChildrenProvider(view);
}
public interface ICustomViewChildrenProvider
{
Collection<View> getCustomViewChildren();
}
private static class BaseViewChildrenProvider implements ICustomViewChildrenProvider
{
private final View mView;
BaseViewChildrenProvider(View view)
{
mView = view;
}
@Override
public Collection<View> getCustomViewChildren()
{
if (mView instanceof ViewGroup)
{
ViewGroup parent = (ViewGroup)mView;
LinkedList<View> children = new LinkedList<View>();
for (int i = 0; i < parent.getChildCount(); i++)
children.add(parent.getChildAt(i));
return Collections.unmodifiableCollection(children);
}
else
return Collections.emptyList();
}
}
}
| gpl-2.0 |
gcorral/hivequeen | HiveQueen/hqadmin/views/admin.py | 666 | '''
Created on 24 may. 2021
@author: user
'''
from django.contrib.auth import login
from django.shortcuts import redirect
from django.views.generic import CreateView
from ..forms import AdminSignUpForm
from ..models import User
class AdminSignUpView(CreateView):
model = User
form_class = AdminSignUpForm
template_name = 'registration/signup_form.html'
def get_context_data(self, **kwargs):
kwargs['user_type'] = 'admin'
return super().get_context_data(**kwargs)
def form_valid(self, form):
user = form.save()
login(self.request, user)
#TODO:.
return redirect('admin') | gpl-2.0 |
func0der/punchcard | Plugin/Report/Test/Fixture/ReportFixture.php | 1660 | <?php
/**
* ReportFixture
*
*/
class ReportFixture extends CakeTestFixture {
/**
* Fields
*
* @var array
*/
public $fields = array(
'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'key' => 'primary'),
'user_id' => array('type' => 'integer', 'null' => true, 'default' => null),
'week' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 2, 'key' => 'index'),
'year' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 6),
'published' => array('type' => 'boolean', 'null' => true, 'default' => null, 'key' => 'index'),
'accepted' => array('type' => 'boolean', 'null' => true, 'default' => null, 'key' => 'index'),
'review' => array('type' => 'boolean', 'null' => true, 'default' => null, 'key' => 'index'),
'department_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'key' => 'index'),
'indexes' => array(
'PRIMARY' => array('column' => 'id', 'unique' => 1),
'week_year' => array('column' => array('week', 'year'), 'unique' => 0),
'published' => array('column' => 'published', 'unique' => 0),
'accepted' => array('column' => 'accepted', 'unique' => 0),
'review' => array('column' => 'review', 'unique' => 0),
'department_id' => array('column' => 'department_id', 'unique' => 0)
),
'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'MyISAM')
);
/**
* Records
*
* @var array
*/
public $records = array(
array(
'id' => 1,
'user_id' => 1,
'week' => 1,
'year' => 1,
'published' => 1,
'accepted' => 1,
'review' => 1,
'department_id' => 1
),
);
}
| gpl-2.0 |
Voskrese/mipsonqemu | user/uc/home/language/lang_source.php | 1635 | <?php
/*
[UCenter Home] (C) 2007-2008 Comsenz Inc.
$Id: lang_source.php 12489 2009-07-01 06:41:34Z xupeng $
*/
if(!defined('IN_UCHOME')) {
exit('Access Denied');
}
$_SGLOBAL['sourcelang'] = array (
'hour' => '小时',
'before' => '前',
'minute' => '分钟',
'second' => '秒',
'now' => '现在',
'dot' => '、',
'mtag' => '群组',
'poll' => '投票',
'event' => '活动',
'thread' => '话题',
'blog' => '日志',
'friend_group_default' => '其他',
'friend_group_1' => '通过本站认识',
'friend_group_2' => '通过活动认识',
'friend_group_3' => '通过朋友认识',
'friend_group_4' => '亲人',
'friend_group_5' => '同事',
'friend_group_6' => '同学',
'friend_group_7' => '不认识',
'friend_group' => '自定义',
'default_albumname' => '默认相册',
'wall' => '留言',
'pic_comment' => '图片评论',
'blog_comment' => '日志评论',
'clickblog' => '日志表态',
'clickpic' => '图片表态',
'clickthread' => '话题表态',
'share_comment' => '分享评论',
'share_notice' => '分享',
'doing_comment' => '记录回复',
'friend_notice' => '好友',
'thread_comment' => '话题回复',
'event_comment' => '活动留言',
'event_member' => '活动成员管理',
'event_memberstatus' => '活动成员身份',
'poll_comment' => '投票评论',
'poll_invite' => '投票邀请',
'credit' => '积分',
'credit_unit' => '个',
'man' => '男',
'woman' => '女',
'year' => '年',
'month' => '月',
'day' => '日',
'unmarried' => '单身',
'married' => '非单身',
'hidden_username' => '匿名'
);
?> | gpl-2.0 |
hexmode/wikipathways.org | wpi/extensions/PrivatePathways/ListPrivatePathways_body.php | 1615 | <?php
class ListPrivatePathways extends SpecialPage {
function __construct() {
parent::__construct('ListPrivatePathways', 'list_private_pathways');
}
function execute($par) {
global $wgOut, $wgUser, $wgLang;
if ( !$this->userCanExecute($wgUser) ) {
$this->displayRestrictionError();
return;
}
$this->setHeaders();
$wgOut->addWikiText(wfMessage( "listprivatepathways-desc" )->text());
$permissions = MetaTag::getTags(PermissionManager::$TAG);
$table = "<TABLE class='prettytable sortable'>";
$table .= "<TH>Pathway<TH>Read<TH>Write<TH>Manage permissions<TH>Expires";
foreach($permissions as $ps) {
$tr = "<TR>";
$pp = unserialize($ps->getText());
if($pp) {
$title = Title::newFromId($pp->getPageId());
if(!Pathway::parseIdentifier($title->getText())) {
continue;
}
$pathway = Pathway::newFromTitle($title);
$tr .= "<TD><A href='{$title->getFullURL()}'>{$pathway->getName()} ({$pathway->getSpecies()})</A>";
$p = $pp->getPermissions();
$tr .= "<TD>" . self::createUserString($p['read']);
$tr .= "<TD>" . self::createUserString($p['edit']);
$tr .= "<TD>" . self::createUserString($p[PermissionManager::$ACTION_MANAGE]);
$tr .= "<TD>" . $wgLang->date($pp->getExpires(), true);
$table .= $tr;
}
}
$table .= "</TABLE>";
$wgOut->addHTML($table);
}
public static function createUserString($array = array()) {
global $wgUser;
$us = "";
foreach($array as $uid) {
$u = User::newFromId($uid);
$us .= RequestContext::getMain()->getSkin()->userLink( $uid, $u->getName() ) . "; ";
}
return $us;
}
}
?>
| gpl-2.0 |
jslemmer/cafe | submit.php | 4638 | <!DOCTYPE html>
<html>
<head>
<title>Laowai Cafe</title>
<link type="text/css" rel="stylesheet" href="static/css/style.css"/>
<link type="text/css" rel="stylesheet" href="static/css/kube.css"/>
</head>
<body><br/><br/><br/><br/>
<row centered>
<column cols="6">
<?php
session_start();
include "require/db.php";
echo "<div class='forms'>
<fieldset class='alert alert-success'>
<legend class='fat'>";
if(isset($_SESSION['food__quantity']) && !isset($_POST['fname']) && !isset($_POST['isCata'])){
if(isset($_SESSION['order_id'])){
/**To edit an order, first need to DELETE previous order*/
$sql_del="DELETE FROM orders WHERE order_id={$_SESSION['order_id']}";
$mysql->query($sql_del);
unset($_SESSION['order_id']);
}
/**save new order info into array, create new order and INSERT each food item*/
$food__quantity=$_SESSION['food__quantity'];
$cus_id = $_SESSION['cus_id'];
unset($_SESSION['cus_id']);
unset($_SESSION['food__quantity']);
session_destroy();
if(isset($_POST['time']) && !empty($_POST['time'])){
$time = "'{$_POST['time']}'";
}else{
$time = 'curtime()';
}
$itemnum = count($food__quantity);
$sql_inserto = "INSERT orders(cus_id,date,time) VALUE($cus_id,curdate(),$time)";
$mysql->query($sql_inserto);
$order_id = mysql_insert_id();
for ($itemcount=0;$itemcount<$itemnum;$itemcount++) {
$food_id = array_keys($food__quantity)[$itemcount];
$quantity = $food__quantity[$food_id];
$sql_insertf = "INSERT order_food(order_id,food_id,quantity) VALUE(".$order_id.",".$food_id.",".$quantity.")";
$mysql->query($sql_insertf);
}
echo "Create Order Successfully";
header("refresh:1;url='index.php?page=current_orders'");
}else if(isset($_POST['fname'])){
/**chaeck info and create a new customer*/
$fname = preg_replace("/\s/","",(string)$_POST['fname']);
if(!empty($fname)){
$lname = preg_replace("/\s/","",(string)$_POST['lname']);
$tel = preg_replace("/\s/","",(string)$_POST['tel']);
if(isset($_POST['cusid'])){
$cusid = $_POST['cusid'];
$sql_editcus = "UPDATE customer_info SET firstname = '$fname',lastname = '$lname',tel = '$tel' WHERE cus_id = '$cusid'";
$mysql->query($sql_editcus);
echo 'Update Customer Successfully';
}else{
$sql_newcus= "INSERT customer_info (firstname,lastname,tel) VALUE ('$fname','$lname','$tel')";
$mysql->query($sql_newcus);
echo "Add Customer Successfully";
}
header("refresh:1;url='index.php?page=customer&action=info'");
}else{
echo "<script> history.back(-1)</script>";
}
}else if(isset($_POST['isCata'])){
/**create or update food item*/
$foodname = preg_replace("/\s/","",(string)$_POST['foodName']);
$foodPrice = preg_replace("/\s/","",(string)$_POST['price']);
if(!empty($foodname)){
if($_POST['isCata']=='food'){
$foodCata = $_POST['foodCata'];
if(isset($_POST['origId'])){
$sql_newfood = "UPDATE food_catalogue SET cata_name = '$foodname',Price = $foodPrice,catalog_id = $foodCata WHERE food_id = {$_POST['origId']}";
echo "Update Food Information Successfully";
}else{
$sql_newfood = "INSERT food_catalogue (cata_name,Price,catalog_id) VALUES ('$foodname',$foodPrice,$foodCata)";
echo "Add New Food Successfully";
}
$mysql->query($sql_newfood);
header("refresh:1;url='index.php?page=food&action=detail'");
}else if($_POST['isCata']=='cata'){
if(isset($_POST['origId'])){
$sql_newcata = "UPDATE food_catalogue SET cata_name = '$foodname' WHERE catalog_id = {$_POST['origId']}";
echo "Update Food Catalogue Successfully";
}else{
$cataId = $_POST['cataId'];
$sql_newcata = "INSERT food_catalogue (cata_name,catalog_id) VALUES ('$foodname',$cataId)";
echo "Add New Food Catalogue Successfully";
}
$mysql->query($sql_newcata);
header("refresh:1;url='index.php?page=food&action=cata'");
}
}else{
echo "Wrong!<script>history.go(-1);</script>";
}
}
echo " </legend>
<p>Back to Home Page in 1 seconds...</p>
<a href='index.php'>Back to Homepage immdiately</a>
</fieldset>
</div>";
?>
</column>
</row>
</body>
</html> | gpl-2.0 |
google-code/chuvanan-dev | wp-content/themes/mycollege/framework/inc/page-top.php | 2530 | <?php
/* ------------------------------------------------------------------------ */
/* Page Titles
/* ------------------------------------------------------------------------ */
global $sd_data;
$header_bg = rwmb_meta('sd_header_page_bg');
$header_bg = wp_get_attachment_image_src( $header_bg, 'full');
$no_repeat = rwmb_meta( 'sd_no_repeat', 'type=checkbox');
$repeat_x = rwmb_meta('sd_repeat_x', 'type=checkbox');
$repeat_y = rwmb_meta('sd_repeat_y', 'type=checkbox');
$no_repeat == 1 ? $no_repeat = ' no-repeat center ' : $no_repeat = '';
$repeat_x == 1 ? $repeat_x = ' repeat-x ' : $repeat_x = '';
$repeat_y == 1 ? $repeat_y = ' repeat-y ' : $repeat_y = '';
?>
<?php if (!is_front_page()) : ?>
<!-- page top -->
<div class="page-top clearfix" <?php if (!empty($header_bg)) echo 'style="background: url('.$header_bg[0].')'.$no_repeat.$repeat_x.$repeat_y.';"' ?>>
<?php if( is_archive() ) : ?>
<?php if (have_posts()) : ?>
<?php /* If this is a category archive */ if (is_category()) { ?>
<h2>
<?php _e('Categorized as:', 'framework'); ?>
<?php single_cat_title(); ?>
</h2>
<?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
<h2>
<?php _e('Tagged as:', 'framework'); ?>
<?php single_tag_title(); ?>
</h2>
<?php /* If this is a daily archive */ } elseif (is_day()) { ?>
<h2>
<?php _e('Archive for', 'framework'); ?>
<?php the_time('F jS, Y'); ?>
</h2>
<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
<h2>
<?php _e('Archive for', 'framework'); ?>
<?php the_time('F, Y'); ?>
</h2>
<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
<h2>
<?php _e('Archive for', 'framework'); ?>
<?php the_time('Y'); ?>
</h2>
<?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<h2>
<?php _e('Archive', 'framework'); ?>
</h2>
<?php } else { ?>
<h2>
<?php _e('Categorized as:', 'framework'); ?>
<?php single_cat_title(); ?>
</h2>
<?php } ?>
<?php endif; ?>
<?php elseif (is_search()) : ?>
<h2>
<?php _e('Search Results for:', 'framework'); ?>
<?php $allsearch = &new WP_Query("s=$s&showposts=-1"); $key = esc_html($s, 1); echo '"' . $key . '"'; wp_reset_query(); ?>
</h2>
<?php elseif (is_404()) : ?>
<h2>
<?php _e('Ooops, 404 Not Found!', 'framework'); ?>
</h2>
<?php else : ?>
<h2>
<?php the_title(); ?>
</h2>
<?php endif; ?>
</div>
<!-- page top end -->
<?php endif; ?> | gpl-2.0 |
ojdkbuild/lookaside_java-1.8.0-openjdk | hotspot/src/share/vm/utilities/numberSeq.hpp | 5739 | /*
* Copyright (c) 2001, 2012, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef SHARE_VM_UTILITIES_NUMBERSEQ_HPP
#define SHARE_VM_UTILITIES_NUMBERSEQ_HPP
#include "memory/allocation.hpp"
/**
** This file contains a few classes that represent number sequence,
** x1, x2, x3, ..., xN, and can calculate their avg, max, and sd.
**
** Here's a quick description of the classes:
**
** AbsSeq: abstract superclass
** NumberSeq: the sequence is assumed to be very long and the
** maximum, avg, sd, davg, and dsd are calculated over all its elements
** TruncatedSeq: this class keeps track of the last L elements
** of the sequence and calculates avg, max, and sd only over them
**/
#define DEFAULT_ALPHA_VALUE 0.7
class AbsSeq: public CHeapObj<mtInternal> {
private:
void init(double alpha);
protected:
int _num; // the number of elements in the sequence
double _sum; // the sum of the elements in the sequence
double _sum_of_squares; // the sum of squares of the elements in the sequence
double _davg; // decaying average
double _dvariance; // decaying variance
double _alpha; // factor for the decaying average / variance
// This is what we divide with to get the average. In a standard
// number sequence, this should just be the number of elements in it.
virtual double total() const { return (double) _num; };
public:
AbsSeq(double alpha = DEFAULT_ALPHA_VALUE);
virtual void add(double val); // adds a new element to the sequence
void add(unsigned val) { add((double) val); }
virtual double maximum() const = 0; // maximum element in the sequence
virtual double last() const = 0; // last element added in the sequence
// the number of elements in the sequence
int num() const { return _num; }
// the sum of the elements in the sequence
double sum() const { return _sum; }
double avg() const; // the average of the sequence
double variance() const; // the variance of the sequence
double sd() const; // the standard deviation of the sequence
double davg() const; // decaying average
double dvariance() const; // decaying variance
double dsd() const; // decaying "standard deviation"
// Debugging/Printing
virtual void dump();
virtual void dump_on(outputStream* s);
};
class NumberSeq: public AbsSeq {
private:
bool check_nums(NumberSeq* total, int n, NumberSeq** parts);
protected:
double _last;
double _maximum; // keep track of maximum value
public:
NumberSeq(double alpha = DEFAULT_ALPHA_VALUE);
virtual void add(double val);
virtual double maximum() const { return _maximum; }
virtual double last() const { return _last; }
// Debugging/Printing
virtual void dump_on(outputStream* s);
};
// HDR sequence stores the low-resolution high-dynamic-range values.
// It does so by maintaining the double array, where first array defines
// the magnitude of the value being stored, and the second array maintains
// the low resolution histogram within that magnitude. For example, storing
// 4.352819 * 10^3 increments the bucket _hdr[3][435]. This allows for
// memory efficient storage of huge amount of samples.
//
// Accepts positive numbers only.
class HdrSeq: public NumberSeq {
private:
enum PrivateConstants {
ValBuckets = 512,
MagBuckets = 24,
MagMinimum = -12,
};
int** _hdr;
public:
HdrSeq();
~HdrSeq();
virtual void add(double val);
double percentile(double level) const;
};
// Binary magnitude sequence stores the power-of-two histogram.
// It has very low memory requirements, and is thread-safe. When accuracy
// is not needed, it is preferred over HdrSeq.
class BinaryMagnitudeSeq {
private:
jlong _sum;
jlong* _mags;
public:
BinaryMagnitudeSeq();
~BinaryMagnitudeSeq();
void add(size_t val);
size_t num() const;
size_t level(int level) const;
size_t sum() const;
int min_level() const;
int max_level() const;
};
class TruncatedSeq: public AbsSeq {
private:
enum PrivateConstants {
DefaultSeqLength = 10
};
void init();
protected:
double *_sequence; // buffers the last L elements in the sequence
int _length; // this is L
int _next; // oldest slot in the array, i.e. next to be overwritten
public:
// accepts a value for L
TruncatedSeq(int length = DefaultSeqLength,
double alpha = DEFAULT_ALPHA_VALUE);
~TruncatedSeq();
virtual void add(double val);
virtual double maximum() const;
virtual double last() const; // the last value added to the sequence
double oldest() const; // the oldest valid value in the sequence
double predict_next() const; // prediction based on linear regression
// Debugging/Printing
virtual void dump_on(outputStream* s);
};
#endif // SHARE_VM_UTILITIES_NUMBERSEQ_HPP
| gpl-2.0 |
xchen101/analysis-preservation.cern.ch | scripts/schemas.py | 2433 | # -*- coding: utf-8 -*-
#
# This file is part of CERN Analysis Preservation Framework.
# Copyright (C) 2016 CERN.
#
# CERN Analysis Preservation Framework 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.
#
# CERN Analysis Preservation Framework 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 CERN Analysis Preservation Framework; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307, USA.
#
# In applying this license, CERN does not
# waive the privileges and immunities granted to it by virtue of its status
# as an Intergovernmental Organization or submit itself to any jurisdiction.
import errno
import os
PROJECT_BASE = os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir)
JSONSCHEMAS_DIR = os.path.join(
PROJECT_BASE,
'cap',
'jsonschemas',
)
JSONSCHEMAS_OUT_DIR = os.path.join(
PROJECT_BASE,
'cap',
'jsonschemas_gen',
)
print(PROJECT_BASE)
print(JSONSCHEMAS_DIR)
print("-----------------------")
BASE_URL = "https://analysis-preservation.cern.ch"
UPDATETO_URL = "https://localhost:5000"
def update_refs_jsonfile(jsonschema_path, textToSearch, textToReplace):
input = open(jsonschema_path)
filename = jsonschema_path.replace(JSONSCHEMAS_DIR, JSONSCHEMAS_OUT_DIR)
if not os.path.exists(os.path.dirname(filename)):
try:
os.makedirs(os.path.dirname(filename))
except OSError as exc:
# Guard against race condition
if exc.errno != errno.EEXIST:
raise
output = open(filename, 'w')
for s in input.xreadlines():
output.write(s.replace(textToSearch, textToReplace))
output.close()
input.close()
for root, dirs, files in os.walk(JSONSCHEMAS_DIR):
for file in files:
if file.endswith(".json"):
print(os.path.join(root, file))
update_refs_jsonfile(
os.path.join(root, file),
BASE_URL,
UPDATETO_URL)
| gpl-2.0 |
jlterman/milo | docs/doxygen/html/search/variables_9.js | 1160 | var searchData=
[
['terms',['terms',['../classExpression.html#a10749df14772a9162729347071b618d5',1,'Expression']]],
['test_5ffuncs',['test_funcs',['../milo__test_8cpp.html#a00c4f4ac3b84b58ae9c4335fc0970e6c',1,'milo_test.cpp']]],
['transitions',['transitions',['../classXML_1_1FSM.html#abe83c8a43ef4c05048075c7dac0494c0',1,'XML::FSM']]],
['type',['type',['../classTerm.html#abf93d41971cae1ff37e11f4129339a71',1,'Term::type()'],['../classExpression.html#ab1e6b11d0cf386f8cca8209d54fdfc24',1,'Expression::type()'],['../classInput.html#ac414e17d2c1d5636d8c683a4909dd8b9',1,'Input::type()'],['../classDivide.html#a318b1686d40e8b170de479739861dafe',1,'Divide::type()'],['../classPower.html#a54f82e5aec4f6282009c2c849d200aab',1,'Power::type()'],['../classConstant.html#a9c57d6ca14617dbedbec860e28aee513',1,'Constant::type()'],['../classVariable.html#a77d7a4e52177ab1919dfa1761f0e0c4e',1,'Variable::type()'],['../classNumber.html#aa124d7fe47b5d207ca4c0b29abb1a567',1,'Number::type()'],['../classFunction.html#a19079c8123fe9d41ce29235b4c90c448',1,'Function::type()'],['../classDifferential.html#a6049708654d875bdee08984a22996656',1,'Differential::type()']]]
];
| gpl-2.0 |
pamfilos/data.cern.ch | ui/cap-react/src/components/errors/404.js | 1731 | import React from "react";
import Box from "grommet/components/Box";
import Heading from "grommet/components/Heading";
import Label from "grommet/components/Label";
import Button from "../partials/Button";
import { withRouter } from "react-router";
import PropTypes from "prop-types";
const NotFoundPage = ({ history }) => {
return (
<Box flex colorIndex="light-1" align="center" justify="center">
<Box style={{ color: "#006A93" }}>
<Box
direction="row"
align="center"
responsive={false}
pad="small"
style={{ letterSpacing: "1px" }}
>
<Heading>404</Heading>
<Box
style={{
height: "5px",
width: "20px",
background: "#006A93",
margin: "0 20px"
}}
/>
<Heading>Page was not found</Heading>
</Box>
<Box margin={{ top: "medium" }} align="center">
<Label style={{ textAlign: "center" }}>
The page your are looking for, either was removed <br />or<br /> the
url path is not correct
</Label>
</Box>
<Box
direction="row"
responsive={false}
justify="between"
margin={{ top: "large" }}
pad="medium"
>
<Button
text="Previous"
secondary={true}
onClick={() => history.goBack()}
/>
<Button
text="Home"
primary={true}
onClick={() => history.push("/")}
/>
</Box>
</Box>
</Box>
);
};
NotFoundPage.propTypes = {
history: PropTypes.object
};
export default withRouter(NotFoundPage);
| gpl-2.0 |
grappler/Easy-Digital-Downloads | templates/history-downloads.php | 4120 | <?php if( ! empty( $_GET['edd-verify-success'] ) ) : ?>
<p class="edd-account-verified edd_success">
<?php _e( 'Your account has been successfully verified!', 'easy-digital-downloads' ); ?>
</p>
<?php
endif;
/**
* This template is used to display the download history of the current user.
*/
$purchases = edd_get_users_purchases( get_current_user_id(), 20, true, 'any' );
if ( $purchases ) :
do_action( 'edd_before_download_history' ); ?>
<table id="edd_user_history">
<thead>
<tr class="edd_download_history_row">
<?php do_action( 'edd_download_history_header_start' ); ?>
<th class="edd_download_download_name"><?php _e( 'Download Name', 'easy-digital-downloads' ); ?></th>
<?php if ( ! edd_no_redownload() ) : ?>
<th class="edd_download_download_files"><?php _e( 'Files', 'easy-digital-downloads' ); ?></th>
<?php endif; //End if no redownload?>
<?php do_action( 'edd_download_history_header_end' ); ?>
</tr>
</thead>
<?php foreach ( $purchases as $payment ) :
$downloads = edd_get_payment_meta_cart_details( $payment->ID, true );
$purchase_data = edd_get_payment_meta( $payment->ID );
$email = edd_get_payment_user_email( $payment->ID );
if ( $downloads ) :
foreach ( $downloads as $download ) :
// Skip over Bundles. Products included with a bundle will be displayed individually
if ( edd_is_bundled_product( $download['id'] ) )
continue; ?>
<tr class="edd_download_history_row">
<?php
$price_id = edd_get_cart_item_price_id( $download );
$download_files = edd_get_download_files( $download['id'], $price_id );
$name = get_the_title( $download['id'] );
// Retrieve and append the price option name
if ( ! empty( $price_id ) ) {
$name .= ' - ' . edd_get_price_option_name( $download['id'], $price_id, $payment->ID );
}
do_action( 'edd_download_history_row_start', $payment->ID, $download['id'] );
?>
<td class="edd_download_download_name"><?php echo esc_html( $name ); ?></td>
<?php if ( ! edd_no_redownload() ) : ?>
<td class="edd_download_download_files">
<?php
if ( edd_is_payment_complete( $payment->ID ) ) :
if ( $download_files ) :
foreach ( $download_files as $filekey => $file ) :
$download_url = edd_get_download_file_url( $purchase_data['key'], $email, $filekey, $download['id'], $price_id );
?>
<div class="edd_download_file">
<a href="<?php echo esc_url( $download_url ); ?>" class="edd_download_file_link">
<?php echo edd_get_file_name( $file ); ?>
</a>
</div>
<?php do_action( 'edd_download_history_files', $filekey, $file, $id, $payment->ID, $purchase_data );
endforeach;
else :
_e( 'No downloadable files found.', 'easy-digital-downloads' );
endif; // End if payment complete
else : ?>
<span class="edd_download_payment_status">
<?php printf( __( 'Payment status is %s', 'easy-digital-downloads' ), edd_get_payment_status( $payment, true) ); ?>
</span>
<?php
endif; // End if $download_files
?>
</td>
<?php endif; // End if ! edd_no_redownload()
do_action( 'edd_download_history_row_end', $payment->ID, $download['id'] );
?>
</tr>
<?php
endforeach; // End foreach $downloads
endif; // End if $downloads
endforeach;
?>
</table>
<div id="edd_download_history_pagination" class="edd_pagination navigation">
<?php
$big = 999999;
echo paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var( 'paged' ) ),
'total' => ceil( edd_count_purchases_of_customer() / 20 ) // 20 items per page
) );
?>
</div>
<?php do_action( 'edd_after_download_history' ); ?>
<?php else : ?>
<p class="edd-no-downloads"><?php _e( 'You have not purchased any downloads', 'easy-digital-downloads' ); ?></p>
<?php endif; ?>
| gpl-2.0 |
Tawreh/mtg | modules/contrib/feeds/src/Feeds/Target/Email.php | 1953 | <?php
/**
* @file
* Contains \Drupal\feeds\Feeds\Target\Email.
*/
namespace Drupal\feeds\Feeds\Target;
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\feeds\FieldTargetDefinition;
use Drupal\feeds\Plugin\Type\Target\ConfigurableTargetInterface;
use Drupal\feeds\Plugin\Type\Target\FieldTargetBase;
/**
* Defines a email field mapper.
*
* @FeedsTarget(
* id = "email",
* field_types = {"email"}
* )
*/
class Email extends FieldTargetBase implements ConfigurableTargetInterface {
/**
* {@inheritdoc}
*/
protected static function prepareTarget(FieldDefinitionInterface $field_definition) {
return FieldTargetDefinition::createFromFieldDefinition($field_definition)
->addProperty('value')
->markPropertyUnique('value');
}
/**
* {@inheritdoc}
*/
protected function prepareValue($delta, array &$values) {
$values['value'] = trim($values['value']);
if (!filter_var($values['value'], FILTER_VALIDATE_EMAIL)) {
$values['value'] = '';
}
if ($this->configuration['defuse'] && $values['value']) {
$values['value'] .= '_test';
}
}
/**
* {@inheritdoc}
*/
public function defaultConfiguration() {
return ['defuse' => FALSE];
}
/**
* {@inheritdoc}
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$form['defuse'] = [
'#type' => 'checkbox',
'#title' => $this->t('Defuse e-mail addresses'),
'#default_value' => $this->configuration['defuse'],
'#description' => $this->t('This appends _test to all imported e-mail addresses to ensure they cannot be used as recipients.'),
];
return $form;
}
/**
* {@inheritdoc}
*/
public function getSummary() {
return $this->configuration['defuse'] ?
$this->t('Addresses <strong>will</strong> be defused.') :
$this->t('Addresses will not be defused.');
}
}
| gpl-2.0 |
nizaranand/New-Life-Office | phpMyAdmin/index.php | 5036 | <?php
/* $Id: index.php,v 2.2 2003/11/26 22:52:24 rabus Exp $ */
// vim: expandtab sw=4 ts=4 sts=4:
/**
* Gets core libraries and defines some variables
*/
require_once('./libraries/grab_globals.lib.php');
require_once('./libraries/common.lib.php');
// Gets the default font sizes
PMA_setFontSizes();
// Gets the host name
// loic1 - 2001/25/11: use the new globals arrays defined with php 4.1+
if (empty($HTTP_HOST)) {
if (!empty($_ENV) && isset($_ENV['HTTP_HOST'])) {
$HTTP_HOST = $_ENV['HTTP_HOST'];
}
else if (@getenv('HTTP_HOST')) {
$HTTP_HOST = getenv('HTTP_HOST');
}
else {
$HTTP_HOST = '';
}
}
/**
* Defines the frameset
*/
// loic1: If left light mode -> urldecode the db name
if (isset($lightm_db)) {
// no longer urlencoded because of html entities in the db name
// $db = urldecode($lightm_db);
$db = $lightm_db;
unset($lightm_db);
}
$url_query = PMA_generate_common_url(isset($db) ? $db : '');
header('Content-Type: text/html; charset=' . $GLOBALS['charset']);
require_once('./libraries/relation.lib.php');
$cfgRelation = PMA_getRelationsParam();
if ($cfg['QueryHistoryDB'] && $cfgRelation['historywork']) {
PMA_purgeHistory($cfg['Server']['user']);
}
$phpmain_hash = md5($cfg['PmaAbsoluteUri']);
$phpmain_hash_js = time();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $available_languages[$lang][2]; ?>" lang="<?php echo $available_languages[$lang][2]; ?>" dir="<?php echo $text_dir; ?>">
<head>
<title>phpMyAdmin <?php echo PMA_VERSION; ?> - <?php echo $HTTP_HOST; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>" />
<link rel="stylesheet" type="text/css" href="./css/phpmyadmin.css.php?lang=<?php echo $lang; ?>&js_frame=right" />
</head>
<?php
if ($cfg['QueryFrame']) {
if ($cfg['QueryFrameJS']) {
echo '<script type="text/javascript">' . "\n";
echo '<!--' . "\n";
echo ' document.writeln(\'<frameset cols="' . $cfg['LeftWidth'] . ',*" rows="*" border="1" frameborder="1" framespacing="0">\');' . "\n";
echo ' document.writeln(\' <frameset rows="*, 50" framespacing="0" frameborder="0" border="0">\');' . "\n";
echo ' document.writeln(\' <frame src="left.php?' . $url_query . '&hash=' . $phpmain_hash . $phpmain_hash_js . '" name="nav" frameborder="0" />\');' . "\n";
echo ' document.writeln(\' <frame src="queryframe.php?' . $url_query . '&hash=' . $phpmain_hash . $phpmain_hash_js . '" name="queryframe" frameborder="0" scrolling="no" />\');' . "\n";
echo ' document.writeln(\' </frameset>\');' . "\n";
echo ' document.writeln(\' <frame src="' . (empty($db) ? $cfg['DefaultTabServer'] : $cfg['DefaultTabDatabase']) . '?' . $url_query . '" name="phpmain' . $phpmain_hash . $phpmain_hash_js . '" border="0" frameborder="0" />\');' . "\n";
echo ' document.writeln(\' <noframes>\');' . "\n";
echo ' document.writeln(\' <body bgcolor="#FFFFFF">\');' . "\n";
echo ' document.writeln(\' <p>' . str_replace("'", "\'", $strNoFrames) . '</p>\');' . "\n";
echo ' document.writeln(\' </body>\');' . "\n";
echo ' document.writeln(\' </noframes>\');' . "\n";
echo ' document.writeln(\'</frameset>\');' . "\n";
echo '//-->' . "\n";
echo '</script>' . "\n";
echo "\n";
echo '<noscript>' . "\n";
}
echo '<frameset cols="' . $cfg['LeftWidth'] . ',*" rows="*" border="1" frameborder="1" framespacing="0">' . "\n";
echo ' <frameset rows="*, 50" framespacing="0" frameborder="0" border="0">' . "\n";
echo ' <frame src="left.php?' . $url_query . '&hash=' . $phpmain_hash . '" name="nav" frameborder="0" />' . "\n";
echo ' <frame src="queryframe.php?' . $url_query . '&hash=' . $phpmain_hash . '" name="queryframe" frameborder="0" scrolling="no" />' . "\n";
echo ' </frameset>' . "\n";
echo ' <frame src="' . (empty($db) ? $cfg['DefaultTabServer'] : $cfg['DefaultTabDatabase']) . '?' . $url_query . '" name="phpmain' . $phpmain_hash . '" frameborder="0" />' . "\n";
} else {
echo '<frameset cols="' . $cfg['LeftWidth'] . ',*" rows="*" border="1" frameborder="1" framespacing="0">' . "\n";
echo ' <frame src="left.php?' . $url_query . '&hash=' . $phpmain_hash . '" name="nav" frameborder="0" />' . "\n";
echo ' <frame src="' . (empty($db) ? $cfg['DefaultTabServer'] : $cfg['DefaultTabDatabase']) . '?' . $url_query . '" name="phpmain' . $phpmain_hash . '" frameborder="1" />' . "\n";
}
?>
<noframes>
<body bgcolor="#FFFFFF">
<p><?php echo $strNoFrames; ?></p>
</body>
</noframes>
</frameset>
<?php
if ($cfg['QueryFrame'] && $cfg['QueryFrameJS']) {
echo '</noscript>' . "\n";
}
?>
</html>
| gpl-2.0 |
sk19871216/Yilife | zhy_handler_imageloader02/src/main/java/com/zhy/imageloader/MainActivity.java | 8073 | package com.zhy.imageloader;
import java.io.File;
import java.io.FilenameFilter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.ContentResolver;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.provider.MediaStore;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup.LayoutParams;
import android.view.WindowManager;
import android.widget.GridView;
import android.widget.PopupWindow.OnDismissListener;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.zhy.bean.ImageFloder;
import com.zhy.imageloader.ListImageDirPopupWindow.OnImageDirSelected;
public class MainActivity extends Activity implements OnImageDirSelected
{
private ProgressDialog mProgressDialog;
/**
* 存储文件夹中的图片数量
*/
private int mPicsSize;
/**
* 图片数量最多的文件夹
*/
private File mImgDir;
/**
* 所有的图片
*/
private List<String> mImgs;
private GridView mGirdView;
private MyAdapter mAdapter;
/**
* 临时的辅助类,用于防止同一个文件夹的多次扫描
*/
private HashSet<String> mDirPaths = new HashSet<String>();
/**
* 扫描拿到所有的图片文件夹
*/
private List<ImageFloder> mImageFloders = new ArrayList<ImageFloder>();
private RelativeLayout mBottomLy;
private TextView mChooseDir;
private TextView mImageCount;
int totalCount = 0;
private int mScreenHeight;
private ListImageDirPopupWindow mListImageDirPopupWindow;
private Handler mHandler = new Handler()
{
public void handleMessage(android.os.Message msg)
{
mProgressDialog.dismiss();
// 为View绑定数据
data2View();
// 初始化展示文件夹的popupWindw
initListDirPopupWindw();
}
};
/**
* 为View绑定数据
*/
private void data2View()
{
if (mImgDir == null)
{
Toast.makeText(getApplicationContext(), "擦,一张图片没扫描到",
Toast.LENGTH_SHORT).show();
return;
}
mImgs = Arrays.asList(mImgDir.list());
/**
* 可以看到文件夹的路径和图片的路径分开保存,极大的减少了内存的消耗;
*/
mAdapter = new MyAdapter(getApplicationContext(), mImgs,
R.layout.grid_item, mImgDir.getAbsolutePath());
mGirdView.setAdapter(mAdapter);
mImageCount.setText(totalCount + "张");
};
/**
* 初始化展示文件夹的popupWindw
*/
private void initListDirPopupWindw()
{
mListImageDirPopupWindow = new ListImageDirPopupWindow(
LayoutParams.MATCH_PARENT, (int) (mScreenHeight * 0.7),
mImageFloders, LayoutInflater.from(getApplicationContext())
.inflate(R.layout.list_dir, null));
mListImageDirPopupWindow.setOnDismissListener(new OnDismissListener()
{
@Override
public void onDismiss()
{
// 设置背景颜色变暗
WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.alpha = 1.0f;
getWindow().setAttributes(lp);
}
});
// 设置选择文件夹的回调
mListImageDirPopupWindow.setOnImageDirSelected(this);
}
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_image);
DisplayMetrics outMetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(outMetrics);
mScreenHeight = outMetrics.heightPixels;
initView();
getImages();
initEvent();
}
/**
* 利用ContentProvider扫描手机中的图片,此方法在运行在子线程中 完成图片的扫描,最终获得jpg最多的那个文件夹
*/
private void getImages()
{
if (!Environment.getExternalStorageState().equals(
Environment.MEDIA_MOUNTED))
{
Toast.makeText(this, "暂无外部存储", Toast.LENGTH_SHORT).show();
return;
}
// 显示进度条
mProgressDialog = ProgressDialog.show(this, null, "正在加载...");
new Thread(new Runnable()
{
@Override
public void run()
{
String firstImage = null;
Uri mImageUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
ContentResolver mContentResolver = MainActivity.this
.getContentResolver();
// 只查询jpeg和png的图片
Cursor mCursor = mContentResolver.query(mImageUri, null,
MediaStore.Images.Media.MIME_TYPE + "=? or "
+ MediaStore.Images.Media.MIME_TYPE + "=?",
new String[] { "image/jpeg", "image/png" },
MediaStore.Images.Media.DATE_MODIFIED);
Log.e("TAG", mCursor.getCount() + "");
while (mCursor.moveToNext())
{
// 获取图片的路径
String path = mCursor.getString(mCursor
.getColumnIndex(MediaStore.Images.Media.DATA));
Log.e("TAG", path);
// 拿到第一张图片的路径
if (firstImage == null)
firstImage = path;
// 获取该图片的父路径名
File parentFile = new File(path).getParentFile();
if (parentFile == null)
continue;
String dirPath = parentFile.getAbsolutePath();
ImageFloder imageFloder = null;
// 利用一个HashSet防止多次扫描同一个文件夹(不加这个判断,图片多起来还是相当恐怖的~~)
if (mDirPaths.contains(dirPath))
{
continue;
} else
{
mDirPaths.add(dirPath);
// 初始化imageFloder
imageFloder = new ImageFloder();
imageFloder.setDir(dirPath);
imageFloder.setFirstImagePath(path);
}
int picSize = parentFile.list(new FilenameFilter()
{
@Override
public boolean accept(File dir, String filename)
{
if (filename.endsWith(".jpg")
|| filename.endsWith(".png")
|| filename.endsWith(".jpeg"))
return true;
return false;
}
}).length;
totalCount += picSize;
imageFloder.setCount(picSize);
mImageFloders.add(imageFloder);
if (picSize > mPicsSize)
{
mPicsSize = picSize;
mImgDir = parentFile;
}
}
mCursor.close();
// 扫描完成,辅助的HashSet也就可以释放内存了
mDirPaths = null;
// 通知Handler扫描图片完成
mHandler.sendEmptyMessage(0x110);
}
}).start();
}
/**
* 初始化View
*/
private void initView()
{
mGirdView = (GridView) findViewById(R.id.id_gridView);
mChooseDir = (TextView) findViewById(R.id.id_choose_dir);
mImageCount = (TextView) findViewById(R.id.id_total_count);
mBottomLy = (RelativeLayout) findViewById(R.id.id_bottom_ly);
}
private void initEvent()
{
/**
* 为底部的布局设置点击事件,弹出popupWindow
*/
mBottomLy.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View v)
{
mListImageDirPopupWindow
.setAnimationStyle(R.style.anim_popup_dir);
mListImageDirPopupWindow.showAsDropDown(mBottomLy, 0, 0);
// 设置背景颜色变暗
WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.alpha = .3f;
getWindow().setAttributes(lp);
}
});
}
@Override
public void selected(ImageFloder floder)
{
mImgDir = new File(floder.getDir());
mImgs = Arrays.asList(mImgDir.list(new FilenameFilter()
{
@Override
public boolean accept(File dir, String filename)
{
if (filename.endsWith(".jpg") || filename.endsWith(".png")
|| filename.endsWith(".jpeg"))
return true;
return false;
}
}));
/**
* 可以看到文件夹的路径和图片的路径分开保存,极大的减少了内存的消耗;
*/
mAdapter = new MyAdapter(getApplicationContext(), mImgs,
R.layout.grid_item, mImgDir.getAbsolutePath());
mGirdView.setAdapter(mAdapter);
// mAdapter.notifyDataSetChanged();
mImageCount.setText(floder.getCount() + "张");
mChooseDir.setText(floder.getName());
mListImageDirPopupWindow.dismiss();
}
}
| gpl-2.0 |
michaelklapper/TYPO3.CMS | typo3/sysext/core/Classes/Category/CategoryRegistry.php | 17963 | <?php
namespace TYPO3\CMS\Core\Category;
/*
* This file is part of the TYPO3 CMS 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.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Core\SingletonInterface;
use TYPO3\CMS\Core\Utility\ArrayUtility;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Lang\LanguageService;
/**
* Class to register category configurations.
*/
class CategoryRegistry implements SingletonInterface
{
/**
* @var array
*/
protected $registry = array();
/**
* @var array
*/
protected $extensions = array();
/**
* @var array
*/
protected $addedCategoryTabs = array();
/**
* @var string
*/
protected $template = '';
/**
* Returns a class instance
*
* @return CategoryRegistry
*/
public static function getInstance()
{
return GeneralUtility::makeInstance(__CLASS__);
}
/**
* Creates this object.
*/
public function __construct()
{
$this->template = str_repeat(PHP_EOL, 3) . 'CREATE TABLE %s (' . PHP_EOL
. ' %s int(11) DEFAULT \'0\' NOT NULL' . PHP_EOL . ');' . str_repeat(PHP_EOL, 3);
}
/**
* Adds a new category configuration to this registry.
* TCA changes are directly applied
*
* @param string $extensionKey Extension key to be used
* @param string $tableName Name of the table to be registered
* @param string $fieldName Name of the field to be registered
* @param array $options Additional configuration options
* + fieldList: field configuration to be added to showitems
* + typesList: list of types that shall visualize the categories field
* + position: insert position of the categories field
* + label: backend label of the categories field
* + fieldConfiguration: TCA field config array to override defaults
* @param bool $override If TRUE, any category configuration for the same table / field is removed before the new configuration is added
* @return bool
* @throws \InvalidArgumentException
* @throws \RuntimeException
*/
public function add($extensionKey, $tableName, $fieldName = 'categories', array $options = array(), $override = false)
{
$didRegister = false;
if (empty($tableName) || !is_string($tableName)) {
throw new \InvalidArgumentException('No or invalid table name "' . $tableName . '" given.', 1369122038);
}
if (empty($extensionKey) || !is_string($extensionKey)) {
throw new \InvalidArgumentException('No or invalid extension key "' . $extensionKey . '" given.', 1397836158);
}
if ($override) {
$this->remove($tableName, $fieldName);
}
if (!$this->isRegistered($tableName, $fieldName)) {
$this->registry[$tableName][$fieldName] = $options;
$this->extensions[$extensionKey][$tableName][$fieldName] = $fieldName;
if (isset($GLOBALS['TCA'][$tableName]['columns'])) {
$this->applyTcaForTableAndField($tableName, $fieldName);
$didRegister = true;
}
}
return $didRegister;
}
/**
* Gets all extension keys that registered a category configuration.
*
* @return array
*/
public function getExtensionKeys()
{
return array_keys($this->extensions);
}
/**
* Gets all categorized tables
*
* @return array
*/
public function getCategorizedTables()
{
return array_keys($this->registry);
}
/**
* Returns a list of category fields for a given table for populating selector "category_field"
* in tt_content table (called as itemsProcFunc).
*
* @param array $configuration Current field configuration
* @throws \UnexpectedValueException
* @return void
*/
public function getCategoryFieldsForTable(array &$configuration)
{
$table = '';
$menuType = isset($configuration['row']['menu_type'][0]) ? $configuration['row']['menu_type'][0] : '';
// Define the table being looked up from the type of menu
if ($menuType === 'categorized_pages') {
$table = 'pages';
} elseif ($menuType === 'categorized_content') {
$table = 'tt_content';
}
// Return early if no table is defined
if (empty($table)) {
throw new \UnexpectedValueException('The given menu_type is not supported.', 1381823570);
}
// Loop on all registries and find entries for the correct table
foreach ($this->registry as $tableName => $fields) {
if ($tableName === $table) {
foreach ($fields as $fieldName => $options) {
$fieldLabel = $this->getLanguageService()->sL($GLOBALS['TCA'][$tableName]['columns'][$fieldName]['label']);
$configuration['items'][] = array($fieldLabel, $fieldName);
}
}
}
}
/**
* Tells whether a table has a category configuration in the registry.
*
* @param string $tableName Name of the table to be looked up
* @param string $fieldName Name of the field to be looked up
* @return bool
*/
public function isRegistered($tableName, $fieldName = 'categories')
{
return isset($this->registry[$tableName][$fieldName]);
}
/**
* Generates tables definitions for all registered tables.
*
* @return string
*/
public function getDatabaseTableDefinitions()
{
$sql = '';
foreach ($this->getExtensionKeys() as $extensionKey) {
$sql .= $this->getDatabaseTableDefinition($extensionKey);
}
return $sql;
}
/**
* Generates table definitions for registered tables by an extension.
*
* @param string $extensionKey Extension key to have the database definitions created for
* @return string
*/
public function getDatabaseTableDefinition($extensionKey)
{
if (!isset($this->extensions[$extensionKey]) || !is_array($this->extensions[$extensionKey])) {
return '';
}
$sql = '';
foreach ($this->extensions[$extensionKey] as $tableName => $fields) {
foreach ($fields as $fieldName) {
$sql .= sprintf($this->template, $tableName, $fieldName);
}
}
return $sql;
}
/**
* Apply TCA to all registered tables
*
* @return void
* @internal
*/
public function applyTcaForPreRegisteredTables()
{
$this->registerDefaultCategorizedTables();
foreach ($this->registry as $tableName => $fields) {
foreach ($fields as $fieldName => $_) {
$this->applyTcaForTableAndField($tableName, $fieldName);
}
}
}
/**
* Applies the additions directly to the TCA
*
* @param string $tableName
* @param string $fieldName
*/
protected function applyTcaForTableAndField($tableName, $fieldName)
{
$this->addTcaColumn($tableName, $fieldName, $this->registry[$tableName][$fieldName]);
$this->addToAllTCAtypes($tableName, $fieldName, $this->registry[$tableName][$fieldName]);
}
/**
* Add default categorized tables to the registry
*
* @return void
*/
protected function registerDefaultCategorizedTables()
{
$defaultCategorizedTables = GeneralUtility::trimExplode(
',',
$GLOBALS['TYPO3_CONF_VARS']['SYS']['defaultCategorizedTables'],
true
);
foreach ($defaultCategorizedTables as $defaultCategorizedTable) {
if (!$this->isRegistered($defaultCategorizedTable)) {
$this->add('core', $defaultCategorizedTable, 'categories');
}
}
}
/**
* Add a new field into the TCA types -> showitem
*
* @param string $tableName Name of the table to be categorized
* @param string $fieldName Name of the field to be used to store categories
* @param array $options Additional configuration options
* + fieldList: field configuration to be added to showitems
* + typesList: list of types that shall visualize the categories field
* + position: insert position of the categories field
* @return void
*/
protected function addToAllTCAtypes($tableName, $fieldName, array $options)
{
// Makes sure to add more TCA to an existing structure
if (isset($GLOBALS['TCA'][$tableName]['columns'])) {
if (empty($options['fieldList'])) {
$fieldList = $this->addCategoryTab($tableName, $fieldName);
} else {
$fieldList = $options['fieldList'];
}
$typesList = '';
if (isset($options['typesList']) && $options['typesList'] !== '') {
$typesList = $options['typesList'];
}
$position = '';
if (!empty($options['position'])) {
$position = $options['position'];
}
// Makes the new "categories" field to be visible in TSFE.
ExtensionManagementUtility::addToAllTCAtypes($tableName, $fieldList, $typesList, $position);
}
}
/**
* Creates the 'fieldList' string for $fieldName which includes a categories tab.
* But only one categories tab is added per table.
*
* @param string $tableName
* @param string $fieldName
* @return string
*/
protected function addCategoryTab($tableName, $fieldName)
{
$fieldList = '';
if (!isset($this->addedCategoryTabs[$tableName])) {
$fieldList .= '--div--;LLL:EXT:lang/locallang_tca.xlf:sys_category.tabs.category, ';
$this->addedCategoryTabs[$tableName] = $tableName;
}
$fieldList .= $fieldName;
return $fieldList;
}
/**
* Add a new TCA Column
*
* @param string $tableName Name of the table to be categorized
* @param string $fieldName Name of the field to be used to store categories
* @param array $options Additional configuration options
* + fieldConfiguration: TCA field config array to override defaults
* + label: backend label of the categories field
* + interface: boolean if the category should be included in the "interface" section of the TCA table
* + l10n_mode
* + l10n_display
* @return void
*/
protected function addTcaColumn($tableName, $fieldName, array $options)
{
// Makes sure to add more TCA to an existing structure
if (isset($GLOBALS['TCA'][$tableName]['columns'])) {
// Take specific label into account
$label = 'LLL:EXT:lang/locallang_tca.xlf:sys_category.categories';
if (!empty($options['label'])) {
$label = $options['label'];
}
// Take specific value of exclude flag into account
$exclude = true;
if (isset($options['exclude'])) {
$exclude = (bool)$options['exclude'];
}
$fieldConfiguration = empty($options['fieldConfiguration']) ? array() : $options['fieldConfiguration'];
$columns = array(
$fieldName => array(
'exclude' => $exclude,
'label' => $label,
'config' => static::getTcaFieldConfiguration($tableName, $fieldName, $fieldConfiguration),
),
);
if (isset($options['l10n_mode'])) {
$columns[$fieldName]['l10n_mode'] = $options['l10n_mode'];
}
if (isset($options['l10n_display'])) {
$columns[$fieldName]['l10n_display'] = $options['l10n_display'];
}
if (isset($options['displayCond'])) {
$columns[$fieldName]['displayCond'] = $options['displayCond'];
}
// Register opposite references for the foreign side of a relation
if (empty($GLOBALS['TCA']['sys_category']['columns']['items']['config']['MM_oppositeUsage'][$tableName])) {
$GLOBALS['TCA']['sys_category']['columns']['items']['config']['MM_oppositeUsage'][$tableName] = array();
}
if (!in_array($fieldName, $GLOBALS['TCA']['sys_category']['columns']['items']['config']['MM_oppositeUsage'][$tableName])) {
$GLOBALS['TCA']['sys_category']['columns']['items']['config']['MM_oppositeUsage'][$tableName][] = $fieldName;
}
// Add field to interface list per default (unless the 'interface' property is FALSE)
if (
(!isset($options['interface']) || $options['interface'])
&& !empty($GLOBALS['TCA'][$tableName]['interface']['showRecordFieldList'])
&& !GeneralUtility::inList($GLOBALS['TCA'][$tableName]['interface']['showRecordFieldList'], $fieldName)
) {
$GLOBALS['TCA'][$tableName]['interface']['showRecordFieldList'] .= ',' . $fieldName;
}
// Adding fields to an existing table definition
ExtensionManagementUtility::addTCAcolumns($tableName, $columns);
}
}
/**
* Get the config array for given table and field.
* This method does NOT take care of adding sql fields, adding the field to TCA types
* nor does it set the MM_oppositeUsage in the sys_category TCA. This has to be taken care of manually!
*
* @param string $tableName The table name
* @param string $fieldName The field name (default categories)
* @param array $fieldConfigurationOverride Changes to the default configuration
* @return array
* @api
*/
public static function getTcaFieldConfiguration($tableName, $fieldName = 'categories', array $fieldConfigurationOverride = array())
{
// Forges a new field, default name is "categories"
$fieldConfiguration = array(
'type' => 'select',
'renderType' => 'selectTree',
'foreign_table' => 'sys_category',
'foreign_table_where' => ' AND sys_category.sys_language_uid IN (-1, 0) ORDER BY sys_category.sorting ASC',
'MM' => 'sys_category_record_mm',
'MM_opposite_field' => 'items',
'MM_match_fields' => array(
'tablenames' => $tableName,
'fieldname' => $fieldName,
),
'size' => 50,
'maxitems' => 9999,
'treeConfig' => array(
'parentField' => 'parent',
'appearance' => array(
'expandAll' => true,
'showHeader' => true,
'maxLevels' => 99,
),
),
);
// Merge changes to TCA configuration
if (!empty($fieldConfigurationOverride)) {
ArrayUtility::mergeRecursiveWithOverrule(
$fieldConfiguration,
$fieldConfigurationOverride
);
}
return $fieldConfiguration;
}
/**
* A slot method to inject the required category database fields to the
* tables definition string
*
* @param array $sqlString
* @return array
*/
public function addCategoryDatabaseSchemaToTablesDefinition(array $sqlString)
{
$this->registerDefaultCategorizedTables();
$sqlString[] = $this->getDatabaseTableDefinitions();
return array('sqlString' => $sqlString);
}
/**
* A slot method to inject the required category database fields of an
* extension to the tables definition string
*
* @param array $sqlString
* @param string $extensionKey
* @return array
*/
public function addExtensionCategoryDatabaseSchemaToTablesDefinition(array $sqlString, $extensionKey)
{
$sqlString[] = $this->getDatabaseTableDefinition($extensionKey);
return array('sqlString' => $sqlString, 'extensionKey' => $extensionKey);
}
/**
* @return LanguageService
*/
protected function getLanguageService()
{
return $GLOBALS['LANG'];
}
/**
* Removes the given field in the given table from the registry if it is found.
*
* @param string $tableName The name of the table for which the registration should be removed.
* @param string $fieldName The name of the field for which the registration should be removed.
*/
protected function remove($tableName, $fieldName)
{
if (!$this->isRegistered($tableName, $fieldName)) {
return;
}
unset($this->registry[$tableName][$fieldName]);
foreach ($this->extensions as $extensionKey => $tableFieldConfig) {
foreach ($tableFieldConfig as $extTableName => $fieldNameArray) {
if ($extTableName === $tableName && isset($fieldNameArray[$fieldName])) {
unset($this->extensions[$extensionKey][$tableName][$fieldName]);
break;
}
}
}
// If no more fields are configured we unregister the categories tab.
if (empty($this->registry[$tableName]) && isset($this->addedCategoryTabs[$tableName])) {
unset($this->addedCategoryTabs[$tableName]);
}
}
}
| gpl-2.0 |
maude-team/maude | src/Meta/metaVariant.cc | 8690 | /*
This file is part of the Maude 2 interpreter.
Copyright 1997-2012 SRI International, Menlo Park, CA 94025, USA.
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.
*/
//
// Code for variant narrowing descent functions.
//
#include "variantSearch.hh"
local_inline bool
MetaLevelOpSymbol::getCachedVariantSearch(MetaModule* m,
FreeDagNode* subject,
RewritingContext& context,
Int64 solutionNr,
VariantSearch*& search,
Int64& lastSolutionNr)
{
CacheableState* cachedState;
if (m->remove(subject, cachedState, lastSolutionNr))
{
if (lastSolutionNr <= solutionNr)
{
search = safeCast(VariantSearch*, cachedState);
//
// The parent context pointer of the root context in the VariantSearch is possibly
// stale since it points the context from a different descent function call.
//
safeCast(UserLevelRewritingContext*, search->getContext())->
beAdoptedBy(safeCast(UserLevelRewritingContext*, &context));
return true;
}
delete cachedState;
}
return false;
}
bool
MetaLevelOpSymbol::metaGetVariant2(FreeDagNode* subject, RewritingContext& context, bool irredundant)
{
DebugAdvisory(Tty(Tty::CYAN) << "meta variant call: " << Tty(Tty::GREEN) << (DagNode*) subject << Tty(Tty::RESET));
//
// We handle both metaGenerateVariant() and metaGenerateIrredundantVariant().
//
if (MetaModule* m = metaLevel->downModule(subject->getArgument(0)))
{
DagNode* metaVarIndex = subject->getArgument(3);
Int64 solutionNr;
if (metaLevel->isNat(metaVarIndex) &&
metaLevel->downSaturate64(subject->getArgument(4), solutionNr) && solutionNr >= 0)
{
const mpz_class& varIndex = metaLevel->getNat(metaVarIndex);
VariantSearch* vs;
Int64 lastSolutionNr;
if (getCachedVariantSearch(m, subject, context, solutionNr, vs, lastSolutionNr))
m->protect(); // Use cached state
else
{
Term* start;
Vector<Term*> blockerTerms;
if ((start = metaLevel->downTerm(subject->getArgument(1), m)) &&
metaLevel->downTermList(subject->getArgument(2), m, blockerTerms))
{
m->protect();
RewritingContext* startContext = term2RewritingContext(start, context);
Vector<DagNode*> blockerDags;
FOR_EACH_CONST(i, Vector<Term*>, blockerTerms)
{
Term* t = *i;
t = t->normalize(true); // we don't really need to normalize but we do need to set hash values
blockerDags.append(t->term2Dag());
t->deepSelfDestruct();
}
vs = new VariantSearch(startContext, blockerDags, new FreshVariableSource(m, varIndex), false, irredundant);
lastSolutionNr = -1;
}
else
return false;
}
DagNode* result;
const Vector<DagNode*>* variant;
int nrFreeVariables;
int parentIndex = -1; // dummy
bool moreInLayer = false; // dummy
if (lastSolutionNr == solutionNr)
{
//
// So the user can ask for the same variant over and over again without
// a horrible loss of performance.
//
variant = vs->getLastReturnedVariant(nrFreeVariables, parentIndex, moreInLayer);
}
else
{
while (lastSolutionNr < solutionNr)
{
variant = vs->getNextVariant(nrFreeVariables, parentIndex, moreInLayer);
if (variant == 0)
{
bool incomplete = vs->isIncomplete();
delete vs;
result = metaLevel->upNoVariant(incomplete);
goto fail;
}
context.transferCount(*(vs->getContext()));
++lastSolutionNr;
}
}
{
m->insert(subject, vs, solutionNr);
mpz_class lastVarIndex = varIndex + nrFreeVariables;
mpz_class parentIndexBig(parentIndex);
result = metaLevel->upVariant(*variant, vs->getVariableInfo(), lastVarIndex, parentIndexBig, moreInLayer, m); // dummy args
}
fail:
(void) m->unprotect();
return context.builtInReplace(subject, result);
}
}
return false;
}
bool
MetaLevelOpSymbol::metaGetVariant(FreeDagNode* subject, RewritingContext& context)
{
//
// op metaGenerateVariant : Module Term TermList Nat Nat ~> Variant? .
//
return metaGetVariant2(subject, context, false);
}
bool
MetaLevelOpSymbol::metaGetIrredundantVariant(FreeDagNode* subject, RewritingContext& context)
{
//
// op metaGenerateIrredundantVariant : Module Term TermList Nat Nat ~> Variant? .
//
return metaGetVariant2(subject, context, true);
}
bool
MetaLevelOpSymbol::metaVariantUnify2(FreeDagNode* subject, RewritingContext& context, bool disjoint)
{
DebugAdvisory(Tty(Tty::CYAN) << "meta variant unify call: " << Tty(Tty::GREEN) << (DagNode*) subject << Tty(Tty::RESET));
//
// We handle both metaVariantUnify() and metaVariantDisjointUnify().
//
if (MetaModule* m = metaLevel->downModule(subject->getArgument(0)))
{
Int64 solutionNr;
DagNode* metaVarIndex = subject->getArgument(3);
if (metaLevel->isNat(metaVarIndex) &&
metaLevel->downSaturate64(subject->getArgument(4), solutionNr) && solutionNr >= 0)
{
const mpz_class& varIndex = metaLevel->getNat(metaVarIndex);
VariantSearch* vs;
Int64 lastSolutionNr;
if (getCachedVariantSearch(m, subject, context, solutionNr, vs, lastSolutionNr))
m->protect(); // Use cached state
else
{
Vector<Term*> lhs;
Vector<Term*> rhs;
if (!metaLevel->downUnificationProblem(subject->getArgument(1), lhs, rhs, m, disjoint))
return false;
Vector<Term*> blockerTerms;
if (!metaLevel->downTermList(subject->getArgument(2), m, blockerTerms))
{
FOR_EACH_CONST(i, Vector<Term*>, lhs)
(*i)->deepSelfDestruct();
FOR_EACH_CONST(j, Vector<Term*>, rhs)
(*j)->deepSelfDestruct();
return false;
}
m->protect();
DagNode* d = m->makeUnificationProblemDag(lhs, rhs);
RewritingContext* startContext = context.makeSubcontext(d, UserLevelRewritingContext::META_EVAL);
Vector<DagNode*> blockerDags;
FOR_EACH_CONST(i, Vector<Term*>, blockerTerms)
{
Term* t = *i;
t = t->normalize(true); // we don't really need to normalize but we do need to set hash values
blockerDags.append(t->term2Dag());
t->deepSelfDestruct();
}
vs = new VariantSearch(startContext, blockerDags, new FreshVariableSource(m, varIndex), true, false);
lastSolutionNr = -1;
}
DagNode* result;
const Vector<DagNode*>* unifier;
int nrFreeVariables;
if (lastSolutionNr == solutionNr)
{
//
// So the user can ask for the same unifier over and over again without
// a horrible loss of performance.
//
unifier = vs->getLastReturnedUnifier(nrFreeVariables);
}
else
{
while (lastSolutionNr < solutionNr)
{
unifier = vs->getNextUnifier(nrFreeVariables);
if (unifier == 0)
{
bool incomplete = vs->isIncomplete();
delete vs;
result = disjoint ? metaLevel->upNoUnifierTriple(incomplete) : metaLevel->upNoUnifierPair(incomplete);
goto fail;
}
context.transferCount(*(vs->getContext()));
++lastSolutionNr;
}
}
{
m->insert(subject, vs, solutionNr);
mpz_class lastVarIndex = varIndex + nrFreeVariables;
result = disjoint ?
metaLevel->upUnificationTriple(*unifier, vs->getVariableInfo(), lastVarIndex, m) :
metaLevel->upUnificationPair(*unifier, vs->getVariableInfo(), lastVarIndex, m);
}
fail:
(void) m->unprotect();
return context.builtInReplace(subject, result);
}
}
return false;
}
bool
MetaLevelOpSymbol::metaVariantUnify(FreeDagNode* subject, RewritingContext& context)
{
//
// op metaVariantUnify : Module UnificationProblem TermList Nat Nat ~> UnificationPair? .
//
return metaVariantUnify2(subject, context, false);
}
bool
MetaLevelOpSymbol::metaVariantDisjointUnify(FreeDagNode* subject, RewritingContext& context)
{
//
// op metaVariantDisjointUnify : Module UnificationProblem TermList Nat Nat ~> UnificationTriple? .
//
return metaVariantUnify2(subject, context, true);
}
| gpl-2.0 |
jgsojo/programing-fundamentals | Practica 3/main.cpp | 21269 | // Practica 3
// Fecha de entrega: 29 de Marzo de 2012
// Autores: Jesús García Sojo y Alfredo Hernández Burgos
// Clase, curso y asignatura: 1º E, Fundamentos de Programacion
// La practica consiste en un juego de Sudoku con ayuda al usuario
// Cuando le pidamos una fila y columna al usuario, las convertiremos directamente a la posicion del array,
// es decir, le restaremos uno, para trabajar con los indices mas comodamente
// Elementos para trabajar en c++
#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
using namespace std;
// Declaracion de constantes
const int MAX = 9; // Tiene que ser un numero al cuadrado, 2x2, 3x3, 4x4...
const int RAIZMAX = 3; // Es la raíz tamaño del sudoku
// Declaracion de tipos
typedef int tSudoku [MAX][MAX];
typedef bool tSudokuBool [MAX][MAX];
typedef bool tCandidatos [MAX];
typedef struct {
int contador;
tSudoku sudoku;
tSudokuBool sudokuBool;
} tTablero;
// Declaracion de prototipos
void muestraTablero (tTablero tablero);
// Pinta el tablero completo
void pintaLinea (int linea, tTablero tablero);
// Pinta por consola la linea del indice dado, colocando los valores del tablero
void pintaIndices ();
// Pinta por consola la linea que contiene los indices de las columnas
void pintaNumero (int linea, int columna, tTablero tablero);
// Pinta por consola el numero contenido en la posicion dada
void pintaGuiones ();
// Pinta una linea de guiones
bool rellenaSudokuInicialDesdeTxt (tTablero &tablero, string direccionDelTxt);
// Rellena el sudoku inicial, desde el fichero donde se encuentra
bool rellenaSudokuSolucionDesdeTxt (tSudoku sudoku, string direccionDelTxt);
// Rellena el sudoku solucion
void cambiaDireccionTxt (string nombre, string &direccion);
// Pide al usuario que cambie la direccion del fichero "nombre", con la opcion de dejar el que esta
void inicializaTablero (tTablero &tablero);
// Inicializa la estructura tablero dada
bool valorValido (int num);
// Dado un numero, devuelve false si no esta entre 1 y MAX incluidos
bool valoresValidos (int num1, int num2, int num3);
// Dados tres numeros, devuelve false si alguno de los 3 no esta entre 1 y MAX incluidos
int menu();
// Muestra el menu y devuelve la opcion valida
void pintaMenu();
// Muestra las opciones del menu
bool esDigito (char C);
// Devuelve true si el caracter introducido es un digito
bool sudokuResuelto(tTablero tablero, const tSudoku sudokuSolucion);
// Devuelve true si el sudoku esta resuelto correctamente
void posiblesValores(tTablero tablero);
// Pide la posicion en la que se quiere mirar los valores posibles, y los muestra por pantalla
void solicitaFilaYColumna (int &fila, int &columna);
// Pide una fila y columna hasta que sean valores validos, entre los valores validos
bool esVacia (tTablero tablero, int fila, int columna);
// Devuelve true si una casilla es vacia
void calculaCandidatos (int fila, int columna, tCandidatos candidatos, tTablero tablero);
// Calcula los valores posibles de una fila y columna, devolviendo un array de bool, con true los que si pueden serlo
void muestraCandidatos (const tCandidatos candidatos);
// Muestra por pantalla los valores posibles
bool estaEnFila (int fila, tTablero tablero, int digito);
// Devuelve true si el digito dado esta en la fila dada
bool estaEnColumna (int columna, tTablero tablero, int digito);
// Devuelve true si el digito dado esta en la columna dada
bool estaEnRegion (int fila, int columna, tTablero tablero, int digito);
// Devuelve true si el digito dado esta en la region que se encuentran la fila y columna dadas
void colocaValor(tTablero &tablero);
// Pide una fila y columna, y si no esta vacia, coloca el valor que le diga el usuario
int solicitaValor ();
// Pide un valor, y lo devuelve, cuando este dentro del rango que puede tener
bool colocaValorEnCasilla (int fila, int columna, int valor, tTablero &tablero);
// Intenta colocar un valor en la fila y columna dadas, si es posible hacerlo, devuelve true
bool esCasillaInicial(int fila, int columna, tTablero tablero);
// Devuelve true si la casilla dada por la fila y la columna es de las dadas al inicio del sudoku
void borraValor (tTablero &tablero);
// Pide una fila y columna y si esa casilla no contiene un valor inicial del sudoku, borra su contenido
void muestraIncorrectos (tTablero tablero, const tSudoku solucion);
// Muestra las casillas cuyos valores no coinciden con los de la solucion
void reiniciarTablero (tTablero &tablero);
// Reinicia el tablero, dejandolo como lo teniamos al inicio
void rellenaCasillas (tTablero &tablero);
// Rellena las casillas que solo tienen un valor posible
bool soloUnCandidato(int fila, int columna, tTablero tablero, int &valor);
// Devuelve true si la casilla dada solo tiene un candidato y cambia el valor, poniendo el del valor posible
// Implementacion
void cambiaDireccionTxt (string nombre, string &direccion) {
// Variables
char aux;
// Peticion de la direccion
cout << "Nombre de " << nombre << " (Intro-> archivo por defecto '" << direccion << "'): ";
// Lectura y comprobacion de la direccion
aux = cin.peek();
if (aux != '\n'){ // Si no ha pulsado intro, leemos el string con la direccion
cin >> direccion;
}
// Limpiamos la entrada
cin.sync();
// Ponemos un par de saltos de linea para separar
cout << endl << endl;
}
bool valoresValidos (int num1, int num2, int num3){
return (valorValido (num1) && valorValido (num2) && valorValido (num3));
}
bool valorValido (int num){
return (num > 0 && num <= MAX);
}
bool rellenaSudokuInicialDesdeTxt (tTablero &tablero, string direccionDelTxt){
// Suponemos que la estructura del fichero es la correcta (nos dan fila, columna, y valor, todos ellos numeros)
// Variables
ifstream archivo;
int fila, columna, valor;
bool error = false, centinela = false;
// Apertura del fichero
archivo.open(direccionDelTxt);
if (archivo.is_open()) { // Si se abre correctamente
// Leemos los valores
do {
archivo >> fila; // Leemos el primer valor, la fila
if (fila == -1){ // Si es -1, activamos el centinela
centinela = true;
}
else {
archivo >> columna; // Leemos el segundo valor, la columna
archivo >> valor; // Leemos el tercer valor, el valor de la posicion
error = !(valoresValidos (fila, columna, valor)); // Si alguno de los 3 no esta entre 1 y 9, hay error
}
if (!error && !centinela){ // Si no hay error ni centinela, guardamos el valor en la posicion dada
tablero.sudoku [fila-1][columna-1] = valor;
tablero.sudokuBool [fila-1][columna-1] = true; // Decimos que es casilla inicial
tablero.contador --; // Disminuimos el valor del contador de posiciones vacias
}
}
while (!error && !centinela);
// Cierre del fichero
archivo.close();
}
else error = true;
// Retorno de la funcion
return error;
}
bool rellenaSudokuSolucionDesdeTxt (tSudoku sudoku, string direccionDelTxt){
// Variables
ifstream archivo;
int valor;
bool error = false;
// Apertura del fichero
archivo.open(direccionDelTxt);
if (archivo.is_open()) { // Si se abre correctamente
// Leemos los valores
for (int i = 0; i < MAX; i++){
for (int j = 0; j < MAX; j++){
archivo >> valor; // Vamos cogiendo los valores
sudoku [i][j] = valor; // Los colocamos por orden
}
}
// Cierre del fichero
archivo.close();
}
else error = true;
// Retorno de la funcion
return error;
}
void inicializaTablero (tTablero &tablero) {
for (int i = 0; i < MAX; i++){ // Hacemos un recorrido inicializando la estructura
for (int j = 0; j < MAX; j++){
tablero.sudoku [i][j] = 0;
tablero.sudokuBool [i][j] = false;
}
}
tablero.contador = MAX*MAX; // Es el numero de numeros que tiene el sudoku
}
void pintaLinea (int linea, tTablero tablero) {
if (linea+1 > 9) {
cout << linea+1 << " |";
}
else cout << " " << linea+1 << " |";
for (int i=0; i < (RAIZMAX); i++){
for (int j=0; j < (RAIZMAX); j++){
cout << " ";
pintaNumero (linea, (RAIZMAX*i)+j, tablero);
cout << " ";
}
cout << "|";
}
cout << endl;
}
void pintaIndices () {
cout << endl << " ";
for (int i = 0; i < RAIZMAX; i++) {
for (int j = 0; j < RAIZMAX; j++) {
if (((RAIZMAX*i)+j+1) > 9) {
cout << (RAIZMAX*i)+j+1 << " ";
}
else cout << " " << (RAIZMAX*i)+j+1 << " ";
}
cout << " ";
}
cout << endl;
}
void pintaNumero (int linea, int columna, tTablero tablero) {
if (tablero.sudoku [linea][columna] == 0) {
cout << " ";
}
else cout << tablero.sudoku [linea][columna];
}
void pintaGuiones () {
cout << " -";
for (int i = 0; i < RAIZMAX; i++) {
for (int j = 0; j < RAIZMAX; j++) {
cout << "---";
}
cout << "-";
}
cout << endl;
}
void muestraTablero (tTablero tablero) {
// Mostramos los indices de las columnas
pintaIndices();
// Mostramos barra de separacion
pintaGuiones();
// Mostramos el resto del tablero
for (int i=0; i < RAIZMAX; i++){
for (int j=0; j < RAIZMAX; j++){
pintaLinea((RAIZMAX*i+j), tablero);
}
pintaGuiones();
}
cout << endl;
}
bool esDigito (char C) {
// Declaracion de variables
char aux = C;
bool esDigito = false;
// Calculo de la funcion
esDigito = ((aux >= '0') && (aux <= '9'));
// Salida de la funcion
return esDigito;
}
void pintaMenu(){
cout << endl << endl;
cout << "0.- SALIR" << endl;
cout << "1.- Ver posibles valores de casilla" << endl;
cout << "2.- Colocar un valor en la casilla" << endl;
cout << "3.- Borrar el valor de una casilla" << endl;
cout << "4.- Mostrar valores incorrectos" << endl;
cout << "5.- Reiniciar tablero" << endl;
cout << "6.- Completar casillas simples" << endl;
cout << "Opcion: ";
}
int menu() {
// Declaracion de variables
int opcion = 0; // Para guardar la opcion elegida
char aux = ' '; // Variable auxiliar para ver lo que viene en la entrada
bool error = false; // Para ver si es una opcion valida
// Bucle principal
do { // Mostramos el menu hasta que la opcion elegida sea una de las validas
pintaMenu ();
aux = cin.peek(); // Miramos que hay a la entrada
if (esDigito(aux)) { // Si a la entrada hay un digito, cojemos la opcion
cin >> opcion;
}
error = ((opcion < 0) || (opcion > 6)) || !esDigito(aux); // Si la opcion no esta entre 0 y 6 incluidos o no es digito
if (error) { // Si hay error, mostramos el mensaje de error
cout << "Esa opcion no es valida" << endl << endl;
}
cin.sync();
}
while (error);
// Salida de la funcion
return opcion; // Devolvemos la opcion
}
bool sudokuResuelto(tTablero tablero, const tSudoku sudokuSolucion){
// Variables
bool correcto = true;
int i = 0, j = 0;
// Comprobamos si todas las posiciones del sudoku son iguales que la del sudoku solucion
while (correcto && i < MAX) {
j = 0;
while (correcto && j < MAX) {
correcto = (tablero.sudoku [i][j] == sudokuSolucion [i][j]);
j ++;
}
i ++;
}
return ((tablero.contador == 0) && correcto);
}
void posiblesValores(tTablero tablero){
// Variables
int fila, columna;
tCandidatos candidatos = {0}; // Creamos una lista de candidatos inicializada
// Peticion de datos
solicitaFilaYColumna (fila, columna);
// Calculo de valores posibles
calculaCandidatos (fila, columna, candidatos, tablero);
// Muestra de datos
muestraCandidatos (candidatos);
}
bool estaEnFila (int fila, tTablero tablero, int digito){
// Variables
bool enFila = false;
int i = 0;
// Recorrido de la fila buscando el digito
while (i < MAX && !enFila) {
enFila = (tablero.sudoku [fila][i] == digito);
i++;
}
return enFila;
}
bool estaEnColumna (int columna, tTablero tablero, int digito){
// Variables
bool enColumna = false;
int i = 0;
// Recorrido de la columna buscando el digito
while (i < MAX && !enColumna) {
enColumna = (tablero.sudoku [i][columna] == digito);
i++;
}
return enColumna;
}
bool estaEnRegion (int fila, int columna, tTablero tablero, int digito){
// Variables
bool enRegion = false;
int i = 0, divFila = 0;
int j = 0, divColumna = 0;
// Recorrido de la fila buscando el digito
while (i < RAIZMAX && !enRegion) {
j = 0;
while (j < RAIZMAX && !enRegion) {
divFila = fila/RAIZMAX;
divColumna = columna/RAIZMAX;
enRegion = (tablero.sudoku [(divFila*RAIZMAX)+i][(divColumna*RAIZMAX)+j] == digito);
j++;
}
i++;
}
return enRegion;
}
void calculaCandidatos (int fila, int columna, tCandidatos candidatos, tTablero tablero){
for (int i=1; i <= MAX; i++) {
// Recorremos todos los numeros posibles y si estan en la fila, la columna o la region, no es candidato, pero si eso no pasa, lo añadimos
if (!((estaEnFila (fila, tablero, i)) || (estaEnColumna (columna, tablero, i)) || (estaEnRegion (fila, columna, tablero, i)))) {
candidatos [i-1] = true;
}
}
}
void muestraCandidatos (const tCandidatos candidatos){
bool hayCandidatos = false; // Cuando encontremos algun candidato, lo pondremos a cierto
for (int i=0; i < MAX; i++){
if (candidatos [i]){
cout << i+1 << " ";
hayCandidatos = true;
}
}
if (!hayCandidatos) cout << "NO HAY CANDIDATOS";
cout << endl << endl;
}
void solicitaFilaYColumna (int &fila, int &columna){
// Variables
char aux;
// Ejecucion
do {
// Inicializamos por si vienen con datos basura
fila = 0;
columna = 0;
cout << "Intruduce la fila y columna [1.." << MAX << "] (separadas por un espacio): ";
aux = cin.peek();
if (esDigito(aux)){ // Si viene un digito, lo cogemos como fila
cin >> fila;
aux = cin.get(); // Cogemos el espacio que venga
aux = cin.peek();
if (esDigito(aux)){ // Si viene un digito, lo cogemos como columna
cin >> columna;
}
}
cin.sync(); // En cualquier caso limpiamos lo que venga
}
while (!(valoresValidos(fila, columna, 1))); // La funcion tiene 3 parametros y solo necesito dos, pongo uno que siempre lo va a cumplir
// Cambiamos el valor de la fila y la columna para que nos valga
fila --;
columna --;
}
bool esVacia (tTablero tablero, int fila, int columna){
return (tablero.sudoku [fila][columna] == 0); // Es vacia si contiene un 0
}
int solicitaValor (){
// Variables
char aux;
int valor;
// Ejecucion
do {
cout << "Intruduce un valor en el intervalo [1.." << MAX << "]: ";
aux = cin.peek();
if (esDigito(aux)){ // Si viene un digito, lo cogemos como fila
cin >> valor;
}
cin.sync(); // En cualquier caso limpiamos lo que venga
}
while (!(esDigito(aux)) || !(valorValido(valor))); // Mientras no sea un digito o no sea valor valido
return valor;
}
bool colocaValorEnCasilla (int fila, int columna, int valor, tTablero &tablero){
// Variables
tCandidatos candidatos = {0};
bool coloca = false;
int i = 0;
// Obtenemos los candidatos de la casilla y si el valor dado es uno de ellos, no lo colocamos y devolvemos false
calculaCandidatos (fila, columna, candidatos, tablero);
coloca = candidatos [valor-1]; // Si el valor dado, es candidato, lo colocamos
if (coloca) {
tablero.sudoku [fila][columna] = valor;
tablero.contador --;
}
return coloca;
}
bool esCasillaInicial(int fila, int columna, tTablero tablero){
return tablero.sudokuBool [fila][columna];
}
void colocaValor(tTablero &tablero){
// Variables
int fila = 0, columna = 0, valor = 0;
// Solicitamos la fila y la columna, comprobamos si es vacia
solicitaFilaYColumna (fila, columna);
if (esVacia(tablero, fila, columna)){
valor = solicitaValor ();
if (!(colocaValorEnCasilla (fila, columna, valor, tablero))){ // Si no se ha podido colocar el valor en la casilla
cout << "DIGITO NO VALIDO";
}
else muestraTablero(tablero);
}
else {
if (esCasillaInicial(fila, columna, tablero)){
cout << "NO MODIFICABLE";
}
else {
cout << "CASILLA NO VACIA";
}
cout << endl << endl;
}
}
void borraValor (tTablero &tablero){
// Variables
int fila = 0, columna = 0;
// Solicitamos la fila y la columna, comprobamos si es vacia
solicitaFilaYColumna (fila, columna);
if (esVacia(tablero, fila, columna)){ // Si es vacia no se puede hacer nada, se muestra mensaje
cout << "CASILLA VACIA" << endl << endl;
}
else {
if (esCasillaInicial(fila, columna, tablero)){ // Si es de las iniciales, no se puede borrar
cout << "NO MODIFICABLE"<< endl << endl;
}
else {
// Hacemos que el valor de esa casilla sea 0 y disminuimos el contador
tablero.sudoku[fila][columna] = 0;
tablero.contador ++;
muestraTablero(tablero);
}
}
}
void muestraIncorrectos (tTablero tablero, const tSudoku solucion) {
// Variables
int contador = 0;
// Recorremos el tablero buscando los errores, y los mostramos
cout << "ERRORES:" << endl;
for (int i = 0; i < MAX; i++){
for (int j = 0; j < MAX; j++){
if (!esVacia(tablero, i, j) && !(tablero.sudoku [i][j] == solucion [i][j])){ // Si no es vacia y no coincide con la solucion
cout << "[" << i << "," << j << "] (" << tablero.sudoku [i][j] << ")" << endl;
contador ++;
}
}
}
if (contador == 0) cout << "NO HAY ERRORES" << endl;
}
void reiniciarTablero (tTablero &tablero){
// Recorremos el tablero poniendo a 0 las casillas no iniciales y aumentamos el contador de casillas libres por cada una que borramos
for (int i = 0; i < MAX; i++){
for (int j = 0; j < MAX; j++){
if (!(esCasillaInicial (i, j, tablero)) && !(esVacia(tablero, i, j))){
tablero.sudoku [i][j] = 0;
tablero.contador ++;
}
}
}
muestraTablero (tablero);
}
bool soloUnCandidato(int fila, int columna, tTablero tablero, int &valor){
// Variables
int contador = 0;
bool soloUno = false;
tCandidatos candidatos = {0};
// Buscamos los candidatos, los contamos con el contador y si es uno, lo devolvemos, y devolvemos true
calculaCandidatos (fila, columna, candidatos, tablero);
for (int i = 0; i < MAX; i++){
if (candidatos [i]) { // Si es candidato
contador ++; // Añadimos un candidato al contador
valor = i+1; // El valor es el numero que es candidato
}
}
soloUno = (contador == 1);
return soloUno;
}
void rellenaCasillas (tTablero &tablero){
// Variables
int valor;
int contador = 0;
// Recorrido
for (int i = 0; i < MAX; i++){
for (int j = 0; j < MAX; j++){
if (esVacia(tablero, i, j) && soloUnCandidato(i, j, tablero, valor)) { // Si es vacia, y tiene solo un candidato
tablero.sudoku [i][j] = valor; // Colocamos el valor
contador ++;
tablero.contador --;
}
}
}
muestraTablero (tablero);
cout << "Se han completado: " << contador << " celdas" << endl;
}
int main () {
// Variables
int opcion = 8;
tTablero tablero;
tSudoku sudokuSolucion;
string direccionSudoku = "sudoku1.txt";
string direccionSolucion = "solsdk1.txt";
bool errorCargaInicial = false, errorCargaSolucion = false;
bool resuelto = false;
// Inicializacion del tablero
inicializaTablero(tablero);
// Pedimos las direcciones de los ficheros
cambiaDireccionTxt ("el sudoku", direccionSudoku);
cambiaDireccionTxt ("la solucion", direccionSolucion);
// Cargamos los valores de los ficheros
errorCargaInicial = rellenaSudokuInicialDesdeTxt (tablero, direccionSudoku);
if (errorCargaInicial){ // Si hay error al cargar, mostramos un mensaje diciendolo
cout << "Fallo al cargar el archivo con el estado inicial del sudoku" << endl;
}
else { // Si no hay error al cargar el inicial, cargamos el de solucion
errorCargaSolucion = rellenaSudokuSolucionDesdeTxt (sudokuSolucion, direccionSolucion);
if (errorCargaSolucion){ // Si hay error al cargar la solucion
cout << "No se encuentra el sudoku con la solucion" << endl;
}
else {
// Mostramos el tablero, el menu y vamos ejecutando lo que nos pida el usuario
// Tablero
muestraTablero(tablero);
do {
// Menu
opcion = menu();
cout << endl;
switch (opcion) {
case 1: posiblesValores(tablero); break;
case 2: colocaValor (tablero); break;
case 3: borraValor (tablero); break;
case 4: muestraIncorrectos (tablero, sudokuSolucion); break;
case 5: reiniciarTablero (tablero); break;
case 6: rellenaCasillas (tablero); break;
};
resuelto = sudokuResuelto(tablero, sudokuSolucion); // Cuando el numero de elementos colocados sea igual al maximo y todo este bien
}
while (opcion != 0 && !resuelto);
if (resuelto) { // Si lo he resuelto, le felicitamos
cout << endl << endl << "_______________" << endl << "ENHORABUENA!!" << endl << "--------------" << endl << "HAS LOGRADO RESOLVER EL SUDOKU!!" << endl << endl;
}
}
}
system("pause");
return 0;
} | gpl-2.0 |
FCC/mobile-mba-androidapp | libcore/src/com/samknows/measurement/environment/DCSData.java | 410 | package com.samknows.measurement.environment;
import java.util.List;
import org.json.JSONObject;
public interface DCSData {
public static final String JSON_TYPE = "type";
public static final String JSON_TIMESTAMP = "timestamp";
public static final String JSON_DATETIME = "datetime";
public List<String> convert();
public List<JSONObject> getPassiveMetric();
public List<JSONObject> convertToJSON();
}
| gpl-2.0 |
hh-italian-group/hh-bbtautau | Analysis/src/NonResModel.cpp | 4564 | /*! Class than provides nonresonant EFT model for event analyzers.
This file is part of https://github.com/hh-italian-group/hh-bbtautau. */
#include "hh-bbtautau/Analysis/include/NonResModel.h"
#include "h-tautau/McCorrections/include/PileUpWeight.h"
namespace analysis {
NonResModel::ParamPositionDesc::ParamPositionDesc(const NameMap& names)
{
SetParamPosition(names, "kl", kl);
SetParamPosition(names, "kt", kt);
SetParamPosition(names, "c2", c2);
SetParamPosition(names, "cg", cg);
SetParamPosition(names, "c2g", c2g);
}
NonResModel::Point NonResModel::ParamPositionDesc::CreatePoint(const ValueVec& param_values) const
{
Point point;
SetValue(param_values, "kl", kl, point.kl);
SetValue(param_values, "kt", kt, point.kt);
SetValue(param_values, "c2", c2, point.c2);
SetValue(param_values, "cg", cg, point.cg);
SetValue(param_values, "c2g", c2g, point.c2g);
return point;
}
void NonResModel::ParamPositionDesc::SetParamPosition(const NameMap& names, const std::string& name, OptPos& pos)
{
auto iter = names.find(name);
if(iter != names.end())
pos = iter->second;
}
void NonResModel::ParamPositionDesc::SetValue(const ValueVec& values, const std::string& name,
const OptPos& pos, double& value)
{
if(pos) {
if(values.size() <= *pos)
throw exception("Value not found for EFT parameter %1%.") % name;
value = Parse<double>(values.at(*pos));
}
}
NonResModel::NonResModel(const mc_corrections::EventWeights_HH& _weights, const SampleDescriptor& sample,
std::shared_ptr<TFile> file, tuple_skimmer::CrossSectionProvider& xs_provider) :
weighting_mode(WeightType::PileUp, WeightType::BSM_to_SM, WeightType::GenEventWeight),
weights(_weights),
eft_weights(weights.GetProviderT<NonResHH_EFT::WeightProvider>(WeightType::BSM_to_SM)),
points_are_orthogonal(sample.create_orthogonal_points)
{
const ParamPositionDesc param_positions(sample.GetModelParameterNames());
eft_weights->AddFile(*file);
eft_weights->CreatePdfs();
if(weighting_mode.count(WeightType::PileUp)){
auto pile_up_weight = weights.GetProviderT<mc_corrections::PileUpWeightEx>(mc_corrections::WeightType::PileUp);
pile_up_weight->SetActiveDataset(sample.reference_pu_sample);
}
for(const auto& sample_wp : sample.working_points) {
point_names.push_back(sample_wp.full_name);
points.push_back(param_positions.CreatePoint(sample_wp.param_values));
double xs = -1;
if(!sample_wp.cross_section.empty())
xs = xs_provider.GetCrossSection(sample_wp.cross_section);
point_xs.push_back(xs);
}
total_shape_weights = weights.GetTotalShapeWeights(file, weighting_mode, points, sample.create_orthogonal_points);
}
void NonResModel::ProcessEvent(const EventAnalyzerDataId& anaDataId, EventInfo& event, double weight,
double shape_weight, bbtautau::AnaTupleWriter::DataIdMap& dataIds, double cross_section,
std::map<UncertaintySource, std::map<UncertaintyScale, float>>& uncs_weight_map)
{
for(size_t n = 0; n < points.size(); ++n) {
if(points_are_orthogonal && (event->evt % points.size()) != n) continue;
const auto final_id = anaDataId.Set(point_names.at(n));
eft_weights->SetTargetPoint(points.at(n));
const double eft_weight = eft_weights->Get(event);
const double shape_weight_correction = shape_weight / total_shape_weights.at(UncertaintyScale::Central).at(n);
const double eft_weight_correction = eft_weight / event->weight_bsm_to_sm;
const double xs_correction = point_xs.at(n) > 0 ? point_xs.at(n) / cross_section : 1.;
const double final_weight = weight * shape_weight_correction * eft_weight_correction * xs_correction;
dataIds[final_id] = final_weight;
uncs_weight_map[UncertaintySource::PileUp][UncertaintyScale::Central] = static_cast<float>(event->weight_pu /
total_shape_weights.at(UncertaintyScale::Central).at(n));
uncs_weight_map[UncertaintySource::PileUp][UncertaintyScale::Up] = static_cast<float>(event->weight_pu_up /
total_shape_weights.at(UncertaintyScale::Up).at(n));
uncs_weight_map[UncertaintySource::PileUp][UncertaintyScale::Down] = static_cast<float>(event->weight_pu_down /
total_shape_weights.at(UncertaintyScale::Down).at(n));
}
}
} // namespace analysis
| gpl-2.0 |
carlosway89/testshop | ext/payone/php/Payone/Api/Response/Management/GetFile.php | 1824 | <?php
/**
*
* NOTICE OF LICENSE
*
* This source file is subject to the GNU General Public License (GPL 2)
* that is bundled with this package in the file LICENSE.txt
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Payone to newer
* versions in the future. If you wish to customize Payone for your
* needs please refer to http://www.payone.de for more information.
*
* @category Payone
* @package Payone_Api
* @subpackage Response
* @copyright Copyright (c) 2012 <[email protected]> - www.noovias.com
* @author Matthias Walter <[email protected]>
* @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 2)
* @link http://www.noovias.com
*/
/**
*
* @category Payone
* @package Payone_Api
* @subpackage Response
* @copyright Copyright (c) 2012 <[email protected]> - www.noovias.com
* @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 2)
* @link http://www.noovias.com
*/
class Payone_Api_Response_Management_GetFile extends Payone_Api_Response_Abstract
{
/**
* @var string
*/
protected $response = NULL;
/**
* @param string $response
*/
public function setResponse($response)
{
$this->response = $response;
}
/**
* @return string
*/
public function getResponse()
{
return $this->response;
}
/**
* @return string
*/
public function __toString()
{
if ($this->isError()) {
$result = parent::__toString();
}
else {
$stringArray = array('status=' . $this->getStatus(), 'data=PDF-Content');
$result = implode('|', $stringArray);
}
return $result;
}
}
| gpl-2.0 |
seavan/smoltoday | trunk/src/meridian.smolensk/meta_impl/photobank_photo_prices.meta.cs | 624 | /* Automatically generated codefile, Meridian
* Generated by magic, please do not interfere
* Please sleep well and do not smoke. Love, Sam */
using System;
using System.Linq;
using System.Text;
using System.Data.Linq;
using System.Collections.Generic;
namespace meridian.smolensk.proto
{
public partial class photobank_photo_prices_meta
{
public photobank_photo_prices_meta()
{
}
/* metafile template */
public long id { get; set; }
public long rel_photo_id { get; set; }
public int license_id { get; set; }
public double price { get; set; }
/* metafile template */
}
}
| gpl-2.0 |
rraptorr/php-amf3 | tests/amf3_decode_object_stdclass_subclass.phpt | 577 | --TEST--
AMF3 decoding - subclass of stdClass
--FILE--
<?php
class DTO extends stdClass {
private $private = "private value";
protected $protected = "protected value";
public $field;
public $id;
}
$count = 0;
$amf3 = pack("H*", "0a230744544f0b6669656c64056964060b76616c7565048526");
$data = amf3_decode($amf3, $count);
var_dump($data);
var_dump($count);
?>
--EXPECT--
object(DTO)#1 (4) {
["private":"DTO":private]=>
string(13) "private value"
["protected":protected]=>
string(15) "protected value"
["field"]=>
string(5) "value"
["id"]=>
int(678)
}
int(25)
| gpl-2.0 |
jellobrain/Symbiota | ident/dichotomous/loader.php | 14745 | <?php
include_once('../config/symbini.php');
include_once($serverRoot.'/config/dbconnection.php');
header("Content-Type: text/html; charset=".$charset);
$nodeId = array_key_exists("nodeid",$_REQUEST)?$_REQUEST["nodeid"]:0;
$stmtId = array_key_exists("stmtid",$_REQUEST)?$_REQUEST["stmtid"]:0;
$action = array_key_exists("action",$_REQUEST)?$_REQUEST["action"]:"";
$statement = array_key_exists("statement",$_REQUEST)?trim($_REQUEST["statement"]):"";
$parentStmtId = array_key_exists("parentstmtid",$_REQUEST)?$_REQUEST["parentstmtid"]:0;
$taxon = array_key_exists("taxon",$_REQUEST)?$_REQUEST["taxon"]:"";
$tid = array_key_exists("tid",$_REQUEST)?$_REQUEST["tid"]:"";
$notes = array_key_exists("notes",$_REQUEST)?$_REQUEST["notes"]:"";
$dichoManager = new DichoManager();
if($action){
$dataArr = Array();
$dataArr["nodeid"] = $nodeId;
$dataArr["statement"] = $statement;
$dataArr["tid"] = $tid;
$dataArr["notes"] = $notes;
if($action == "Add New Child Cuplet"){
$dataArr["parentstmtid"] = $parentStmtId;
$dataArr["statement2"] = $_REQUEST["statement2"];
$dataArr["tid2"] = $_REQUEST["tid2"];
$dataArr["notes2"] = $_REQUEST["notes2"];
$nodeId = $dichoManager->addCuplet($dataArr);
}
else{
$dataArr["stmtid"] = $stmtId;
$dichoManager->editStatement($dataArr);
}
}
$editable = false;
if($isAdmin || array_key_exists("KeyEditor",$userRights)){
$editable = true;
}
?>
<html>
<head>
<title><?php echo $defaultTitle; ?> Dichotomous Key Loader</title>
<link href="../css/base.css?<?php echo $CSS_VERSION; ?>" type="text/css" rel="stylesheet" />
<link href="../css/main.css?<?php echo $CSS_VERSION; ?>" type="text/css" rel="stylesheet" />
<meta name='keywords' content='' />
<script LANGUAGE="JavaScript">
var cseXmlHttp;
var targetStr;
function toggle(target){
var divObjs = document.getElementsByTagName("div");
for (i = 0; i < divObjs.length; i++) {
var obj = divObjs[i];
if(obj.getAttribute("class") == target || obj.getAttribute("className") == target){
if(obj.style.display=="none"){
obj.style.display="block";
}
else {
obj.style.display="none";
}
}
}
var spanObjs = document.getElementsByTagName("span");
for (i = 0; i < spanObjs.length; i++) {
var obj = spanObjs[i];
if(obj.getAttribute("class") == target || obj.getAttribute("className") == target){
if(obj.style.display=="none"){
obj.style.display="inline";
}
else {
obj.style.display="none";
}
}
}
}
function checkScinameExistance(inputObj,tStr){
targetStr = tStr;
sciname = inputObj.value;
if (sciname.length == 0){
return;
}
cseXmlHttp=GetXmlHttpObject();
if (cseXmlHttp==null){
alert ("Your browser does not support AJAX!");
return;
}
var url="rpc/gettid.php";
url=url+"?sciname="+sciname;
url=url+"&sid="+Math.random();
cseXmlHttp.onreadystatechange=cseStateChanged;
cseXmlHttp.open("POST",url,true);
cseXmlHttp.send(null);
}
function cseStateChanged(){
if (cseXmlHttp.readyState==4){
var responseStr = cseXmlHttp.responseText;
if(responseStr == ""){
alert("INVALID TAXON: Name does not exist in database.");
}
else{
document.getElementById(targetStr).value = responseStr;
}
}
}
function GetXmlHttpObject(){
var xmlHttp=null;
try{
// Firefox, Opera 8.0+, Safari, IE 7.x
xmlHttp=new XMLHttpRequest();
}
catch (e){
// Internet Explorer
try{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e){
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
</script>
</head>
<body>
<?php
$displayLeftMenu = (isset($ident_dichotomous_loaderMenu)?$ident_dichotomous_loaderMenu:"true");
include($serverRoot.'/header.php');
if(isset($ident_dichotomous_loaderCrumbs)) echo "<div class='navpath'>".$ident_dichotomous_loaderCrumbs."</div>";
?>
<!-- This is inner text! -->
<div id="innertext">
<?php if($editable){ ?>
<div style="float:right;cursor:pointer;" onclick="javascript:toggle('editcontrols');" title="Toggle Editing on and off">
<img style="border:0px;" src="../images/edit.png"/>
</div>
<?php } ?>
<h1>Dichotomous Key Loader</h1>
<ul>
<?php
$rows = Array();
if($nodeId){
$rows = $dichoManager->echoNodeById($nodeId);
}
elseif($stmtId){
$rows = $dichoManager->echoNodeByStmtId($stmtId);
}
foreach($rows as $rowCnt => $row){
if($rowCnt === 0 && $row["parentstmtid"]){
echo "<a href='dichotomous.php?stmtid=".$row["parentstmtid"]."'>";
echo "<img src='../images/back.png' style='height:10px;border:0px;'/> Go Back";
echo "</a>";
}
?>
<li>
<div style='clear:both;margin-top:20px;'>
<?php
echo $row["nodeid"].str_repeat("'",$rowCnt).". ".$row["statement"];
if($editable){
?>
<span class="editcontrols" style="cursor:pointer;display:none;" onclick="javascript:toggle('editdiv<?php echo $rowCnt; ?>');" title="Edit Statements">
<img style="border:0px;width:12px;margin-left:5px;" src="../images/edit.png"/>
</span>
<span class="editcontrols" style="cursor:pointer;display:none;" onclick="javascript:toggle('adddiv<?php echo $rowCnt; ?>');" title="Add a New Cuplet">
<img style="border:0px;width:12px;margin-left:5px;" src="../images/add.png"/>
</span>
<?php
}
if($row["childid"]){
if($row["tid"]) echo " [".$row["sciname"]."] ";
echo "<div style='float:right;'>".str_repeat(".",20)."GOTO ";
echo "<a href='dichotomous.php?nodeid=".$row["childid"]."'>";
echo $row["childid"];
echo "</a></div>";
}
else{
if($row["tid"]) echo "<div style='float:right;'>".str_repeat(".",20)."GOTO ".$row["sciname"]."</div>";
}
?>
</div>
<?php if($editable){ ?>
<div class="editcontrols" style="display:none;">
<div class="editdiv<?php echo $rowCnt; ?>" style="margin:10px;display:none;">
<form name="editform" action="dichotomous.php" method="get">
<fieldset style="width:360px;">
<legend>Statement Editor</legend>
<div>
Statement:
<input type="text" name="statement" value="<?php echo $row["statement"]; ?>" size="43"/>
</div>
<div>
Taxon:
<input type="text" id="taxa<?php echo $rowCnt; ?>" name="taxa" value="<?php echo $row["sciname"]; ?>" onchange="checkScinameExistance(this,'tid-<?php echo $rowCnt; ?>');" />
<input type="hidden" id="tid-<?php echo $rowCnt; ?>" name="tid" value="<?php echo $row["tid"]; ?>" />
</div>
<div>
Notes:
<input type="text" name="notes" value="<?php echo $row["notes"]; ?>" size="43"/>
</div>
<div>
<input type="hidden" name="nodeid" value="<?php echo $nodeId; ?>" />
<input type="hidden" name="stmtid" value="<?php echo $row["stmtid"]; ?>" />
<input type="submit" name="action" value="Submit Edits" />
</div>
</fieldset>
</form>
</div>
<div class="adddiv<?php echo $rowCnt; ?>" style="margin:10px;display:none;">
<form name="addform" action="dichotomous.php" method="get">
<fieldset style="width:360px;">
<legend>Add New Child Cuplet</legend>
<div style="font-weight:bold;">
Statement 1:
</div>
<div>
Statement:
<input type="text" name="statement" value="" size="43"/>
</div>
<div>
Taxon:
<input type="text" id="taxon1-<?php echo $rowCnt; ?>" name="taxon" onchange="checkScinameExistance(this,'tid1-<?php echo $rowCnt; ?>');" />
<input type="hidden" id="tid1-<?php echo $rowCnt; ?>" name="tid" value="" />
</div>
<div>
Notes:
<input type="text" name="notes" value="" size="43" />
</div>
<hr/>
<div style="font-weight:bold;">
Statement 2:
</div>
<div>
Statement:
<input type="text" name="statement2" value="" size="43" />
</div>
<div>
Taxon:
<input type="text" id="taxon2-<?php echo $rowCnt; ?>" name="taxon2" value="" onchange="checkScinameExistance(this,'tid2-<?php echo $rowCnt; ?>');"/>
<input type="hidden" id="tid2-<?php echo $rowCnt; ?>" name="tid2" value="" />
</div>
<div>
Notes:
<input type="text" name="notes2" value="" size="43" />
</div>
<div>
<input type="hidden" name="nodeid" value="<?php echo $nodeId; ?>" />
<input type="hidden" name="parentstmtid" value="<?php echo $row["stmtid"]; ?>" />
<input type="submit" name="action" value="Add New Child Cuplet" />
</div>
</fieldset>
</form>
</div>
</div>
<?php }?>
</li>
<?php } ?>
</ul>
</div>
<?php
include($serverRoot.'/footer.php');
?>
</body>
</html>
<?php
class DichoManager{
private function getConnection($type = "readonly") {
return MySQLiConnectionFactory::getCon($type);
}
public function echoNodeById($nodeId){
$sql = "SELECT DISTINCT d.nodeid, d.stmtid, d.statement, d.parentstmtid, d.tid, t.sciname, d.notes, dc.nodeid AS childid ".
"FROM dichotomouskey d LEFT JOIN taxa t ON d.tid = t.tid ".
"LEFT JOIN dichotomouskey dc ON d.stmtid = dc.parentstmtid ".
"WHERE d.nodeid = ".$nodeId." ".
"ORDER BY d.stmtid";
//echo $sql;
return $this->echoNode($sql);
}
public function echoNodeByStmtId($stmtId){
$sql = "SELECT DISTINCT d.nodeid, d.stmtid, d.statement, d.parentstmtid, d.tid, t.sciname, d.notes, dc.nodeid AS childid ".
"FROM dichotomouskey d LEFT JOIN taxa t ON d.tid = t.tid ".
"LEFT JOIN dichotomouskey dc ON d.stmtid = dc.parentstmtid ".
"WHERE d.nodeid = (SELECT d2.nodeid FROM dichotomouskey d2 WHERE d2.stmtid = $stmtId) ".
"ORDER BY d.stmtid";
return $this->echoNode($sql);
}
private function echoNode($sql){
$con = $this->getConnection();
$result = $con->query($sql);
$returnArr = Array();
$stmtCnt = 0;
while($row = $result->fetch_object()){
$returnArr[$stmtCnt]["nodeid"] = $row->nodeid;
$returnArr[$stmtCnt]["stmtid"] = $row->stmtid;
$returnArr[$stmtCnt]["statement"] = $row->statement;
$returnArr[$stmtCnt]["parentstmtid"] = $row->parentstmtid;
$returnArr[$stmtCnt]["childid"] = $row->childid;
$returnArr[$stmtCnt]["sciname"] = $row->sciname;
$returnArr[$stmtCnt]["tid"] = $row->tid;
$returnArr[$stmtCnt]["notes"] = $row->notes;
$stmtCnt++;
}
$result->close();
$con->close();
return $returnArr;
}
public function editStatement($dataArr){
$con = $this->getConnection("write");
$sql = "UPDATE dichotomouskey ".
"SET statement = '".$this->cleanString($dataArr["statement"])."',tid=".($dataArr["tid"]?$dataArr["tid"]:"\N").
",notes='".$this->cleanString($dataArr["notes"])."' ".
"WHERE stmtid = ".$dataArr["stmtid"];
//echo $sql;
if(!$con->query($sql)){
echo "<div>ERROR Updating Statement: ".$con->error."</div>";
echo "<div>SQL: ".$sql."</div>";
}
$con->close();
}
public function addCuplet($dataArr){
$parentStart=0;$parentEnd=0;
$childStart=0;$childEnd=0;
$con = $this->getConnection("write");
$sql = "SELECT di.startindex, di.endindex FROM dichotomousindex di WHERE di.nodeid = ".$dataArr["nodeid"];
//echo $sql;
$result = $con->query($sql);
if($row = $result->fetch_object()){
$parentStart = $row->startindex;
$parentEnd = $row->endindex;
}
$result->close();
$sql = "SELECT di.startindex, di.endindex ".
"FROM dichotomouskey dk INNER JOIN dichotomousindex di ON dk.nodeid = di.nodeid ".
"WHERE dk.parentstmtid = ".$dataArr["parentstmtid"];
//echo $sql;
$result = $con->query($sql);
if($row = $result->fetch_object()){
$childStart = $row->startindex;
$chidlEnd = $row->endindex;
}
$result->close();
if($childStart){
//All where start < childStart and end > childEnd -> end = +2
$con->query("UPDATE dichotomousindex SET endindex = endindex + 2 WHERE startindex < $childStart AND endindex > $childEnd");
//All where start >= childStart and end <= childEnd -> start = +1 and end = +1
$con->query("UPDATE dichotomousindex SET startindex = startindex + 1,endindex = endindex + 1 WHERE startindex >= $childStart AND endindex <= $childEnd");
//Create new node with start = childStart+1 and and end = childEnd+2
$con->query("INSERT INTO dichotomousindex (startindex, endindex) VALUES(".($childStart).",".($childEnd+2).")");
}
else{
//All ends > parentStart -> increase by 2
$con->query("UPDATE dichotomousindex SET endindex = endindex +2 WHERE endindex > ".$parentStart);
//All starts > parentStart -> increase by 2
$con->query("UPDATE dichotomousindex SET startindex = startindex + 2 WHERE startindex > ".$parentStart);
//Create new node with start = parentStart+1 and and end = parentStart+2
$con->query("INSERT INTO dichotomousindex (startindex, endindex) VALUES(".($parentStart+1).",".($parentStart+2).")");
}
$newNodeId = $con->insert_id;
$sql = "INSERT INTO dichotomouskey (nodeid,statement,parentstmtid,tid,notes) ".
"VALUES(".$newNodeId.",\"".$this->cleanString($dataArr["statement"])."\",".$dataArr["parentstmtid"].",".($dataArr["tid"]?$dataArr["tid"]:"\N").",\"".$this->cleanString($dataArr["notes"])."\") ";
if(!$con->query($sql)){
echo "<div>ERROR Loading Statement1: ".$con->error."</div>";
echo "<div>SQL: ".$sql."</div>";
}
$sql = "INSERT INTO dichotomouskey (nodeid,statement,parentstmtid,tid,notes) ".
"VALUES(".$newNodeId.",\"".$this->cleanString($dataArr["statement2"])."\",".$dataArr["parentstmtid"].",".($dataArr["tid2"]?$dataArr["tid2"]:"\N").",\"".$this->cleanString($dataArr["notes2"])."\") ";
if(!$con->query($sql)){
echo "<div>ERROR Loading Statement1: ".$con->error."</div>";
echo "<div>SQL: ".$sql."</div>";
}
$con->close();
return $newNodeId;
}
private function cleanString($str){
$str = str_replace("\"","-",$str);
$str = str_replace(chr(10),"",$str);
$str = str_replace(chr(11),"",$str);
$str = str_replace(chr(12),"",$str);
$str = str_replace(chr(13),"",$str);
return $str;
}
}
?>
| gpl-2.0 |
pablo93/TrinityCore | src/server/game/Chat/Commands/Level2.cpp | 36423 | /*
* Copyright (C) 2008-2012 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 "DatabaseEnv.h"
#include "DBCStores.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "Item.h"
#include "GameObject.h"
#include "Opcodes.h"
#include "Chat.h"
#include "MapManager.h"
#include "Language.h"
#include "World.h"
#include "GameEventMgr.h"
#include "SpellMgr.h"
#include "PoolMgr.h"
#include "AccountMgr.h"
#include "WaypointManager.h"
#include "Util.h"
#include <cctype>
#include <iostream>
#include <fstream>
#include <map>
#include "OutdoorPvPMgr.h"
#include "Transport.h"
#include "TargetedMovementGenerator.h" // for HandleNpcUnFollowCommand
#include "CreatureGroups.h"
#include "ace/INET_Addr.h"
//mute player for some times
bool ChatHandler::HandleMuteCommand(const char* args)
{
char* nameStr;
char* delayStr;
extractOptFirstArg((char*)args, &nameStr, &delayStr);
if (!delayStr)
return false;
char *mutereason = strtok(NULL, "\r");
std::string mutereasonstr = "No reason";
if (mutereason != NULL)
mutereasonstr = mutereason;
Player* target;
uint64 target_guid;
std::string target_name;
if (!extractPlayerTarget(nameStr, &target, &target_guid, &target_name))
return false;
uint32 accountId = target ? target->GetSession()->GetAccountId() : sObjectMgr->GetPlayerAccountIdByGUID(target_guid);
// find only player from same account if any
if (!target)
if (WorldSession* session = sWorld->FindSession(accountId))
target = session->GetPlayer();
uint32 notspeaktime = (uint32) atoi(delayStr);
// must have strong lesser security level
if (HasLowerSecurity (target, target_guid, true))
return false;
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME);
if (target)
{
// Target is online, mute will be in effect right away.
int64 muteTime = time(NULL) + notspeaktime * MINUTE;
target->GetSession()->m_muteTime = muteTime;
stmt->setInt64(0, muteTime);
ChatHandler(target).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notspeaktime, mutereasonstr.c_str());
}
else
{
// Target is offline, mute will be in effect starting from the next login.
int32 muteTime = -int32(notspeaktime * MINUTE);
stmt->setInt64(0, muteTime);
}
stmt->setUInt32(1, accountId);
LoginDatabase.Execute(stmt);
std::string nameLink = playerLink(target_name);
PSendSysMessage(target ? LANG_YOU_DISABLE_CHAT : LANG_COMMAND_DISABLE_CHAT_DELAYED, nameLink.c_str(), notspeaktime, mutereasonstr.c_str());
return true;
}
//unmute player
bool ChatHandler::HandleUnmuteCommand(const char* args)
{
Player* target;
uint64 target_guid;
std::string target_name;
if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name))
return false;
uint32 accountId = target ? target->GetSession()->GetAccountId() : sObjectMgr->GetPlayerAccountIdByGUID(target_guid);
// find only player from same account if any
if (!target)
if (WorldSession* session = sWorld->FindSession(accountId))
target = session->GetPlayer();
// must have strong lesser security level
if (HasLowerSecurity (target, target_guid, true))
return false;
if (target)
{
if (target->CanSpeak())
{
SendSysMessage(LANG_CHAT_ALREADY_ENABLED);
SetSentErrorMessage(true);
return false;
}
target->GetSession()->m_muteTime = 0;
}
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME);
stmt->setInt64(0, 0);
stmt->setUInt32(1, accountId);
LoginDatabase.Execute(stmt);
if (target)
ChatHandler(target).PSendSysMessage(LANG_YOUR_CHAT_ENABLED);
std::string nameLink = playerLink(target_name);
PSendSysMessage(LANG_YOU_ENABLE_CHAT, nameLink.c_str());
return true;
}
bool ChatHandler::HandleGUIDCommand(const char* /*args*/)
{
uint64 guid = m_session->GetPlayer()->GetSelection();
if (guid == 0)
{
SendSysMessage(LANG_NO_SELECTION);
SetSentErrorMessage(true);
return false;
}
PSendSysMessage(LANG_OBJECT_GUID, GUID_LOPART(guid), GUID_HIPART(guid));
return true;
}
//move item to other slot
bool ChatHandler::HandleItemMoveCommand(const char* args)
{
if (!*args)
return false;
char* pParam1 = strtok((char*)args, " ");
if (!pParam1)
return false;
char* pParam2 = strtok(NULL, " ");
if (!pParam2)
return false;
uint8 srcslot = (uint8)atoi(pParam1);
uint8 dstslot = (uint8)atoi(pParam2);
if (srcslot == dstslot)
return true;
if (!m_session->GetPlayer()->IsValidPos(INVENTORY_SLOT_BAG_0, srcslot, true))
return false;
if (!m_session->GetPlayer()->IsValidPos(INVENTORY_SLOT_BAG_0, dstslot, false))
return false;
uint16 src = ((INVENTORY_SLOT_BAG_0 << 8) | srcslot);
uint16 dst = ((INVENTORY_SLOT_BAG_0 << 8) | dstslot);
m_session->GetPlayer()->SwapItem(src, dst);
return true;
}
//demorph player or unit
bool ChatHandler::HandleDeMorphCommand(const char* /*args*/)
{
Unit* target = getSelectedUnit();
if (!target)
target = m_session->GetPlayer();
// check online security
else if (target->GetTypeId() == TYPEID_PLAYER && HasLowerSecurity((Player*)target, 0))
return false;
target->DeMorph();
return true;
}
//kick player
bool ChatHandler::HandleKickPlayerCommand(const char *args)
{
Player* target = NULL;
std::string playerName;
if (!extractPlayerTarget((char*)args, &target, NULL, &playerName))
return false;
if (m_session && target == m_session->GetPlayer())
{
SendSysMessage(LANG_COMMAND_KICKSELF);
SetSentErrorMessage(true);
return false;
}
// check online security
if (HasLowerSecurity(target, 0))
return false;
if (sWorld->getBoolConfig(CONFIG_SHOW_KICK_IN_WORLD))
sWorld->SendWorldText(LANG_COMMAND_KICKMESSAGE, playerName.c_str());
else
PSendSysMessage(LANG_COMMAND_KICKMESSAGE, playerName.c_str());
target->GetSession()->LogoutPlayer(false);
return true;
}
//show info of player
bool ChatHandler::HandlePInfoCommand(const char* args)
{
Player* target;
uint64 target_guid;
std::string target_name;
uint32 parseGUID = MAKE_NEW_GUID(atol((char*)args), 0, HIGHGUID_PLAYER);
if (sObjectMgr->GetPlayerNameByGUID(parseGUID, target_name))
{
target = sObjectMgr->GetPlayerByLowGUID(parseGUID);
target_guid = parseGUID;
}
else if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name))
return false;
uint32 accId = 0;
uint32 money = 0;
uint32 total_player_time = 0;
uint8 level = 0;
uint32 latency = 0;
uint8 race;
uint8 Class;
int64 muteTime = 0;
int64 banTime = -1;
uint32 mapId;
uint32 areaId;
uint32 phase = 0;
// get additional information from Player object
if (target)
{
// check online security
if (HasLowerSecurity(target, 0))
return false;
accId = target->GetSession()->GetAccountId();
money = target->GetMoney();
total_player_time = target->GetTotalPlayedTime();
level = target->getLevel();
latency = target->GetSession()->GetLatency();
race = target->getRace();
Class = target->getClass();
muteTime = target->GetSession()->m_muteTime;
mapId = target->GetMapId();
areaId = target->GetAreaId();
phase = target->GetPhaseMask();
}
// get additional information from DB
else
{
// check offline security
if (HasLowerSecurity(NULL, target_guid))
return false;
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_PINFO);
stmt->setUInt32(0, GUID_LOPART(target_guid));
PreparedQueryResult result = CharacterDatabase.Query(stmt);
if (!result)
return false;
Field* fields = result->Fetch();
total_player_time = fields[0].GetUInt32();
level = fields[1].GetUInt8();
money = fields[2].GetUInt32();
accId = fields[3].GetUInt32();
race = fields[4].GetUInt8();
Class = fields[5].GetUInt8();
mapId = fields[6].GetUInt16();
areaId = fields[7].GetUInt16();
}
std::string username = GetTrinityString(LANG_ERROR);
std::string email = GetTrinityString(LANG_ERROR);
std::string last_ip = GetTrinityString(LANG_ERROR);
uint32 security = 0;
std::string last_login = GetTrinityString(LANG_ERROR);
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_PINFO);
stmt->setInt32(0, int32(realmID));
stmt->setUInt32(1, accId);
PreparedQueryResult result = LoginDatabase.Query(stmt);
if (result)
{
Field* fields = result->Fetch();
username = fields[0].GetString();
security = fields[1].GetUInt8();
email = fields[2].GetString();
muteTime = fields[5].GetUInt64();
if (email.empty())
email = "-";
if (!m_session || m_session->GetSecurity() >= AccountTypes(security))
{
last_ip = fields[3].GetString();
last_login = fields[4].GetString();
uint32 ip = inet_addr(last_ip.c_str());
#if TRINITY_ENDIAN == BIGENDIAN
EndianConvertReverse(ip);
#endif
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_IP2NATION_COUNTRY);
stmt->setUInt32(0, ip);
PreparedQueryResult result2 = WorldDatabase.Query(stmt);
if (result2)
{
Field* fields2 = result2->Fetch();
last_ip.append(" (");
last_ip.append(fields2[0].GetString());
last_ip.append(")");
}
}
else
{
last_ip = "-";
last_login = "-";
}
}
std::string nameLink = playerLink(target_name);
PSendSysMessage(LANG_PINFO_ACCOUNT, (target?"":GetTrinityString(LANG_OFFLINE)), nameLink.c_str(), GUID_LOPART(target_guid), username.c_str(), accId, email.c_str(), security, last_ip.c_str(), last_login.c_str(), latency);
std::string bannedby = "unknown";
std::string banreason = "";
stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_PINFO_BANS);
stmt->setUInt32(0, accId);
PreparedQueryResult result2 = LoginDatabase.Query(stmt);
if (!result2)
{
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PINFO_BANS);
stmt->setUInt32(0, GUID_LOPART(target_guid));
result2 = CharacterDatabase.Query(stmt);
}
if (result2)
{
Field* fields = result2->Fetch();
banTime = int64(fields[1].GetBool() ? 0 : fields[0].GetUInt32());
bannedby = fields[2].GetString();
banreason = fields[3].GetString();
}
if (muteTime > 0)
PSendSysMessage(LANG_PINFO_MUTE, secsToTimeString(muteTime - time(NULL), true).c_str());
if (banTime >= 0)
PSendSysMessage(LANG_PINFO_BAN, banTime > 0 ? secsToTimeString(banTime - time(NULL), true).c_str() : "permanently", bannedby.c_str(), banreason.c_str());
std::string race_s, Class_s;
switch (race)
{
case RACE_HUMAN: race_s = "Human"; break;
case RACE_ORC: race_s = "Orc"; break;
case RACE_DWARF: race_s = "Dwarf"; break;
case RACE_NIGHTELF: race_s = "Night Elf"; break;
case RACE_UNDEAD_PLAYER: race_s = "Undead"; break;
case RACE_TAUREN: race_s = "Tauren"; break;
case RACE_GNOME: race_s = "Gnome"; break;
case RACE_TROLL: race_s = "Troll"; break;
case RACE_BLOODELF: race_s = "Blood Elf"; break;
case RACE_DRAENEI: race_s = "Draenei"; break;
}
switch (Class)
{
case CLASS_WARRIOR: Class_s = "Warrior"; break;
case CLASS_PALADIN: Class_s = "Paladin"; break;
case CLASS_HUNTER: Class_s = "Hunter"; break;
case CLASS_ROGUE: Class_s = "Rogue"; break;
case CLASS_PRIEST: Class_s = "Priest"; break;
case CLASS_DEATH_KNIGHT: Class_s = "Death Knight"; break;
case CLASS_SHAMAN: Class_s = "Shaman"; break;
case CLASS_MAGE: Class_s = "Mage"; break;
case CLASS_WARLOCK: Class_s = "Warlock"; break;
case CLASS_DRUID: Class_s = "Druid"; break;
}
std::string timeStr = secsToTimeString(total_player_time, true, true);
uint32 gold = money /GOLD;
uint32 silv = (money % GOLD) / SILVER;
uint32 copp = (money % GOLD) % SILVER;
PSendSysMessage(LANG_PINFO_LEVEL, race_s.c_str(), Class_s.c_str(), timeStr.c_str(), level, gold, silv, copp);
// Add map, zone, subzone and phase to output
int locale = GetSessionDbcLocale();
std::string areaName = "<unknown>";
std::string zoneName = "";
MapEntry const* map = sMapStore.LookupEntry(mapId);
AreaTableEntry const* area = GetAreaEntryByAreaID(areaId);
if (area)
{
areaName = area->area_name[locale];
AreaTableEntry const* zone = GetAreaEntryByAreaID(area->zone);
if (zone)
zoneName = zone->area_name[locale];
}
if (target)
{
if (!zoneName.empty())
PSendSysMessage(LANG_PINFO_MAP_ONLINE, map->name[locale], zoneName.c_str(), areaName.c_str(), phase);
else
PSendSysMessage(LANG_PINFO_MAP_ONLINE, map->name[locale], areaName.c_str(), "<unknown>", phase);
}
else
PSendSysMessage(LANG_PINFO_MAP_OFFLINE, map->name[locale], areaName.c_str());
return true;
}
//rename characters
bool ChatHandler::HandleCharacterRenameCommand(const char* args)
{
Player* target;
uint64 targetGuid;
std::string targetName;
if (!extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
return false;
if (target)
{
// check online security
if (HasLowerSecurity(target, 0))
return false;
PSendSysMessage(LANG_RENAME_PLAYER, GetNameLink(target).c_str());
target->SetAtLoginFlag(AT_LOGIN_RENAME);
}
else
{
// check offline security
if (HasLowerSecurity(NULL, targetGuid))
return false;
std::string oldNameLink = playerLink(targetName);
PSendSysMessage(LANG_RENAME_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid));
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
stmt->setUInt16(0, uint16(AT_LOGIN_RENAME));
stmt->setUInt32(1, GUID_LOPART(targetGuid));
CharacterDatabase.Execute(stmt);
}
return true;
}
// customize characters
bool ChatHandler::HandleCharacterCustomizeCommand(const char* args)
{
Player* target;
uint64 targetGuid;
std::string targetName;
if (!extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
return false;
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
stmt->setUInt16(0, uint16(AT_LOGIN_CUSTOMIZE));
if (target)
{
PSendSysMessage(LANG_CUSTOMIZE_PLAYER, GetNameLink(target).c_str());
target->SetAtLoginFlag(AT_LOGIN_CUSTOMIZE);
stmt->setUInt32(1, target->GetGUIDLow());
}
else
{
std::string oldNameLink = playerLink(targetName);
stmt->setUInt32(1, GUID_LOPART(targetGuid));
PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid));
}
CharacterDatabase.Execute(stmt);
return true;
}
bool ChatHandler::HandleCharacterChangeFactionCommand(const char* args)
{
Player* target;
uint64 targetGuid;
std::string targetName;
if (!extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
return false;
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
stmt->setUInt16(0, uint16(AT_LOGIN_CHANGE_FACTION));
if (target)
{
PSendSysMessage(LANG_CUSTOMIZE_PLAYER, GetNameLink(target).c_str());
target->SetAtLoginFlag(AT_LOGIN_CHANGE_FACTION);
stmt->setUInt32(1, target->GetGUIDLow());
}
else
{
std::string oldNameLink = playerLink(targetName);
PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid));
stmt->setUInt32(1, GUID_LOPART(targetGuid));
}
CharacterDatabase.Execute(stmt);
return true;
}
bool ChatHandler::HandleCharacterChangeRaceCommand(const char * args)
{
Player* target;
uint64 targetGuid;
std::string targetName;
if (!extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
return false;
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
stmt->setUInt16(0, uint16(AT_LOGIN_CHANGE_RACE));
if (target)
{
// TODO : add text into database
PSendSysMessage(LANG_CUSTOMIZE_PLAYER, GetNameLink(target).c_str());
target->SetAtLoginFlag(AT_LOGIN_CHANGE_RACE);
stmt->setUInt32(1, target->GetGUIDLow());
}
else
{
std::string oldNameLink = playerLink(targetName);
// TODO : add text into database
PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid));
stmt->setUInt32(1, GUID_LOPART(targetGuid));
}
CharacterDatabase.Execute(stmt);
return true;
}
bool ChatHandler::HandleCharacterReputationCommand(const char* args)
{
Player* target;
if (!extractPlayerTarget((char*)args, &target))
return false;
LocaleConstant loc = GetSessionDbcLocale();
FactionStateList const& targetFSL = target->GetReputationMgr().GetStateList();
for (FactionStateList::const_iterator itr = targetFSL.begin(); itr != targetFSL.end(); ++itr)
{
const FactionState& faction = itr->second;
FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction.ID);
char const* factionName = factionEntry ? factionEntry->name[loc] : "#Not found#";
ReputationRank rank = target->GetReputationMgr().GetRank(factionEntry);
std::string rankName = GetTrinityString(ReputationRankStrIndex[rank]);
std::ostringstream ss;
if (m_session)
ss << faction.ID << " - |cffffffff|Hfaction:" << faction.ID << "|h[" << factionName << ' ' << localeNames[loc] << "]|h|r";
else
ss << faction.ID << " - " << factionName << ' ' << localeNames[loc];
ss << ' ' << rankName << " (" << target->GetReputationMgr().GetReputation(factionEntry) << ')';
if (faction.Flags & FACTION_FLAG_VISIBLE)
ss << GetTrinityString(LANG_FACTION_VISIBLE);
if (faction.Flags & FACTION_FLAG_AT_WAR)
ss << GetTrinityString(LANG_FACTION_ATWAR);
if (faction.Flags & FACTION_FLAG_PEACE_FORCED)
ss << GetTrinityString(LANG_FACTION_PEACE_FORCED);
if (faction.Flags & FACTION_FLAG_HIDDEN)
ss << GetTrinityString(LANG_FACTION_HIDDEN);
if (faction.Flags & FACTION_FLAG_INVISIBLE_FORCED)
ss << GetTrinityString(LANG_FACTION_INVISIBLE_FORCED);
if (faction.Flags & FACTION_FLAG_INACTIVE)
ss << GetTrinityString(LANG_FACTION_INACTIVE);
SendSysMessage(ss.str().c_str());
}
return true;
}
bool ChatHandler::HandleLookupEventCommand(const char* args)
{
if (!*args)
return false;
std::string namepart = args;
std::wstring wnamepart;
// converting string that we try to find to lower case
if (!Utf8toWStr(namepart, wnamepart))
return false;
wstrToLower(wnamepart);
bool found = false;
uint32 count = 0;
uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap();
GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr->GetActiveEventList();
for (uint32 id = 0; id < events.size(); ++id)
{
GameEventData const& eventData = events[id];
std::string descr = eventData.description;
if (descr.empty())
continue;
if (Utf8FitTo(descr, wnamepart))
{
if (maxResults && count++ == maxResults)
{
PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
return true;
}
char const* active = activeEvents.find(id) != activeEvents.end() ? GetTrinityString(LANG_ACTIVE) : "";
if (m_session)
PSendSysMessage(LANG_EVENT_ENTRY_LIST_CHAT, id, id, eventData.description.c_str(), active);
else
PSendSysMessage(LANG_EVENT_ENTRY_LIST_CONSOLE, id, eventData.description.c_str(), active);
if (!found)
found = true;
}
}
if (!found)
SendSysMessage(LANG_NOEVENTFOUND);
return true;
}
bool ChatHandler::HandleCombatStopCommand(const char* args)
{
Player* target = NULL;
if (args && strlen(args) > 0)
{
target = sObjectAccessor->FindPlayerByName(args);
if (!target)
{
SendSysMessage(LANG_PLAYER_NOT_FOUND);
SetSentErrorMessage(true);
return false;
}
}
if (!target)
if (!extractPlayerTarget((char*)args, &target))
return false;
// check online security
if (HasLowerSecurity(target, 0))
return false;
target->CombatStop();
target->getHostileRefManager().deleteReferences();
return true;
}
bool ChatHandler::HandleLookupPlayerIpCommand(const char* args)
{
std::string ip;
int32 limit;
char* limit_str;
Player *chr = getSelectedPlayer();
if (!*args)
{
// NULL only if used from console
if (!chr || chr == GetSession()->GetPlayer())
return false;
ip = chr->GetSession()->GetRemoteAddress();
limit = -1;
}
else
{
ip = strtok ((char*)args, " ");
limit_str = strtok (NULL, " ");
limit = limit_str ? atoi (limit_str) : -1;
}
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BY_IP);
stmt->setString(0, ip);
PreparedQueryResult result = LoginDatabase.Query(stmt);
return LookupPlayerSearchCommand(result, limit);
}
bool ChatHandler::HandleLookupPlayerAccountCommand(const char* args)
{
if (!*args)
return false;
std::string account = strtok ((char*)args, " ");
char* limit_str = strtok (NULL, " ");
int32 limit = limit_str ? atoi (limit_str) : -1;
if (!AccountMgr::normalizeString (account))
return false;
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_LIST_BY_NAME);
stmt->setString(0, account);
PreparedQueryResult result = LoginDatabase.Query(stmt);
return LookupPlayerSearchCommand (result, limit);
}
bool ChatHandler::HandleLookupPlayerEmailCommand(const char* args)
{
if (!*args)
return false;
std::string email = strtok ((char*)args, " ");
char* limit_str = strtok (NULL, " ");
int32 limit = limit_str ? atoi (limit_str) : -1;
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_LIST_BY_EMAIL);
stmt->setString(0, email);
PreparedQueryResult result = LoginDatabase.Query(stmt);
return LookupPlayerSearchCommand(result, limit);
}
bool ChatHandler::LookupPlayerSearchCommand(PreparedQueryResult result, int32 limit)
{
if (!result)
{
PSendSysMessage(LANG_NO_PLAYERS_FOUND);
SetSentErrorMessage(true);
return false;
}
int i = 0;
uint32 count = 0;
uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
do
{
if (maxResults && count++ == maxResults)
{
PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
return true;
}
Field* fields = result->Fetch();
uint32 acc_id = fields[0].GetUInt32();
std::string acc_name = fields[1].GetString();
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_GUID_NAME_BY_ACC);
stmt->setUInt32(0, acc_id);
PreparedQueryResult result2 = CharacterDatabase.Query(stmt);
if (result2)
{
PSendSysMessage(LANG_LOOKUP_PLAYER_ACCOUNT, acc_name.c_str(), acc_id);
uint64 guid = 0;
std::string name;
do
{
Field* charfields = result2->Fetch();
guid = charfields[0].GetUInt64();
name = charfields[1].GetString();
PSendSysMessage(LANG_LOOKUP_PLAYER_CHARACTER, name.c_str(), guid);
++i;
} while (result2->NextRow() && (limit == -1 || i < limit));
}
} while (result->NextRow());
if (i == 0) // empty accounts only
{
PSendSysMessage(LANG_NO_PLAYERS_FOUND);
SetSentErrorMessage(true);
return false;
}
return true;
}
/// Triggering corpses expire check in world
bool ChatHandler::HandleServerCorpsesCommand(const char* /*args*/)
{
sObjectAccessor->RemoveOldCorpses();
return true;
}
bool ChatHandler::HandleRepairitemsCommand(const char* args)
{
Player* target;
if (!extractPlayerTarget((char*)args, &target))
return false;
// check online security
if (HasLowerSecurity(target, 0))
return false;
// Repair items
target->DurabilityRepairAll(false, 0, false);
PSendSysMessage(LANG_YOU_REPAIR_ITEMS, GetNameLink(target).c_str());
if (needReportToTarget(target))
ChatHandler(target).PSendSysMessage(LANG_YOUR_ITEMS_REPAIRED, GetNameLink().c_str());
return true;
}
bool ChatHandler::HandleWaterwalkCommand(const char* args)
{
if (!*args)
return false;
Player* player = getSelectedPlayer();
if (!player)
{
PSendSysMessage(LANG_NO_CHAR_SELECTED);
SetSentErrorMessage(true);
return false;
}
// check online security
if (HasLowerSecurity(player, 0))
return false;
if (strncmp(args, "on", 3) == 0)
player->SetMovement(MOVE_WATER_WALK); // ON
else if (strncmp(args, "off", 4) == 0)
player->SetMovement(MOVE_LAND_WALK); // OFF
else
{
SendSysMessage(LANG_USE_BOL);
return false;
}
PSendSysMessage(LANG_YOU_SET_WATERWALK, args, GetNameLink(player).c_str());
if (needReportToTarget(player))
ChatHandler(player).PSendSysMessage(LANG_YOUR_WATERWALK_SET, args, GetNameLink().c_str());
return true;
}
bool ChatHandler::HandleCreatePetCommand(const char* /*args*/)
{
Player* player = m_session->GetPlayer();
Creature* creatureTarget = getSelectedCreature();
if (!creatureTarget || creatureTarget->isPet() || creatureTarget->GetTypeId() == TYPEID_PLAYER)
{
PSendSysMessage(LANG_SELECT_CREATURE);
SetSentErrorMessage(true);
return false;
}
CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(creatureTarget->GetEntry());
// Creatures with family 0 crashes the server
if (cInfo->family == 0)
{
PSendSysMessage("This creature cannot be tamed. (family id: 0).");
SetSentErrorMessage(true);
return false;
}
if (player->GetPetGUID())
{
PSendSysMessage("You already have a pet");
SetSentErrorMessage(true);
return false;
}
// Everything looks OK, create new pet
Pet* pet = new Pet(player, HUNTER_PET);
if (!pet->CreateBaseAtCreature(creatureTarget))
{
delete pet;
PSendSysMessage("Error 1");
return false;
}
creatureTarget->setDeathState(JUST_DIED);
creatureTarget->RemoveCorpse();
creatureTarget->SetHealth(0); // just for nice GM-mode view
pet->SetUInt64Value(UNIT_FIELD_CREATEDBY, player->GetGUID());
pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, player->getFaction());
if (!pet->InitStatsForLevel(creatureTarget->getLevel()))
{
sLog->outError("InitStatsForLevel() in EffectTameCreature failed! Pet deleted.");
PSendSysMessage("Error 2");
delete pet;
return false;
}
// prepare visual effect for levelup
pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->getLevel()-1);
pet->GetCharmInfo()->SetPetNumber(sObjectMgr->GeneratePetNumber(), true);
// this enables pet details window (Shift+P)
pet->InitPetCreateSpells();
pet->SetFullHealth();
pet->GetMap()->AddToMap(pet->ToCreature());
// visual effect for levelup
pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->getLevel());
player->SetMinion(pet, true);
pet->SavePetToDB(PET_SAVE_AS_CURRENT);
player->PetSpellInitialize();
return true;
}
bool ChatHandler::HandlePetLearnCommand(const char* args)
{
if (!*args)
return false;
Player* player = m_session->GetPlayer();
Pet* pet = player->GetPet();
if (!pet)
{
PSendSysMessage("You have no pet");
SetSentErrorMessage(true);
return false;
}
uint32 spellId = extractSpellIdFromLink((char*)args);
if (!spellId || !sSpellMgr->GetSpellInfo(spellId))
return false;
// Check if pet already has it
if (pet->HasSpell(spellId))
{
PSendSysMessage("Pet already has spell: %u", spellId);
SetSentErrorMessage(true);
return false;
}
// Check if spell is valid
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo))
{
PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spellId);
SetSentErrorMessage(true);
return false;
}
pet->learnSpell(spellId);
PSendSysMessage("Pet has learned spell %u", spellId);
return true;
}
bool ChatHandler::HandlePetUnlearnCommand(const char *args)
{
if (!*args)
return false;
Player* player = m_session->GetPlayer();
Pet* pet = player->GetPet();
if (!pet)
{
PSendSysMessage("You have no pet");
SetSentErrorMessage(true);
return false;
}
uint32 spellId = extractSpellIdFromLink((char*)args);
if (pet->HasSpell(spellId))
pet->removeSpell(spellId, false);
else
PSendSysMessage("Pet doesn't have that spell");
return true;
}
bool ChatHandler::HandleLookupTitleCommand(const char* args)
{
if (!*args)
return false;
// can be NULL in console call
Player* target = getSelectedPlayer();
// title name have single string arg for player name
char const* targetName = target ? target->GetName() : "NAME";
std::string namepart = args;
std::wstring wnamepart;
if (!Utf8toWStr(namepart, wnamepart))
return false;
// converting string that we try to find to lower case
wstrToLower(wnamepart);
uint32 counter = 0; // Counter for figure out that we found smth.
uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
// Search in CharTitles.dbc
for (uint32 id = 0; id < sCharTitlesStore.GetNumRows(); id++)
{
CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(id);
if (titleInfo)
{
int loc = GetSessionDbcLocale();
std::string name = titleInfo->name[loc];
if (name.empty())
continue;
if (!Utf8FitTo(name, wnamepart))
{
loc = 0;
for (; loc < TOTAL_LOCALES; ++loc)
{
if (loc == GetSessionDbcLocale())
continue;
name = titleInfo->name[loc];
if (name.empty())
continue;
if (Utf8FitTo(name, wnamepart))
break;
}
}
if (loc < TOTAL_LOCALES)
{
if (maxResults && counter == maxResults)
{
PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
return true;
}
char const* knownStr = target && target->HasTitle(titleInfo) ? GetTrinityString(LANG_KNOWN) : "";
char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index
? GetTrinityString(LANG_ACTIVE)
: "";
char titleNameStr[80];
snprintf(titleNameStr, 80, name.c_str(), targetName);
// send title in "id (idx:idx) - [namedlink locale]" format
if (m_session)
PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->bit_index, id, titleNameStr, localeNames[loc], knownStr, activeStr);
else
PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, titleNameStr, localeNames[loc], knownStr, activeStr);
++counter;
}
}
}
if (counter == 0) // if counter == 0 then we found nth
SendSysMessage(LANG_COMMAND_NOTITLEFOUND);
return true;
}
bool ChatHandler::HandleCharacterTitlesCommand(const char* args)
{
if (!*args)
return false;
Player* target;
if (!extractPlayerTarget((char*)args, &target))
return false;
LocaleConstant loc = GetSessionDbcLocale();
char const* targetName = target->GetName();
char const* knownStr = GetTrinityString(LANG_KNOWN);
// Search in CharTitles.dbc
for (uint32 id = 0; id < sCharTitlesStore.GetNumRows(); id++)
{
CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(id);
if (titleInfo && target->HasTitle(titleInfo))
{
std::string name = titleInfo->name[loc];
if (name.empty())
continue;
char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index
? GetTrinityString(LANG_ACTIVE)
: "";
char titleNameStr[80];
snprintf(titleNameStr, 80, name.c_str(), targetName);
// send title in "id (idx:idx) - [namedlink locale]" format
if (m_session)
PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->bit_index, id, titleNameStr, localeNames[loc], knownStr, activeStr);
else
PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, name.c_str(), localeNames[loc], knownStr, activeStr);
}
}
return true;
}
| gpl-2.0 |
RedXBeard/deployapp | config.py | 2031 | from kivy.storage.jsonstore import JsonStore
from subprocess import Popen, PIPE
from os import path, makedirs
from kivy import __version__
def run_command(command):
process = Popen(command, stdout=PIPE)
while True:
output = process.stdout.readline()
if output == '' and process.poll() is not None:
break
if output:
print output.strip()
rc = process.poll()
return rc
def run_syscall(cmd, serve_output=False):
"""
run_syscall; handle sys calls this function used as shortcut.
::cmd: String, shell command is expected.
"""
# import time
p = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE)
out, err = p.communicate()
# out, err = "", ""
# while p.poll() in (None, 0, 1):
# output = p.stdout.readline()
# error = p.stderr.readline()
# out += output
# err += error
# print output, error
# if output == "":
# break
# time.sleep(1)
# try:
# p.terminate()
# except OSError:
# pass
return out.rstrip(), err.rstrip()
PATH_SEPERATOR = '\\' if path.realpath(__file__).find('\\') != -1 else '/'
PROJECT_PATH = PATH_SEPERATOR.join(
path.realpath(__file__).split(PATH_SEPERATOR)[:-1]
)
if PATH_SEPERATOR == '/':
cmd = "echo $HOME"
else:
cmd = "echo %USERPROFILE%"
out, err = run_syscall(cmd)
DATAFILE = "%(out)s%(ps)s.kivydeployapp%(ps)sdeployapp" % {
'out': out.rstrip(),
'ps': PATH_SEPERATOR
}
KIVY_VERSION = __version__
DB = JsonStore(DATAFILE)
directory = path.dirname(DATAFILE)
if not path.exists(directory):
makedirs(directory)
DB.store_put('servers', [])
DB.store_put('username', "")
DB.store_put('password', "")
DB.store_sync()
if not DB.store_exists('servers'):
DB.store_put('servers', [])
DB.store_sync()
if not DB.store_exists('username'):
DB.store_put('username', "")
DB.store_sync()
if not DB.store_exists('password'):
DB.store_put('password', "")
DB.store_sync()
| gpl-2.0 |
sarahkpeck/it-starts-with | wp-content/themes/headway/library/admin/admin.php | 19345 | <?php
class HeadwayAdmin {
public static function init() {
self::setup_hooks();
Headway::load(array(
'api/api-admin-meta-box',
'admin/admin-write' => true,
'admin/admin-pages',
'admin/api-admin-inputs'
));
}
public static function setup_hooks() {
/* Actions */
add_action('admin_init', array(__CLASS__, 'activation'), 1);
add_action('admin_init', array(__CLASS__, 'enqueue'));
add_action('admin_init', array(__CLASS__, 'visual_editor_redirect'), 12);
add_action('init', array(__CLASS__, 'form_action_save'), 12); // Init runs before admin_menu; admin_menu runs before admin_init
add_action('init', array(__CLASS__, 'form_action_licenses'), 12);
add_action('init', array(__CLASS__, 'form_action_reset'), 12);
add_action('init', array(__CLASS__, 'form_action_maintenance'), 12);
add_action('admin_menu', array(__CLASS__, 'add_menus'));
add_action('headway_admin_save_message', array(__CLASS__, 'save_message'));
add_action('admin_notices', array(__CLASS__, 'notice_no_widgets_or_menus'));
add_action('admin_notices', array(__CLASS__, 'notice_no_license'));
add_filter('plugins_api', array(__CLASS__, 'get_addon_info'), 10, 3);
add_filter('themes_api', array(__CLASS__, 'get_addon_info'), 10, 3);
add_filter('page_row_actions', array(__CLASS__, 'row_action_visual_editor'), 10, 2);
add_filter('post_row_actions', array(__CLASS__, 'row_action_visual_editor'), 10, 2);
add_filter('tag_row_actions', array(__CLASS__, 'row_action_visual_editor'), 10, 2);
}
public static function form_action_licenses() {
if ( !headway_post('headway-licenses', false))
return false;
if ( !wp_verify_nonce(headway_post('headway-admin-nonce', false), 'headway-admin-nonce') )
return false;
if ( !is_array(headway_post('headway-licenses')) )
return false;
global $headway_admin_save_message;
global $headway_admin_save_error_message;
/* Save and activations */
if ( $save_and_activations = headway_get('save-and-activate', headway_post('headway-licenses')) ) {
if ( is_array($save_and_activations) && count($save_and_activations) ) {
foreach ( $save_and_activations as $item_slug_to_activate => $submit_value ) {
HeadwayOption::set('license-key-' . $item_slug_to_activate, headway_get('license-key-' . $item_slug_to_activate, headway_post('headway-admin-input')));
$activation_request = headway_activate_license($item_slug_to_activate);
self::set_license_activation_message($activation_request);
}
}
}
/* Activations */
if ( $activations = headway_get('activate', headway_post('headway-licenses')) ) {
if ( is_array($activations) && count($activations) ) {
foreach ( headway_get('activate', headway_post('headway-licenses')) as $item_slug_to_activate => $submit_value ) {
$activation_request = headway_activate_license($item_slug_to_activate);
self::set_license_activation_message($activation_request);
}
}
}
/* Deactivations */
if ( $deactivations = headway_get('deactivate', headway_post('headway-licenses')) ) {
if ( is_array($deactivations) && count($deactivations) ) {
foreach ( headway_get('deactivate', headway_post('headway-licenses')) as $item_slug_to_deactivate => $submit_value ) {
$deactivation_request = headway_deactivate_license($item_slug_to_deactivate);
if ( $deactivation_request == 'deactivated' ) {
$headway_admin_save_message = 'License deactivated.';
} else if ( !is_wp_error($deactivation_request) ) {
$headway_admin_save_error_message = '<strong>Whoops!</strong> Could not deactivate license. Please check that you have entered your license correctly.';
} else {
$headway_admin_save_error_message = '
<strong>Error While Deactivating:</strong> (' . $deactivation_request->get_error_code() . ') ' . $deactivation_request->get_error_message() . '<br /><br />
' . __('Please contact Headway Support if this error persists.', 'headway') . '
';
}
}
}
}
return true;
}
public static function set_license_activation_message($activation_request) {
global $headway_admin_save_message;
global $headway_admin_save_error_message;
if ( $activation_request == 'active' || $activation_request == 'valid' ) {
$headway_admin_save_message = __('License saved and activated.', 'headway');
} else if ( $activation_request == 'invalid' || $activation_request == 'expired' ) {
$headway_admin_save_error_message = __('
<strong>Whoops!</strong> Could not activate license. Please check that you have entered your license correctly and that it has not expired.<br /><br />
Make sure you copied your license correctly from the <a href="http://headwaythemes.com/dashboard" target="_blank">Headway Dashboard</a>.
', 'headway');
} else if ( is_wp_error($activation_request) ) {
$headway_admin_save_error_message = '
<strong>Error While Activating:</strong> (' . $activation_request->get_error_code() . ') ' . $activation_request->get_error_message() . '<br /><br />
' . __('Please contact Headway Support if this error persists.', 'headway') . '
';
}
}
public static function form_action_save() {
//Form action for all Headway configuration panels. Not in function/hook so it can load before everything else.
if ( !headway_post('headway-submit', false))
return false;
if ( !wp_verify_nonce(headway_post('headway-admin-nonce', false), 'headway-admin-nonce') ) {
global $headway_admin_save_message;
$headway_admin_save_message = 'Security nonce did not match.';
return false;
}
foreach ( headway_post('headway-admin-input', array()) as $option => $value ) {
HeadwayOption::set($option, $value);
}
global $headway_admin_save_message;
$headway_admin_save_message = 'Settings saved.';
return true;
}
public static function form_action_reset() {
//Form action for all Headway configuration panels. Not in function/hook so it can load before everything else.
if ( !headway_post('reset-headway', false) )
return false;
//Verify the nonce so other sites can't maliciously reset a Headway installation.
if ( !wp_verify_nonce(headway_post('headway-reset-nonce', false), 'headway-reset-nonce') ) {
$GLOBALS['headway_admin_save_message'] = 'Security nonce did not match.';
return false;
}
//Fetch all options in wp_options and remove the Headway-specific options
foreach ( wp_load_alloptions() as $option => $option_value ) {
//This if statement is incredibly important and must not be tampered with and needs to be triple-checked if changed.
if ( strpos($option, 'headway_option_') === 0 || strpos($option, 'headway_layout_options_') === 0 || $option === 'headway' ) {
delete_option($option);
}
}
do_action('headway_global_reset');
$GLOBALS['headway_admin_save_message'] = 'Headway was successfully reset.';
//This will hide the reset box if set to true.
$GLOBALS['headway_reset_success'] = true;
return true;
}
public static function form_action_maintenance() {
//Form action for all Headway configuration panels. Not in function/hook so it can load before everything else.
if ( !headway_post('headway-maintenance-nonce', false) )
return false;
//Check the nonce for security
if ( !wp_verify_nonce(headway_post('headway-maintenance-nonce', false), 'headway-maintenance-nonce') ) {
$GLOBALS['headway_admin_save_message'] = 'Security nonce did not match.';
return false;
}
//Load the maintenance class
Headway::load('common/maintenance');
//Handle block repair
if ( headway_post('repair-blocks', false) ) {
HeadwayMaintenance::repair_blocks();
$GLOBALS['headway_admin_save_message'] = 'Blocks have successfully been repaired.';
}
return true;
}
public static function activation() {
if ( !is_admin() || !headway_get('activated') )
return false;
global $pagenow;
if ( $pagenow !== 'themes.php' )
return false;
//Track the version number in the DB
$headway_settings = get_option('headway', array('version' => 0));
if ( version_compare($headway_settings['version'], HEADWAY_VERSION, '<=') )
$headway_settings['version'] = HEADWAY_VERSION;
update_option('headway', $headway_settings);
//Since they may be upgrading and files may change, let's clear the cache
do_action('headway_activation');
self::activation_redirect();
}
public static function activation_redirect() {
do_action('headway_activation_redirect');
//If a child theme has been activated rather than Headway, then don't redirect.
//Let the child theme developer redirect if they want by using the hook above.
if ( HEADWAY_CHILD_THEME_ACTIVE === true )
return false;
$parent_menu = self::parent_menu();
//If header were sent, then don't do the redirect
if ( headers_sent() )
return false;
//We're all good, redirect now
wp_safe_redirect(admin_url('admin.php?page=headway-' . $parent_menu['id']));
die();
}
public static function visual_editor_redirect() {
if ( isset($_GET['page']) && strpos($_GET['page'], 'headway-visual-editor') !== false && !headers_sent() )
wp_safe_redirect(home_url() . '/?visual-editor=true');
}
public static function add_admin_separator($position){
global $menu;
$menu[$position] = array('', 'read', 'separator-headway', '', 'wp-menu-separator headway-separator');
ksort($menu);
}
public static function add_admin_submenu($name, $id, $callback) {
$parent_menu = self::parent_menu();
return add_submenu_page('headway-' . $parent_menu['id'], $name, $name, 'manage_options', $id, $callback);
}
public static function add_menus(){
//If the hide menus constant is set to true, don't hide the menus!
if (defined('HEADWAY_HIDE_MENUS') && HEADWAY_HIDE_MENUS === true)
return false;
//If user cannot access the admin panels, then don't bother running these functions
if ( !HeadwayCapabilities::can_user_visually_edit() )
return false;
$menu_name = ( HeadwayOption::get('hide-menu-version-number') == true ) ? 'Headway' : 'Headway ' . HEADWAY_VERSION;
$icon_url = headway_url() . '/library/admin/images/headway-16.png';
$parent_menu = self::parent_menu();
self::add_admin_separator(48);
add_menu_page($parent_menu['name'], $menu_name, 'manage_options', 'headway-' . $parent_menu['id'], $parent_menu['callback'], $icon_url, 49);
switch ( $parent_menu['id'] ) {
case 'getting-started':
self::add_admin_submenu('Getting Started', 'headway-getting-started', array('HeadwayAdminPages', 'getting_started'));
self::add_admin_submenu('Visual Editor', 'headway-visual-editor', array('HeadwayAdminPages', 'visual_editor'));
if ( is_main_site() )
self::add_admin_submenu('Extend', 'headway-extend', array('HeadwayAdminPages', 'extend'));
self::add_admin_submenu('Options', 'headway-options', array('HeadwayAdminPages', 'options'));
self::add_admin_submenu('Tools', 'headway-tools', array('HeadwayAdminPages', 'tools'));
break;
case 'visual-editor':
self::add_admin_submenu('Visual Editor', 'headway-visual-editor', array('HeadwayAdminPages', 'visual_editor'));
if ( is_main_site() )
self::add_admin_submenu('Extend', 'headway-extend', array('HeadwayAdminPages', 'extend'));
self::add_admin_submenu('Options', 'headway-options', array('HeadwayAdminPages', 'options'));
self::add_admin_submenu('Tools', 'headway-tools', array('HeadwayAdminPages', 'tools'));
break;
case 'options':
self::add_admin_submenu('Options', 'headway-options', array('HeadwayAdminPages', 'options'));
self::add_admin_submenu('Visual Editor', 'headway-visual-editor', array('HeadwayAdminPages', 'visual_editor'));
if ( is_main_site() )
self::add_admin_submenu('Extend', 'headway-extend', array('HeadwayAdminPages', 'extend'));
self::add_admin_submenu('Tools', 'headway-tools', array('HeadwayAdminPages', 'tools'));
break;
}
}
public static function parent_menu() {
$menu_setup = HeadwayOption::get('menu-setup', false, 'getting-started');
/* Figure out the primary page */
switch ( $menu_setup ) {
case 'getting-started':
$parent_menu = array(
'id' => 'getting-started',
'name' => 'Getting Started',
'callback' => array('HeadwayAdminPages', 'getting_started')
);
break;
case 'visual-editor':
$parent_menu = array(
'id' => 'visual-editor',
'name' => 'Visual Editor',
'callback' => array('HeadwayAdminPages', 'visual_editor')
);
break;
case 'options':
$parent_menu = array(
'id' => 'options',
'name' => 'Options',
'callback' => array('HeadwayAdminPages', 'options')
);
break;
}
return $parent_menu;
}
public static function enqueue() {
global $pagenow;
/* Global */
wp_enqueue_style('headway_admin_global', headway_url() . '/library/admin/css/admin-headway-global.css');
/* General Headway admin CSS/JS */
if ( strpos(headway_get('page'), 'headway') !== false ) {
wp_enqueue_script('headway_jquery_scrollto', headway_url() . '/library/media/js/jquery.scrollto.js', array('jquery'));
wp_enqueue_script('headway_jquery_tabby', headway_url() . '/library/media/js/jquery.tabby.js', array('jquery'));
wp_enqueue_script('headway_jquery_qtip', headway_url() . '/library/media/js/jquery.qtip.js', array('jquery'));
wp_enqueue_script('headway_admin_js', headway_url() . '/library/admin/js/admin-headway.js', array('jquery', 'headway_jquery_qtip'));
wp_enqueue_style('headway_admin', headway_url() . '/library/admin/css/admin-headway.css');
wp_enqueue_style('headway_alerts', headway_url() . '/library/media/css/alerts.css');
}
/* Extend */
if ( headway_get('page') == 'headway-extend' )
wp_enqueue_script('headway_jquery_masonry', headway_url() . '/library/media/js/jquery.masonry.js', array('jquery'));
/* Meta Boxes */
wp_enqueue_style('headway_admin_write', headway_url() . '/library/admin/css/admin-write.css');
wp_enqueue_style('headway_alerts', headway_url() . '/library/media/css/alerts.css');
wp_enqueue_script('headway_admin_write', headway_url() . '/library/admin/js/admin-write.js', array('jquery'));
}
public static function save_message() {
global $headway_admin_save_message;
if ( !isset($headway_admin_save_message) || $headway_admin_save_message == false )
return false;
echo '<div class="alert alert-green save-message"><p>' . $headway_admin_save_message . '</p></div>';
}
public static function notice_no_widgets_or_menus() {
global $pagenow;
if ( $pagenow != 'widgets.php' && $pagenow != 'nav-menus.php' )
return false;
$grid_mode_url = add_query_arg(array('visual-editor' => 'true', 'visual-editor-mode' => 'grid'), home_url());
//Show the widgets message if no widget blocks exist.
if ( $pagenow == 'widgets.php' ) {
$widget_area_blocks = HeadwayBlocksData::get_blocks_by_type('widget-area');
if ( !empty($widget_area_blocks) )
return;
if ( !current_theme_supports('headway-grid') )
return;
echo '<div class="updated" style="margin-top: 15px;">
<p>Headway has detected that you have no Widget Area blocks. If you wish to use the WordPress widgets system with Headway, please add a Widget Area block in the <a href="' . $grid_mode_url . '" target="_blank">Visual Editor: Grid</a>.</p>
<style type="text/css">
div.error.below-h2 { display: none; }
div.error.below-h2 + p { display: none; }
</style>
</div>';
}
//Show the navigation menus message if no navigation blocks exist.
if ( $pagenow == 'nav-menus.php' ) {
$navigation_blocks = HeadwayBlocksData::get_blocks_by_type('navigation');
if ( !empty($navigation_blocks) )
return;
if ( !current_theme_supports('headway-grid') )
return;
echo '<div class="updated">
<p>Headway has detected that you have no Navigation blocks. If you wish to use the WordPress menus system with Headway, please add a Navigation block in the <a href="' . $grid_mode_url . '" target="_blank">Visual Editor: Grid</a>.</p>
</div>';
}
}
public static function notice_no_license() {
if ( !headway_get_license_key('headway') ) {
echo '
<div id="update-nag">
<p><strong>Important!</strong> Your license key has changed. Please go to the <a href="http://headwaythemes.com/dashboard" target="_blank">Headway Dashboard</a> to find your new license key so you can update to the most recent version of Headway.</p>
</div>
';
}
}
public static function show_header($title = false, $icon_id = 'icon-headway') {
echo '<div class="wrap headway-page">';
echo '<div class="icon32" id="' . $icon_id . '"><br /></div>';
if ( $title )
echo '<h2>' . $title . '</h2>';
}
public static function show_footer() {
echo '</div><!-- #wrapper -->';
}
public static function get_addon_info($api, $action, $args) {
if ( !$api && headway_get('headway') ) {
/* Output */
$addon_info_request = wp_remote_post(add_query_arg(array('action' => 'addon-info'), HEADWAY_EXTEND_DATA_URL), array(
'body' => array(
'slug' => headway_get('slug'),
'license_key' => headway_get_license_key()
)
));
$addon_info = wp_remote_retrieve_body($addon_info_request);
if ( !is_serialized($addon_info) || $addon_info_request['response']['code'] != 200 )
return false;
$addon_info = maybe_unserialize($addon_info);
$api = new stdClass();
$api->name = $addon_info['name'];
$api->version = $addon_info['version'];
$api->download_link = str_replace('{KEY}', headway_get_license_key(), $addon_info['download_url']);
}
return $api;
}
public static function row_action_visual_editor($actions, $item) {
if ( !HeadwayCapabilities::can_user_visually_edit() )
return $actions;
/* Post */
if ( isset($item->post_status) ) {
if ( $item->post_status != 'publish' )
return $actions;
$post_type = get_post_type_object($item->post_type);
if ( !$post_type->public )
return $actions;
$layout_id = 'single-' . $item->post_type . '-' . $item->ID;
/* Category */
} elseif ( isset($item->term_id) && $item->taxonomy == 'category' ) {
$layout_id = 'archive-category-' . $item->term_id;
/* Post Tag */
} elseif ( isset($item->term_id) && $item->taxonomy == 'post_tag' ) {
$layout_id = 'archive-post_tag-' . $item->term_id;
/* Taxonomy */
} elseif ( isset($item->term_id) ) {
$layout_id = 'archive-taxonomy-' . $item->taxonomy . '-' . $item->term_id;
}
$visual_editor_url = home_url('/?visual-editor=true&ve-layout=' . $layout_id);
$actions['hw-visual-editor'] = '<a href="' . $visual_editor_url . '" title="Open in Headway Visual Editor" rel="permalink" target="_blank">Open in Visual Editor</a>';
return $actions;
}
} | gpl-2.0 |
ares/katello | app/lib/actions/pulp3/orchestration/repository/generate_metadata.rb | 1186 | module Actions
module Pulp3
module Orchestration
module Repository
class GenerateMetadata < Pulp3::Abstract
def plan(repository, smart_proxy, options = {})
options[:contents_changed] = (options && options.key?(:contents_changed)) ? options[:contents_changed] : true
publication_content_type = !::Katello::RepositoryTypeManager.find(repository.content_type).pulp3_skip_publication
sequence do
plan_action(Actions::Pulp3::Repository::CreateVersion, repository, smart_proxy) if options[:repository_creation]
if options[:source_repository] && publication_content_type
repository.update_attributes!(publication_href: options[:source_repository].publication_href)
elsif publication_content_type
plan_action(Actions::Pulp3::Repository::CreatePublication, repository, smart_proxy, options)
end
plan_action(Actions::Pulp3::Repository::RefreshDistribution, repository, smart_proxy, :contents_changed => options[:contents_changed]) if repository.environment
end
end
end
end
end
end
end
| gpl-2.0 |
cdparra/reminiscens-lifeapi | app/controllers/Utilities.java | 13432 | package controllers;
import static play.libs.Json.toJson;
import java.io.IOException;
import java.util.Iterator;
import java.util.List;
import org.codehaus.jackson.JsonNode;
import be.objectify.deadbolt.java.actions.SubjectPresent;
import models.User;
import play.Logger;
import play.Play;
import play.data.Form;
import play.mvc.Controller;
import play.mvc.Security;
import play.mvc.Result;
import pojos.CityBean;
import pojos.FileBean;
import pojos.ResponseStatusBean;
import security.MyDynamicResourceHandler;
import security.SecurityModelConstants;
import delegates.ContextDelegate;
import delegates.UtilitiesDelegate;
import enums.LogActions;
import enums.ResponseStatus;
public class Utilities extends Controller {
public static Form<FileBean> fileForm = Form.form(FileBean.class);
public static Result getCities() {
List<CityBean> bean = UtilitiesDelegate.getInstance().getCities();
return bean != null ? ok(toJson(bean)) : notFound();
}
public static Result getCitiesByCountryName(String country) {
List<CityBean> bean = UtilitiesDelegate.getInstance()
.getCitiesByCountryName(country);
return bean != null ? ok(toJson(bean)) : notFound();
}
public static Result getCitiesByCountryNameAndRegion(String country,
String region) {
List<CityBean> bean = UtilitiesDelegate.getInstance()
.getCitiesByCountryNameAndRegion(country, region);
return bean != null ? ok(toJson(bean)) : notFound();
}
public static Result getCityById(Long cityId) {
CityBean bean = UtilitiesDelegate.getInstance().getCitiesById(cityId);
return bean != null ? ok(toJson(bean)) : notFound();
}
public static Result getNewCities(Long lastCityId) {
List<CityBean> bean = UtilitiesDelegate.getInstance().getNewCities(
lastCityId);
return bean != null ? ok(toJson(bean)) : notFound();
}
public static Result getCitiesByName(String name) {
List<CityBean> bean = UtilitiesDelegate.getInstance().getCityByName(
name);
return bean != null ? ok(toJson(bean)) : notFound();
}
public static Result testUpload() {
return ok(views.html.upload.render());
}
// TODO merge file upload with posting of memento
@Security.Authenticated(Secured.class)
public static Result upload() {
Form<FileBean> filledForm = fileForm.bindFromRequest();
String userEmail = session().get("pa.u.id");
User user = User.getByEmail(userEmail);
if (filledForm.hasErrors()) {
ResponseStatusBean response = new ResponseStatusBean();
response.setResponseStatus(ResponseStatus.BADREQUEST);
response.setStatusMessage("play.authenticate.filledFromHasErrors:"
+ filledForm.errorsAsJson());
return badRequest(toJson(response));
} else {
play.mvc.Http.MultipartFormData body = request().body()
.asMultipartFormData();
play.mvc.Http.MultipartFormData.FilePart file = body
.getFile("file") == null ? body.getFile("files[]") : body
.getFile("file");
FileBean fileBean = filledForm.get() == null ? new FileBean()
: filledForm.get();
if (user != null) {
Logger.debug("User " + user.getEmail() + " posted a file");
fileBean.setOwner(user.getUserId());
} else {
// TODO removed once authentication is fully tested, @security
// should be enough
flash("error", "Missing file");
ResponseStatusBean response = new ResponseStatusBean();
response.setResponseStatus(ResponseStatus.UNAUTHORIZED);
response.setStatusMessage("User is information is null");
return unauthorized(toJson(response));
}
if (file != null) {
try {
fileBean = UtilitiesDelegate.getInstance().saveFile(file,
fileBean);
} catch (IOException e) {
flash("error", "Error saving file in disk");
ResponseStatusBean response = new ResponseStatusBean();
response.setResponseStatus(ResponseStatus.SERVERERROR);
response.setStatusMessage(e.getMessage());
return internalServerError(toJson(response));
}
// Log Action
int logAction = Play.application().configuration()
.getInt("log.actions");
if (logAction == 1) {
UtilitiesDelegate.getInstance().logActivity(user,
LogActions.FILE_NEW.toString(), request().path());
}
return ok(toJson(fileBean));
} else {
flash("error", "Missing file");
ResponseStatusBean response = new ResponseStatusBean();
response.setResponseStatus(ResponseStatus.BADREQUEST);
response.setStatusMessage("File is null");
return badRequest(toJson(response));
}
}
}
@SubjectPresent
public static Result getFile(String hashcode) {
String userEmail = session().get("pa.u.id");
User user = User.getByEmail(userEmail);
if (user != null) {
java.io.File f = UtilitiesDelegate.getInstance().getFile(hashcode,
user.getUserId());
if (f != null) {
return ok(f);
} else {
// TODO remove once authentication is fully tested, @security
// should be enough
flash("error", "Missing file");
ResponseStatusBean response = new ResponseStatusBean();
response.setResponseStatus(ResponseStatus.NOTAVAILABLE);
response.setStatusMessage("File does not exist");
return notFound(toJson(response));
}
} else {
// TODO remove once authentication is fully tested, @security
// should be enough
flash("error", "Missing file");
ResponseStatusBean response = new ResponseStatusBean();
response.setResponseStatus(ResponseStatus.UNAUTHORIZED);
response.setStatusMessage("User is information is null");
return unauthorized(toJson(response));
}
}
@SubjectPresent
public static Result getFileBySize(String hashcode, String size) {
String userEmail = session().get("pa.u.id");
User user = User.getByEmail(userEmail);
String upSize = size.toUpperCase();
if (!upSize.equals("THUMBNAIL") && !upSize.equals("SMALL")
&& !upSize.equals("MEDIUM") && !upSize.equals("LARGE")) {
flash("error", "Size " + size + " not available");
ResponseStatusBean response = new ResponseStatusBean();
response.setResponseStatus(ResponseStatus.NOTAVAILABLE);
response.setStatusMessage("Size " + size + "not available");
return notFound(toJson(response));
}
if (user != null) {
java.io.File f = UtilitiesDelegate.getInstance().getFile(hashcode,
user.getUserId(), size);
if (f != null) {
return ok(f);
} else {
// TODO remove once authentication is fully tested, @security
// should be enough
flash("error", "Missing file");
ResponseStatusBean response = new ResponseStatusBean();
response.setResponseStatus(ResponseStatus.NOTAVAILABLE);
response.setStatusMessage("Missing file");
return notFound(toJson(response));
}
} else {
// TODO remove once authentication is fully tested, @security
// should be enough
flash("error", "Missing file");
ResponseStatusBean response = new ResponseStatusBean();
response.setResponseStatus(ResponseStatus.UNAUTHORIZED);
response.setStatusMessage("User is information is null");
return unauthorized(toJson(response));
}
}
public static Result getFileNoLogin(String hashcode) {
java.io.File f = UtilitiesDelegate.getInstance().getFileNoLogin(
hashcode);
if (f != null) {
return ok(f);
} else {
// TODO remove once authentication is fully tested, @security
// should be enough
flash("error", "Missing file");
ResponseStatusBean response = new ResponseStatusBean();
response.setResponseStatus(ResponseStatus.NOTAVAILABLE);
response.setStatusMessage("File does not exist");
return notFound(toJson(response));
}
}
public static Result getFileBySizeNoLogin(String hashcode, String size) {
String upSize = size.toUpperCase();
if (!upSize.equals("THUMBNAIL") && !upSize.equals("SMALL")
&& !upSize.equals("MEDIUM") && !upSize.equals("LARGE")) {
flash("error", "Size " + size + " not available");
ResponseStatusBean response = new ResponseStatusBean();
response.setResponseStatus(ResponseStatus.NOTAVAILABLE);
response.setStatusMessage("Size " + size + "not available");
return notFound(toJson(response));
}
java.io.File f = UtilitiesDelegate.getInstance().getFileNoLogin(
hashcode, size);
if (f != null) {
return ok(f);
} else {
// TODO remove once authentication is fully tested, @security
// should be enough
flash("error", "Missing file");
ResponseStatusBean response = new ResponseStatusBean();
response.setResponseStatus(ResponseStatus.NOTAVAILABLE);
response.setStatusMessage("Missing file");
return notFound(toJson(response));
}
}
@SubjectPresent
public static Result logActivity(String action, String uri) {
String userEmail = session().get("pa.u.id");
User user = User.getByEmail(userEmail);
if (user != null) {
UtilitiesDelegate.getInstance().logActivity(user, action, uri);
// if the call to the logger is to register that a memento has been
// seen within the contexts, register this as a stat
if (action.equals(LogActions.DETAILVIEWS.toString())
|| action.equals(LogActions.VIEWS.toString())
|| action.equals(LogActions.STORY_NEW.toString())) {
Long contextId = MyDynamicResourceHandler.getIdFromPath(uri,
SecurityModelConstants.ID_FROM_CONTEXT);
Long publicMementoId = MyDynamicResourceHandler.getIdFromPath(
uri, SecurityModelConstants.ID_FROM_MEMENTO);
try {
ContextDelegate.getInstance()
.increaseStatsOnContextMemento(contextId,
publicMementoId, action);
} catch (Exception e) {
ResponseStatusBean response = new ResponseStatusBean();
response.setResponseStatus(ResponseStatus.SERVERERROR);
response.setStatusMessage("Log was saved, but views on "
+ uri + "was not computed due to an error: "
+ e.getLocalizedMessage());
return internalServerError(toJson(response));
}
}
ResponseStatusBean response = new ResponseStatusBean();
response.setResponseStatus(ResponseStatus.OK);
response.setStatusMessage("Log was stored");
return ok(toJson(response));
} else {
// TODO remove once authentication is fully tested, @security
// should be enough
flash("error", "Missing file");
ResponseStatusBean response = new ResponseStatusBean();
response.setResponseStatus(ResponseStatus.UNAUTHORIZED);
response.setStatusMessage("User is information is null");
return unauthorized(toJson(response));
}
}
@SubjectPresent
public static Result logActivityGET(String action, String uri) {
String userEmail = session().get("pa.u.id");
User user = User.getByEmail(userEmail);
if (user != null) {
UtilitiesDelegate.getInstance().logActivity(user, action, uri);
// if the call to the logger is to register that a memento has been
// seen within the contexts, register this as a stat
if (action.equals(LogActions.DETAILVIEWS.toString())
|| action.equals(LogActions.VIEWS.toString())
|| action.equals(LogActions.STORY_NEW.toString())) {
Long contextId = MyDynamicResourceHandler.getIdFromPath(uri,
SecurityModelConstants.ID_FROM_CONTEXT);
Long publicMementoId = MyDynamicResourceHandler.getIdFromPath(
uri, SecurityModelConstants.ID_FROM_MEMENTO);
try {
ContextDelegate.getInstance()
.increaseStatsOnContextMemento(contextId,
publicMementoId, action);
} catch (Exception e) {
ResponseStatusBean response = new ResponseStatusBean();
response.setResponseStatus(ResponseStatus.SERVERERROR);
response.setStatusMessage("Log was saved, but views on "
+ uri + "was not computed due to an error: "
+ e.getLocalizedMessage());
return internalServerError(toJson(response));
}
}
ResponseStatusBean response = new ResponseStatusBean();
response.setResponseStatus(ResponseStatus.OK);
response.setStatusMessage("Log was stored");
return ok(toJson(response));
} else {
// TODO remove once authentication is fully tested, @security
// should be enough
flash("error", "Missing file");
ResponseStatusBean response = new ResponseStatusBean();
response.setResponseStatus(ResponseStatus.UNAUTHORIZED);
response.setStatusMessage("User is information is null");
return unauthorized(toJson(response));
}
}
@SubjectPresent
public static Result postStats(Long contextId) {
String userEmail = session().get("pa.u.id");
User user = User.getByEmail(userEmail);
if (user != null) {
JsonNode json = request().body().asJson();
if (json == null) {
return badRequest("Expecting Json data");
} else {
JsonNode views = json.get("views");
JsonNode detailViews = json.get("detailViews");
//views
for (Iterator<String> fields = views.getFieldNames(); fields.hasNext();) {
String id = fields.next();
Long publicMementoId = Long.parseLong(id);
Long stats = views.get(id).asLong();
//Logger.debug("Stats posted to publicMementoId=" + id + "; stats = "+stats+"; in context = "+contextId);
ContextDelegate.getInstance()
.increaseStatsOnContextMemento(contextId,publicMementoId, "VIEWS",stats);
}
//detail views
for (Iterator<String> fields = detailViews.getFieldNames(); fields.hasNext();) {
String id = fields.next();
Long publicMementoId = Long.parseLong(id);
Long stats = detailViews.get(id).asLong();
ContextDelegate.getInstance()
.increaseStatsOnContextMemento(contextId,publicMementoId, "DETAILVIEWS",stats);
}
}
return ok();
} else {
return unauthorized();
}
}
}
| gpl-2.0 |
nfprojects/nfengine | Src/Engine/Renderers/RendererVk/Internal/RenderPassManager.hpp | 1497 | /**
* @file
* @author Lookey ([email protected])
* @brief Declaration of Vulkan's Render Pass Manager.
*/
#pragma once
#include "Defines.hpp"
#include "RenderPassDesc.hpp"
#include "Engine/Common/Containers/HashMap.hpp"
namespace NFE {
namespace Renderer {
struct RenderPassDescHash
{
uint32 operator() (const Renderer::RenderPassDesc& renderPassDesc)
{
uint32 colorHash = 0;
for (auto& format : renderPassDesc.colorFormats)
colorHash ^= Common::GetHash(uint32(format));
return colorHash ^ Common::GetHash(renderPassDesc.colorFormats.Size()) ^ Common::GetHash(uint32(renderPassDesc.depthFormat));
}
};
/**
* A class managing Vulkan's Render Passes.
*
* It's main goal is to provide a user with VkRenderPass objects, reducing
* their amount to minimum. Render Passes only need formats to be created -
* if any part of nfRendererVk asks for a specific Render Pass (which is
* one created for specific formats), this class will reuse any already
* created Render Pass, or will create a new one.
*/
class RenderPassManager
{
VkDevice mDeviceRef;
using RenderPassMap = Common::HashMap<RenderPassDesc, VkRenderPass, RenderPassDescHash>;
RenderPassMap mRenderPasses;
VkRenderPass ConstructRenderPass(const RenderPassDesc& desc);
public:
RenderPassManager(VkDevice device);
~RenderPassManager();
VkRenderPass GetRenderPass(const RenderPassDesc& desc);
};
} // namespace Renderer
} // namespace NFE
| gpl-2.0 |
hexbinary/landing | src/main/java/oscar/oscarMessenger/pageUtil/MsgDisplayMessagesAction.java | 4016 | /**
* Copyright (c) 2001-2002. Department of Family Medicine, McMaster University. All Rights Reserved.
* This software is published under the GPL GNU General Public License.
* 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.
*
* This software was written for the
* Department of Family Medicine
* McMaster University
* Hamilton
* Ontario, Canada
*/
package oscar.oscarMessenger.pageUtil;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.oscarehr.common.dao.MessageListDao;
import org.oscarehr.common.model.MessageList;
import org.oscarehr.util.MiscUtils;
import org.oscarehr.util.SpringUtils;
import oscar.util.ConversionUtils;
public class MsgDisplayMessagesAction extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
// Setup variables
oscar.oscarMessenger.pageUtil.MsgSessionBean bean = null;
String[] messageNo = ((MsgDisplayMessagesForm) form).getMessageNo();
String providerNo;
//Initialize forward location
String findForward = "success";
if (request.getParameter("providerNo") != null & request.getParameter("userName") != null) {
bean = new oscar.oscarMessenger.pageUtil.MsgSessionBean();
bean.setProviderNo(request.getParameter("providerNo"));
bean.setUserName(request.getParameter("userName"));
request.getSession().setAttribute("msgSessionBean", bean);
}//if
else {
bean = (oscar.oscarMessenger.pageUtil.MsgSessionBean) request.getSession().getAttribute("msgSessionBean");
}//else
/*
*edit 2006-0811-01 by wreby
* Adding a search and clear search action to the DisplayMessages JSP
*/
if (request.getParameter("btnSearch") != null) {
oscar.oscarMessenger.pageUtil.MsgDisplayMessagesBean displayMsgBean = (oscar.oscarMessenger.pageUtil.MsgDisplayMessagesBean) request.getSession().getAttribute("DisplayMessagesBeanId");
displayMsgBean.setFilter(request.getParameter("searchString"));
} else if (request.getParameter("btnClearSearch") != null) {
oscar.oscarMessenger.pageUtil.MsgDisplayMessagesBean displayMsgBean = (oscar.oscarMessenger.pageUtil.MsgDisplayMessagesBean) request.getSession().getAttribute("DisplayMessagesBeanId");
displayMsgBean.clearFilter();
} else if (request.getParameter("btnDelete") != null) {
//This will go through the array of message Numbers and set them
//to del.which stands for deleted. but you prolly could have figured that out
providerNo = bean.getProviderNo();
MessageListDao dao = SpringUtils.getBean(MessageListDao.class);
for (int i = 0; i < messageNo.length; i++) {
List<MessageList> msgs = dao.findByProviderNoAndMessageNo(providerNo, ConversionUtils.fromLongString(messageNo[i]));
for (MessageList msg : msgs) {
msg.setDeleted(true);
dao.merge(msg);
}
}//for
} else {
MiscUtils.getLogger().debug("Unexpected action in MsgDisplayMessagesBean.java");
}
return (mapping.findForward(findForward));
}
}
| gpl-2.0 |
JulieKuehl/julie-jumpstart | wp-content/themes/jumpstart/framework/includes/frontend.php | 9896 | <?php
/**
* Initiate Front-end
*
* @since 2.0.0
*/
function themeblvd_frontend_init() {
/**
* Setup frontend
* (1) Template Parts
* (2) Template Attributes
* (3) Theme Mode (list or grid)
* (4) Main Configuration
* - a. Original $post object ID
* - b. Builder name and post ID (if custom layout)
* - c. Featured areas classes (if present)
* - d. Sidebar layout
* - e. Sidebar ID's
*/
Theme_Blvd_Frontend_Init::get_instance();
/**
* Setup any secondary queries or hook any modifications
* to the primary query.
*/
Theme_Blvd_Query::get_instance();
}
/**
* Get content extension for uses of get_template_part
* End Usage: get_template_part( 'content', {$part} )
* File name structure: content-{$part}.php
*
* @since 2.0.0
*
* @param string $type Type of template part to get
* @return string $part Extension to use for get_template_part
*/
function themeblvd_get_part( $type ) {
$config = Theme_Blvd_Frontend_Init::get_instance();
$part = $config->get_template_parts( $type );
return apply_filters( 'themeblvd_template_part', $part, $type );
}
/**
* Get the current mode of the framework, list or grid.
* This determines if archives and the posts page display
* as a grid.
*
* Grid mode is triggered when the template parts for "index"
* and "archive" are filtered to be either "grid", "archive_grid"
* or "index_grid".
*
* @since 2.3.0
*
* @return bool
*/
function themeblvd_is_grid_mode() {
$config = Theme_Blvd_Frontend_Init::get_instance();
if ( $config->get_mode() == 'grid' ) {
return true;
}
return false;
}
/**
* This function is used from within the theme's template
* files to return the values setup in the frontend init.
*
* @since 2.0.0
*
* @param mixed $key string $key to retrieve from frontend config object
* @param mixed $secondary string Optional array key to traverse one level deeper
* @return mixed Value from frontend config object
*/
function themeblvd_config( $key = '', $secondary = '' ) {
$config = Theme_Blvd_Frontend_Init::get_instance();
return $config->get_config( $key, $secondary );
}
/**
* Display CSS class for current sidebar layout.
*
* @since 2.0.0
*/
function themeblvd_sidebar_layout_class() {
$config = Theme_Blvd_Frontend_Init::get_instance();
echo $config->get_config('sidebar_layout');
}
/**
* At any time, this function can be called to effect
* the global template attributes array which can
* be utilized within template files.
*
* This system provides a way for attributes to be set
* and retreived with themeblvd_get_att() from files
* included with WP's get_template_part.
*
* @since 2.2.0
*
* @param array $atts Attributes to be merged with global attributes
* @param bool $flush Whether or not to flush previous attributes before merging
*/
function themeblvd_set_atts( $atts, $flush = false ) {
$config = Theme_Blvd_Frontend_Init::get_instance();
return $config->set_atts( $atts, $flush );
}
/**
* Working with the system established in the
* previous function, this function allows you
* to set an individual att along with creating
* a new variable.
*
* @since 2.2.0
*
* @param string $key Key in $atts array to modify
* @param mixed $value New value
* @return mixed New value
*/
function themeblvd_set_att( $key, $value ) {
$config = Theme_Blvd_Frontend_Init::get_instance();
return $config->set_att( $key, $value );
}
/**
* Retrieve a single attribute set with
* themeblvd_set_atts()
*
* @since 2.2.0
*
* @param string $key Key in $atts array to retrieve
* @return mixed Value of attribute
*/
function themeblvd_get_att( $key ) {
$config = Theme_Blvd_Frontend_Init::get_instance();
return $config->get_att( $key );
}
/**
* Get the secondary query.
*
* @since 2.3.0
*
* @param array|string $args Arguments to parse into query
* @param string $type Type of secondary query, list or grid
* @return array $second_query Newly stored second query attribute
*/
function themeblvd_get_second_query() {
$query = Theme_Blvd_Query::get_instance();;
return $query->get_second_query();
}
/**
* Set the secondary query.
*
* @since 2.3.0
*
* @return array The secondary query
*/
function themeblvd_set_second_query( $args, $type ) {
$query = Theme_Blvd_Query::get_instance();;
return $query->set_second_query( $args, $type );
}
/**
* Verify the state of the original query.
*
* @since 2.3.0
*
* @param string $type The primary type of WP page being checked for
* @param string $helper A secondary param if allowed with $type
* @return bool
*/
function themeblvd_was( $type, $helper = '' ) {
$query = Theme_Blvd_Query::get_instance();
return $query->was( $type, $helper );
}
/**
* Determine current web browser and generate a CSS class for
* it. This function gets filtered onto WP's body_class.
*
* @since 2.2.0
*
* @param array $classes Current body classes
* @return array $classes Body classes with browser classes added
*/
function themeblvd_browser_class( $classes ) {
// Get current user agent
$browser = $_SERVER[ 'HTTP_USER_AGENT' ];
// OS class
if ( preg_match( "/Mac/", $browser ) ) {
$classes[] = 'mac';
} elseif ( preg_match( "/Windows/", $browser ) ) {
$classes[] = 'windows';
} elseif ( preg_match( "/Linux/", $browser ) ) {
$classes[] = 'linux';
} else {
$classes[] = 'unknown-os';
}
// Browser class
if ( preg_match( "/Chrome/", $browser ) ) {
$classes[] = 'chrome';
} elseif ( preg_match( "/Safari/", $browser ) ) {
$classes[] = 'safari';
} elseif ( preg_match( "/Opera/", $browser ) ) {
$classes[] = 'opera';
} elseif ( preg_match( "/MSIE/", $browser ) ) {
// Internet Explorer... ugh, kill me now.
$classes[] = 'msie';
if ( preg_match( "/MSIE 6.0/", $browser ) ) {
$classes[] = 'ie6';
} elseif ( preg_match( "/MSIE 7.0/", $browser ) ) {
$classes[] = 'ie7';
} elseif ( preg_match( "/MSIE 8.0/", $browser ) ) {
$classes[] = 'ie8';
} elseif ( preg_match( "/MSIE 9.0/", $browser ) ) {
$classes[] = 'ie9';
} elseif ( preg_match( "/MSIE 10.0/", $browser ) ) {
$classes[] = 'ie10';
}
} elseif ( preg_match( "/Firefox/", $browser ) && preg_match( "/Gecko/", $browser ) ) {
$classes[] = 'firefox';
} else {
$classes[] = 'unknown-browser';
}
return apply_filters( 'themeblvd_browser_classes', $classes, $browser );
}
if ( !function_exists( 'themeblvd_include_scripts' ) ) :
/**
* Load framework's JS scripts
*
* To add scripts or remove unwanted scripts that you
* know you won't need to maybe save some frontend load
* time, this function can easily be re-done from a
* child theme.
*
* (1) jQuery - Already registered by WP, and enqueued for most our scripts.
* (2) Twitter Bootstrap - All Bootstrap JS plugins combiled.
* (3) Magnific Popup - Handles all default lightbox functionality.
* (4) Super Fish/Hover Intent - Used for primary navigation.
* (5) FlexSlider - Responsive slider, controls framework's "standard" slider type.
* (6) Roundabout - Carousel-style slider, controls framwork's "3D Carousel" slider type.
* (7) Theme Blvd scripts - Anything used by the framework to set other items into motion.
* (8) iOS Orientation Fix - Allows zooming to be enabled on [older] iOS devices while still
* allowing auto adjustment when switching between landscape and portrait.
* (9) Already registered by WP, enable commentform to show when visitor clicks "Reply" on comment.
*
* @since 2.0.0
*/
function themeblvd_include_scripts() {
global $themeblvd_framework_scripts;
// Start framework scripts. This can be used declare the
// $deps of any enque'd JS files intended to come after
// the framework.
$scripts = array( 'jquery' );
// Register scripts -- These scripts are only enque'd as needed.
wp_register_script( 'flexslider', TB_FRAMEWORK_URI . '/assets/js/flexslider.min.js', array('jquery'), '2.1', true );
wp_register_script( 'roundabout', TB_FRAMEWORK_URI . '/assets/js/roundabout.min.js', array('jquery'), '1.1', true );
wp_register_script( 'nivo', TB_FRAMEWORK_URI . '/assets/js/nivo.min.js', array('jquery'), '3.2', true );
// Enque Scripts
wp_enqueue_script( 'jquery' );
if ( themeblvd_supports( 'assets', 'bootstrap' ) ) {
$scripts[] = 'bootstrap';
wp_enqueue_script( 'bootstrap', TB_FRAMEWORK_URI . '/assets/plugins/bootstrap/js/bootstrap.min.js', array('jquery'), '2.3.2', true );
}
if ( themeblvd_supports( 'assets', 'magnific_popup' ) ) {
$scripts[] = 'magnific_popup';
wp_enqueue_script( 'magnific_popup', TB_FRAMEWORK_URI . '/assets/js/magnificpopup.min.js', array('jquery'), '0.9.3', true );
}
if ( themeblvd_supports( 'assets', 'superfish' ) ) {
$scripts[] = 'superfish';
wp_enqueue_script( 'hoverintent', TB_FRAMEWORK_URI . '/assets/js/hoverintent.min.js', array('jquery'), 'r7', true );
wp_enqueue_script( 'superfish', TB_FRAMEWORK_URI . '/assets/js/superfish.min.js', array('jquery'), '1.7.4', true );
}
if ( themeblvd_supports( 'assets', 'primary_js' ) ) {
$scripts[] = 'themeblvd';
wp_enqueue_script( 'themeblvd', TB_FRAMEWORK_URI . '/assets/js/themeblvd.min.js', array('jquery'), TB_FRAMEWORK_VERSION, true );
// Localize primary themeblvd.js script. This allows us to pass any filterable
// parameters through to our primary script.
wp_localize_script( 'themeblvd', 'themeblvd', themeblvd_get_js_locals() );
}
// Final filter on framework script.
$themeblvd_framework_scripts = apply_filters( 'themeblvd_framework_scripts', $scripts );
// iOS Orientation (for older iOS devices, not supported by default)
if ( themeblvd_supports( 'display', 'responsive' ) && themeblvd_supports( 'assets', 'ios_orientation' ) ) {
wp_enqueue_script( 'ios-orientationchange-fix', TB_FRAMEWORK_URI . '/assets/js/ios-orientationchange-fix.js', true );
}
// Comments reply
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
endif; | gpl-2.0 |
joshmoore/zeroc-ice | java/demo/book/simple_filesystem/Filesystem/FileI.java | 1451 | // **********************************************************************
//
// Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
package Filesystem;
public class FileI extends _FileDisp
{
// FileI constructor
public
FileI(Ice.Communicator communicator, String name, DirectoryI parent)
{
_name = name;
_parent = parent;
assert(_parent != null);
//
// Create an identity
//
_id = new Ice.Identity();
_id.name = java.util.UUID.randomUUID().toString();
}
// Slice Node::name() operation
public String
name(Ice.Current current)
{
return _name;
}
// Slice File::read() operation
public String[]
read(Ice.Current current)
{
return _lines;
}
// Slice File::write() operation
public void
write(String[] text, Ice.Current current)
throws GenericError
{
_lines = text;
}
public void
activate(Ice.ObjectAdapter a)
{
NodePrx thisNode = NodePrxHelper.uncheckedCast(a.add(this, _id));
_parent.addChild(thisNode);
}
private String _name;
private DirectoryI _parent;
private Ice.Identity _id;
private String[] _lines;
}
| gpl-2.0 |
pythonprobr/pypratico | aula1/recode.py | 830 | # coding: utf-8
"""
``recode`` converte bytes de uma codificação para outra.
Caso mais simples:
>>> recode('abc', 'ASCII', 'utf-8')
'abc'
>>> recode('não', 'utf-8', 'iso-8859-1') == 'n\xe3o'
True
"""
import io
import sys
def recode(bytes_ent, codif_ent, codif_sai):
texto = bytes_ent.decode(codif_ent)
return texto.encode(codif_sai)
def recode_arq(nome_arq, codif_ent, codif_sai):
with io.open(nome_arq, encoding=codif_ent) as entrada:
nome_sai = codif_sai + nome_arq
with io.open(nome_sai, 'wt', encoding=codif_sai) as saida:
for lin in entrada:
saida.write(lin)
return nome_sai
if __name__=='__main__':
nome_arq, codif_ent, codif_sai = sys.argv[1:]
gravado = recode_arq(nome_arq, codif_ent, codif_sai)
print(gravado, 'gravado')
| gpl-2.0 |
malhotrah/platypus | wp-content/plugins/cartondesign/js/cartondesign.js | 6164 | /**
* Created by hitanshu on 9/8/14.
*/
function cartondesignsavedata(firstname,lastname,companyname,email,url,type)
{
jQuery.ajax({
type: 'POST',
url: ajaxcartondesign.ajaxurl,
data: {
action: 'cartondesign_save_data',
cdfirstname: firstname,
cdlastname: lastname,
cdcompanyname: companyname,
cdemail: email,
url:url,
type:type
},
success:function(data, textStatus, XMLHttpRequest){
// var fileDownloadUrl='/platypus/wp-content/plugins/cartondesign/process.php';
if(data=="success")
{
var _iframe_dl = jQuery('<iframe />')
.attr('src','/platypus/wp-content'+url)
.hide()
.appendTo('body');
jQuery.fancybox.close();
}
else
{
alert(data);
}
},
error: function(MLHttpRequest, textStatus, errorThrown){
console.log(errorThrown);
}
});
}
function getFilteredData(lengthMin,lengthMax,widthMin,widthMax,depthMin,depthMax,type,page)
{
jQuery.ajax({
type: 'POST',
url: ajaxcartondesign.ajaxurl,
data: {
action: 'cartondesign_get_data',
lengthMin: lengthMin,
lengthMax: lengthMax,
widthMin: widthMin,
widthMax: widthMax,
depthMin: depthMin,
depthMax: depthMax,
page:page,
type_id:type
},
beforeSend: function(){
jQuery("#carton_design_files").css('opacity', '0');
jQuery("#ajax_loading_content").show();
},
success:function(data, textStatus, XMLHttpRequest){
jQuery('#carton_design_files').html(data).show();
jQuery("#carton_design_files").css('opacity', '1');
jQuery("#ajax_loading_content").hide();
},
error: function(MLHttpRequest, textStatus, errorThrown){
console.log(errorThrown);
jQuery("#ajax_loading_content").hide();
}
});
}
jQuery(document).ready(function(){
//calling for first time
getFilteredData('','','','','','','',1);
jQuery(document).on("click",".cd-download", function(e){
e.preventDefault();
jQuery(".fancybox-inner #download_form #download_url_block").empty();
var url=jQuery(this).attr("data-url");
var typeId=jQuery(this).attr("data-type-id");
var formContent=jQuery("#cd_download_form").html();
jQuery.fancybox({'content':formContent});
jQuery(".fancybox-inner #download_form #download_url_block").append('<input type="hidden" id="download_url" data-type-id="'+typeId+'" data-id="'+url+'"/>');
});
jQuery(document).on("click","#download_form input[type='submit']", function(event){
event.preventDefault();
var error_div_selector=jQuery(".fancybox-inner #download_form #download_form_error");
error_div_selector.empty();
var firstname=jQuery.trim(jQuery(".fancybox-inner #download_form #cdfirstname").val());
var lastname=jQuery.trim(jQuery(".fancybox-inner #download_form #cdlastname").val());
var companyname=jQuery.trim(jQuery(".fancybox-inner #download_form #cdcompanyname").val());
var email=jQuery.trim(jQuery(".fancybox-inner #download_form #cdemail").val());
if(firstname.length==0)
{
error_div_selector.append("Please fill FirstName.");
return false;
}
else if(lastname.length==0)
{
error_div_selector.append("Please fill LastName.");
return false;
}
else if(companyname.length==0)
{
error_div_selector.append("Please fill CompanyName.");
return false;
}
else
{
if(email.length==0)
{
error_div_selector.append("Please fill Email.");
return false;
}
else if(!IsEmail(email))
{
error_div_selector.append("Please provide valid email id.");
return false;
}
else
{
//submit form
var url=jQuery(".fancybox-inner #download_form #download_url_block #download_url").attr('data-id');
var type=jQuery(".fancybox-inner #download_form #download_url_block #download_url").attr('data-type-id');
cartondesignsavedata(firstname,lastname,companyname,email,url,type);
}
}
});
jQuery(document).on("click","#search_layout", function(e){
var lengthMin= jQuery.trim(jQuery('#length_min').val());
var lengthMax= jQuery.trim(jQuery('#length_max').val());
var widthMin= jQuery.trim(jQuery('#width_min').val());
var widthMax= jQuery.trim(jQuery('#width_max').val());
var depthMin= jQuery.trim(jQuery('#depth_min').val());
var depthMax= jQuery.trim(jQuery('#depth_max').val());
var type=jQuery('#type_id').val();
getFilteredData(lengthMin,lengthMax,widthMin,widthMax,depthMin,depthMax,type,1);
});
jQuery(document).on("click","#page_btn", function(e){
var lengthMin= jQuery.trim(jQuery('#length_min').val());
var lengthMax= jQuery.trim(jQuery('#length_max').val());
var widthMin= jQuery.trim(jQuery('#width_min').val());
var widthMax= jQuery.trim(jQuery('#width_max').val());
var depthMin= jQuery.trim(jQuery('#depth_min').val());
var depthMax= jQuery.trim(jQuery('#depth_max').val());
var type=jQuery('#type_id').val();
var page=jQuery(this).attr('data-id');
getFilteredData(lengthMin,lengthMax,widthMin,widthMax,depthMin,depthMax,type,page);
});
function IsEmail(email) {
var regex = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if(!regex.test(email)) {
return false;
}else{
return true;
}
}
}); | gpl-2.0 |
aleax/openscada | src/moduls/daq/DCON/DCON_client.cpp | 39685 |
//OpenSCADA module DAQ.DCON file: DCON_client.cpp
/***************************************************************************
* Copyright (C) 2008-2011 by Almaz Karimov *
* 2008-2019 by Roman Savochenko, [email protected] *
* *
* 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., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include <signal.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <termios.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <string.h>
#include <tsys.h>
#include <ttypeparam.h>
#include "DCON_client.h"
//*************************************************
//* Modul info! *
#define MOD_ID "DCON"
#define MOD_NAME _("DCON client")
#define MOD_TYPE SDAQ_ID
#define VER_TYPE SDAQ_VER
#define MOD_VER "1.3.6"
#define AUTHORS _("Roman Savochenko, Almaz Karimov")
#define DESCRIPTION _("Provides an implementation of DCON-client protocol. Supports I-7000 DCON protocol.")
#define LICENSE "GPL2"
//*************************************************
DCONDAQ::TTpContr *DCONDAQ::mod; //Pointer for direct access to the module
extern "C"
{
#ifdef MOD_INCL
TModule::SAt daq_DCON_module(int n_mod)
#else
TModule::SAt module(int n_mod)
#endif
{
if(n_mod == 0) return TModule::SAt(MOD_ID,MOD_TYPE,VER_TYPE);
return TModule::SAt("");
}
#ifdef MOD_INCL
TModule *daq_DCON_attach(const TModule::SAt &AtMod, const string &source)
#else
TModule *attach(const TModule::SAt &AtMod, const string &source)
#endif
{
if(AtMod == TModule::SAt(MOD_ID,MOD_TYPE,VER_TYPE)) return new DCONDAQ::TTpContr(source);
return NULL;
}
}
using namespace DCONDAQ;
//******************************************************
//* TTpContr *
//******************************************************
TTpContr::TTpContr(string name) : TTypeDAQ(MOD_ID)
{
mod = this;
modInfoMainSet(MOD_NAME, MOD_TYPE, MOD_VER, AUTHORS, DESCRIPTION, LICENSE, name);
}
TTpContr::~TTpContr( )
{
}
void TTpContr::postEnable( int flag )
{
TTypeDAQ::postEnable( flag );
//Controler's bd structure
fldAdd(new TFld("PRM_BD",_("Parameters table"),TFld::String,TFld::NoFlag,"30",""));
fldAdd(new TFld("SCHEDULE",_("Acquisition schedule"),TFld::String,TFld::NoFlag,"100","1"));
fldAdd(new TFld("PRIOR",_("Priority of the acquisition task"),TFld::Integer,TFld::NoFlag,"2","0","-1;199"));
fldAdd(new TFld("ADDR",_("Transport"),TFld::String,TFld::NoFlag,"41",""));
fldAdd(new TFld("REQ_TRY",_("Request tries"),TFld::Integer,TFld::NoFlag,"1","1","1;10"));
//Parameter type bd structure
int t_prm = tpParmAdd("std", "PRM_BD", _("Standard"), true);
tpPrmAt(t_prm).fldAdd(new TFld("MOD_ADDR",_("Module address"),TFld::Integer,TFld::NoFlag|TCfg::NoVal,"20","1","0;255"));
tpPrmAt(t_prm).fldAdd(new TFld("CRC_CTRL",_("CRC control"),TFld::Boolean,TFld::NoFlag|TCfg::NoVal,"1","1"));
tpPrmAt(t_prm).fldAdd(new TFld("HOST_SIGNAL",_("Host signal"),TFld::Integer,TFld::Selectable|TCfg::NoVal,"1","0",
"0;1",_("No signal;HostOK")));
tpPrmAt(t_prm).fldAdd(new TFld("AI_METHOD",_("AI method"),TFld::Integer,TFld::Selectable|TCfg::NoVal,"1","0",
"0;1;2;3;4;6;8;10;20;116;201;202;203;204;206;208;210;220;316",
_("No AI;1AI (#AA);2AI (#AA);3AI (#AA);4AI (#AA);6AI (#AA);8AI (#AA);10AI (#AA);20AI (#AA);16AI (#AA^AA);1AI (#AAN);2AI (#AAN);3AI (#AAN);4AI (#AAN);6AI (#AAN);8AI (#AAN);10AI (#AANN);20AI (#AANN);16AI (#AAN^AAN)")));
tpPrmAt(t_prm).fldAdd(new TFld("AI_RANGE",""/*_("AI range")*/,TFld::Integer,TFld::Selectable|TCfg::NoVal,"1","0",
"0;1;2",_("Engineer or percent;Hexadecimal (0000 FFFF);Hexadecimal (8000 7FFF)")));
tpPrmAt(t_prm).fldAdd(new TFld("AO_METHOD",_("AO method"),TFld::Integer,TFld::Selectable|TCfg::NoVal,"1","0",
"0;1;2;4;14",_("No AO;1AO (#AA);2AO (#AAN);4AO (#AAN);4AO (#AACN)")));
tpPrmAt(t_prm).fldAdd(new TFld("AO_RANGE",""/*_("AO range")*/,TFld::Integer,TFld::Selectable|TCfg::NoVal,"1","0",
"0;1;2;3;4;5;6;7;8;9;10",
_("Engineer (00.000 20.000);Engineer (04.000 20.000);Engineer (00.000 10.000);Engineer (+00.000 +20.000);"
"Engineer (+04.000 +20.000);Engineer (+00.000 +10.000);Engineer (-10.000 +10.000);Engineer (+00.000 +05.000);"
"Engineer (-05.000 +05.000);Percent (+000.00 +100.00);Hexadecimal (000 FFF)")));
tpPrmAt(t_prm).fldAdd(new TFld("DI_METHOD",_("DI method"),TFld::Integer,TFld::Selectable|TCfg::NoVal,"1","0",
"0;3;4;7;8;14;16;101;201",
_("No DI;3DI ($AA6);4DI ($AA6);7DI ($AA6);8DI ($AA6);14DI ($AA6);16DI ($AA6);1DI (@AADI);8DI ($AA6,FF00)")) );
tpPrmAt(t_prm).fldAdd(new TFld("DO_METHOD",_("DO method"),TFld::Integer,TFld::Selectable|TCfg::NoVal,"1","0",
"0;2;3;4;5;7;8;12;13;16;102;103;202;204;306;402;504;604;608;704;708;712)",
_("No DO;2DO (@AA,0300);3DO (@AA,7);4DO (@AA,F);5DO (@AA,1F);7DO (@AA,7F);8DO (@AA,FF);12DO (@AA,0FFF);"
"13DO (@AA,1FFF);16DO (@AA,FFFF);2DO (^AADOVVV);3DO (^AADOVVV);2DO (@AADO);4DO (@AADO);6DO (@AADODD);"
"2DO (@AADO0D);4DO (@(^)AADO0D);4DO (@AA,0F00);8DO (@AA,FF00);4DO (#AA000F);8DO (#AA00FF);12DO (#AA000FFF)")));
tpPrmAt(t_prm).fldAdd(new TFld("CI_METHOD",_("CI method"),TFld::Integer,TFld::Selectable|TCfg::NoVal,"1","0",
"0;2;3",_("No CI;2CI (#AA);3CI (#AA)")));
}
void TTpContr::load_( )
{
//Load parameters from command line
}
void TTpContr::save_( )
{
}
TController *TTpContr::ContrAttach( const string &name, const string &daq_db ) { return new TMdContr(name,daq_db,this); }
//******************************************************
//* TMdContr *
//******************************************************
TMdContr::TMdContr( string name_c, const string &daq_db, TElem *cfgelem ) :
TController(name_c, daq_db, cfgelem), enRes(true), reqRes(true),
mAddr(cfg("ADDR")), mPrior(cfg("PRIOR").getId()), connTry(cfg("REQ_TRY").getId()),
prcSt(false), callSt(false), endrunReq(false), mPer(1e9), tmGath(0)
{
cfg("PRM_BD").setS("DCONPrm_"+name_c);
}
TMdContr::~TMdContr( )
{
if(startStat()) stop();
}
string TMdContr::getStatus( )
{
string rez = TController::getStatus();
if(startStat() && !redntUse()) {
if(callSt) rez += TSYS::strMess(_("Acquisition. "));
if(period()) rez += TSYS::strMess(_("Acquisition with the period: %s. "),tm2s(1e-9*period()).c_str());
else rez += TSYS::strMess(_("Next acquisition by the cron '%s'. "),atm2s(TSYS::cron(cron()),"%d-%m-%Y %R").c_str());
rez += TSYS::strMess(_("Spent time: %s. "),tm2s(1e-6*tmGath).c_str());
}
return rez;
}
TParamContr *TMdContr::ParamAttach( const string &name, int type ) { return new TMdPrm(name, &owner().tpPrmAt(type)); }
void TMdContr::load_( )
{
if(!SYS->chkSelDB(DB())) throw TError();
//TController::load_( );
}
void TMdContr::disable_( )
{
}
void TMdContr::start_( )
{
if(prcSt) return;
//Fix old address format
if(addr().size() && TSYS::strParse(addr(),1,".").empty()) mAddr = "Serial."+addr();
//Establish connection
AutoHD<TTransportOut> tr = SYS->transport().at().at(TSYS::strSepParse(addr(),0,'.')).at().outAt(TSYS::strSepParse(addr(),1,'.'));
try { tr.at().start(); }
catch(TError &err) { mess_err(err.cat.c_str(),"%s",err.mess.c_str()); }
//Start the gathering data task
SYS->taskCreate(nodePath('.',true), mPrior, TMdContr::Task, this);
}
void TMdContr::stop_( )
{
//Stop the request and calc data task
if(prcSt) SYS->taskDestroy(nodePath('.',true), &endrunReq);
}
void TMdContr::prmEn( TMdPrm *prm, bool val )
{
unsigned i_prm;
MtxAlloc res(enRes, true);
for(i_prm = 0; i_prm < pHd.size(); i_prm++)
if(&pHd[i_prm].at() == prm) break;
if(val && i_prm >= pHd.size()) pHd.push_back(prm);
if(!val && i_prm < pHd.size()) pHd.erase(pHd.begin()+i_prm);
}
string TMdContr::DCONCRC( string str )
{
unsigned char CRC = 0;
for(unsigned i = 0; i < str.size(); i++) CRC += (unsigned char)str[i];
return TSYS::strMess("%02X",CRC);
}
string TMdContr::DCONReq( string &pdu, bool CRC, unsigned acqLen, char resOK )
{
MtxAlloc res(reqRes, true);
char buf[1000];
string rez, err;
try {
AutoHD<TTransportOut> tr = SYS->transport().at().at(TSYS::strSepParse(addr(),0,'.')).at().outAt(TSYS::strSepParse(addr(),1,'.'));
if(!tr.at().startStat()) tr.at().start();
if(CRC) pdu += DCONCRC(pdu);
if(messLev() == TMess::Debug) mess_debug_(nodePath().c_str(), _("REQ -> '%s'"), pdu.c_str());
pdu += "\r";
MtxAlloc resN(tr.at().reqRes(), true);
for(int i_tr = 0, resp_len = 0; i_tr < vmax(1,vmin(10,connTry)); i_tr++) {
try {
resp_len = tr.at().messIO(pdu.data(), pdu.size(), buf, sizeof(buf));
rez.assign(buf,resp_len);
//Wait tail
while(resp_len && (rez.size() < 2 || rez[rez.size()-1] != '\r')) {
try{ resp_len = tr.at().messIO(NULL, 0, buf, sizeof(buf)); } catch(TError &er) { break; }
rez.append(buf, resp_len);
}
} catch(TError &er) { //By possible the send request breakdown and no response
if(err.empty()) err = _("10:Transport error: ") + er.mess;
else if(err.find(er.mess) == string::npos) err += "; " + er.mess;
continue;
}
if(rez.size() < 2 || rez[rez.size()-1] != '\r') { err = _("13:Error respond: Not full."); continue; }
pdu = rez.substr(0,rez.size()-1);
if(!pdu.size() || (CRC && pdu.size() < 3)) { err = _("20:Respond length error."); break; }
if(CRC && strtol(pdu.substr(pdu.size()-2).c_str(),NULL,16) != strtol(DCONCRC(pdu.substr(0,pdu.size()-2)).c_str(),NULL,16))
{ err = _("21:Invalid module CRC."); continue; }
if(acqLen) {
if(pdu[0] != resOK) { err = _("22:Invalid module response."); continue; }
else if(((!CRC && acqLen != pdu.size()) || (CRC && (acqLen+2) != pdu.size()))) { err = _("20:Respond length error."); break; }
}
if(messLev() == TMess::Debug) mess_debug_(nodePath().c_str(), _("RESP -> '%s'"), pdu.c_str());
err = "0";
break;
}
} catch(TError &er) { err = _("10:Transport error: ")+er.mess; }
if(err != "0") {
if(messLev() == TMess::Debug) mess_debug_(nodePath().c_str(), _("ERR -> '%s': %s"), pdu.c_str(), err.c_str());
pdu = "";
}
return err;
}
void *TMdContr::Task( void *icntr )
{
string str, pdu, ai_txterr, ao_txterr, di_txterr, do_txterr, ci_txterr;
int n, m, i;
TMdContr &cntr = *(TMdContr *)icntr;
cntr.endrunReq = false;
cntr.prcSt = true;
bool isStart = true;
bool isStop = false;
try {
while(true) {
if(!isStart && !isStop && !cntr.redntUse()) {
cntr.callSt = true;
int64_t t_cnt = TSYS::curTime();
//Update controller's data
MtxAlloc res(cntr.enRes, true);
for(unsigned i_p = 0; i_p < cntr.pHd.size(); i_p++) {
if(cntr.endrunReq) break;
//Reset errors
ai_txterr = ao_txterr = di_txterr = do_txterr = ci_txterr = "0";
//AI
n = 0;
switch(cntr.pHd[i_p].at().aiMethod) {
case 1: case 2: case 3: case 4: case 6: case 8: case 10: case 20:
n = cntr.pHd[i_p].at().aiMethod;
case 116: if(!n) n = 8;
//#AA
//Request with module
pdu = TSYS::strMess("#%02X",(int)cntr.pHd[i_p].at().modAddr);
m = (cntr.pHd[i_p].at().aiRange == 0) ? 7 : 4;
ai_txterr=cntr.DCONReq(pdu,cntr.pHd[i_p].at().crcCtrl,(m*n+1));
for(i = 0; i < n; i++) {
if(ai_txterr != "0") { cntr.pHd[i_p].at().AI[i] = EVAL_REAL; continue; }
if(m == 7) cntr.pHd[i_p].at().AI[i] = s2r(pdu.substr(i*m+1,m));
if(m == 4) cntr.pHd[i_p].at().AI[i] = strtol(pdu.substr(i*m+1,m).c_str(),NULL,16);
if(cntr.pHd[i_p].at().aiRange == 2 && cntr.pHd[i_p].at().AI[i] > 0x7fff)
cntr.pHd[i_p].at().AI[i]=cntr.pHd[i_p].at().AI[i]-0x10000;
}
if(cntr.pHd[i_p].at().aiMethod == 116) {
//^AA
//Request with module
pdu = TSYS::strMess("^%02X",(int)cntr.pHd[i_p].at().modAddr);
m = (cntr.pHd[i_p].at().aiRange == 0) ? 7 : 4;
ai_txterr=cntr.DCONReq(pdu,cntr.pHd[i_p].at().crcCtrl,1);
for(i = 0; i < n; i++) {
if(ai_txterr != "0") { cntr.pHd[i_p].at().AI[i] = EVAL_REAL; continue; }
if(m == 7) cntr.pHd[i_p].at().AI[i+8] = s2r(pdu.substr(i*m+1,m));
if(m == 4) cntr.pHd[i_p].at().AI[i+8] = strtol(pdu.substr(i*m+1,m).c_str(),NULL,16);
if(cntr.pHd[i_p].at().aiRange == 2 && cntr.pHd[i_p].at().AI[i+8] > 0x7fff)
cntr.pHd[i_p].at().AI[i+8] = cntr.pHd[i_p].at().AI[i+8]-0x10000;
}
}
break;
case 201: case 202: case 203: case 204: case 206: case 208: case 210: case 220:
n = cntr.pHd[i_p].at().aiMethod - 200;
case 316: if(!n) n = 8;
//#AAN
//Request with module
m = (cntr.pHd[i_p].at().aiRange == 0) ? 7 : 4;
for(i = 0; i < n; i++) {
if((cntr.pHd[i_p].at().aiMethod == 210)||(cntr.pHd[i_p].at().aiMethod == 220))
pdu = TSYS::strMess("#%02X%02X",(int)cntr.pHd[i_p].at().modAddr,i);
else pdu = TSYS::strMess("#%02X%d",(int)cntr.pHd[i_p].at().modAddr,i);
ai_txterr = cntr.DCONReq(pdu,cntr.pHd[i_p].at().crcCtrl,(m+1));
if(ai_txterr != "0") cntr.pHd[i_p].at().AI[i] = EVAL_REAL;
else {
if(m == 7) cntr.pHd[i_p].at().AI[i] = s2r(pdu.substr(1,m));
if(m == 4) cntr.pHd[i_p].at().AI[i] = strtol(pdu.substr(1,m).c_str(),NULL,16);
if(cntr.pHd[i_p].at().aiRange == 2 && cntr.pHd[i_p].at().AI[i] > 0x7fff)
cntr.pHd[i_p].at().AI[i]=cntr.pHd[i_p].at().AI[i]-0x10000;
}
}
if(cntr.pHd[i_p].at().aiMethod == 316) {
//^AAN
//Request with module
m = (cntr.pHd[i_p].at().aiRange == 0) ? 7 : 4;
for(i = 0; i < n; i++) {
pdu = TSYS::strMess("^%02X%d",(int)cntr.pHd[i_p].at().modAddr,i);
ai_txterr=cntr.DCONReq(pdu,cntr.pHd[i_p].at().crcCtrl,1);
if(ai_txterr != "0") cntr.pHd[i_p].at().AI[i] = EVAL_REAL;
else {
if(m == 7) cntr.pHd[i_p].at().AI[i+8] = s2r(pdu.substr(1,m));
if(m == 4) cntr.pHd[i_p].at().AI[i+8] = strtol(pdu.substr(1,m).c_str(),NULL,16);
if(cntr.pHd[i_p].at().aiRange == 2 && cntr.pHd[i_p].at().AI[i+8] > 0x7fff)
cntr.pHd[i_p].at().AI[i+8] = cntr.pHd[i_p].at().AI[i+8]-0x10000;
}
}
}
break;
}
//AO
switch(cntr.pHd[i_p].at().aoMethod) {
case 1: case 2: case 4: case 14:
n = cntr.pHd[i_p].at().aoMethod;
if(n == 14) n = 4;
for(i = 0; i < n; i++) {
//Control range
switch(cntr.pHd[i_p].at().aoRange) {
case 0://Engineer (00.000 20.000)
str = TSYS::strMess("%06.3f",vmax(0,vmin(20,cntr.pHd[i_p].at().AO[i])));
break;
case 1://Engineer (04.000 20.000)
str = TSYS::strMess("%06.3f",vmax(4,vmin(20,cntr.pHd[i_p].at().AO[i])));
break;
case 2://Engineer (00.000 10.000)
str = TSYS::strMess("%06.3f",vmax(0,vmin(10,cntr.pHd[i_p].at().AO[i])));
break;
case 3://Engineer (+00.000 +20.000)
str = TSYS::strMess("%+07.3f",vmax(0,vmin(20,cntr.pHd[i_p].at().AO[i])));
break;
case 4://Engineer (+04.000 +20.000)
str = TSYS::strMess("%+07.3f",vmax(4,vmin(20,cntr.pHd[i_p].at().AO[i])));
break;
case 5://Engineer (+00.000 +10.000)
str = TSYS::strMess("%+07.3f",vmax(0,vmin(10,cntr.pHd[i_p].at().AO[i])));
break;
case 6://Engineer (-10.000 +10.000)
str = TSYS::strMess("%+07.3f",vmax(-10,vmin(10,cntr.pHd[i_p].at().AO[i])));
break;
case 7://Engineer (+00.000 +05.000)
str = TSYS::strMess("%+07.3f",vmax(0,vmin(5,cntr.pHd[i_p].at().AO[i])));
break;
case 8://Engineer (-05.000 +05.000)
str = TSYS::strMess("%+07.3f",vmax(-5,vmin(5,cntr.pHd[i_p].at().AO[i])));
break;
case 9://Percent (+000.00 +100.00)
str = TSYS::strMess("%+07.2f",vmax(0,vmin(100,cntr.pHd[i_p].at().AO[i])));
break;
case 10://Hexadecimal (000 FFF)
str = TSYS::strMess("%03X",(int)vmax(0,vmin(0xFFF,cntr.pHd[i_p].at().AO[i])));
break;
default: ao_txterr = _("23:Undefined range"); break;
}
//Request with module
if(cntr.pHd[i_p].at().aoMethod == 1) pdu = TSYS::strMess("#%02X%s",(int)cntr.pHd[i_p].at().modAddr,str.c_str());
else if (cntr.pHd[i_p].at().aoMethod == 14) pdu = TSYS::strMess("#%02XC%d%s",(int)cntr.pHd[i_p].at().modAddr,i,str.c_str());
else pdu = TSYS::strMess("#%02X%d%s",(int)cntr.pHd[i_p].at().modAddr,i,str.c_str());
if((ao_txterr=cntr.DCONReq(pdu,cntr.pHd[i_p].at().crcCtrl,1)) == "0") ;
else if(pdu.size() && pdu[0] == '?') ao_txterr = _("24:Module out of range");
else if(pdu.size() && pdu[0] == '!') ao_txterr = _("25:Command ignored (host watchdog).");
}
}
//DI
unsigned int DI = 0;
n = 0;
switch(cntr.pHd[i_p].at().diMethod) {
case 3: if(!n) n = 3; //3DI ($AA6)
case 4: if(!n) n = 4; //4DI ($AA6)
case 7: if(!n) n = 7; //7DI ($AA6)
case 8: if(!n) n = 8; //8DI ($AA6)
case 14:if(!n) n = 14; //14DI ($AA6)
case 16:if(!n) n = 16; //16DI ($AA6)
case 201:if(!n) n = 8; //8DI ($AA6,FF00)
//Request with module
pdu = TSYS::strMess("$%02X6",(int)cntr.pHd[i_p].at().modAddr);
di_txterr = cntr.DCONReq(pdu,cntr.pHd[i_p].at().crcCtrl,7,'!');
if(di_txterr == "0") DI = strtoul(pdu.substr(1,4).c_str(),NULL,16);
if(cntr.pHd[i_p].at().diMethod == 201) DI = DI>>8;
for(int i_n = 0; i_n < n; i_n++)
cntr.pHd[i_p].at().DI[i_n] = (di_txterr == "0") ? ((DI>>i_n)&0x01) : EVAL_BOOL;
break;
case 101: //1DI (@AADI)
//Request with module
pdu = TSYS::strMess("@%02XDI",(int)cntr.pHd[i_p].at().modAddr);
di_txterr = cntr.DCONReq(pdu,cntr.pHd[i_p].at().crcCtrl,7,'!');
cntr.pHd[i_p].at().DI[0] = (di_txterr == "0") ? (char)strtoul(pdu.substr(6,2).c_str(),NULL,16) : EVAL_BOOL;
break;
}
//DO
unsigned code = 0;
n = 0;
pdu = "";
switch(cntr.pHd[i_p].at().doMethod) {
case 2: //2DO (@AA,0300)
//Request with module
code = (cntr.pHd[i_p].at().DO[1]?2:0)+(cntr.pHd[i_p].at().DO[0]?1:0);
pdu = TSYS::strMess("@%02X%02X00",(int)cntr.pHd[i_p].at().modAddr,code);
if((do_txterr=cntr.DCONReq(pdu,cntr.pHd[i_p].at().crcCtrl,1)) == "0") ;
else if(pdu.size() && pdu[0] == '!') do_txterr = _("25:Command ignored (host watchdog).");
break;
case 604: //4DO (@AA,0F00)
for(unsigned i_n = 0; i_n < 4; i_n++) if(cntr.pHd[i_p].at().DO[i_n]) code += (1<<i_n);
pdu = TSYS::strMess("@%02X%02X00",(int)cntr.pHd[i_p].at().modAddr,code);
if((do_txterr=cntr.DCONReq(pdu,cntr.pHd[i_p].at().crcCtrl,1)) == "0") ;
else if(pdu.size() && pdu[0] == '!') do_txterr = _("25:Command ignored (host watchdog).");
break;
case 608: //8DO (@AA,FF00)
for(unsigned i_n = 0; i_n < 8; i_n++) if(cntr.pHd[i_p].at().DO[i_n]) code += (1<<i_n);
pdu = TSYS::strMess("@%02X%02X00",(int)cntr.pHd[i_p].at().modAddr,code);
if((do_txterr=cntr.DCONReq(pdu,cntr.pHd[i_p].at().crcCtrl,1)) == "0") ;
else if(pdu.size() && pdu[0] == '!') do_txterr = _("25:Command ignored (host watchdog).");
break;
case 3: //3DO (@AA,7)
for(unsigned i_n = 0; i_n < 3; i_n++) if(cntr.pHd[i_p].at().DO[i_n]) code += (1<<i_n);
pdu = TSYS::strMess("@%02X%01X",(int)cntr.pHd[i_p].at().modAddr,code);
if((do_txterr=cntr.DCONReq(pdu,cntr.pHd[i_p].at().crcCtrl,1)) == "0") ;
else if(pdu.size() && pdu[0] == '!') do_txterr = _("25:Command ignored (host watchdog).");
break;
case 4: //4DO (@AA,F)
for(unsigned i_n = 0; i_n < 4; i_n++) if(cntr.pHd[i_p].at().DO[i_n]) code += (1<<i_n);
pdu = TSYS::strMess("@%02X%01X",(int)cntr.pHd[i_p].at().modAddr,code);
if((do_txterr=cntr.DCONReq(pdu,cntr.pHd[i_p].at().crcCtrl,1)) == "0") ;
else if(pdu.size() && pdu[0] == '!') do_txterr = _("25:Command ignored (host watchdog).");
break;
case 5: //5DO (@AA,1F)
for(unsigned i_n = 0; i_n < 5; i_n++) if(cntr.pHd[i_p].at().DO[i_n]) code += (1<<i_n);
pdu = TSYS::strMess("@%02X%02X",(int)cntr.pHd[i_p].at().modAddr,code);
if((do_txterr=cntr.DCONReq(pdu,cntr.pHd[i_p].at().crcCtrl,1)) == "0") ;
else if(pdu.size() && pdu[0] == '!') do_txterr = _("25:Command ignored (host watchdog).");
break;
case 7: //7DO (@AA,7F)
for(unsigned i_n = 0; i_n < 7; i_n++) if(cntr.pHd[i_p].at().DO[i_n]) code += (1<<i_n);
pdu = TSYS::strMess("@%02X%02X",(int)cntr.pHd[i_p].at().modAddr,code);
if((do_txterr=cntr.DCONReq(pdu,cntr.pHd[i_p].at().crcCtrl,1)) == "0") ;
else if(pdu.size() && pdu[0] == '!') do_txterr = _("25:Command ignored (host watchdog).");
break;
case 8: //8DO (@AA,FF)
for(unsigned i_n = 0; i_n < 8; i_n++) if(cntr.pHd[i_p].at().DO[i_n]) code += (1<<i_n);
pdu = TSYS::strMess("@%02X%02X",(int)cntr.pHd[i_p].at().modAddr,code);
if((do_txterr=cntr.DCONReq(pdu,cntr.pHd[i_p].at().crcCtrl,1)) == "0") ;
else if(pdu.size() && pdu[0] == '!') do_txterr = _("25:Command ignored (host watchdog).");
break;
case 12: //12DO (@AA,0FFF)
for(unsigned i_n = 0; i_n < 12; i_n++) if(cntr.pHd[i_p].at().DO[i_n]) code += (1<<i_n);
pdu = TSYS::strMess("@%02X%04X",(int)cntr.pHd[i_p].at().modAddr,code);
if((do_txterr=cntr.DCONReq(pdu,cntr.pHd[i_p].at().crcCtrl,1)) == "0") ;
else if(pdu.size() && pdu[0] == '!') do_txterr = _("25:Command ignored (host watchdog).");
break;
case 13: //13DO (@AA,1FFF)
for(unsigned i_n = 0; i_n < 13; i_n++) if(cntr.pHd[i_p].at().DO[i_n]) code += (1<<i_n);
pdu = TSYS::strMess("@%02X%04X",(int)cntr.pHd[i_p].at().modAddr,code);
if((do_txterr=cntr.DCONReq(pdu,cntr.pHd[i_p].at().crcCtrl,1)) == "0") ;
else if(pdu.size() && pdu[0] == '!') do_txterr = _("25:Command ignored (host watchdog).");
break;
case 16: //16DO (@AA,FFFF)
for(unsigned i_n = 0; i_n < 16; i_n++) if(cntr.pHd[i_p].at().DO[i_n]) code += (1<<i_n);
pdu = TSYS::strMess("@%02X%04X",(int)cntr.pHd[i_p].at().modAddr,code);
if((do_txterr=cntr.DCONReq(pdu,cntr.pHd[i_p].at().crcCtrl,1)) == "0") ;
else if(pdu.size() && pdu[0] == '!') do_txterr = _("25:Command ignored (host watchdog).");
break;
case 102: //2DO (^AADOVVV)
//Request with module
pdu = TSYS::strMess("^%02XDO",(int)cntr.pHd[i_p].at().modAddr);
pdu += cntr.pHd[i_p].at().DO[0] ? "1" : "0";
pdu += cntr.pHd[i_p].at().DO[1] ? "1" : "0";
pdu += "0";
if((do_txterr=cntr.DCONReq(pdu,cntr.pHd[i_p].at().crcCtrl,1)) == "0") ;
else if(pdu.size() && pdu[0] == '!') do_txterr = _("25:Command ignored (host watchdog).");
break;
case 103: //3DO (^AADOVVV)
pdu = TSYS::strMess("^%02XDO",(int)cntr.pHd[i_p].at().modAddr);
pdu += cntr.pHd[i_p].at().DO[0] ? "1" : "0";
pdu += cntr.pHd[i_p].at().DO[1] ? "1" : "0";
pdu += cntr.pHd[i_p].at().DO[2] ? "1" : "0";
if((do_txterr=cntr.DCONReq(pdu,cntr.pHd[i_p].at().crcCtrl,1)) == "0") ;
else if(pdu.size() && pdu[0] == '!') do_txterr = _("25:Command ignored (host watchdog).");
break;
case 202: //2DO (@AADO)
n = 2;
case 204: //4DO (@AADO)
if(!n) n = 4;
for(int i_r = 0; i_r < n/2; i_r++) {
//Request with module
for(unsigned i_n = 0; i_n < 2; i_n++) if(cntr.pHd[i_p].at().DO[i_r*2+i_n]) code += (1<<i_n);
pdu = TSYS::strMess("@%02XDO%01X%01X",(int)cntr.pHd[i_p].at().modAddr,i_r,code);
do_txterr = cntr.DCONReq(pdu,cntr.pHd[i_p].at().crcCtrl,3,'!');
}
break;
case 306: //6DO (@AADODD)
//Request with module
for(unsigned i_n = 0; i_n < 6; i_n++) if(cntr.pHd[i_p].at().DO[i_n]) code += (1<<i_n);
pdu = TSYS::strMess("@%02XDO%02X",(int)cntr.pHd[i_p].at().modAddr,code);
do_txterr = cntr.DCONReq(pdu,cntr.pHd[i_p].at().crcCtrl,3,'!');
break;
case 402: //2DO (@AADO0D)
for(unsigned i_n = 0; i_n < 2; i_n++) if(cntr.pHd[i_p].at().DO[i_n]) code += (1<<i_n);
pdu = TSYS::strMess("@%02XDO%02X",(int)cntr.pHd[i_p].at().modAddr,code);
do_txterr = cntr.DCONReq(pdu,cntr.pHd[i_p].at().crcCtrl,3,'!');
break;
case 504: //4DO (@(^)AADO0D)
//Request with module
code = (cntr.pHd[i_p].at().DO[1]?2:0)+(cntr.pHd[i_p].at().DO[0]?1:0);
pdu = TSYS::strMess("@%02XDO%02X",(int)cntr.pHd[i_p].at().modAddr,code);
do_txterr = cntr.DCONReq(pdu,cntr.pHd[i_p].at().crcCtrl,3,'!');
//Request with module
code = (cntr.pHd[i_p].at().DO[3]?2:0)+(cntr.pHd[i_p].at().DO[2]?1:0);
pdu = TSYS::strMess("^%02XDO%02X",(int)cntr.pHd[i_p].at().modAddr,code);
do_txterr = cntr.DCONReq(pdu,cntr.pHd[i_p].at().crcCtrl,3,'!');
break;
case 704: //4DO (#AA000F)
for(unsigned i_n = 0; i_n < 4; i_n++) if(cntr.pHd[i_p].at().DO[i_n]) code += (1<<i_n);
pdu = TSYS::strMess("#%02X00%02X",(int)cntr.pHd[i_p].at().modAddr,code);
do_txterr = cntr.DCONReq(pdu,cntr.pHd[i_p].at().crcCtrl,1);
break;
case 708: //8DO (#AA00FF)
for(unsigned i_n = 0; i_n < 8; i_n++) if(cntr.pHd[i_p].at().DO[i_n]) code += (1<<i_n);
pdu = TSYS::strMess("#%02X00%02X",(int)cntr.pHd[i_p].at().modAddr,code);
do_txterr = cntr.DCONReq(pdu,cntr.pHd[i_p].at().crcCtrl,1);
break;
case 712: //12DO (#AA000FFF)
for(unsigned i_n = 0; i_n < 12; i_n++) if(cntr.pHd[i_p].at().DO[i_n]) code += (1<<i_n);
pdu = TSYS::strMess("#%02X00%04X",(int)cntr.pHd[i_p].at().modAddr,code);
do_txterr = cntr.DCONReq(pdu,cntr.pHd[i_p].at().crcCtrl,1);
break;
}
//CI
n = 0;
switch(cntr.pHd[i_p].at().ciMethod) {
case 2://2CI (#AA)
n = 2;
case 3://3CI (#AA)
if(!n) n = 3;
for(int i_n = 0; i_n < n; i_n++) {
//> Request with module
pdu = TSYS::strMess("#%02X%d",(int)cntr.pHd[i_p].at().modAddr,i_n);
if(cntr.pHd[i_p].at().crcCtrl) pdu += cntr.DCONCRC(pdu);
if((ci_txterr=cntr.DCONReq(pdu,false,cntr.pHd[i_p].at().crcCtrl?11:9)) == "0") {
if(cntr.pHd[i_p].at().crcCtrl) {
pdu = pdu.substr(0,1) + pdu.substr(3,8) + pdu.substr(1,2);
if(strtol(pdu.substr(9,2).c_str(),NULL,16) != strtol(cntr.DCONCRC(pdu.substr(0,9)).c_str(),NULL,16))
{ ci_txterr=_("21:Invalid module CRC."); continue; }
}
cntr.pHd[i_p].at().CI[i_n] = strtol(pdu.substr(1,8).c_str(),NULL,16);
}
}
break;
}
//Host signal
switch(cntr.pHd[i_p].at().hostSignal) {
case 1: { //HostOK signal
pdu = "~**";
cntr.DCONReq(pdu,cntr.pHd[i_p].at().crcCtrl);
break;
}
}
cntr.pHd[i_p].at().aiErr.setVal(ai_txterr);
cntr.pHd[i_p].at().aoErr.setVal(ao_txterr);
cntr.pHd[i_p].at().diErr.setVal(di_txterr);
cntr.pHd[i_p].at().doErr.setVal(do_txterr);
cntr.pHd[i_p].at().ciErr.setVal(ci_txterr);
}
res.unlock();
//Calc acquisition process time
cntr.tmGath = TSYS::curTime()-t_cnt;
cntr.callSt = false;
}
if(isStop) break;
TSYS::taskSleep((int64_t)cntr.period(), cntr.period() ? "" : cntr.cron());
if(cntr.endrunReq) isStop = true;
isStart = false;
}
} catch(TError &err) { mess_err(err.cat.c_str(), err.mess.c_str()); }
cntr.prcSt = false;
return NULL;
}
void TMdContr::cntrCmdProc( XMLNode *opt )
{
//Get page info
if(opt->name() == "info") {
TController::cntrCmdProc(opt);
ctrMkNode("fld",opt,-1,"/cntr/cfg/ADDR",mAddr.fld().descr(),startStat()?R_R_R_:RWRWR_,"root",SDAQ_ID,3,
"tp","str","dest","select","select","/cntr/cfg/trLst");
ctrRemoveNode(opt,"/cntr/cfg/PERIOD");
ctrMkNode("fld",opt,-1,"/cntr/cfg/SCHEDULE",cfg("SCHEDULE").fld().descr(),startStat()?R_R_R_:RWRWR_,"root",SDAQ_ID,4,
"tp","str","dest","sel_ed","sel_list",TMess::labSecCRONsel(),"help",TMess::labSecCRON());
ctrMkNode("fld",opt,-1,"/cntr/cfg/PRIOR",cfg("PRIOR").fld().descr(),startStat()?R_R_R_:RWRWR_,"root",SDAQ_ID,1,"help",TMess::labTaskPrior());
return;
}
//Process command to page
string a_path = opt->attr("path");
if(a_path == "/cntr/cfg/trLst" && ctrChkNode(opt)) {
vector<string> sls;
SYS->transport().at().outTrList(sls);
for(unsigned i_s = 0; i_s < sls.size(); i_s++)
opt->childAdd("el")->setText(sls[i_s]);
}
else TController::cntrCmdProc(opt);
}
bool TMdContr::cfgChange( TCfg &co, const TVariant &pc )
{
TController::cfgChange(co, pc);
if(co.fld().name() == "SCHEDULE")
mPer = TSYS::strSepParse(cron(),1,' ').empty() ? vmax(0,1e9*s2r(cron())) : 0;
return true;
}
//******************************************************
//* TMdPrm *
//******************************************************
TMdPrm::TMdPrm( string name, TTypeParam *tp_prm ) :
TParamContr(name, tp_prm), pEl("w_attr"), modAddr(cfg("MOD_ADDR").getId()), crcCtrl(cfg("CRC_CTRL").getBd()),
hostSignal(cfg("HOST_SIGNAL").getId()), aiMethod(cfg("AI_METHOD").getId()), aiRange(cfg("AI_RANGE").getId()), aoMethod(cfg("AO_METHOD").getId()),
aoRange(cfg("AO_RANGE").getId()), diMethod(cfg("DI_METHOD").getId()), doMethod(cfg("DO_METHOD").getId()), ciMethod(cfg("CI_METHOD").getId())
{
aiErr.setVal("0");
aoErr.setVal("0");
diErr.setVal("0");
doErr.setVal("0");
ciErr.setVal("0");
//Default input/output data
for(int i = 0; i < 32; i++) {
AI[i] = AO[i] = CI[i] = 0;
DI[i] = DO[i] = false;
}
}
TMdPrm::~TMdPrm( )
{
nodeDelAll( );
}
void TMdPrm::postEnable( int flag )
{
TParamContr::postEnable(flag);
if(!vlElemPresent(&pEl)) vlElemAtt(&pEl);
}
TMdContr &TMdPrm::owner( ) const { return (TMdContr&)TParamContr::owner(); }
void TMdPrm::enable()
{
if(enableStat()) return;
TParamContr::enable();
//Delete DAQ parameter's attributes
for(unsigned i_f = 0; i_f < pEl.fldSize(); ) {
try { pEl.fldDel(i_f); continue; }
catch(TError &err) { mess_warning(err.cat.c_str(),err.mess.c_str()); }
i_f++;
}
//Make DAQ parameter's attributes
unsigned itCnt = 0;
// AI
switch(aiMethod) {
case 1: case 201: itCnt = 1; break; //1AI (#AA,#AAN)
case 2: case 202: itCnt = 2; break; //2AI (#AA,#AAN)
case 3: case 203: itCnt = 3; break; //3AI (#AA,#AAN)
case 4: case 204: itCnt = 4; break; //4AI (#AA,#AAN)
case 6: case 206: itCnt = 6; break; //6AI (#AA,#AAN)
case 8: case 208: itCnt = 8; break; //8AI (#AA,#AAN)
case 10: case 210:itCnt = 10; break; //10AI (#AA,#AANN)
case 20: case 220:itCnt = 20; break; //20AI (#AA,#AANN)
case 16: case 316:itCnt = 16; break; //16AI (#AA^AA,#AAN^AAN)
default: itCnt = 0; break;
}
if(itCnt) {
string saiMethod = i2s(aiMethod);
pEl.fldAdd(new TFld("aiErr","aiErr",TFld::String,TFld::NoWrite|TVal::DirRead,"","","","",saiMethod.c_str()));
for(unsigned i_p = 0; i_p < itCnt; i_p++)
pEl.fldAdd(new TFld(TSYS::strMess("AI%d",i_p).c_str(),TSYS::strMess("AI%d",i_p).c_str(),
TFld::Real,TFld::NoWrite|TVal::DirRead,"","","","",saiMethod.c_str()));
}
// AO
string ao_d;
switch(aoRange) {
case 0: ao_d = "0;20"; break; //Engineer (00.000 20.000)
case 1: ao_d = "4;20"; break; //Engineer (04.000 20.000)
case 2: ao_d = "0;10"; break; //Engineer (00.000 10.000)
case 3: ao_d = "0;20"; break; //Engineer (+00.000 +20.000)
case 4: ao_d = "4;20"; break; //Engineer (+04.000 +20.000)
case 5: ao_d = "0;10"; break; //Engineer (+00.000 +10.000)
case 6: ao_d = "-10;10";break; //Engineer (-10.000 +10.000)
case 7: ao_d = "0;5"; break; //Engineer (+00.000 +05.000)
case 8: ao_d = "-5;5"; break; //Engineer (-05.000 +05.000)
case 9: ao_d = "0;100"; break; //Percent (+000.00 +100.00)
case 10:ao_d = "0;4095";break; //Hexadecimal (000 FFF)
default:ao_d = ""; break;
}
switch(aoMethod) {
case 1: itCnt = 1; break; //1AO (#AA)
case 2: itCnt = 2; break; //2AO (#AAN)
case 4: itCnt = 4; break; //4AO (#AAN)
case 14: itCnt = 4; break; //4AO (#AACN)
default:itCnt = 0; break;
}
if(itCnt) {
string saoMethod = i2s(aoMethod);
pEl.fldAdd(new TFld("aoErr","aoErr",TFld::String,TFld::NoWrite|TVal::DirRead,"","","","",saoMethod.c_str()) );
for(unsigned i_p = 0; i_p < itCnt; i_p++)
pEl.fldAdd(new TFld(TSYS::strMess("AO%d",i_p).c_str(),TSYS::strMess("AO%d",i_p).c_str(),
TFld::Real,TVal::DirRead|TVal::DirWrite,"20","1",ao_d.c_str(),"",saoMethod.c_str()));
}
// DI
switch(diMethod) {
case 3: itCnt = 3; break; //3DI ($AA6)
case 4: itCnt = 4; break; //4DI ($AA6)
case 7: itCnt = 7; break; //7DI ($AA6)
case 8: itCnt = 8; break; //8DI ($AA6)
case 14:itCnt = 14; break; //14DI ($AA6)
case 16:itCnt = 16; break; //16DI ($AA6)
case 101:itCnt = 1; break; //1DI (@AADI)
case 201:itCnt = 8; break; //8DI ($AA6,FF00)
default:itCnt = 0; break;
}
if(itCnt) {
string sdiMethod = i2s(diMethod);
pEl.fldAdd(new TFld("diErr","diErr",TFld::String,TFld::NoWrite|TVal::DirRead,"","","","",sdiMethod.c_str()));
for(unsigned i_p = 0; i_p < itCnt; i_p++)
pEl.fldAdd(new TFld(TSYS::strMess("DI%d",i_p).c_str(),TSYS::strMess("DI%d",i_p).c_str(),
TFld::Boolean,TFld::NoWrite|TVal::DirRead,"","","","",sdiMethod.c_str()));
}
// DO
switch(doMethod) {
case 2: itCnt = 2; break; //2DO (@AA,0300)
case 3: itCnt = 3; break; //3DO (@AA,7)
case 4: itCnt = 4; break; //4DO (@AA,F)
case 5: itCnt = 5; break; //5DO (@AA,1F)
case 7: itCnt = 7; break; //7DO (@AA,7F)
case 8: itCnt = 8; break; //8DO (@AA,FF)
case 12:itCnt = 12; break; //12DO (@AA,0FFF)
case 13:itCnt = 13; break; //13DO (@AA,1FFF)
case 16:itCnt = 16; break; //16DO (@AA,FFFF)
case 102:itCnt = 2; break; //2DO (^AADOVVV)
case 103:itCnt = 3; break; //3DO (^AADOVVV)
case 202:itCnt = 2; break; //2DO (@AADO)
case 204:itCnt = 4; break; //4DO (@AADO)
case 306:itCnt = 6; break; //@AADODD
case 402:itCnt = 2; break; //@AADO0D
case 504:itCnt = 4; break; //4DO (@(^)AADO0D)
case 604:itCnt = 4; break; //4DO (@AA,0F00)
case 608:itCnt = 8; break; //8DO (@AA,FF00)
case 704:itCnt = 4; break; //4DO (#AA000F)
case 708:itCnt = 8; break; //8DO (#AA00FF)
case 712:itCnt = 12; break; //12DO (#AA000FFF)
default:itCnt = 0; break;
}
if(itCnt) {
string sdoMethod = i2s(doMethod);
pEl.fldAdd(new TFld("doErr","doErr",TFld::String,TFld::NoWrite|TVal::DirRead,"","","","",sdoMethod.c_str()) );
for(unsigned i_p = 0; i_p < itCnt; i_p++)
pEl.fldAdd(new TFld(TSYS::strMess("DO%d",i_p).c_str(),TSYS::strMess("DO%d",i_p).c_str(),
TFld::Boolean,TVal::DirRead|TVal::DirWrite,"","","","",sdoMethod.c_str()));
}
// CI
switch(ciMethod) {
case 2: itCnt = 2; break; //2CI (#AA)
case 3: itCnt = 3; break; //3CI (#AA)
default:itCnt = 0; break;
}
if(itCnt) {
string sciMethod = i2s(ciMethod);
pEl.fldAdd(new TFld("ciErr","ciErr",TFld::String,TFld::NoWrite|TVal::DirRead,"","","","",sciMethod.c_str()));
for(unsigned i_p = 0; i_p < itCnt; i_p++)
pEl.fldAdd(new TFld(TSYS::strMess("CI%d",i_p).c_str(),TSYS::strMess("CI%d",i_p).c_str(),
TFld::Real,TFld::NoWrite|TVal::DirRead,"","","","",sciMethod.c_str()));
}
owner().prmEn(this, true);
}
void TMdPrm::disable()
{
if(!enableStat()) return;
owner().prmEn(this, false);
TParamContr::disable();
//Set EVAL to parameter attributes
vector<string> ls;
elem().fldList(ls);
for(unsigned i_el = 0; i_el < ls.size(); i_el++)
vlAt(ls[i_el]).at().setS(EVAL_STR, 0, true);
}
void TMdPrm::vlGet( TVal &val )
{
if(!enableStat() || !owner().startStat()) {
if(val.name() == "err") {
if(!enableStat()) val.setS(_("1:Parameter disabled."),0,true);
else if(!owner().startStat()) val.setS(_("2:Acquisition stopped."),0,true);
}
else val.setS(EVAL_STR,0,true);
return;
}
if(owner().redntUse()) return;
if(val.name() == "aiErr") val.setS(aiErr.getVal(),0,true);
else if(val.name() == "aoErr") val.setS(aoErr.getVal(),0,true);
else if(val.name() == "diErr") val.setS(diErr.getVal(),0,true);
else if(val.name() == "doErr") val.setS(doErr.getVal(),0,true);
else if(val.name() == "ciErr") val.setS(ciErr.getVal(),0,true);
else if(val.name() == "err") {
if(aiErr.getVal() != "0") val.setS(aiErr.getVal(),0,true);
else if(aoErr.getVal() != "0") val.setS(aoErr.getVal(),0,true);
else if(diErr.getVal() != "0") val.setS(diErr.getVal(),0,true);
else if(doErr.getVal() != "0") val.setS(doErr.getVal(),0,true);
else if(ciErr.getVal() != "0") val.setS(ciErr.getVal(),0,true);
else val.setS("0",0,true);
}
else if(val.name().compare(0,2,"AI") == 0) val.setR(AI[s2i(val.name().substr(2,val.name().size()-2))],0,true);
else if(val.name().compare(0,2,"AO") == 0) val.setR(AO[s2i(val.name().substr(2,val.name().size()-2))],0,true);
else if(val.name().compare(0,2,"DI") == 0) val.setB(DI[s2i(val.name().substr(2,val.name().size()-2))],0,true);
else if(val.name().compare(0,2,"DO") == 0) val.setB(DO[s2i(val.name().substr(2,val.name().size()-2))],0,true);
else if(val.name().compare(0,2,"CI") == 0) val.setR(CI[s2i(val.name().substr(2,val.name().size()-2))],0,true);
}
void TMdPrm::vlSet( TVal &vo, const TVariant &vl, const TVariant &pvl )
{
if(!enableStat() || !owner().startStat()) { vo.setI(EVAL_INT, 0, true); return; }
//Send to active reserve station
if(owner().redntUse()) {
if(vl == pvl) return;
XMLNode req("set");
req.setAttr("path",nodePath(0,true)+"/%2fserv%2fattr")->childAdd("el")->setAttr("id",vo.name())->setText(vl.getS());
SYS->daq().at().rdStRequest(owner().workId(),req);
return;
}
//Direct write
if(vo.name().compare(0,2,"AO") == 0) AO[s2i(vo.name().substr(2,vo.name().size()-2))] = vl.getR();
if(vo.name().compare(0,2,"DO") == 0) DO[s2i(vo.name().substr(2,vo.name().size()-2))] = vl.getB();
}
void TMdPrm::vlArchMake( TVal &val )
{
TParamContr::vlArchMake(val);
if(val.arch().freeStat()) return;
val.arch().at().setSrcMode(TVArchive::PassiveAttr);
val.arch().at().setPeriod(owner().period() ? (int64_t)owner().period()/1000 : 1000000);
val.arch().at().setHardGrid(true);
val.arch().at().setHighResTm(true);
}
bool TMdPrm::cfgChange( TCfg &co, const TVariant &pc )
{
TParamContr::cfgChange(co, pc);
if(enableStat() && (co.fld().name() == "AI_METHOD" || co.fld().name() == "AO_METHOD" ||
co.fld().name() == "DI_METHOD" || co.fld().name() == "DO_METHOD" || co.fld().name() == "CI_METHOD"))
disable();
return true;
}
void TMdPrm::cntrCmdProc( XMLNode *opt )
{
//Get page info
if(opt->name() == "info") {
TParamContr::cntrCmdProc(opt);
if(aiMethod == 0) ctrRemoveNode(opt,"/prm/cfg/AI_RANGE");
if(aoMethod == 0) ctrRemoveNode(opt,"/prm/cfg/AO_RANGE");
return;
}
//Process command to page
TParamContr::cntrCmdProc(opt);
}
| gpl-2.0 |
muliana98/ITMedia-Com | admin/content/kategori/kategori-update.php | 1659 | <?php
include "koneksi.php";
$id_kategori = mysqli_real_escape_string($koneksi, trim($_GET['id_kategori']));
$beritabaru = "SELECT * FROM kategori WHERE id_kategori='$id_kategori'";
$sql = mysqli_query($koneksi, $beritabaru);
$hasil = mysqli_fetch_array($sql);
$id_kategori = mysqli_real_escape_string($koneksi, trim($hasil['id_kategori']));
$nm_kategori = mysqli_real_escape_string($koneksi, trim($hasil['nm_kategori']));
$deskripsi = mysqli_real_escape_string($koneksi, trim(stripslashes($hasil['deskripsi'])));
?>
<div class="row">
<div class="container">
<h4 class="text-info"><i class="icon icon-edit"></i> Perbarui Kategori</h4>
<form method="post" name="input" action="content/kategori/kategori-update-p.php" class="orange">
<input type="hidden" name="id_kategori" value="<?php echo $id_kategori; ?>" />
<input type="hidden" name="getnama" value="<?php echo $nm_kategori; ?>" />
<table class="table table-striped">
<tr>
<td>Nama Kategori</td>
<td>:</td>
<td><input type="text" name="nm_kategori" value="<?php echo $nm_kategori; ?>" class="input-xlarge"></td>
</tr>
<tr>
<td>Deskripsi</td>
<td>:</td>
<td><input type="text" name="deskripsi" value="<?php echo $deskripsi; ?>" class="input-xlarge"></td>
</tr>
<tr>
<td></td>
<td colspan="2">
<input type="submit" name="input" class="btn btn-success" value="Update Kategori">
<a class="btn btn-danger" href="home.php?menu=kategori">Batal</a>
</td>
</tr>
</table>
</form>
</div>
</div>
| gpl-2.0 |
sal64dd/Digilib_net | digilib_net/Digilib_net/elib_bin/Studyzone/NcertBook.php | 9334 | <?php
/*
* NcertBooks of Digilib_net
* ver 11.70
* Glasswid flwer
*
* author: designed and developed by sal64dd
* contact: [email protected]
*/
if(!isset($_GET["ncBook"])){
header('Location: '."study_home.php");
}
else{
//defaults
ini_set("include_path", "../../");
include "elib_depend/glasswindow/Glasswid_flwer.php";
//links
digilib_Meta("Digital Library | Home", '
<link rel="stylesheet" type="text/css" href="elib_bin/Studyzone/NcertBook.css">');
echo '<body>';
//Navibar
digilib_Header();
//Get the info from sql
$db = new mysqli($GLOBALS["db_MYSQL_SERVER"], $GLOBALS["db_MYSQL_USER"], $GLOBALS["db_MYSQL_Pass"], $GLOBALS["db_MYSQL_DB"]);
if($db->connect_errno > 0){
echo('Unable to connect to database. Try again later!');
}
$sql ='SELECT * from `ncert_book_info` where `book_id`=\''.$_GET["ncBook"].'\';';
if(!$result = $db->query($sql)){
echo('There was an error in the Server. Please try again later.');
}
if($result->num_rows == 0){
echo('Coundn\'t find the asked Book! Try something else.');
}
else{
$row = $result->fetch_assoc();
$result->free();
$db->close();
//****START OF HTML FILE****
echo '<div class="body-cont"><div class="main">
<div class="display">
<div class="cover"></div>
<div class="info">
<div class="book-name">'.$row['book_title'].'</div>
<div class="author-name">Class '.$row['grade'].'</div>
<hr>
<div class="ttinfo">Rating:';
for($i=0;$i<$row['rating'];$i+=2){
if(($row['rating']-$i)==1){
echo '<span class="halfstar"></span>';
}
else{
echo '<span class="fullstar"></span>';
}
}
echo '</div>
<div class="ttinfo">Chapters: <span class="ttifno">'.$row['chapter_no'].'</span></div>
<div class="ttinfo">Size: <span class="ttifno">'.$row['size'].' mb</span></div>
<div class="ttinfo">Available As Download: <span class="ttifno">'.($row['isAvailDown']?'Yes':'No').'</span></div>
<div class="ttinfo">Available In Library: <span class="ttifno">'.($row['isAvailLib']?'Yes':'No').'</span></div>
<hr>
<a href="'.$row['book_link'].'" class="Download"><div></div>Download</a>';
if($row['buy_link']!=""){
echo '<a href="'.$row['buy_link'].'" class="Buy"><div></div>Buy</a>';
}
echo '</div>
</div>';
$Book_Arr = explode("|" , $row['chapter_info']);
$count = count($Book_Arr);
//Feeds
//settings
$NCERT_Chap_feeds[0][0]=1; //width
$NCERT_Chap_feeds[0][1]=0; //image 1=true, 0=false
$NCERT_Chap_feeds[0][2]="Chapters"; //name
$NCERT_Chap_feeds[0][3]=1; //index no
$NCERT_Chap_feeds[0][4]=$count/2; //count of feed elem
for($i=0,$j=0;$i<$count;$i+=2,$j++){
$NCERT_Chap_feeds[$j+1][0]=$Book_Arr[$i];
$NCERT_Chap_feeds[$j+1][1]="";
$NCERT_Chap_feeds[$j+1][3]="elib_bin/Studyzone/NcertBook.php?ncBook=00000001&ncChap=".($i+1);
}
echo '<div class="book_prev hd_divs">
<h1>Quick Preview:</h1>
<hr><div class="feed">';
prt_feed($NCERT_Chap_feeds);
prt_feed_css();
if(isset($_GET["ncChap"])){
echo '<iframe class="PrevFrame" src="'.$Book_Arr[($_GET["ncChap"])].'" frameborder="0" scrolling="no">
</iframe>';
}
else{
echo '<div class="PrevFrame">Select a Chapter</div>';
}
echo'
</div></div>
<div class="comment hd_divs">
<h1>Reviews</h1>
<hr></div>';
prt_nbstyle_css();
//****END OF HTML FILE****
echo '</div></div>';
//Footer
digilib_Footer();
echo '<script src="elib_bin/Elib/Book.js"></script>
</body></html>';
}
}
function prt_nbstyle_css(){
echo' <style>
.body-cont .display{
position: relative;
display: block;
width: auto; height: auto;
text-align: left;
}
.body-cont .display .cover{
position: relative;
display: inline-block; vertical-align: middle;
width: 300px; height: 380px;
border: solid 1px #dedede; border-radius: 5px;
box-shadow: 0px 0px 8px rgba(100,100,100,0.1);
margin-right: 10px;
background: url(elib_database/database_study/cover/'.$_GET['ncBook'].'.jpg) center no-repeat;
background-size: cover;
}
.body-cont .display .info{
position: relative;
display: inline-block; vertical-align: middle;
width: calc(100% - 320px); height: auto;
}
.body-cont .display .info .book-name{
font-family: display_4_r;
font-size: 56px;
color: #686868;
height: auto; width: calc(100% - 30px);
white-space: normal;
text-shadow: 0px 0px 1px #686868;
}
.body-cont .display .info .author-name{
font-family: display_4_r;
font-size: 36px;
color: #cdcdcd;
height: auto; width: calc(100% - 30px);
white-space: normal;
margin-bottom: 30px;
color: #FF8930;
text-shadow: 0px 0px 1px #FF8930
}
.body-cont .display .info .ttinfo{
font-family: display_4_r;
font-size: 16px;
padding: 5px;
color: #adadad;
}
.body-cont .display .info hr{
border: none;
border-top: solid 1px #dedede;
}
.body-cont .display .info .ttinfo .fullstar{
width: 15px; height: 15px;
display: inline-block; vertical-align:top;
background: url(elib_depend/graphics/interface_graphics/icons/orgGrad/stargrey.png) center no-repeat;
background-size: contain;
}
.body-cont .display .info .ttinfo .halfstar{
width: 7px; height: 15px;
display: inline-block; vertical-align:top;
background: url(elib_depend/graphics/interface_graphics/icons/orgGrad/stargrey.png) no-repeat;
background-size: 15px 15px;
background-position: -8px;
margin-left:3px;
}
.body-cont .display .info .Download{
position: relative;
padding: 15px;
background: linear-gradient(to bottom, rgba(83,203,241,1) 0%,rgba(5,171,224,1) 100%);
font-family: display_4_r;
font-size: 20px;
color: #efefef;
display: inline-block;vertical-align: top;
width: auto; height: auto;
cursor: pointer;
}
.body-cont .display .info .Download div{
position: absolute;
top: 0; left:0; right:0; bottom: 0;
background: url("elib_depend/graphics/interface_graphics/icons/white/downgrey.png") right no-repeat;
background-size: 40px;
background-position: 122px 8px;
}
.body-cont .display .info .Buy{
position: relative;
padding: 15px;
background: linear-gradient(to bottom, #ffa84c 0%,#ff7b0d 100%);
font-family: display_4_r;
font-size: 20px;
color: #efefef;
display: inline-block;vertical-align: top;
cursor: pointer;
}
.body-cont .display .info .Download, .body-cont .display .info .Buy{
text-decoration: none;
padding-right:50px;
padding-left: 20px;
}
.body-cont .display .info .Buy div{
position: absolute;
top: 0; left:0; right:0; bottom: 0;
background: url("elib_depend/graphics/interface_graphics/icons/white/externLinksgrey.png") right no-repeat;
background-size: 40px;
background-position: 62px;
}
.body-cont .display .info .Download:hover{
background: linear-gradient(to bottom, rgba(100,223,261,1) 0%,rgba(5,171,224,1) 100%);
color: #fff;
text-shadow: 0px 0px 3px #fff;
}
.body-cont .display .info .Buy:hover{
background: linear-gradient(to bottom, #ffcf5f 10%,#ff7b0d 100%);
color: #fff;
text-shadow: 0px 0px 3px #fff;
}
.body-cont .hd_divs{
display: block; width: auto;
height: auto;
margin-bottom: 10px;
margin-top: 30px;
text-align: left;
font-family: display_4_r;
color:#a8a8a8;
font-size: 14px;
line-height:18px; word-spacing: 3px; word-break: break-all;
}
.body-cont .hd_divs h1{
font-family: display_4_r;
font-size: 24px;
text-align: left;
color: #cdcdcd;
}
.body-cont .hd_divs hr{
border: none;
border-top: solid 1px #cdcdcd;
}
.body-cont .book_prev .PrevFrame{
position: relative;
display: inline-block;
width: calc(100% - 340px);
vertical-align: top;
height: 540px;
background: #fefefe;
box-shadow:inset 0px 0px 3px rgba(100,100,100,0.3);
}
.body-cont .book_prev div.PrevFrame{
text-align: center;
line-height: 500px;
border-radius :3px;
background: #fefefe;
box-shadow:inset 0px 0px 3px rgba(100,100,100,0.3);
}
.body-cont .hd_divs .author_pic{
border: solid 1px #dedede;
border-radius: 5px;
width: 160px; height: 200px;
float: left;
margin: 10px;
}
.body-cont .hd_divs .More{
display: block;
position: relative;
text-align: right;
margin: 5px;
color: #FF8930;
font-size: 16px;
cursor: pointer;
}
@media only screen and (max-width: 770px){
.body-cont .display .cover, .body-cont .display .info{
display: block;
margin: 15px;
}
.body-cont .display .info{
width: auto;
}
}
@media only screen and (max-width: 1000px){
.body-cont .book_prev .PrevFrame{
display: block;
width: calc(100% - 10px);height: 500px;
}
}
</style>';}
?> | gpl-2.0 |
roderickmackenzie/gpvdm | gpvdm_gui/gui/epitaxy_class.py | 8876 | #
# General-purpose Photovoltaic Device Model - a drift diffusion base/Shockley-Read-Hall
# model for 1st, 2nd and 3rd generation solar cells.
# Copyright (C) 2008-2022 Roderick C. I. MacKenzie r.c.i.mackenzie at googlemail.com
#
# https://www.gpvdm.com
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License v2.0, 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.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
## @package epitaxy_class
# The epitaxy class.
#
import os
import math
from util import isnumber
from cal_path import get_materials_path
from cal_path import get_default_material_path
from cal_path import get_sim_path
from contacts_io import contacts_io
from shape import shape
from gui_enable import gui_get
if gui_get()==True:
#from file_watch import get_watch
from PyQt5.QtCore import pyqtSignal
from PyQt5.QtWidgets import QWidget
from util_text import insert_tab
from json_base import json_base
from json_epi_interface import json_epi_interface
from json_material_db_item import json_material_db_item
class epi_layer(shape):
def __init__(self):
super().__init__()
self.var_list.append(["layer_type","other"])
self.var_list.append(["layer_interface",json_epi_interface()])
self.var_list.append(["solve_optical_problem",True])
self.var_list.append(["solve_thermal_problem",True])
self.var_list_build()
self.start=0.0
self.end=0.0
def set_dy(self,data):
if type(data)==float or type(data)==int:
self.dy=float(data)
if type(data)==str:
try:
self.dy=float(data)
except:
return False
return True
def cal_rgb(self):
if self.color_r==0.0 and self.color_g==0.8 and self.color_b==0.0:
mat_db_item=json_material_db_item()
if mat_db_item.load(os.path.join(os.path.join(get_materials_path(),self.optical_material),"data.json"))==False:
return
self.color_r=mat_db_item.color_r
self.color_g=mat_db_item.color_g
self.color_b=mat_db_item.color_b
self.color_alpha=mat_db_item.color_alpha
class epitaxy(json_base):
def __init__(self):
self.layers=[]
self.callbacks=[]
json_base.__init__(self,"epitaxy")
self.segments_name=["layers"]
self.var_list.append(["contacts",contacts_io()])
self.var_list_build()
self.loaded=False
def dump_tree(self):
for i in range(0,len(self.layers)):
l=self.layers[i]
print("layer:"+str(i)+" "+str(l.name))
for s in l.shapes:
print(s.name)
def dump(self):
lines=self.gen_output()
for l in lines:
print(l)
def get_new_material_name(self):
count=0
while(1):
found=False
name="newlayer"+str(count)
for l in self.layers:
if name==l.shape_name:
found=True
break
if found==False:
break
count=count+1
return name
def layer_to_index(self,index):
if type(index)==int:
return index
else:
for i in range(0,len(self.layers)):
if self.layers[i].name==index:
return i
return -1
def add_new_layer(self,pos=-1):
if pos!=-1:
pos=self.layer_to_index(pos)
a=epi_layer()
a.dy=100e-9
a.shape_name=self.get_new_material_name()
a.shapes=[]
a.color_r=1.0
a.color_g=0
a.color_b=0
a.color_alpha=0.5
a.load_triangles()
if pos==-1:
self.layers.append(a)
else:
self.layers.insert(pos, a)
return a
def move_up(self,pos):
pos=self.layer_to_index(pos)
if pos<1:
return
self.layers.insert(pos-1, self.layers.pop(pos))
def move_down(self,pos):
pos=self.layer_to_index(pos)
#print(pos)
if pos>len(self.layers)-1 or pos<0:
return
self.layers.insert(pos+1, self.layers.pop(pos))
def gen_json(self):
lines=[]
lines.append("\"epitaxy\": {")
lines.append("\t\"layers\":"+str(len(self.layers))+",")
for i in range(0,len(self.layers)):
lines.append("\t\"layer"+str(i)+"\": {")
lines.extend(self.layers[i].gen_json(include_bracket=False))
lines[-1]=lines[-1]+","
lines.append("\t\t\"layer_shapes\":"+str(len(self.layers[i].shapes))+",")
ns=0
for s in self.layers[i].shapes:
lines.append("\t\t\"shape"+str(ns)+"\": {")
insert_lines=s.shape_gen_json()
insert_tab(insert_lines,3)
lines.extend(insert_lines[1:])
lines[-1]=lines[-1]+","
ns=ns+1
lines[-1]=lines[-1][:-1]
lines.append("\t}")
lines[-1]=lines[-1]+","
lines.extend(self.contacts.gen_json())
lines.append("}")
#print(self.contacts.gen_json())
return lines
def update_layer_type(self,layer,data):
l=self.layers[layer]
l.layer_type=data
if l.layer_type=="active":
l.shape_dos.enabled=True
else:
l.shape_dos.enabled=False
def find_object_by_id(self,id):
for c in self.contacts.segments:
if c.id==id:
return c
for l in self.layers:
obj=l.find_object_by_id(id)
if obj!=None:
return obj
for s in l.shapes:
obj=s.find_object_by_id(id)
if obj!=None:
return obj
return None
def find_layer_by_id(self,id):
nl=0
for c in self.contacts.segments:
if c.id==id:
if c.position=="top":
return 0
if c.position=="bottom":
return len(self.layers)-1
for l in self.layers:
if l.id==id:
return nl
for s in l.shapes:
if s.id==id:
return nl
nl=nl+1
return None
def find_shape_by_name(self,name):
for c in self.contacts.segments:
if c.shape_name==name:
return c
for l in self.layers:
if l.shape_name==name:
return l
for s in l.shapes:
if s.shape_name==name:
return s
return None
def get_top_contact_layer(self):
for l in range(0,len(self.layers)):
if self.layers[l].layer_type=="contact":
return l
return -1
def get_btm_contact_layer(self):
found=0
for l in range(0,len(self.layers)):
if self.layers[l].layer_type=="contact":
if found==1:
return l
found=found+1
return -1
def get_all_sub_shapes(self,id):
ret=[]
for l in self.layers:
if l.id==id:
ret.append(l)
for s in l.shapes:
ret.append(s)
#return ret
return ret
def ylen(self):
tot=0
for a in self.layers:
tot=tot+a.dy
return tot
def get_layer_by_cordinate(self,y):
tot=0
for i in range(0,len(self.layers)):
tot=tot+self.layers[i].dy
#print(tot, y,i)
if tot>=y or math.isclose(tot, y, rel_tol=1e-10):
return i
return -1
def reload_shapes(self):
for a in self.layers:
for s in a.shapes:
#print(s.file_name)
s.load(s.file_name)
def get_shapes_between_x(self,x0,x1):
shapes=[]
for layer in self.layers:
for s in layer.shapes:
for pos in s.expand_xyz0(layer):
if pos.x>x0 and pos.x<x1:
shapes.append(s)
return shapes
def add_callback(self,fn):
self.callbacks.append(fn)
def load_from_json(self,json):
if type(json)!=dict:
asdasd
self.layers=[]
y_pos=0.0
number_of_layers=json['layers']
for layer in range(0,number_of_layers):
layer_json=json['layer'+str(layer)]
a=epi_layer()
a.decode_from_json(layer_json)
if a.layer_type=="active":
a.shape_dos.enabled=True
a.cal_rgb()
#shape
a.shapes=[]
for ns in range(0,int(layer_json['layer_shapes'])):
my_shape=shape()
my_shape.decode_from_json(layer_json["shape"+str(ns)])
my_shape.moveable=True
a.shapes.append(my_shape)
a.start=y_pos
y_pos=y_pos+a.dy
a.end=y_pos
self.layers.append(a)
self.contacts.load_json(json['contacts'])
self.loaded=True
#self.dump_tree()
def get_layer_end(self,l):
pos=0.0
for i in range(0, l+1):
pos=pos+self.layers[i].dy
return pos
def get_layer_start(self,l):
pos=0.0
for i in range(0, l):
pos=pos+self.layers[i].dy
return pos
def get_device_start(self,data):
if data.electrical_solver.solver_type=="circuit":
return 0.0
pos=0.0
for i in range(0, len(self.layers)):
if self.layers[i].layer_type=="active":
return pos
pos=pos+self.layers[i].dy
return None
def get_next_dos_layer(self,layer):
layer=layer+1
for i in range(layer,len(self.layers)):
if self.layers[i].layer_type=="active":
return i
return False
def symc_to_mesh(self,mesh_y):
active_layers=0
tot_dy=0.0
for l in self.layers:
if l.layer_type=="active":
active_layers=active_layers+1
tot_dy=tot_dy+l.dy
if len(mesh_y.segments)==active_layers:
pos=0
for l in self.layers:
if l.layer_type=="active":
mesh_y.segments[pos].len=l.dy
pos=pos+1
return
if len(mesh_y.segments)==1:
mesh_y.segments[0].len=tot_dy
| gpl-2.0 |
TheReaCompany/nicolemiller | wp-content/themes/hazel/templates/blog/blog_large_image-loop.php | 17225 | <?php
global $qode_options;
global $more;
$more = 0;
$blog_hide_comments = "";
if (isset($qode_options['blog_hide_comments'])) {
$blog_hide_comments = $qode_options['blog_hide_comments'];
}
$blog_hide_author = "";
if (isset($qode_options['blog_hide_author'])) {
$blog_hide_author = $qode_options['blog_hide_author'];
}
$qode_like = "on";
if (isset($qode_options['qode_like'])) {
$qode_like = $qode_options['qode_like'];
}
$wp_read_more = "off";
if (isset($qode_options['wp_read_more'])) {
$wp_read_more = $qode_options['wp_read_more'];
}
$_post_format = get_post_format();
?>
<?php
switch ($_post_format) {
case "video":
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="post_content_holder">
<div class="post_image">
<?php $_video_type = get_post_meta(get_the_ID(), "video_format_choose", true);?>
<?php if($_video_type == "youtube") { ?>
<iframe src="http://www.youtube.com/embed/<?php echo get_post_meta(get_the_ID(), "video_format_link", true); ?>?wmode=transparent" wmode="Opaque" frameborder="0" allowfullscreen></iframe>
<?php } elseif ($_video_type == "vimeo"){ ?>
<iframe src="http://player.vimeo.com/video/<?php echo get_post_meta(get_the_ID(), "video_format_link", true); ?>?title=0&byline=0&portrait=0" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
<?php } elseif ($_video_type == "self"){ ?>
<div class="video">
<div class="mobile-video-image" style="background-image: url(<?php echo get_post_meta(get_the_ID(), "video_format_image", true); ?>);"></div>
<div class="video-wrap" >
<video class="video" poster="<?php echo get_post_meta(get_the_ID(), "video_format_image", true); ?>" preload="auto">
<?php if(get_post_meta(get_the_ID(), "video_format_webm", true) != "") { ?> <source type="video/webm" src="<?php echo get_post_meta(get_the_ID(), "video_format_webm", true); ?>"> <?php } ?>
<?php if(get_post_meta(get_the_ID(), "video_format_mp4", true) != "") { ?> <source type="video/mp4" src="<?php echo get_post_meta(get_the_ID(), "video_format_mp4", true); ?>"> <?php } ?>
<?php if(get_post_meta(get_the_ID(), "video_format_ogv", true) != "") { ?> <source type="video/ogg" src="<?php echo get_post_meta(get_the_ID(), "video_format_ogv", true); ?>"> <?php } ?>
<object width="320" height="240" type="application/x-shockwave-flash" data="<?php echo get_template_directory_uri(); ?>/js/flashmediaelement.swf">
<param name="movie" value="<?php echo get_template_directory_uri(); ?>/js/flashmediaelement.swf" />
<param name="flashvars" value="controls=true&file=<?php echo get_post_meta(get_the_ID(), "video_format_mp4", true); ?>" />
<img src="<?php echo get_post_meta(get_the_ID(), "video_format_image", true); ?>" width="1920" height="800" title="No video playback capabilities" alt="Video thumb" />
</object>
</video>
</div></div>
<?php } ?>
</div>
<div class="post_text">
<div class="post_text_inner">
<h3><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
<div class="post_info">
<?php if($blog_hide_author == "no") { ?>
<span class="post_author">
<a class="post_author_link" href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>">
<i class="icon_pencil-edit" aria-hidden="true"></i>
<span><?php the_author_meta('display_name'); ?></span></a>
</span>
<?php } ?>
<span class="time">
<i class="icon_clock_alt" aria-hidden="true"></i>
<span><?php the_time('d.m.Y '); ?></span>
</span>
<span class="post_category">
<i class="icon_tag_alt" aria-hidden="true"></i>
<span><?php the_category(', '); ?></span>
</span>
<?php if($blog_hide_comments != "yes"){ ?>
<a class="post_comments" href="<?php comments_link(); ?>" target="_self">
<i class="icon_comment_alt" aria-hidden="true"></i>
<span><?php comments_number('0', '1', '%'); ?></span></a>
<?php } ?>
<?php if( $qode_like == "on" ) { ?>
<div class="blog_like">
<?php if( function_exists('qode_like') ) qode_like(); ?>
</div>
<?php } ?>
<?php if(isset($qode_options['enable_social_share']) && $qode_options['enable_social_share'] == "yes") { ?>
<?php echo do_shortcode('[social_share]'); ?>
<?php } ?>
</div>
<?php
if($wp_read_more == "off"){
qode_excerpt();
} else {
the_content('Read More');
}
?>
<?php if($wp_read_more == "off"){ ?>
<div class="post_more">
<a href="<?php the_permalink(); ?>" class="qbutton small"><?php _e('Read More','qode'); ?></a>
</div>
<?php } ?>
</div>
</div>
</div>
</article>
<?php
break;
case "audio":
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="post_content_holder">
<div class="post_image">
<audio class="blog_audio" src="<?php echo get_post_meta(get_the_ID(), "audio_link", true) ?>" controls="controls">
<?php _e("Your browser don't support audio player","qode"); ?>
</audio>
</div>
<div class="post_text">
<div class="post_text_inner">
<h3><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
<div class="post_info">
<?php if($blog_hide_author == "no") { ?>
<span class="post_author">
<a class="post_author_link" href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>">
<i class="icon_pencil-edit" aria-hidden="true"></i><span><?php the_author_meta('display_name'); ?></span></a>
</span>
<?php } ?>
<span class="time">
<i class="icon_clock_alt" aria-hidden="true"></i>
<span><?php the_time('d.m.Y '); ?></span>
</span>
<span class="post_category">
<i class="icon_tag_alt" aria-hidden="true"></i>
<span><?php the_category(', '); ?></span>
</span>
<?php if($blog_hide_comments != "yes"){ ?>
<a class="post_comments" href="<?php comments_link(); ?>" target="_self">
<i class="icon_comment_alt" aria-hidden="true"></i>
<span><?php comments_number('0', '1', '%'); ?></span></a>
<?php } ?>
<?php if( $qode_like == "on" ) { ?>
<div class="blog_like">
<?php if( function_exists('qode_like') ) qode_like(); ?>
</div>
<?php } ?>
<?php if(isset($qode_options['enable_social_share']) && $qode_options['enable_social_share'] == "yes") { ?>
<?php echo do_shortcode('[social_share]'); ?>
<?php } ?>
</div>
<?php
if($wp_read_more == "off"){
qode_excerpt();
} else {
the_content('Read More');
}
?>
<?php if($wp_read_more == "off"){ ?>
<div class="post_more">
<a href="<?php the_permalink(); ?>" class="qbutton small"><?php _e('Read More','qode'); ?></a>
</div>
<?php } ?>
</div>
</div>
</div>
</article>
<?php
break;
case "gallery":
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="post_content_holder">
<div class="post_image">
<div class="flexslider">
<ul class="slides">
<?php
$post_content = get_the_content();
preg_match('/\[gallery.*ids=.(.*).\]/', $post_content, $ids);
$array_id = explode(",", $ids[1]);
foreach($array_id as $img_id){ ?>
<li><a href="<?php the_permalink(); ?>"><?php echo wp_get_attachment_image( $img_id, 'full' ); ?></a></li>
<?php } ?>
</ul>
</div>
</div>
<div class="post_text">
<div class="post_text_inner">
<h3><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
<div class="post_info">
<?php if($blog_hide_author == "no") { ?>
<span class="post_author">
<a class="post_author_link" href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>">
<i class="icon_pencil-edit" aria-hidden="true"></i><span><?php the_author_meta('display_name'); ?></span></a>
</span>
<?php } ?>
<span class="time">
<i class="icon_clock_alt" aria-hidden="true"></i>
<span><?php the_time('d.m.Y '); ?></span>
</span>
<span class="post_category">
<i class="icon_tag_alt" aria-hidden="true"></i>
<span><?php the_category(', '); ?></span>
</span>
<?php if($blog_hide_comments != "yes"){ ?>
<a class="post_comments" href="<?php comments_link(); ?>" target="_self">
<i class="icon_comment_alt" aria-hidden="true"></i>
<span><?php comments_number('0', '1', '%'); ?></span></a>
<?php } ?>
<?php if( $qode_like == "on" ) { ?>
<div class="blog_like">
<?php if( function_exists('qode_like') ) qode_like(); ?>
</div>
<?php } ?>
<?php if(isset($qode_options['enable_social_share']) && $qode_options['enable_social_share'] == "yes") { ?>
<?php echo do_shortcode('[social_share]'); ?>
<?php } ?>
</div>
<?php
if($wp_read_more == "off"){
qode_excerpt();
} else {
the_content('Read More');
}
?>
<?php if($wp_read_more == "off"){ ?>
<div class="post_more">
<a href="<?php the_permalink(); ?>" class="qbutton small"><?php _e('Read More','qode'); ?></a>
</div>
<?php } ?>
</div>
</div>
</div>
</article>
<?php
break;
case "link":
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="post_content_holder">
<div class="post_text">
<div class="post_text_inner">
<div class="post_info">
<?php if($blog_hide_author == "no") { ?>
<span class="post_author">
<a class="post_author_link" href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>">
<i class="icon_pencil-edit" aria-hidden="true"></i><span><?php the_author_meta('display_name'); ?></span></a>
</span>
<?php } ?>
<span class="time">
<i class="icon_clock_alt" aria-hidden="true"></i>
<span><?php the_time('d.m.Y '); ?></span>
</span>
<span class="post_category">
<i class="icon_tag_alt" aria-hidden="true"></i>
<span><?php the_category(', '); ?></span>
</span>
<?php if($blog_hide_comments != "yes"){ ?>
<a class="post_comments" href="<?php comments_link(); ?>" target="_self">
<i class="icon_comment_alt" aria-hidden="true"></i>
<span><?php comments_number('0', '1', '%'); ?></span></a>
<?php } ?>
<?php if( $qode_like == "on" ) { ?>
<div class="blog_like">
<?php if( function_exists('qode_like') ) qode_like(); ?>
</div>
<?php } ?>
<?php if(isset($qode_options['enable_social_share']) && $qode_options['enable_social_share'] == "yes") { ?>
<?php echo do_shortcode('[social_share]'); ?>
<?php } ?>
</div>
<i class="link_mark icon_link_alt pull-left" aria-hidden="true"></i>
<div class="post_title">
<p><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
</div>
</div>
</div>
</div>
</article>
<?php
break;
case "quote":
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="post_content_holder">
<div class="post_text">
<div class="post_text_inner">
<div class="post_info">
<?php if($blog_hide_author == "no") { ?>
<span class="post_author">
<a class="post_author_link" href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"><i class="icon_pencil-edit" aria-hidden="true"></i> <span><?php the_author_meta('display_name'); ?></span></a>
</span>
<?php } ?>
<span class="time">
<i class="icon_clock_alt" aria-hidden="true"></i>
<span><?php the_time('d.m.Y '); ?></span>
</span>
<span class="post_category">
<i class="icon_tag_alt" aria-hidden="true"></i>
<span><?php the_category(', '); ?></span>
</span>
<?php if($blog_hide_comments != "yes"){ ?>
<a class="post_comments" href="<?php comments_link(); ?>" target="_self">
<i class="icon_comment_alt" aria-hidden="true"></i>
<span><?php comments_number('0', '1', '%'); ?></span></a>
<?php } ?>
<?php if( $qode_like == "on" ) { ?>
<div class="blog_like">
<?php if( function_exists('qode_like') ) qode_like(); ?>
</div>
<?php } ?>
<?php if(isset($qode_options['enable_social_share']) && $qode_options['enable_social_share'] == "yes") { ?>
<?php echo do_shortcode('[social_share]'); ?>
<?php } ?>
</div>
<i class="qoute_mark icon_quotations pull-left" aria-hidden="true"></i>
<div class="post_title">
<p>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php echo get_post_meta(get_the_ID(), "quote_format", true); ?>
<span class="quote_author">— <?php the_title(); ?></span>
</a>
</p>
</div>
</div>
</div>
</div>
</article>
<?php
break;
default:
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="post_content_holder">
<?php if ( has_post_thumbnail() ) { ?>
<div class="post_image">
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
<?php the_post_thumbnail('full'); ?>
</a>
</div>
<?php } ?>
<div class="post_text">
<div class="post_text_inner">
<h3><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
<div class="post_info">
<?php if($blog_hide_author == "no") { ?>
<span class="post_author">
<a class="post_author_link" href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>">
<i class="icon_pencil-edit" aria-hidden="true"></i>
<span><?php the_author_meta('display_name'); ?></span></a>
</span>
<?php } ?>
<span class="time">
<i class="icon_clock_alt" aria-hidden="true"></i>
<span><?php the_time('d.m.Y '); ?></span>
</span>
<span class="post_category">
<i class="icon_tag_alt" aria-hidden="true"></i>
<span><?php the_category(', '); ?></span>
</span>
<?php if($blog_hide_comments != "yes"){ ?>
<a class="post_comments" href="<?php comments_link(); ?>" target="_self">
<i class="icon_comment_alt" aria-hidden="true"></i>
<span><?php comments_number('0', '1', '%'); ?></span></a>
<?php } ?>
<?php if( $qode_like == "on" ) { ?>
<div class="blog_like">
<?php if( function_exists('qode_like') ) qode_like(); ?>
</div>
<?php } ?>
<?php if(isset($qode_options['enable_social_share']) && $qode_options['enable_social_share'] == "yes") { ?>
<?php echo do_shortcode('[social_share]'); ?>
<?php } ?>
</div>
<?php
if($wp_read_more == "off"){
qode_excerpt();
} else {
the_content('Read More');
}
?>
<?php if($wp_read_more == "off"){ ?>
<div class="post_more">
<a href="<?php the_permalink(); ?>" class="qbutton small"><?php _e('Read More','qode'); ?></a>
</div>
<?php } ?>
</div>
</div>
</div>
</article>
<?php
}
?>
| gpl-2.0 |
InformaticaMG/WP-template | wp-content/themes/wp-clear321/js/jquery.mobilemenu.js | 1743 | /**
* jQuery Mobile Menu
* Turn unordered list menu into dropdown select menu
* version 1.0(31-OCT-2011)
*
* Built on top of the jQuery library
* http://jquery.com
*
* Documentation
* http://github.com/mambows/mobilemenu
*/
(function($){
$.fn.mobileMenu = function(options) {
var defaults = {
defaultText: '',
className: 'select-menu',
subMenuClass: 'sub-menu',
subMenuDash: '– '
},
settings = $.extend( defaults, options ),
el = $(this);
this.each(function(){
// ad class to submenu list
el.find('ul').addClass(settings.subMenuClass);
// Create base menu
$('<select />',{
'class' : settings.className
}).insertAfter( el );
// Create default option
$('<option />', {
"value" : '#',
"text" : settings.defaultText
}).appendTo( '.' + settings.className );
// Create select option from menu
el.find('a').each(function(){
var $this = $(this),
optText = ' ' + $this.text(),
optSub = $this.parents( '.' + settings.subMenuClass ),
len = optSub.length,
dash;
// if menu has sub menu
if( $this.parents('ul').hasClass( settings.subMenuClass ) ) {
dash = Array( len+1 ).join( settings.subMenuDash );
optText = dash + optText;
}
// Now build menu and append it
$('<option />', {
"value" : this.href,
"html" : optText,
"selected" : (this.href == window.location.href)
}).appendTo( '.' + settings.className );
}); // End el.find('a').each
// Change event on select element
$('.' + settings.className).change(function(){
var locations = $(this).val();
if( locations !== '#' ) {
window.location.href = $(this).val();
};
});
}); // End this.each
return this;
};
})(jQuery); | gpl-2.0 |
TheTypoMaster/Scaper | openjdk/jaxws/drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/runtime/reflect/PrimitiveArrayListerShort.java | 3404 | /*
* Copyright 2005-2006 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. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* 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.
*/
package com.sun.xml.internal.bind.v2.runtime.reflect;
import com.sun.xml.internal.bind.api.AccessorException;
import com.sun.xml.internal.bind.v2.runtime.XMLSerializer;
/**
* {@link Lister} for primitive type arrays.
*
* <p>
* B y t e ArrayLister is used as the master to generate the rest of the
* lister classes. Do not modify the generated copies.
*/
final class PrimitiveArrayListerShort<BeanT> extends Lister<BeanT,short[],Short,PrimitiveArrayListerShort.ShortArrayPack> {
private PrimitiveArrayListerShort() {
}
/*package*/ static void register() {
Lister.primitiveArrayListers.put(Short.TYPE,new PrimitiveArrayListerShort());
}
public ListIterator<Short> iterator(final short[] objects, XMLSerializer context) {
return new ListIterator<Short>() {
int idx=0;
public boolean hasNext() {
return idx<objects.length;
}
public Short next() {
return objects[idx++];
}
};
}
public ShortArrayPack startPacking(BeanT current, Accessor<BeanT, short[]> acc) {
return new ShortArrayPack();
}
public void addToPack(ShortArrayPack objects, Short o) {
objects.add(o);
}
public void endPacking( ShortArrayPack pack, BeanT bean, Accessor<BeanT,short[]> acc ) throws AccessorException {
acc.set(bean,pack.build());
}
public void reset(BeanT o,Accessor<BeanT,short[]> acc) throws AccessorException {
acc.set(o,new short[0]);
}
static final class ShortArrayPack {
short[] buf = new short[16];
int size;
void add(Short b) {
if(buf.length==size) {
// realloc
short[] nb = new short[buf.length*2];
System.arraycopy(buf,0,nb,0,buf.length);
buf = nb;
}
if(b!=null)
buf[size++] = b;
}
short[] build() {
if(buf.length==size)
// if we are lucky enough
return buf;
short[] r = new short[size];
System.arraycopy(buf,0,r,0,size);
return r;
}
}
}
| gpl-2.0 |
hsfoxman/wiki | languages/messages/MessagesBe_tarask.php | 347119 | <?php
/** Belarusian (Taraškievica orthography) (беларуская (тарашкевіца))
*
* See MessagesQqq.php for message documentation incl. usage of parameters
* To improve a translation please visit http://translatewiki.net
*
* @ingroup Language
* @file
*
* @author Cesco
* @author Crt
* @author EugeneZelenko
* @author Jim-by
* @author Kaganer
* @author Red Winged Duck
* @author Renessaince
* @author Wizardist
* @author Zedlik
* @author Тест
*/
$bookstoreList = array(
'OZ.by' => 'http://oz.by/search.phtml?what=books&isbn=$1',
'Amazon.com' => 'http://www.amazon.com/exec/obidos/ISBN=$1'
);
$datePreferences = array(
'default',
'dmy',
'ISO 8601',
);
$defaultDateFormat = 'dmy';
$dateFormats = array(
'dmy time' => 'H:i',
'dmy date' => 'j xg Y',
'dmy both' => 'H:i, j xg Y',
);
$magicWords = array(
'redirect' => array( '0', '#перанакіраваньне', '#REDIRECT' ),
'notoc' => array( '0', '__БЯЗЬ_ЗЬМЕСТУ__', '__NOTOC__' ),
'nogallery' => array( '0', '__БЕЗ_ГАЛЕРЭІ__', '__NOGALLERY__' ),
'forcetoc' => array( '0', '__ЗЬМЕСТ_ПРЫМУСАМ__', '__FORCETOC__' ),
'toc' => array( '0', '__ЗЬМЕСТ__', '__TOC__' ),
'noeditsection' => array( '0', '__БЕЗ_РЭДАГАВАНЬНЯ_СЭКЦЫІ__', '__NOEDITSECTION__' ),
'currentmonth' => array( '1', 'БЯГУЧЫ_МЕСЯЦ', 'CURRENTMONTH', 'CURRENTMONTH2' ),
'currentmonthname' => array( '1', 'НАЗВА_БЯГУЧАГА_МЕСЯЦА', 'CURRENTMONTHNAME' ),
'currentmonthnamegen' => array( '1', 'НАЗВА_БЯГУЧАГА_МЕСЯЦА_Ў_РОДНЫМ_СКЛОНЕ', 'CURRENTMONTHNAMEGEN' ),
'currentmonthabbrev' => array( '1', 'СКАРОЧАНАЯ_НАЗВА_БЯГУЧАГА_МЕСЯЦА', 'CURRENTMONTHABBREV' ),
'currentday' => array( '1', 'БЯГУЧЫ_ДЗЕНЬ', 'CURRENTDAY' ),
'currentday2' => array( '1', 'БЯГУЧЫ_ДЗЕНЬ_2', 'CURRENTDAY2' ),
'currentdayname' => array( '1', 'НАЗВА_БЯГУЧАГА_ДНЯ', 'CURRENTDAYNAME' ),
'currentyear' => array( '1', 'БЯГУЧЫ_ГОД', 'CURRENTYEAR' ),
'currenttime' => array( '1', 'БЯГУЧЫ_ЧАС', 'CURRENTTIME' ),
'currenthour' => array( '1', 'БЯГУЧАЯ_ГАДЗІНА', 'CURRENTHOUR' ),
'localmonth' => array( '1', 'ЛЯКАЛЬНЫ_МЕСЯЦ', 'LOCALMONTH', 'LOCALMONTH2' ),
'localmonthname' => array( '1', 'НАЗВА_ЛЯКАЛЬНАГА_МЕСЯЦА', 'LOCALMONTHNAME' ),
'localmonthnamegen' => array( '1', 'НАЗВА_ЛЯКАЛЬНАГА_МЕСЯЦА_Ў_РОДНЫМ_СКЛОНЕ', 'LOCALMONTHNAMEGEN' ),
'localmonthabbrev' => array( '1', 'СКАРОЧАНАЯ_НАЗВА_ЛЯКАЛЬНАГА_МЕСЯЦА', 'LOCALMONTHABBREV' ),
'localday' => array( '1', 'ЛЯКАЛЬНЫ_ДЗЕНЬ', 'LOCALDAY' ),
'localday2' => array( '1', 'ЛЯКАЛЬНЫ_ДЗЕНЬ_2', 'LOCALDAY2' ),
'localdayname' => array( '1', 'НАЗВА_ЛЯКАЛЬНАГА_ДНЯ', 'LOCALDAYNAME' ),
'localyear' => array( '1', 'ЛЯКАЛЬНЫ_ГОД', 'LOCALYEAR' ),
'localtime' => array( '1', 'ЛЯКАЛЬНЫ_ЧАС', 'LOCALTIME' ),
'localhour' => array( '1', 'ЛЯКАЛЬНАЯ_ГАДЗІНА', 'LOCALHOUR' ),
'numberofpages' => array( '1', 'КОЛЬКАСЬЦЬ_СТАРОНАК', 'NUMBEROFPAGES' ),
'numberofarticles' => array( '1', 'КОЛЬКАСЬЦЬ_АРТЫКУЛАЎ', 'NUMBEROFARTICLES' ),
'numberoffiles' => array( '1', 'КОЛЬКАСЬЦЬ_ФАЙЛАЎ', 'NUMBEROFFILES' ),
'numberofusers' => array( '1', 'КОЛЬКАСЬЦЬ_УДЗЕЛЬНІКАЎ', 'NUMBEROFUSERS' ),
'numberofactiveusers' => array( '1', 'КОЛЬКАСЬЦЬ_АКТЫЎНЫХ_УДЗЕЛЬНІКАЎ', 'NUMBEROFACTIVEUSERS' ),
'numberofedits' => array( '1', 'КОЛЬКАСЬЦЬ_РЭДАГАВАНЬНЯЎ', 'NUMBEROFEDITS' ),
'numberofviews' => array( '1', 'КОЛЬКАСЬЦЬ_ПРАГЛЯДАЎ', 'NUMBEROFVIEWS' ),
'pagename' => array( '1', 'НАЗВА_СТАРОНКІ', 'PAGENAME' ),
'pagenamee' => array( '1', 'НАЗВА_СТАРОНКІ_2', 'PAGENAMEE' ),
'namespace' => array( '1', 'ПРАСТОРА_НАЗВАЎ', 'NAMESPACE' ),
'namespacee' => array( '1', 'ПРАСТОРА_НАЗВАЎ_2', 'NAMESPACEE' ),
'talkspace' => array( '1', 'ПРАСТОРА_НАЗВАЎ_АБМЕРКАВАНЬНЯ', 'TALKSPACE' ),
'talkspacee' => array( '1', 'ПРАСТОРА_НАЗВАЎ_АБМЕРКАВАНЬНЯ_2', 'TALKSPACEE' ),
'subjectspace' => array( '1', 'ПРАСТОРА_НАЗВАЎ_ПРАДМЕТУ', 'ПРАСТОРА_НАЗВАЎ_АРТЫКУЛА', 'SUBJECTSPACE', 'ARTICLESPACE' ),
'subjectspacee' => array( '1', 'ПРАСТОРА_НАЗВАЎ_ПРАДМЕТУ_2', 'ПРАСТОРА_НАЗВАЎ_АРТЫКУЛА_2', 'SUBJECTSPACEE', 'ARTICLESPACEE' ),
'fullpagename' => array( '1', 'ПОЎНАЯ_НАЗВА_СТАРОНКІ', 'FULLPAGENAME' ),
'fullpagenamee' => array( '1', 'ПОЎНАЯ_НАЗВА_СТАРОНКІ_2', 'FULLPAGENAMEE' ),
'subpagename' => array( '1', 'НАЗВА_ПАДСТАРОНКІ', 'SUBPAGENAME' ),
'subpagenamee' => array( '1', 'НАЗВА_ПАДСТАРОНКІ_2', 'SUBPAGENAMEE' ),
'basepagename' => array( '1', 'НАЗВА_БАЗАВАЙ_СТАРОНКІ', 'BASEPAGENAME' ),
'basepagenamee' => array( '1', 'НАЗВА_БАЗАВАЙ_СТАРОНКІ_2', 'BASEPAGENAMEE' ),
'talkpagename' => array( '1', 'НАЗВА_СТАРОНКІ_АБМЕРКАВАНЬНЯ', 'TALKPAGENAME' ),
'talkpagenamee' => array( '1', 'НАЗВА_СТАРОНКІ_АБМЕРКАВАНЬНЯ_2', 'TALKPAGENAMEE' ),
'subjectpagename' => array( '1', 'НАЗВА_СТАРОНКІ_ПРАДМЕТУ', 'НАЗВА_СТАРОНКІ_АРТЫКУЛА', 'SUBJECTPAGENAME', 'ARTICLEPAGENAME' ),
'subjectpagenamee' => array( '1', 'НАЗВА_СТАРОНКІ_ПРАДМЕТУ_2', 'НАЗВА_СТАРОНКІ_АРТЫКУЛА_2', 'SUBJECTPAGENAMEE', 'ARTICLEPAGENAMEE' ),
'msg' => array( '0', 'ПАВЕДАМЛЕНЬНЕ:', 'MSG:' ),
'subst' => array( '0', 'ПАДСТАНОЎКА:', 'SUBST:' ),
'msgnw' => array( '0', 'ПАВЕДАМЛЕНЬНЕ_БЯЗЬ_ВІКІ:', 'MSGNW:' ),
'img_thumbnail' => array( '1', 'значак', 'міні', 'thumbnail', 'thumb' ),
'img_manualthumb' => array( '1', 'значак=$1', 'міні=$1', 'thumbnail=$1', 'thumb=$1' ),
'img_right' => array( '1', 'справа', 'right' ),
'img_left' => array( '1', 'зьлева', 'left' ),
'img_none' => array( '1', 'няма', 'none' ),
'img_width' => array( '1', '$1пкс', '$1px' ),
'img_center' => array( '1', 'цэнтар', 'center', 'centre' ),
'img_framed' => array( '1', 'рамка', 'framed', 'enframed', 'frame' ),
'img_page' => array( '1', 'старонка=$1', 'старонка $1', 'page=$1', 'page $1' ),
'img_top' => array( '1', 'зьверху', 'top' ),
'img_middle' => array( '1', 'пасярэдзіне', 'middle' ),
'img_bottom' => array( '1', 'зьнізу', 'bottom' ),
'img_link' => array( '1', 'спасылка=$1', 'link=$1' ),
'sitename' => array( '1', 'НАЗВА_САЙТУ', 'SITENAME' ),
'ns' => array( '0', 'ПН:', 'NS:' ),
'localurl' => array( '0', 'ЛЯКАЛЬНЫ_АДРАС:', 'LOCALURL:' ),
'localurle' => array( '0', 'ЛЯКАЛЬНЫ_АДРАС_2:', 'LOCALURLE:' ),
'server' => array( '0', 'СЭРВЭР', 'SERVER' ),
'servername' => array( '0', 'НАЗВА_СЭРВЭРА', 'SERVERNAME' ),
'scriptpath' => array( '0', 'ШЛЯХ_ДА_СКРЫПТА', 'SCRIPTPATH' ),
'grammar' => array( '0', 'ГРАМАТЫКА:', 'GRAMMAR:' ),
'gender' => array( '0', 'ПОЛ:', 'GENDER:' ),
'notitleconvert' => array( '0', '__НЕ_КАНВЭРТАВАЦЬ_НАЗВУ__', '__NOTITLECONVERT__', '__NOTC__' ),
'nocontentconvert' => array( '0', '__НЕ_КАНВЭРТАВАЦЬ_ТЭКСТ__', '__NOCONTENTCONVERT__', '__NOCC__' ),
'currentweek' => array( '1', 'БЯГУЧЫ_ТЫДЗЕНЬ', 'CURRENTWEEK' ),
'currentdow' => array( '1', 'БЯГУЧЫ_ДЗЕНЬ_ТЫДНЯ', 'CURRENTDOW' ),
'localweek' => array( '1', 'ЛЯКАЛЬНЫ_ТЫДЗЕНЬ', 'LOCALWEEK' ),
'localdow' => array( '1', 'ЛЯКАЛЬНЫ_ДЗЕНЬ_ТЫДНЯ', 'LOCALDOW' ),
'revisionid' => array( '1', 'ID_ВЭРСІІ', 'REVISIONID' ),
'revisionday' => array( '1', 'ДЗЕНЬ_ВЭРСІІ', 'REVISIONDAY' ),
'revisionday2' => array( '1', 'ДЗЕНЬ_ВЭРСІІ_2', 'REVISIONDAY2' ),
'revisionmonth' => array( '1', 'МЕСЯЦ_ВЭРСІІ', 'REVISIONMONTH' ),
'revisionyear' => array( '1', 'ГОД_ВЭРСІІ', 'REVISIONYEAR' ),
'revisiontimestamp' => array( '1', 'МОМАНТ_ЧАСУ_ВЭРСІІ', 'REVISIONTIMESTAMP' ),
'plural' => array( '0', 'МНОЖНЫ_ЛІК:', 'PLURAL:' ),
'fullurl' => array( '0', 'ПОЎНЫ_АДРАС:', 'FULLURL:' ),
'fullurle' => array( '0', 'ПОЎНЫ_АДРАС_2:', 'FULLURLE:' ),
'lcfirst' => array( '0', 'ПЕРШАЯ_ЛІТАРА_МАЛАЯ:', 'LCFIRST:' ),
'ucfirst' => array( '0', 'ПЕРШАЯ_ЛІТАРА_ВЯЛІКАЯ:', 'UCFIRST:' ),
'lc' => array( '0', 'МАЛЫМІ_ЛІТАРАМІ:', 'LC:' ),
'uc' => array( '0', 'ВЯЛІКІМІ_ЛІТАРАМІ:', 'UC:' ),
'raw' => array( '0', 'НЕАПРАЦАВАНЫ:', 'RAW:' ),
'displaytitle' => array( '1', 'ПАКАЗВАЦЬ_НАЗВУ', 'DISPLAYTITLE' ),
'rawsuffix' => array( '1', 'Н', 'R' ),
'newsectionlink' => array( '1', '__СПАСЫЛКА_НА_НОВУЮ_СЭКЦЫЮ__', '__NEWSECTIONLINK__' ),
'currentversion' => array( '1', 'БЯГУЧАЯ_ВЭРСІЯ', 'CURRENTVERSION' ),
'currenttimestamp' => array( '1', 'МОМАНТ_ЧАСУ', 'CURRENTTIMESTAMP' ),
'localtimestamp' => array( '1', 'ЛЯКАЛЬНЫ_МОМАНТ_ЧАСУ', 'LOCALTIMESTAMP' ),
'directionmark' => array( '1', 'СЫМБАЛЬ_НАПРАМКУ_ПІСЬМА', 'DIRECTIONMARK', 'DIRMARK' ),
'language' => array( '0', '#МОВА:', '#LANGUAGE:' ),
'contentlanguage' => array( '1', 'МОВА_ЗЬМЕСТУ', 'CONTENTLANGUAGE', 'CONTENTLANG' ),
'pagesinnamespace' => array( '1', 'КОЛЬКАСЬЦЬ_СТАРОНАК_У_ПРАСТОРЫ_НАЗВАЎ:', 'PAGESINNAMESPACE:', 'PAGESINNS:' ),
'numberofadmins' => array( '1', 'КОЛЬКАСЬЦЬ_АДМІНІСТРАТАРАЎ', 'NUMBEROFADMINS' ),
'formatnum' => array( '0', 'ФАРМАТАВАЦЬ_ЛІК', 'FORMATNUM' ),
'defaultsort' => array( '1', 'САРТЫРОЎКА_ПА_ЗМОЎЧВАНЬНІ:', 'КЛЮЧ_САРТЫРОЎКІ_ПА_ЗМОЎЧВАНЬНІ:', 'САРТЫРОЎКА_Ў_КАТЭГОРЫІ_ПА_ЗМОЎЧВАНЬНІ:', 'DEFAULTSORT:', 'DEFAULTSORTKEY:', 'DEFAULTCATEGORYSORT:' ),
'filepath' => array( '0', 'ШЛЯХ_ДА_ФАЙЛА:', 'FILEPATH:' ),
'tag' => array( '0', 'тэг', 'tag' ),
'hiddencat' => array( '1', '__СХАВАЦЬ_КАТЭГОРЫЮ__', '__HIDDENCAT__' ),
'pagesincategory' => array( '1', 'КОЛЬКАСЬЦЬ_СТАРОНАК_У_КАТЭГОРЫІ', 'PAGESINCATEGORY', 'PAGESINCAT' ),
'pagesize' => array( '1', 'ПАМЕР_СТАРОНКІ', 'PAGESIZE' ),
'staticredirect' => array( '1', '__СТАТЫЧНАЕ_ПЕРАНАКІРАВАНЬНЕ__', '__STATICREDIRECT__' ),
);
$namespaceNames = array(
NS_MEDIA => 'Мэдыя',
NS_SPECIAL => 'Спэцыяльныя',
NS_TALK => 'Абмеркаваньне',
NS_USER => 'Удзельнік',
NS_USER_TALK => 'Гутаркі_ўдзельніка',
NS_PROJECT_TALK => 'Абмеркаваньне_{{GRAMMAR:родны|$1}}',
NS_FILE => 'Файл',
NS_FILE_TALK => 'Абмеркаваньне_файла',
NS_MEDIAWIKI => 'MediaWiki',
NS_MEDIAWIKI_TALK => 'Абмеркаваньне_MediaWiki',
NS_TEMPLATE => 'Шаблён',
NS_TEMPLATE_TALK => 'Абмеркаваньне_шаблёну',
NS_HELP => 'Дапамога',
NS_HELP_TALK => 'Абмеркаваньне_дапамогі',
NS_CATEGORY => 'Катэгорыя',
NS_CATEGORY_TALK => 'Абмеркаваньне_катэгорыі',
);
$namespaceAliases = array(
'Удзельніца' => NS_USER,
'Гутаркі ўдзельніцы' => NS_USER_TALK,
'Абмеркаваньне_$1' => NS_PROJECT_TALK,
'Выява' => NS_FILE,
'Абмеркаваньне выявы' => NS_FILE_TALK,
);
$specialPageAliases = array(
'Allmessages' => array( 'Сыстэмныя_паведамленьні' ),
'Allpages' => array( 'Усе_старонкі' ),
'Ancientpages' => array( 'Найстарэйшыя_старонкі' ),
'Block' => array( 'Блякаваньне' ),
'BrokenRedirects' => array( 'Некарэктныя_перанакіраваньні' ),
'Categories' => array( 'Катэгорыі' ),
'ChangePassword' => array( 'Зьмяніць_пароль', 'Ачысьціць_пароль' ),
'Contributions' => array( 'Унёсак' ),
'CreateAccount' => array( 'Стварыць_рахунак' ),
'Deadendpages' => array( 'Тупіковыя_старонкі' ),
'DeletedContributions' => array( 'Выдалены_ўнёсак' ),
'Disambiguations' => array( 'Неадназначнасьці' ),
'DoubleRedirects' => array( 'Двайныя_перанакіраваньні' ),
'Emailuser' => array( 'Даслаць_ліст' ),
'Export' => array( 'Экспарт' ),
'Filepath' => array( 'Шлях_да_файла' ),
'Import' => array( 'Імпарт' ),
'LinkSearch' => array( 'Пошук_вонкавых_спасылак' ),
'Listadmins' => array( 'Сьпіс_адміністратараў' ),
'Listbots' => array( 'Сьпіс_робатаў' ),
'Listfiles' => array( 'Сьпіс_файлаў' ),
'Listredirects' => array( 'Сьпіс_перанакіраваньняў' ),
'Listusers' => array( 'Сьпіс_удзельнікаў' ),
'Log' => array( 'Журналы_падзеяў' ),
'Lonelypages' => array( 'Старонкі-сіраціны' ),
'Longpages' => array( 'Доўгія_старонкі' ),
'MergeHistory' => array( 'Гісторыя_аб\'яднаньняў' ),
'Mycontributions' => array( 'Мой_унёсак' ),
'Mypage' => array( 'Мая_старонка' ),
'Mytalk' => array( 'Мае_размовы' ),
'Newimages' => array( 'Новыя_файлы' ),
'Newpages' => array( 'Новыя_старонкі' ),
'Popularpages' => array( 'Папулярныя_старонкі' ),
'Protectedpages' => array( 'Абароненыя_старонкі' ),
'Protectedtitles' => array( 'Забароненыя_старонкі' ),
'Randompage' => array( 'Выпадковая_старонка' ),
'Randomredirect' => array( 'Выпадковае_перанакіраваньне' ),
'Recentchanges' => array( 'Апошнія_зьмены' ),
'Search' => array( 'Пошук' ),
'Shortpages' => array( 'Кароткія_старонкі' ),
'Specialpages' => array( 'Спэцыяльныя_старонкі' ),
'Statistics' => array( 'Статыстыка' ),
'Uncategorizedcategories' => array( 'Некатэгарызаваныя_катэгорыі' ),
'Uncategorizedimages' => array( 'Некатэгарызаваныя_файлы' ),
'Uncategorizedpages' => array( 'Некатэгарызаваныя_старонкі' ),
'Uncategorizedtemplates' => array( 'Некатэгарызаваныя_шаблёны' ),
'Upload' => array( 'Загрузка' ),
'Version' => array( 'Вэрсія' ),
'Wantedcategories' => array( 'Запатрабаваныя_катэгорыі' ),
'Wantedfiles' => array( 'Запатрабаваныя_файлы' ),
'Wantedpages' => array( 'Запатрабаваныя_старонкі', 'Некарэктныя_спасылкі' ),
'Wantedtemplates' => array( 'Запатрабаваныя_шаблёны' ),
'Watchlist' => array( 'Сьпіс_назіраньня' ),
'Whatlinkshere' => array( 'Спасылкі_на_старонку' ),
);
$separatorTransformTable = array(
',' => "\xc2\xa0", # nbsp
'.' => ','
);
$linkTrail = '/^([абвгґджзеёжзійклмнопрстуўфхцчшыьэюяćčłńśšŭźža-z]+)(.*)$/sDu';
$imageFiles = array(
'button-bold' => 'be-tarask/button_bold.png',
'button-italic' => 'be-tarask/button_italic.png',
'button-link' => 'be-tarask/button_link.png',
);
$messages = array(
# User preference toggles
'tog-underline' => 'Падкрэсьліваць спасылкі:',
'tog-justify' => 'Выраўноўваць тэкст па шырыні старонкі',
'tog-hideminor' => 'Хаваць дробныя зьмены ў сьпісе апошніх зьменаў',
'tog-hidepatrolled' => 'Хаваць патруляваныя зьмены ў сьпісе апошніх зьменаў',
'tog-newpageshidepatrolled' => 'Хаваць патруляваныя старонкі ў сьпісе новых старонак',
'tog-extendwatchlist' => 'Пашырыць сьпіс назіраньня, каб ён паказваў усе зьмены, а ня толькі апошнія',
'tog-usenewrc' => 'Групаваць зьмены старонкі ў сьпісах апошніх зьменаў і назіраньняў (патрабуе JavaScript)',
'tog-numberheadings' => 'Аўтаматычная нумарацыя загалоўкаў',
'tog-showtoolbar' => 'Паказваць панэль інструмэнтаў рэдагаваньня (патрабуе JavaScript)',
'tog-editondblclick' => 'Рэдагаваць старонкі па падвойным пстрыку (JavaScript)',
'tog-editsection' => 'Дазволіць рэдагаваньне асобных сэкцыяў па спасылках [рэдагаваць]',
'tog-editsectiononrightclick' => 'Рэдагаваць сэкцыі па правым пстрыку на загалоўку (патрабуе JavaScript)',
'tog-showtoc' => 'Паказваць зьмест (для старонак з больш як 3 разьдзеламі)',
'tog-rememberpassword' => 'Запомніць мяне ў гэтым браўзэры (ня больш за $1 {{PLURAL:$1|дзень|дні|дзён}})',
'tog-watchcreations' => 'Дадаваць у мой сьпіс назіраньня створаныя мной старонкі і загружаныя файлы',
'tog-watchdefault' => 'Дадаваць у мой сьпіс назіраньня старонкі і файлы, якія я рэдагаваў',
'tog-watchmoves' => 'Дадаваць у мой сьпіс назіраньня перанесеныя мною старонкі і файлы',
'tog-watchdeletion' => 'Дадаваць у мой сьпіс назіраньня старонкі і файлы, якія я выдаляю',
'tog-minordefault' => 'Па змоўчаньні пазначаць усе зьмены дробнымі',
'tog-previewontop' => 'Паказваць папярэдні прагляд старонкі над полем рэдагаваньня',
'tog-previewonfirst' => 'Папярэдні прагляд пры першым рэдагаваньні',
'tog-nocache' => 'Адключыць кэшаваньне старонак у браўзэры',
'tog-enotifwatchlistpages' => 'Паведамляць мне праз электронную пошту пра зьмены старонак і файлаў у маім сьпісе назіраньня',
'tog-enotifusertalkpages' => 'Паведамляць праз электронную пошту пра зьмены маёй старонкі гутарак',
'tog-enotifminoredits' => 'Паведамляць праз электронную пошту таксама пра дробныя зьмены старонак і файлаў',
'tog-enotifrevealaddr' => 'Не хаваць мой адрас электроннай пошты ў паведамленьнях',
'tog-shownumberswatching' => 'Паказваць колькасьць назіральнікаў',
'tog-oldsig' => 'Цяперашні подпіс:',
'tog-fancysig' => 'Апрацоўваць подпіс як вікі-тэкст (без аўтаматычнай спасылкі)',
'tog-externaleditor' => 'Выкарыстоўваць вонкавы рэдактар па змоўчваньні (толькі для адмыслоўцаў, патрабуе спэцыяльных наладак на вашым кампутары. [//www.mediawiki.org/wiki/Manual:External_editors Падрабязнасьці.])',
'tog-externaldiff' => 'Выкарыстоўваць вонкавую праграму параўнаньня вэрсіяў па змоўчваньні (толькі для адмыслоўцаў, патрабуе спэцыяльных наладак на вашым кампутары. [//www.mediawiki.org/wiki/Manual:External_editors Падрабязнасьці.])',
'tog-showjumplinks' => 'Актываваць дапаможныя спасылкі «перайсьці да»',
'tog-uselivepreview' => 'Выкарыстоўваць хуткі папярэдні прагляд (патрабуе JavaScript) (экспэрымэнтальна)',
'tog-forceeditsummary' => 'Папярэджваць пра адсутнасьць кароткага апісаньня зьменаў',
'tog-watchlisthideown' => 'Хаваць мае праўкі ў сьпісе назіраньня',
'tog-watchlisthidebots' => 'Хаваць праўкі робатаў у сьпісе назіраньня',
'tog-watchlisthideminor' => 'Хаваць дробныя праўкі ў сьпісе назіраньня',
'tog-watchlisthideliu' => 'Хаваць праўкі зарэгістраваных удзельнікаў у сьпісе назіраньня',
'tog-watchlisthideanons' => 'Хаваць праўкі ананімаў у сьпісе назіраньня',
'tog-watchlisthidepatrolled' => 'Хаваць патруляваныя праўкі ў сьпісе назіраньня',
'tog-ccmeonemails' => 'Дасылаць мне копіі лістоў, якія я дасылаю іншым удзельнікам',
'tog-diffonly' => 'Не паказваць зьмест старонкі пад параўнаньнем зьменаў',
'tog-showhiddencats' => 'Паказваць схаваныя катэгорыі',
'tog-noconvertlink' => 'Забараніць канвэртацыю назваў спасылак',
'tog-norollbackdiff' => 'Не паказваць зьмены пасьля выкарыстаньня функцыі адкату',
'underline-always' => 'Заўсёды',
'underline-never' => 'Ніколі',
'underline-default' => 'Паводле браўзэра або афармленьня',
# Font style option in Special:Preferences
'editfont-style' => 'Стыль шрыфту ў полі рэдагаваньня:',
'editfont-default' => 'Паводле браўзэра',
'editfont-monospace' => 'Роўнашырокі шрыфт',
'editfont-sansserif' => 'Шрыфт без засечак',
'editfont-serif' => 'Шрыфт з засечкамі',
# Dates
'sunday' => 'нядзеля',
'monday' => 'панядзелак',
'tuesday' => 'аўторак',
'wednesday' => 'серада',
'thursday' => 'чацьвер',
'friday' => 'пятніца',
'saturday' => 'субота',
'sun' => 'Нд',
'mon' => 'Пн',
'tue' => 'Аў',
'wed' => 'Ср',
'thu' => 'Чц',
'fri' => 'Пт',
'sat' => 'Сб',
'january' => 'студзень',
'february' => 'люты',
'march' => 'сакавік',
'april' => 'красавік',
'may_long' => 'травень',
'june' => 'чэрвень',
'july' => 'ліпень',
'august' => 'жнівень',
'september' => 'верасень',
'october' => 'кастрычнік',
'november' => 'лістапад',
'december' => 'сьнежань',
'january-gen' => 'студзеня',
'february-gen' => 'лютага',
'march-gen' => 'сакавіка',
'april-gen' => 'красавіка',
'may-gen' => 'траўня',
'june-gen' => 'чэрвеня',
'july-gen' => 'ліпеня',
'august-gen' => 'жніўня',
'september-gen' => 'верасьня',
'october-gen' => 'кастрычніка',
'november-gen' => 'лістапада',
'december-gen' => 'сьнежня',
'jan' => 'сту',
'feb' => 'лют',
'mar' => 'сак',
'apr' => 'кра',
'may' => 'тра',
'jun' => 'чэр',
'jul' => 'ліп',
'aug' => 'жні',
'sep' => 'вер',
'oct' => 'кас',
'nov' => 'ліс',
'dec' => 'сьн',
# Categories related messages
'pagecategories' => '{{PLURAL:$1|Катэгорыя|Катэгорыі|Катэгорыі}}',
'category_header' => 'Старонкі ў катэгорыі «$1»',
'subcategories' => 'Падкатэгорыі',
'category-media-header' => 'Файлы ў катэгорыі «$1»',
'category-empty' => "''Гэтая катэгорыя ня ўтрымлівае ні старонак, ні файлаў.''",
'hidden-categories' => '{{PLURAL:$1|Схаваная катэгорыя|Схаваныя катэгорыі}}',
'hidden-category-category' => 'Схаваныя катэгорыі',
'category-subcat-count' => '{{PLURAL:$2|Гэтая катэгорыя зьмяшчае наступную падкатэгорыю.|Гэтая катэгорыя зьмяшчае {{PLURAL:$1|наступную $1 падкатэгорыю|наступныя $1 падкатэгорыі|наступныя $1 падкатэгорыяў}} з $2 агулам.}}',
'category-subcat-count-limited' => 'У гэтай катэгорыі $1 {{PLURAL:$1|падкатэгорыя|падкатэгорыі|падкатэгорыяў}}.',
'category-article-count' => '{{PLURAL:$2|Гэтая катэгорыя ўтрымлівае толькі адну старонку.|{{PLURAL:$1|Паказаная $1 старонка|Паказаныя $1 старонкі|Паказаныя $1 старонак}} гэтай катэгорыі з $2.}}',
'category-article-count-limited' => 'У гэтай катэгорыі $1 {{PLURAL:$1|старонка|старонкі|старонак}}.',
'category-file-count' => '{{PLURAL:$2|Гэтая катэгорыя ўтрымлівае толькі адзін файл.|{{PLURAL:$1|Паказаны $1 файл|Паказаныя $1 файлы|Паказаныя $1 файлаў}} гэтай катэгорыі з $2.}}',
'category-file-count-limited' => 'У гэтай катэгорыі $1 {{PLURAL:$1|файл|файлы|файлаў}}.',
'listingcontinuesabbrev' => ' (працяг)',
'index-category' => 'Індэксаваныя старонкі',
'noindex-category' => 'Неіндэксаваныя старонкі',
'broken-file-category' => 'Старонкі зь няслушнымі спасылкамі на файлы',
'about' => 'Апісаньне',
'article' => 'Старонка зьместу',
'newwindow' => '(адкрываецца ў новым акне)',
'cancel' => 'Скасаваць',
'moredotdotdot' => 'Далей…',
'mypage' => 'Старонка',
'mytalk' => 'Гутаркі',
'anontalk' => 'Гутаркі для гэтага IP-адрасу',
'navigation' => 'Навігацыя',
'and' => ' і',
# Cologne Blue skin
'qbfind' => 'Знайсьці',
'qbbrowse' => 'Праглядзець',
'qbedit' => 'Рэдагаваць',
'qbpageoptions' => 'Гэтая старонка',
'qbpageinfo' => 'Інфармацыя пра старонку',
'qbmyoptions' => 'Мае старонкі',
'qbspecialpages' => 'Спэцыяльныя старонкі',
'faq' => 'Частыя пытаньні',
'faqpage' => 'Project:Частыя пытаньні',
# Vector skin
'vector-action-addsection' => 'Дадаць тэму',
'vector-action-delete' => 'Выдаліць',
'vector-action-move' => 'Перанесьці',
'vector-action-protect' => 'Абараніць',
'vector-action-undelete' => 'Аднавіць',
'vector-action-unprotect' => 'Зьмяніць абарону',
'vector-simplesearch-preference' => 'Уключыць спрошчанае поле пошуку (толькі для афармленьня «Вэктар»)',
'vector-view-create' => 'Стварыць',
'vector-view-edit' => 'Рэдагаваць',
'vector-view-history' => 'Паказаць гісторыю',
'vector-view-view' => 'Чытаць',
'vector-view-viewsource' => 'Паказаць крыніцу',
'actions' => 'Дзеяньні',
'namespaces' => 'Прасторы назваў',
'variants' => 'Варыянты',
'errorpagetitle' => 'Памылка',
'returnto' => 'Вярнуцца да старонкі «$1».',
'tagline' => 'Зьвесткі з {{GRAMMAR:родны|{{SITENAME}}}}',
'help' => 'Дапамога',
'search' => 'Пошук',
'searchbutton' => 'Пошук',
'go' => 'Старонка',
'searcharticle' => 'Старонка',
'history' => 'Гісторыя старонкі',
'history_short' => 'Гісторыя',
'updatedmarker' => 'абноўлена з часу майго апошняга наведваньня',
'printableversion' => 'Вэрсія для друку',
'permalink' => 'Сталая спасылка',
'print' => 'Друкаваць',
'view' => 'Прагляд',
'edit' => 'Рэдагаваць',
'create' => 'Стварыць',
'editthispage' => 'Рэдагаваць гэтую старонку',
'create-this-page' => 'Стварыць гэтую старонку',
'delete' => 'Выдаліць',
'deletethispage' => 'Выдаліць гэтую старонку',
'undelete_short' => 'Аднавіць $1 {{PLURAL:$1|рэдагаваньне|рэдагаваньні|рэдагаваньняў}}',
'viewdeleted_short' => 'Паказаць $1 {{PLURAL:$1|выдаленае рэдагаваньне|выдаленыя рэдагаваньні|выдаленых рэдагаваньняў}}',
'protect' => 'Абараніць',
'protect_change' => 'зьмяніць',
'protectthispage' => 'Абараніць гэтую старонку',
'unprotect' => 'Зьмяніць абарону',
'unprotectthispage' => 'Зьмяніць абарону старонкі',
'newpage' => 'Новая старонка',
'talkpage' => 'Абмеркаваць гэтую старонку',
'talkpagelinktext' => 'гутаркі',
'specialpage' => 'Спэцыяльная старонка',
'personaltools' => 'Асабістыя прылады',
'postcomment' => 'Новая сэкцыя',
'articlepage' => 'Паказаць старонку зьместу',
'talk' => 'Абмеркаваньне',
'views' => 'Рэжымы',
'toolbox' => 'Інструмэнты',
'userpage' => 'Паказаць старонку ўдзельніка',
'projectpage' => 'Паказаць старонку праекту',
'imagepage' => 'Паказаць старонку файла',
'mediawikipage' => 'Паказаць старонку паведамленьня',
'templatepage' => 'Паказаць старонку шаблёну',
'viewhelppage' => 'Паказаць старонку дапамогі',
'categorypage' => 'Паказаць старонку катэгорыі',
'viewtalkpage' => 'Паказаць абмеркаваньне',
'otherlanguages' => 'На іншых мовах',
'redirectedfrom' => '(Перанакіравана з «$1»)',
'redirectpagesub' => 'Старонка-перанакіраваньне',
'lastmodifiedat' => 'Гэтая старонка апошні раз рэдагавалася $1 году ў $2.',
'viewcount' => 'Гэтую старонку праглядалі $1 {{PLURAL:$1|раз|разы|разоў}}.',
'protectedpage' => 'Абароненая старонка',
'jumpto' => 'Перайсьці да:',
'jumptonavigation' => 'навігацыі',
'jumptosearch' => 'пошуку',
'view-pool-error' => 'Прабачце, у цяперашні момант сэрвэры перагружаныя.
Занадта шмат удзельнікаў спрабуюць праглядзець гэтую старонку.
Калі ласка, пачакайце і паспрабуйце зайсьці пазьней.
$1',
'pool-timeout' => 'Скончыўся час чаканьня блякаваньня',
'pool-queuefull' => 'Чарга запытаў поўная',
'pool-errorunknown' => 'Невядомая памылка',
# All link text and link target definitions of links into project namespace that get used by other message strings, with the exception of user group pages (see grouppage) and the disambiguation template definition (see disambiguations).
'aboutsite' => 'Пра {{GRAMMAR:вінавальны|{{SITENAME}}}}',
'aboutpage' => 'Project:Пра {{GRAMMAR:вінавальны|{{SITENAME}}}}',
'copyright' => 'Зьмест даступны на ўмовах $1.',
'copyrightpage' => '{{ns:project}}:Аўтарскія правы',
'currentevents' => 'Актуальныя падзеі',
'currentevents-url' => 'Project:Актуальныя падзеі',
'disclaimers' => 'Адмова ад адказнасьці',
'disclaimerpage' => 'Project:Адмова ад адказнасьці',
'edithelp' => 'Дапамога ў рэдагаваньні',
'edithelppage' => 'Help:Рэдагаваньне',
'helppage' => 'Help:Зьмест',
'mainpage' => 'Галоўная старонка',
'mainpage-description' => 'Галоўная старонка',
'policy-url' => 'Project:Правілы',
'portal' => 'Суполка',
'portal-url' => 'Project:Суполка',
'privacy' => 'Правілы адносна прыватнасьці',
'privacypage' => 'Project:Правілы адносна прыватнасьці',
'badaccess' => 'Памылка доступу',
'badaccess-group0' => 'Вам не дазволена выканаць запытанае Вамі дзеяньне.',
'badaccess-groups' => 'Запытанае Вамі дзеяньне дазволенае толькі ўдзельнікам {{PLURAL:$2|з групы|адной з групаў:}} $1.',
'versionrequired' => 'Патрабуецца MediaWiki вэрсіі $1',
'versionrequiredtext' => 'Для карыстаньня гэтай старонкай патрабуецца MediaWiki вэрсіі $1.
Глядзіце [[Special:Version|інфармацыю пра вэрсію]].',
'ok' => 'Добра',
'pagetitle' => '$1 — {{SITENAME}}',
'retrievedfrom' => 'Атрымана з «$1»',
'youhavenewmessages' => 'Вы атрымалі $1 ($2).',
'newmessageslink' => 'новыя паведамленьні',
'newmessagesdifflink' => 'апошняя зьмена',
'youhavenewmessagesfromusers' => 'Вы атрымалі $1 ад {{PLURAL:$3|іншага ўдзельніка|$3 удзельнікаў}} ($2).',
'youhavenewmessagesmanyusers' => 'Вы атрымалі $1 ад некалькіх удзельнікаў ($2).',
'newmessageslinkplural' => '{{PLURAL:$1|новае паведамленьне|новыя паведамленьні}}',
'newmessagesdifflinkplural' => '{{PLURAL:$1|апошняя зьмена|апошнія зьмены}}',
'youhavenewmessagesmulti' => 'Вы атрымалі новыя паведамленьні на $1',
'editsection' => 'рэдагаваць',
'editold' => 'рэдагаваць',
'viewsourceold' => 'паказаць крыніцу',
'editlink' => 'рэдагаваць',
'viewsourcelink' => 'паказаць крыніцу',
'editsectionhint' => 'Рэдагаваць сэкцыю «$1»',
'toc' => 'Зьмест',
'showtoc' => 'паказаць',
'hidetoc' => 'схаваць',
'collapsible-collapse' => 'Згарнуць',
'collapsible-expand' => 'Разгарнуць',
'thisisdeleted' => 'Праглядзець ці аднавіць $1?',
'viewdeleted' => 'Паказаць $1?',
'restorelink' => '$1 {{PLURAL:$1|выдаленую зьмену|выдаленыя зьмены|выдаленых зьменаў}}',
'feedlinks' => 'Стужка:',
'feed-invalid' => 'Памылковы тып стужкі.',
'feed-unavailable' => 'Стужкі сындыкацыі недаступныя',
'site-rss-feed' => '$1 — RSS-стужка',
'site-atom-feed' => '$1 — Atom-стужка',
'page-rss-feed' => '«$1» — RSS-стужка',
'page-atom-feed' => '«$1» — Atom-стужка',
'red-link-title' => '$1 (старонка не існуе)',
'sort-descending' => 'Сартаваць па зьмяншэньні',
'sort-ascending' => 'Сартаваць па ўзрастаньні',
# Short words for each namespace, by default used in the namespace tab in monobook
'nstab-main' => 'Старонка',
'nstab-user' => 'Старонка {{GENDER:{{BASEPAGENAME}}|ўдзельніка|ўдзельніцы}}',
'nstab-media' => 'Мэдыя',
'nstab-special' => 'Спэцыяльная старонка',
'nstab-project' => 'Старонка праекту',
'nstab-image' => 'Файл',
'nstab-mediawiki' => 'Паведамленьне',
'nstab-template' => 'Шаблён',
'nstab-help' => 'Старонка дапамогі',
'nstab-category' => 'Катэгорыя',
# Main script and global functions
'nosuchaction' => 'Няма такога дзеяньня',
'nosuchactiontext' => 'Дзеяньне, пазначанае праз URL, зьяўляецца няслушным.
Магчыма Вы ўвялі няслушны URL, ці перайшлі па няслушнай спасылцы.
Гэта можа быць і памылкай у праграмным забесьпячэньні {{GRAMMAR:родны|{{SITENAME}}}}.',
'nosuchspecialpage' => 'Такой спэцыяльнай старонкі не існуе',
'nospecialpagetext' => '<strong>Спэцыяльная старонка, да якой Вы зьвярнуліся, не існуе.</strong>
Сьпіс дзейных спэцыяльных старонак можна знайсьці на [[Special:SpecialPages|{{int:specialpages}}]].',
# General errors
'error' => 'Памылка',
'databaseerror' => 'Памылка базы зьвестак',
'dberrortext' => 'Выяўленая памылка сынтаксісу ў звароце да базы зьвестак.
Магчыма, гэта памылка праграмнага забесьпячэньня.
Апошні запыт да базы:
<blockquote><code>$1</code></blockquote>
адбыўся з функцыі «<code>$2</code>».
База зьвестак вярнула памылку «<samp>$3: $4</samp>».',
'dberrortextcl' => 'Выяўлена памылка сынтаксісу ў звароце да базы зьвестак.
Апошні запыт да базы:
«$1»
адбыўся з функцыі «$2».
База зьвестак вярнула памылку «$3: $4»',
'laggedslavemode' => "'''Увага:''' старонка можа ня ўтрымліваць апошніх зьменаў.",
'readonly' => 'База зьвестак заблякаваная',
'enterlockreason' => 'Пазначце прычыну блякаваньня і заплянаваны час разблякаваньня',
'readonlytext' => 'База зьвестак заблякаваная для дадаваньня новых старонак і іншых зьменаў, верагодна з прычыны тэхнічнага абслугоўваньня, пасьля якога будзе адноўлена звычайная праца.
Адміністратар, які заблякаваў базу зьвестак, пакінуў наступнае тлумачэньне: $1',
'missing-article' => 'У базе зьвестак ня знойдзены тэкст старонкі «$1» $2.
Звычайна гэта адбываецца ў выпадку пераходу па састарэлай розьніцы альбо спасылцы гісторыі старонкі, якая была выдаленая.
Калі справа ня ў гэтым, верагодна Вы знайшлі памылку ў праграмным забесьпячэньні.
Калі ласка, паведаміце пра гэта [[Special:ListUsers/sysop|адміністратару]], пазначыўшы URL.',
'missingarticle-rev' => '(вэрсія № $1)',
'missingarticle-diff' => '(Розьніца: $1, $2)',
'readonly_lag' => 'База зьвестак была аўтаматычна заблякаваная да выкананьня рэплікацыі галоўнай базы зьвестак з другаснымі',
'internalerror' => 'Унутраная памылка',
'internalerror_info' => 'Унутраная памылка: $1',
'fileappenderrorread' => 'Немагчыма прачытаць «$1» пад час дапаўненьня.',
'fileappenderror' => 'Не атрымалася далучыць «$1» да «$2».',
'filecopyerror' => 'Немагчыма cкапіяваць файл «$1» у «$2».',
'filerenameerror' => 'Немагчыма перайменаваць файл «$1» у «$2».',
'filedeleteerror' => 'Немагчыма выдаліць файл «$1».',
'directorycreateerror' => 'Немагчыма стварыць дырэкторыю «$1».',
'filenotfound' => 'Немагчыма знайсьці файл «$1».',
'fileexistserror' => 'Немагчыма запісаць у файл «$1»: файл існуе',
'unexpected' => 'Нечаканае значэньне: «$1»=«$2».',
'formerror' => 'Памылка: не атрымалася адаслаць зьвесткі формы',
'badarticleerror' => 'Гэтае дзеяньне немагчыма выканаць на гэтай старонцы.',
'cannotdelete' => 'Немагчыма выдаліць старонку альбо файл «$1». Магчыма, яна ўжо выдаленая кімсьці іншым.',
'cannotdelete-title' => 'Немагчыма выдаліць старонку «$1»',
'delete-hook-aborted' => 'Выдаленьне скасаванае працэдурай-перахопнікам.
Тлумачэньняў не было.',
'badtitle' => 'Няслушная назва',
'badtitletext' => 'Запытаная назва старонкі няслушная ці пустая, альбо няслушна ўказаная міжмоўная ці інтэрвікі-назва. Яна можа ўтрымліваць сымбалі, якія нельга ўжываць у назвах.',
'perfcached' => 'Наступныя зьвесткі кэшаваныя і могуць быць састарэлымі. У кэшы {{PLURAL:$1|даступны|даступныя}} ня больш за $1 {{PLURAL:$1|вынік|вынікі|вынікаў}}.',
'perfcachedts' => 'Наступныя зьвесткі кэшаваныя і апошні раз былі абноўленыя $1. У кэшы {{PLURAL:$4|даступны|даступныя}} ня больш за $4 {{PLURAL:$4|вынік|вынікі|вынікаў}}.',
'querypage-no-updates' => 'Абнаўленьні гэтай старонкі цяпер адключаныя. Зьвесткі ня будуць абнаўляцца.',
'wrong_wfQuery_params' => 'Няслушныя парамэтры для wfQuery()<br />
Функцыя: $1<br />
Запыт: $2',
'viewsource' => 'Паказаць крыніцу',
'viewsource-title' => 'Прагляд крыніцы для $1',
'actionthrottled' => 'Дзеяньне прытрыманае',
'actionthrottledtext' => 'У межах барацьбы са спамам Вы абмежаваныя ў надта частым выкананьні гэтага дзеяньня за кароткі прамежак часу, і Вы перавысілі гэтае абмежаваньне. Калі ласка, паспрабуйце яшчэ раз празь некалькі хвілінаў.',
'protectedpagetext' => 'Гэтая старонка была абароненая для перадухіленьня зьменаў ці іншых дзеяньняў.',
'viewsourcetext' => 'Вы можаце праглядаць і капіяваць крынічны тэкст гэтай старонкі:',
'viewyourtext' => "Вы можаце праглядзець і скапіяваць крынічны тэкст '''вашых рэдагаваньняў''' на гэтую старонку:",
'protectedinterface' => 'Гэтая старонка ўтрымлівае інтэрфэйснае паведамленьне праграмнага забесьпячэньня, і яе зьмена забаронена. Каб дадаць ці зьмяніць пераклад ва ўсіх праектах, зьвярніцеся на [//translatewiki.net/ translatewiki.net], праект для перакладу MediaWiki.',
'editinginterface' => "'''Увага:''' Вы рэдагуеце старонку, якая ўтрымлівае сыстэмнае паведамленьне MediaWiki.
Яе зьмена паўплывае на вонкавы выгляд інтэрфэйсу іншых удзельнікаў у гэтай вікі.
Каб дадаць ці зьмяніць пераклад ва ўсіх праектах, зьвярніцеся на [//translatewiki.net/wiki/Main_Page?setlang=be-tarask translatewiki.net] — праект для лякалізацыі MediaWiki.",
'sqlhidden' => '(SQL-запыт схаваны)',
'cascadeprotected' => 'Гэтая старонка абароненая ад рэдагаваньня, таму што яна ўключаная ў {{PLURAL:$1|наступную старонку, якая была абароненая|наступныя старонкі, якія былі абароненыя}} з актывізаванай опцыяй «каскаднай абароны»:
$2',
'namespaceprotected' => "Вы ня маеце правоў на рэдагаваньне старонак у прасторы назваў '''$1'''.",
'customcssprotected' => 'Вы ня маеце правоў на рэдагаваньне гэтай CSS-старонкі, таму што яна ўтрымлівае пэрсанальныя налады іншага ўдзельніка.',
'customjsprotected' => 'Вы ня маеце правоў на рэдагаваньне гэтай старонкі JavaScript, таму што яна ўтрымлівае пэрсанальныя налады іншага ўдзельніка.',
'ns-specialprotected' => 'Немагчыма рэдагаваць спэцыяльныя старонкі.',
'titleprotected' => "Стварэньне старонкі з такой назвай было забароненае ўдзельнікам [[User:$1|$1]].
Прычына забароны: ''$2''.",
'filereadonlyerror' => 'Немагчыма зьмяніць файл «$1», бо файлавае сховішча «$2» знаходзіцца ў рэжыме толькі для чытаньня
Адміністратар, які абмежаваў доступ, пазначыў прычыну: «$3».',
'invalidtitle-knownnamespace' => 'Няслушная назва ў прасторы «$2»: «$3»',
'invalidtitle-unknownnamespace' => 'Няслушная назва ў невядомай прасторы $1: «$2»',
'exception-nologin' => 'Вы не ўвайшлі ў сыстэму',
'exception-nologin-text' => 'Гэтая старонка ці дзеяньне патрабуе, каб вы ўвайшлі ў сыстэму.',
# Virus scanner
'virus-badscanner' => "Няслушная канфігурацыя: невядомы антывірусны сканэр: ''$1''",
'virus-scanfailed' => 'памылка сканаваньня (код $1)',
'virus-unknownscanner' => 'невядомы антывірус:',
# Login and logout pages
'logouttext' => "'''Вы выйшлі з сыстэмы.'''
Вы можаце працягваць працу ў {{GRAMMAR:месны|{{SITENAME}}}} ананімна, альбо можаце [[Special:UserLogin|ўвайсьці ў сыстэму]] як той жа альбо іншы ўдзельнік.
Некаторыя старонкі могуць паказвацца, быццам Вы ўсё яшчэ ў сыстэме. Каб гэтага пазьбегнуць, трэба ачысьціць кэш браўзэра.",
'welcomecreation' => '== Вітаем, $1! ==
Ваш рахунак быў створаны.
Не забудзьцеся зьмяніць Вашыя [[Special:Preferences|налады ў {{GRAMMAR:месны|{{SITENAME}}}}]].',
'yourname' => 'Імя ўдзельніка:',
'yourpassword' => 'Пароль:',
'yourpasswordagain' => 'Паўтарыце пароль:',
'remembermypassword' => 'Запомніць мяне на гэтым кампутары (ня больш за $1 {{PLURAL:$1|дзень|дні|дзён}})',
'securelogin-stick-https' => 'Утрымліваць злучэньне праз HTTPS пасьля ўваходу ў сыстэму',
'yourdomainname' => 'Ваш дамэн:',
'password-change-forbidden' => 'Вы ня можаце зьмяняць паролі ў гэтай вікі.',
'externaldberror' => 'Адбылася памылка аўтэнтыфікацыі з дапамогай вонкавай базы зьвестак, ці Вам не дазволена абнаўляць свой рахунак.',
'login' => 'Увайсьці',
'nav-login-createaccount' => 'Уваход / стварэньне рахунку',
'loginprompt' => 'Вы павінны дазволіць cookie для ўваходу ў {{GRAMMAR:вінавальны|{{SITENAME}}}}.',
'userlogin' => 'Увайсьці ў сыстэму',
'userloginnocreate' => 'Увайсьці',
'logout' => 'Выйсьці',
'userlogout' => 'Выйсьці',
'notloggedin' => 'Вы не ўвайшлі ў сыстэму',
'nologin' => 'Ня маеце рахунку? $1.',
'nologinlink' => 'Стварыце рахунак',
'createaccount' => 'Стварэньне рахунку',
'gotaccount' => 'Ужо маеце рахунак? $1.',
'gotaccountlink' => 'Увайдзіце',
'userlogin-resetlink' => 'Забыліся на зьвесткі для ўваходу?',
'createaccountmail' => 'па электроннай пошце',
'createaccountreason' => 'Прычына:',
'badretype' => 'Уведзеныя Вамі паролі не супадаюць.',
'userexists' => 'Уведзенае Вамі імя ўдзельніка ўжо выкарыстоўваецца кімсьці іншым.
Калі ласка, выберыце іншае імя.',
'loginerror' => 'Памылка ўваходу',
'createaccounterror' => 'Немагчыма стварыць рахунак: $1',
'nocookiesnew' => 'Рахунак быў створаны, але ў сыстэму Вы не ўвайшлі.
{{SITENAME}} выкарыстоўвае cookie для ўваходу ў сыстэму.
У Вашым браўзэры cookies адключаныя.
Калі ласка, дазвольце іх, а потым ўвайдзіце з новым іменем удзельніка і паролем.',
'nocookieslogin' => '{{SITENAME}} выкарыстоўвае cookie для ўваходу ў сыстэму.
У Вашым браўзэры cookie адключаныя.
Калі ласка, уключыце іх і паспрабуйце яшчэ раз.',
'nocookiesfornew' => 'Рахунак удзельніка ня быў створаны, таму што мы не змаглі пацьвердзіць яго крыніцу.
Упэўніце, што ў Вас уключаныя закладкі (cookies), перазагрузіце гэтую старонку і паспрабуйце зноў.',
'noname' => 'Вы пазначылі няслушнае імя ўдзельніка.',
'loginsuccesstitle' => 'Пасьпяховы ўваход у сыстэму',
'loginsuccess' => "'''Цяпер Вы ўвайшлі ў {{GRAMMAR:вінавальны|{{SITENAME}}}} як «$1».'''",
'nosuchuser' => 'Удзельніка «$1» не існуе.
Вялікія і малыя літары адрозьніваюцца ў імёнах удзельнікаў.
Праверце напісаньне альбо [[Special:UserLogin/signup|стварыце новы рахунак]].',
'nosuchusershort' => 'Удзельніка зь іменем «$1» не існуе. Праверце напісаньне.',
'nouserspecified' => 'Вы мусіце пазначыць імя ўдзельніка.',
'login-userblocked' => '{{GENDER:$1|Гэты ўдзельнік заблякаваны|Гэтая ўдзельніца заблякаваная}}. Уваход у сыстэму забаронены.',
'wrongpassword' => 'Уведзены няслушны пароль. Калі ласка, паспрабуйце яшчэ раз.',
'wrongpasswordempty' => 'Быў уведзены пусты пароль. Калі ласка, паспрабуйце яшчэ раз.',
'passwordtooshort' => 'Паролі павінны ўтрымліваць ня менш за $1 {{PLURAL:$1|сымбаль|сымбалі|сымбаляў}}.',
'password-name-match' => 'Ваш пароль павінен адрозьнівацца ад Вашага імя ўдзельніка.',
'password-login-forbidden' => 'Выкарыстаньне гэтага імя ўдзельніка і пароля было забароненае.',
'mailmypassword' => 'Даслаць новы пароль па электроннай пошце',
'passwordremindertitle' => 'Новы часовы пароль для {{GRAMMAR:родны|{{SITENAME}}}}',
'passwordremindertext' => 'Нехта (магчыма Вы, з IP-адрасу $1) запытаў нас даслаць новы пароль для {{GRAMMAR:родны|{{SITENAME}}}} ($4). Для ўдзельніка «$2» быў створаны часовы пароль і ён цяпер «$3». Калі гэта была Вашая ініцыятыва, Вам трэба ўвайсьці ў сыстэму і адразу зьмяніць пароль. Тэрмін дзеяньня Вашага часовага паролю — $5 {{PLURAL:$5|дзень|дні|дзён}}.
Калі гэты запыт адправіў нехта іншы, альбо Вы ўзгадалі свой пароль і ўжо не жадаеце яго зьмяніць, Вы можаце праігнараваць гэты ліст і працягваць карыстацца старым паролем.',
'noemail' => '{{GENDER:$1|Удзельнік «$1» не пазначыў|Удзельніца «$1» не пазначыла}} ніякага адрасу электроннай пошты.',
'noemailcreate' => 'Вы павінны пазначыць слушны адрас электроннай пошты',
'passwordsent' => 'Новы пароль быў дасланы на адрас электроннай пошты ўдзельніка «$1».
Калі ласка, увайдзіце ў сыстэму пасьля яго атрыманьня.',
'blocked-mailpassword' => 'З Вашага IP-адрасу забароненыя рэдагаваньні, а таму таксама для прадухіленьня шкоды недаступная функцыя аднаўленьня паролю.',
'eauthentsent' => 'Пацьверджаньне было дасланае на пазначаны адрас электроннай пошты.
У лісьце ўтрымліваюцца інструкцыі, па выкананьні якіх, Вы зможаце пацьвердзіць, што адрас сапраўды належыць Вам, і на гэты адрас будзе дасылацца пошта адсюль.',
'throttled-mailpassword' => 'Ліст пра скіданьне паролю ўжо было даслана за {{PLURAL:$1|$1 апошнюю гадзіну|$1 апошнія гадзіны|$1 апошніх гадзінаў}}.
Для прадухіленьня злоўжываньняў напамін будзе дасылацца не часьцей як аднойчы ў $1 {{PLURAL:$1|гадзіну|гадзіны|гадзінаў}}.',
'mailerror' => 'Памылка пры адпраўцы электроннай пошты: $1',
'acct_creation_throttle_hit' => 'Наведвальнікі гэтай вікі, якія карысталіся Вашым ІР-адрасам, ужо стварылі $1 {{PLURAL:$1|рахунак у|рахункі ў|рахункаў у}} апошнія дні, што перавышае максымальную дазволеную колькасьць за гэты пэрыяд.
У выніку, наведвальнікі, якія карыстаюцца гэтым ІР-адрасам, ня могуць стварыць зараз болей рахункаў.',
'emailauthenticated' => 'Ваш адрас электроннай пошты быў пацьверджаны $2 у $3.',
'emailnotauthenticated' => 'Ваш адрас электроннай пошты яшчэ не пацьверджаны.
Электронная пошта для наступных магчымасьцяў дасылацца ня будзе.',
'noemailprefs' => 'Пазначце адрас электроннай пошты ў Вашых наладах, каб актывізаваць гэтыя магчымасьці.',
'emailconfirmlink' => 'Пацьвердзіць Ваш адрас электроннай пошты',
'invalidemailaddress' => 'Уведзены адрас электроннай пошты не адпавядае фармату адрасоў электроннай пошты.
Увядзіце слушны адрас электроннай пошты ці ачысьціце гэтае поле.',
'cannotchangeemail' => 'Электронная пошта рахунку ня можа быць зьмененая ў {{GRAMMAR:месны|{{SITENAME}}}}.',
'emaildisabled' => 'Гэты сайт ня можа адсылаць электронныя лісты.',
'accountcreated' => 'Рахунак створаны',
'accountcreatedtext' => 'Рахунак удзельніка для $1 быў створаны.',
'createaccount-title' => 'Стварэньне рахунку ў {{GRAMMAR:месны|{{SITENAME}}}}',
'createaccount-text' => 'Нехта стварыў рахунак «$2» у {{GRAMMAR:месны|{{SITENAME}}}} ($4) для Вашага адрасу электроннай пошты. Пароль для гэтага рахунку — «$3». Вам трэба ўвайсьці і зьмяніць Ваш пароль зараз.
Вы можаце праігнараваць гэты ліст, калі гэты рахунак быў створаны памылкова.',
'usernamehasherror' => 'Імя ўдзельніка ня можа ўтрымліваць сымбаль #',
'login-throttled' => 'Вы зрабілі занадта шмат спробаў уваходу ў сыстэму.
Калі ласка, пачакайце, перад тым, як паспрабаваць ізноў.',
'login-abort-generic' => 'Не атрымалася ўвайсьці ў сыстэму, скасавана',
'loginlanguagelabel' => 'Мова: $1',
'suspicious-userlogout' => 'Ваш запыт на выхад з сыстэмы быў адхілены, таму што выглядае, што ён быў дасланы пашкоджаным браўзэрам альбо кэшаваным проксі-сэрвэрам.',
# Email sending
'php-mail-error-unknown' => 'Узьнікла невядомая памылка ў функцыі PHP mail()',
'user-mail-no-addy' => 'Спроба даслаць электронны ліст без адрасу дастаўкі',
# Change password dialog
'resetpass' => 'Зьмяніць пароль',
'resetpass_announce' => 'Вы ўвайшлі з дапамогай часовага паролю, дасланага праз электронную пошту.
Для завяршэньня ўваходу ў сыстэму Вы мусіце ўвесьці тут новы пароль:',
'resetpass_header' => 'Зьмяніць пароль рахунку',
'oldpassword' => 'Стары пароль:',
'newpassword' => 'Новы пароль:',
'retypenew' => 'Паўтарыце новы пароль:',
'resetpass_submit' => 'Наставіць пароль і увайсьці',
'resetpass_success' => 'Ваш пароль быў пасьпяхова зьменены! Выконваецца ўваход у сыстэму…',
'resetpass_forbidden' => 'Пароль ня можа быць зьменены',
'resetpass-no-info' => 'Для непасрэднага доступу да гэтай старонкі Вам неабходна ўвайсьці ў сыстэму.',
'resetpass-submit-loggedin' => 'Зьмяніць пароль',
'resetpass-submit-cancel' => 'Скасаваць',
'resetpass-wrong-oldpass' => 'Няслушны часовы альбо цяперашні пароль.
Магчыма Вы ўжо пасьпяхова зьмянілі Ваш пароль альбо запыталі новы часовы пароль.',
'resetpass-temp-password' => 'Часовы пароль:',
# Special:PasswordReset
'passwordreset' => 'Ачыстка паролю',
'passwordreset-text' => 'Запоўніце гэтую форму, каб скінуць пароль.',
'passwordreset-legend' => 'Ачысьціць пароль',
'passwordreset-disabled' => 'Магчымасьць ачысткі паролю была забароненая ў {{GRAMMAR:месны|{{SITENAME}}}}.',
'passwordreset-pretext' => '{{PLURAL:$1||Увядзіце ніжэй частку зьвестак}}',
'passwordreset-username' => 'Імя ўдзельніка:',
'passwordreset-domain' => 'Дамэн:',
'passwordreset-capture' => 'Паказаць канчатковы электронны ліст?',
'passwordreset-capture-help' => 'Калі Вы пазначыце гэтае поле, электронны ліст (з часовым паролем), будзе паказаны Вам як толькі ён будзе дасланы ўдзельніку.',
'passwordreset-email' => 'Адрас электроннай пошты:',
'passwordreset-emailtitle' => 'Падрабязнасьці рахунку ў {{GRAMMAR:месны|{{SITENAME}}}}',
'passwordreset-emailtext-ip' => 'Нехта (магчыма Вы, з IP-адрасу $1) зрабіў запыт на вашага паролю ў {{GRAMMAR:месны|{{SITENAME}}}} ($4). {{PLURAL:$3|Наступны рахунак удзельніка зьвязаны|Наступныя рахункі ўдзельнікаў зьвязаныя}} з гэтым адрасам электроннай пошты:
$2
{{PLURAL:$3|Гэты часовы пароль будзе|Гэтыя часовыя паролі будуць}} дзейнічаць $5 {{PLURAL:|дзень|дні|дзён}}.
Цяпер Вам неабходна ўвайсьці і выбраць новы пароль. Калі нехта іншы зрабіў гэты запыт,
ці Вы ўспомнілі Ваш пачатковы пароль, які ня хочаце мяняць,
Вы можаце праігнараваць гэтае паведамленьне, і працягваць выкарыстоўваць стары пароль.',
'passwordreset-emailtext-user' => 'Удзельнік $1 зрабіў запыт на скіданьне вашага паролю ў {{GRAMMAR:месны|{{SITENAME}}}} ($4). {{PLURAL:$3|Наступны рахунак удзельніка зьвязаны|Наступныя рахункі ўдзельнікаў зьвязаныя}} з гэтым адрасам электроннай пошты:
$2
{{PLURAL:$3|Гэты часовы пароль будзе|Гэтыя часовыя паролі будуць}} дзейнічаць $5 {{PLURAL:|дзень|дні|дзён}}.
Цяпер Вам неабходна ўвайсьці і выбраць новы пароль. Калі нехта іншы зрабіў гэты запыт,
ці Вы ўспомнілі Ваш пачатковы пароль, які ня хочаце мяняць,
Вы можаце праігнараваць гэтае паведамленьне, і працягваць выкарыстоўваць стары пароль.',
'passwordreset-emailelement' => 'Імя ўдзельніка: $1
Часовы пароль: $2',
'passwordreset-emailsent' => 'Ліст пра скіданьне паролю быў дасланы.',
'passwordreset-emailsent-capture' => 'Ліст пра скіданьне паролю быў дасланы, што паказана ніжэй.',
'passwordreset-emailerror-capture' => 'Электронны ліст з напамінам быў створаны, што паказана ніжэй, але адбылася памылка адпраўкі ўдзельніку: $1',
# Special:ChangeEmail
'changeemail' => 'Зьмяніць адрас электроннай пошты',
'changeemail-header' => 'Зьмена адрасу электроннай пошты для рахунку',
'changeemail-text' => 'Запоўніце гэтую форму для зьмены адрасу Вашай электроннай пошты. Вам неабходна будзе ўвесьці Ваш пароль для пацьверджаньня зьмены.',
'changeemail-no-info' => 'Для непасрэднага доступу да гэтай старонкі Вам неабходна ўвайсьці ў сыстэму.',
'changeemail-oldemail' => 'Цяперашні адрас электроннай пошты:',
'changeemail-newemail' => 'Новы адрас электроннай пошты:',
'changeemail-none' => '(няма)',
'changeemail-submit' => 'Зьмяніць адрас электроннай пошты',
'changeemail-cancel' => 'Скасаваць',
# Edit page toolbar
'bold_sample' => 'Тоўсты тэкст',
'bold_tip' => 'Тоўсты тэкст',
'italic_sample' => 'Курсіўны тэкст',
'italic_tip' => 'Курсіўны тэкст',
'link_sample' => 'Загаловак спасылкі',
'link_tip' => 'Унутраная спасылка',
'extlink_sample' => 'http://www.example.com загаловак спасылкі',
'extlink_tip' => 'Вонкавая спасылка (не забывайцеся пачынаць з http:// )',
'headline_sample' => 'Тэкст загалоўку',
'headline_tip' => 'Загаловак 2-га ўзроўню',
'nowiki_sample' => 'Устаўце сюды нефарматаваны тэкст',
'nowiki_tip' => 'Ігнараваць вікі-фарматаваньне',
'image_sample' => 'Прыклад.jpg',
'image_tip' => 'Укладзены файл',
'media_sample' => 'Прыклад.ogg',
'media_tip' => 'Спасылка на файл',
'sig_tip' => 'Ваш подпіс і момант часу',
'hr_tip' => 'Гарызантальная лінія (не выкарыстоўвайце часта)',
# Edit pages
'summary' => 'Кароткае апісаньне зьменаў:',
'subject' => 'Тэма/назва:',
'minoredit' => 'Гэта дробная праўка',
'watchthis' => 'Назіраць за гэтай старонкай',
'savearticle' => 'Захаваць старонку',
'preview' => 'Папярэдні прагляд',
'showpreview' => 'Праглядзець',
'showlivepreview' => 'Хуткі папярэдні прагляд',
'showdiff' => 'Паказаць зьмены',
'anoneditwarning' => "'''Папярэджаньне:''' Вы не ўвайшлі ў сыстэму. Ваш IP-адрас будзе запісаны ў гісторыі гэтай старонкі.",
'anonpreviewwarning' => "''Вы не ўвайшлі ў сыстэму. Падчас захаваньня Ваш IP-адрас будзе дададзены ў гісторыю рэдагаваньняў старонкі.''",
'missingsummary' => "'''Напамін:''' Вы не пазначылі кароткае апісаньне зьменаў.
Калі Вы націсьніце кнопку «Запісаць» яшчэ раз, Вашае рэдагаваньне будзе запісанае без апісаньня.",
'missingcommenttext' => 'Калі ласка, увядзіце камэнтар ніжэй.',
'missingcommentheader' => "'''Напамін:''' Вы не пазначылі загаловак камэнтара.
Калі Вы націсьніце кнопку «{{int:savearticle}}» яшчэ раз, Ваш камэнтар захаваецца бяз тэмы.",
'summary-preview' => 'Папярэдні прагляд апісаньня:',
'subject-preview' => 'Папярэдні прагляд загалоўку:',
'blockedtitle' => 'Удзельнік заблякаваны',
'blockedtext' => "'''Ваш рахунак ўдзельніка ці IP-адрас быў заблякаваны.'''
Блякаваньне выканаў $1.
Прычына гэтага: ''$2''.
* Пачатак блякаваньня: $8
* Сканчэньне блякаваньня: $6
* Быў заблякаваны: $7
Вы можаце скантактавацца з $1 ці адным зь іншых [[{{MediaWiki:Grouppage-sysop}}|адміністратараў]], каб абмеркаваць блякаваньне. Заўважце, што Вы ня зможаце ўжыць магчымасьць «даслаць ліст па электроннай пошце», пакуль не пазначыце сапраўдны адрас электроннай пошты ў Вашых [[Special:Preferences|наладах]], і калі гэта Вам не было забаронена.
Ваш IP-адрас — $3, ідэнтыфікатар блякаваньня — #$5.
Калі ласка, улучайце ўсю вышэйпададзеную інфармацыю ва ўсе запыты, што Вы будзеце рабіць.",
'autoblockedtext' => "Ваш IP-адрас быў аўтаматычна заблякаваны, таму што ён ужываўся іншым удзельнікам, які быў заблякаваны $1.
Прычына гэтага:
:''$2''
* Блякаваньне пачалося: $8
* Блякаваньне скончыцца: $6
* Быў заблякаваны: $7
Вы можаце скантактавацца з $1 ці з адным зь іншых [[{{MediaWiki:Grouppage-sysop}}|адміністратараў]], каб абмеркаваць блякаваньне.
Заўважце, што Вы ня зможаце ужываць магчымасьць «даслаць ліст праз электронную пошту», пакуль ня будзе пазначаны дзейны адрас электроннай пошты ў Вашых [[Special:Preferences|наладах удзельніка]], і калі гэта Вам не было забаронена.
Ваш цяперашні IP-адрас — $3, ідэнтыфікатар блякаваньня — #$5.
Калі ласка, улучайце ўсю вышэйпададзеную інфармацыю ва ўсе запыты, што Вы будзеце рабіць.",
'blockednoreason' => 'прычына не пазначана',
'whitelistedittext' => 'Вам трэба $1, каб рэдагаваць старонкі.',
'confirmedittext' => 'Вы мусіце пацьвердзіць Ваш адрас электроннай пошты перад рэдагаваньнем старонак. Калі ласка, пазначце і пацьвердзіце адрас электроннай пошты праз Вашы [[Special:Preferences|налады]].',
'nosuchsectiontitle' => 'Немагчыма знайсьці сэкцыю',
'nosuchsectiontext' => 'Вы спрабуеце рэдагаваць сэкцыю, якой не існуе.
Яна магла быць перанесена, альбо выдалена пад час Вашага прагляду старонкі.',
'loginreqtitle' => 'Патрабуецца ўваход у сыстэму',
'loginreqlink' => 'ўвайсьці',
'loginreqpagetext' => 'Вы мусіце $1, каб праглядаць іншыя старонкі.',
'accmailtitle' => 'Пароль адасланы.',
'accmailtext' => "Выпадковым чынам створаны пароль для [[User talk:$1|$1]] быў адасланы па адрасе $2.
Пароль для гэтага новага рахунку можа быць зьменены на старонцы ''[[Special:ChangePassword|зьмены паролю]]'' пасьля ўваходу.",
'newarticle' => '(Новая)',
'newarticletext' => "Вы прыйшлі па спасылцы на старонку, якая яшчэ не існуе.
Каб стварыць яе, напішыце тэкст у полі ніжэй (глядзіце [[{{MediaWiki:Helppage}}|старонку дапамогі]] для дадатковай інфармацыі).
Калі Вы трапілі сюды памылкова, націсьніце '''назад''' у вашым браўзэры.",
'anontalkpagetext' => "----''Гэта старонка гутарак ананімнага ўдзельніка, які яшчэ не стварыў сабе рахунак альбо не ўжывае яго. Таму мы вымушаныя ўжываць лічбавы IP-адрас дзеля ягонай ідэнтыфікацыі. Адзін IP-адрас можа выкарыстоўвацца некалькімі ўдзельнікамі. Калі Вы — ананімны ўдзельнік і лічыце, што атрымалі не прызначаныя Вам камэнтары, калі ласка, [[Special:UserLogin/signup|стварыце рахунак]] альбо [[Special:UserLogin|увайдзіце ў сыстэму]], каб у будучыні пазьбегнуць магчымай блытаніны зь іншымі ананімнымі ўдзельнікамі.''",
'noarticletext' => 'Цяпер тэкст на гэтай старонцы адсутнічае.
Вы можаце [[Special:Search/{{PAGENAME}}|пашукаць гэтую назву]] ў іншых старонках, <span class="plainlinks">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} пашукаць у адпаведных журналах падзеяў]
альбо [{{fullurl:{{NAMESPACE}}:{{PAGENAME}}|action=edit}} рэдагаваць гэтую старонку]</span>.',
'noarticletext-nopermission' => 'Цяпер на гэтай старонцы тэкст адсутнічае.
Вы можаце [[Special:Search/{{PAGENAME}}|пашукаць назву гэтай старонкі]] на іншых старонках, альбо <span class="plainlinks">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} пашукаць зьвязаныя запісы ў журналах]</span>, але ў вас няма дазволу ствараць гэтую старонку.',
'missing-revision' => 'Вэрсія старонкі №$1 з назвай «{{PAGENAME}}» не існуе.
Звычайна гэта здараецца з-за перахода па састарэлай спасылцы на старонку, якая была выдаленая.
Падрабязнасьці можна знайсьці ў [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} журнале выдаленьняў].',
'userpage-userdoesnotexist' => 'Рахунак удзельніка «<nowiki>$1</nowiki>» не зарэгістраваны. Калі ласка, удакладніце, ці жадаеце Вы стварыць/рэдагаваць гэтую старонку.',
'userpage-userdoesnotexist-view' => 'Рахунак «$1» ня створаны.',
'blocked-notice-logextract' => 'Гэты ўдзельнік у дадзены момант заблякаваны.
Апошні запіс з журналу блякаваньняў пададзены ніжэй для даведкі:',
'clearyourcache' => "'''Заўвага:''' Каб пабачыць зьмены пасьля захаваньня, Вам можа спатрэбіцца ачысьціць кэш Вашага браўзэра.
* '''Firefox / Safari:''' Трымайце ''Shift'' і націсьніце ''Reload'', ці націсьніце ''Ctrl-F5'' ці ''Ctrl-R'' (''⌘-R'' на Mac)
* '''Google Chrome:''' Націсьніце ''Ctrl-Shift-R'' (''⌘-Shift-R'' на Mac)
* '''Internet Explorer:''' Трымайце ''Ctrl'' і націсьніце ''Refresh'', ці націсьніце ''Ctrl-F5''
* '''Opera:''' Ачысьціце кэш праз ''Tools → Preferences''",
'usercssyoucanpreview' => "'''Падказка:''' выкарыстоўвайце кнопку «{{int:showpreview}}», каб паспрабаваць новы код CSS перад тым як яго запісаць.",
'userjsyoucanpreview' => "'''Падказка:''' выкарыстоўвайце кнопку «{{int:showpreview}}», каб паспрабаваць новы код JavaScript перад тым, як яго запісаць.",
'usercsspreview' => "'''Памятайце, што гэта толькі папярэдні прагляд Вашага CSS. Ён яшчэ не запісаны!'''",
'userjspreview' => "'''Памятайце, што гэта толькі папярэдні прагляд Вашага JavaScript, ён яшчэ не запісаны!'''",
'sitecsspreview' => "'''Памятайце, што гэта толькі папярэдні прагляд гэтага CSS.'''
'''Ён яшчэ не захаваны!'''",
'sitejspreview' => "'''Памятайце, што гэта толькі папярэдні прагляд гэтага коду JavaScript.'''
'''Ён яшчэ не захаваны!'''",
'userinvalidcssjstitle' => "'''Папярэджаньне:''' няма тэмы афармленьня «$1».
Памятайце, што ўласныя старонкі .css і .js павінны мець назву, якая складаецца з малых літараў, напрыклад, {{ns:user}}:Хтосьці/vector.css, а не {{ns:user}}:Хтосьці/Vector.css.",
'updated' => '(Абноўлена)',
'note' => "'''Заўвага: '''",
'previewnote' => "'''Гэта толькі папярэдні прагляд.'''
Вашыя зьмены яшчэ не былі захаваныя!",
'continue-editing' => 'Перайсьці да рэдагаваньня',
'previewconflict' => 'Гэта папярэдні прагляд тэксту зь верхняга вакна рэдагаваньня, так ён будзе выглядаць, калі Вы вырашыце яго захаваць.',
'session_fail_preview' => "'''Не атрымалася захаваць Вашую праўку праз тое, што былі страчаныя зьвесткі пра сэсію.
Калі ласка, паспрабуйце яшчэ раз. Калі памылка ня зьнікне, паспрабуйце [[Special:UserLogout|выйсьці з сыстэмы]] і ўвайсьці ізноў.'''",
'session_fail_preview_html' => "'''Не атрымалася захаваць Вашую праўку праз тое, што былі страчаныя зьвесткі пра сэсію.'''
''Таму што ў {{GRAMMAR:месны|{{SITENAME}}}} дазволена выкарыстоўваць чысты HTML, папярэдні прагляд быў адключаны для засьцярогі ад атакаў праз JavaScript.''
'''Калі гэта сапраўдная спроба рэдагаваньня, калі ласка, паспрабуйце яшчэ раз. Калі гэта не дапамагае, паспрабуйце [[Special:UserLogout|выйсьці з сыстэмы]] і ўвайсьці ізноў.'''",
'token_suffix_mismatch' => "'''Вашае рэдагаваньне было адхіленае, таму што Ваш кліент ня можа апрацоўваць знакі пунктуацыі ў акне рэдагаваньня.
Рэдагаваньне было скасаванае для таго, каб пазьбегнуць зьнішчэньня тэксту старонкі.
Такія памылкі здараюцца, калі Вы выкарыстоўваеце ананімны проксі-сэрвэр, які ўтрымлівае памылкі.'''",
'edit_form_incomplete' => "'''Некаторыя часткі формы рэдагаваньня не дасягнулі сэрвэра. Упэўніцеся, што Вашыя рэдагаваньні не пашкоджаныя і паспрабуйце зноў.'''",
'editing' => 'Рэдагаваньне: $1',
'creating' => 'Стварэньне «$1»',
'editingsection' => 'Рэдагаваньне: $1 (сэкцыя)',
'editingcomment' => 'Рэдагаваньне: $1 (новая сэкцыя)',
'editconflict' => 'Канфлікт рэдагаваньня: $1',
'explainconflict' => "Нехта зьмяніў старонку падчас Вашага рэдагаваньня.
У верхнім тэкставым акне знаходзіцца цяперашні зьмест старонкі.
Вашыя зьмены паказаныя ў ніжнім акне.
Вам трэба перанесьці Вашыя зьмены ў цяперашні тэкст.
Калі Вы націсьніце «{{int:savearticle}}», будзе захаваны '''толькі''' тэкст верхняга вакна.",
'yourtext' => 'Ваш тэкст',
'storedversion' => 'Захаваная вэрсія',
'nonunicodebrowser' => "'''ПАПЯРЭДЖАНЬНЕ: Ваш браўзэр не працуе з кадаваньнем UTF-8 (Unicode).
У выніку гэтага ўсе сымбалі ня ўключаныя ў ASCII будуць замененыя на іх шаснаццаткавыя коды.'''",
'editingold' => "'''ПАПЯРЭДЖАНЬНЕ: Вы рэдагуеце састарэлую вэрсію гэтай старонкі.
Калі Вы паспрабуеце захаваць яе, любыя зьмены, зробленыя пасьля гэтай вэрсіі, будуць страчаныя.'''",
'yourdiff' => 'Адрозьненьні',
'copyrightwarning' => "Калі ласка, зьвярніце ўвагу на тое, што ўсе дадаткі і зьмены ў {{GRAMMAR:месны|{{SITENAME}}}} разглядаюцца як выдадзеныя ў адпаведнасьці з умовамі ліцэнзіі $2 (глядзіце падрабязнасьці на $1). Калі Вы супраць таго, каб Вашыя матэрыялы неабмежавана рэдагавалася і распаўсюджвалася, не дадавайце іх.<br />
Вы таксама абавязуецеся, што Ваш матэрыял напісаны асабіста Вамі або зьяўляецца грамадзкім набыткам, альбо ўзяты з падобных вольных крыніцаў.
'''НЕЛЬГА БЕЗ ДАЗВОЛУ ДАДАВАЦЬ МАТЭРЫЯЛЫ, АБАРОНЕНЫЯ АЎТАРСКІМ ПРАВАМ!'''",
'copyrightwarning2' => "Калі ласка, заўважце, што ўвесь унёсак ў {{GRAMMAR:вінавальны|{{SITENAME}}}} можа рэдагавацца, зьмяняцца і выдаляцца іншымі ўдзельнікамі.
Калі Вы з гэтым ня згодныя, калі ласка, не зьмяшчайце сюды Вашыя тэксты.<br />
Разьмяшчэньнем тут тэкстаў, Вы дэкляруеце, што Вы зьяўляецеся іх аўтарам, ці Вы скапіявалі іх з крыніцы, якая дазваляе вольнае выкарыстаньне сваіх тэкстаў (дзеля падрабязнасьцяў глядзіце $1).
'''КАЛІ ЛАСКА, НЕ ЗЬМЯШЧАЙЦЕ ТУТ БЕЗ ДАЗВОЛУ МАТЭРЫЯЛЫ, ЯКІЯ АХОЎВАЮЦЦА АЎТАРСКІМ ПРАВАМ!'''",
'longpageerror' => "'''Памылка: Аб’ём тэксту, які Вы спрабуеце запісаць складае $1 {{PLURAL:$1|кілябайт|кілябайты|кілябайтаў}}, што болей устаноўленага абмежаваньня на $2 {{PLURAL:$2|кілябайт|кілябайты|кілябайтаў}}.'''
Старонка ня можа быць захаваная.",
'readonlywarning' => "'''ПАПЯРЭДЖАНЬНЕ: База зьвестак была заблякаваная для тэхнічнага абслугоўваньня, таму немагчыма зараз захаваць Вашыя зьмены.'''
Вы можаце скапіяваць тэкст у файл на Вашым кампутары, а пазьней захаваць сюды.
Адміністратар, які заблякаваў базу зьвестак, прапанаваў наступнае тлумачэньне: $1",
'protectedpagewarning' => "'''Папярэджаньне: Гэтая старонка была абароненая, таму толькі адміністратары могуць рэдагаваць яе.'''
Апошні запіс з журнала пададзены ніжэй для даведкі:",
'semiprotectedpagewarning' => "'''Заўвага:''' Гэтая старонка была абароненая, і рэдагаваць яе могуць толькі зарэгістраваныя ўдзельнікі.
Апошні запіс з журнала пададзены ніжэй для даведкі:",
'cascadeprotectedwarning' => "'''Папярэджаньне:''' Гэтая старонка абароненая, толькі ўдзельнікі з правамі адміністратараў могуць рэдагаваць яе, таму што яна ўключаная ў {{PLURAL:$1|наступную каскадна-абароненую старонку|наступныя каскадна-абароненыя старонкі}}:",
'titleprotectedwarning' => "'''Папярэджаньне: гэтая старонка была абароненая і для яе стварэньня патрабуюцца [[Special:ListGroupRights|адпаведныя правы]].'''
Апошні запіс з журнала пададзены ніжэй для даведкі:",
'templatesused' => 'На гэтай старонцы {{PLURAL:$1|выкарыстаны наступны шаблён|выкарыстаныя наступныя шаблёны}}:',
'templatesusedpreview' => 'У гэтым папярэднім праглядзе {{PLURAL:$1|выкарыстаны наступны шаблён|выкарыстаныя наступныя шаблёны}}:',
'templatesusedsection' => 'У гэтай сэкцыі {{PLURAL:$1|выкарыстаны наступны шаблён|выкарыстаныя наступныя шаблёны}}:',
'template-protected' => '(абаронены)',
'template-semiprotected' => '(часткова абароненая)',
'hiddencategories' => 'Гэтая старонка належыць $1 {{PLURAL:$1|схаванай катэгорыі|схаваным катэгорыям|схаваным катэгорыям}}:',
'nocreatetitle' => 'Стварэньне старонак абмежаванае',
'nocreatetext' => 'У {{GRAMMAR:месны|{{SITENAME}}}} абмежаванае стварэньне новых старонак.
Вы можаце вярнуцца і рэдагаваць існуючую старонку, альбо [[Special:UserLogin|ўвайсьці ў сыстэму ці стварыць рахунак]].',
'nocreate-loggedin' => 'Вы ня маеце дазволу на стварэньне новых старонак.',
'sectioneditnotsupported-title' => 'Рэдагаваньне сэкцыяў не падтрымліваецца',
'sectioneditnotsupported-text' => 'Рэдагаваньне сэкцыяў не падтрымліваецца ў гэтай старонцы рэдагаваньня',
'permissionserrors' => 'Памылкі дазволаў',
'permissionserrorstext' => 'Вы ня маеце дазволу на гэтае дзеяньне па {{PLURAL:$1|наступнай прычыне|наступных прычынах}}:',
'permissionserrorstext-withaction' => 'Вы ня маеце дазволу на $2 па {{PLURAL:$1|наступнай прычыне|наступных прычынах}}:',
'recreate-moveddeleted-warn' => "'''Увага: Вы ствараеце старонку, якая раней была выдаленая.'''
Упэўніцеся, што стварэньне гэтай старонкі неабходнае.
Ніжэй пададзеныя журналы выдаленьняў і пераносаў гэтай старонкі:",
'moveddeleted-notice' => 'Гэта старонка была выдаленая. Журналы выдаленьняў і пераносаў для гэтай старонкі пададзеныя ніжэй.',
'log-fulllog' => 'Паказаць журнал цалкам',
'edit-hook-aborted' => 'Рэдагаваньне скасаванае працэдурай-перахопнікам.
Тлумачэньняў не было.',
'edit-gone-missing' => 'Немагчыма абнавіць старонку.
Падобна, што яна была выдаленая.',
'edit-conflict' => 'Канфлікт рэдагаваньняў.',
'edit-no-change' => 'Вашае рэдагаваньне было праігнараванае, таму што ў тэкст не былі ўнесеныя зьмены.',
'edit-already-exists' => 'Немагчыма стварыць новую старонку.
Яна ўжо існуе.',
'defaultmessagetext' => 'Перадвызначаны тэкст паведамленьня',
# Parser/template warnings
'expensive-parserfunction-warning' => 'Папярэджаньне: гэтая старонка ўтрымлівае зашмат працаёмістых зваротаў да функцыяў парсэра.
Павінна быць ня болей за $2 {{PLURAL:$2|зварот|звароты|зваротаў}}, а цяпер ўтрымліваецца {{PLURAL:$1|$1 зварот|$1 звароты|$1 зваротаў}}.',
'expensive-parserfunction-category' => 'Старонкі, якія ўтрымліваюць зашмат працаёмістых зваротаў да функцыяў парсэра',
'post-expand-template-inclusion-warning' => 'Папярэджаньне: Памер уключаемых шаблёнаў занадта вялікі.
Некаторыя шаблёны ня будуць уключаныя.',
'post-expand-template-inclusion-category' => 'Старонкі, у якіх перавышаны дапушчальны памер уключаных шаблёнаў',
'post-expand-template-argument-warning' => 'Увага: Гэтая старонка ўтрымлівае прынамсі адзін парамэтар шаблёна, які мае занадта вялікі выгляд у разгорнутым выглядзе.
Гэтыя парамэтры былі прапушчаныя.',
'post-expand-template-argument-category' => 'Старонкі, у якіх прапушчаныя парамэтры шаблёнаў',
'parser-template-loop-warning' => 'Выяўлены цыкль у шаблёнах: [[$1]]',
'parser-template-recursion-depth-warning' => 'Перавышана мяжа глыбіні рэкурсіі шаблёнаў ($1)',
'language-converter-depth-warning' => 'Перавышанае абмежаваньне глыбіні канвэртару варыянтаў мовы ($1)',
'node-count-exceeded-category' => 'Старонкі зь перавышанай колькасьцю вузлоў',
'node-count-exceeded-warning' => 'Старонка перавысіла дазволеную колькасьць вузлоў',
'expansion-depth-exceeded-category' => 'Старонкі зь перавышанай глыбінёй уключэньня',
'expansion-depth-exceeded-warning' => 'Старонка перавысіла дазволеную глыбіню ўключэньняў',
'parser-unstrip-loop-warning' => 'Вызначаная незачыненая пятля',
'parser-unstrip-recursion-limit' => 'Перавышанае абмежаваньне глыбіні рэкурсіі ($1)',
'converter-manual-rule-error' => 'Знойдзеная памылка ў ручным правіле моўнага канвэртара',
# "Undo" feature
'undo-success' => 'Рэдагаваньне можа быць адмененае. Калі ласка, параўнайце адрозьненьні паміж вэрсіямі, каб упэўніцца, што гэта адпаведныя зьмены, а потым запішыце зьмены для сканчэньня рэдагаваньня.',
'undo-failure' => 'Рэдагаваньне ня можа быць скасаванае праз канфлікт паміж папярэднімі рэдагаваньнямі.',
'undo-norev' => 'Рэдагаваньне ня можа быць адмененае, таму што яно не існуе альбо было выдаленае.',
'undo-summary' => 'Скасаваньне праўкі $1 {{GENDER:$2|удзельніка|удзельніцы}} [[Special:Contributions/$2|$2]] ([[User talk:$2|гутаркі]])',
# Account creation failure
'cantcreateaccounttitle' => 'Немагчыма стварыць рахунак',
'cantcreateaccount-text' => "Стварэньне рахункаў з гэтага IP-адрасу ('''$1''') было заблякаванае [[User:$3|$3]].
Прычына блякаваньня пададзеная $3: ''$2''",
# History pages
'viewpagelogs' => 'Паказаць журналы падзеяў для гэтай старонкі',
'nohistory' => 'Гісторыя зьменаў для гэтай старонкі адсутнічае.',
'currentrev' => 'Цяперашняя вэрсія',
'currentrev-asof' => 'Цяперашняя вэрсія на $1',
'revisionasof' => 'Вэрсія ад $1',
'revision-info' => 'Вэрсія ад $1, аўтар $2',
'previousrevision' => '← Папярэдняя вэрсія',
'nextrevision' => 'Наступная вэрсія →',
'currentrevisionlink' => 'Цяперашняя вэрсія',
'cur' => 'цяп',
'next' => 'наступная',
'last' => 'папярэдняя',
'page_first' => 'першая',
'page_last' => 'апошняя',
'histlegend' => 'Параўнаньне: пазначце кропкамі дзьве вэрсіі для параўнаньня і націсьніце enter альбо кнопку ўнізе.<br />
Тлумачэньне: (цяп) = адрозьненьні ад цяперашняй вэрсіі, (папярэдняя) = адрозьненьні ад папярэдняй вэрсіі, д = дробная праўка.',
'history-fieldset-title' => 'Пошук у гісторыі',
'history-show-deleted' => 'Толькі выдаленыя',
'histfirst' => 'найстарэйшыя',
'histlast' => 'найнавейшыя',
'historysize' => '($1 {{PLURAL:$1|байт|байты|байтаў}})',
'historyempty' => '(пуста)',
# Revision feed
'history-feed-title' => 'Гісторыя зьменаў',
'history-feed-description' => 'Гісторыя зьменаў гэтай старонкі',
'history-feed-item-nocomment' => '$1 у $2',
'history-feed-empty' => 'Запатрабаванай старонкі не існуе.
Магчыма, яна была выдаленая альбо яе перанесьлі.
Паспрабуйце [[Special:Search|пашукаць]] падобныя старонкі.',
# Revision deletion
'rev-deleted-comment' => '(апісаньне зьменаў выдаленае)',
'rev-deleted-user' => '(імя ўдзельніка выдаленае)',
'rev-deleted-event' => '(запіс з журнала падзеяў выдалены)',
'rev-deleted-user-contribs' => '[імя ўдзельніка альбо IP-адрас выдалены — рэдагаваньне схаванае з унёску]',
'rev-deleted-text-permission' => "Гэтая вэрсія старонкі была '''выдаленая'''.
Магчыма, падрабязнасьці могуць быць знойдзеныя ў [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} журнале выдаленьняў].",
'rev-deleted-text-unhide' => "Гэтая вэрсія старонкі была '''выдаленая'''.
Падрабязнасьці могуць быць знойдзеныя ў [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} журнале выдаленьняў].
Вы можаце [$1 праглядзець гэтую вэрсію], калі жадаеце.",
'rev-suppressed-text-unhide' => "Гэтая вэрсія старонкі была '''схаваная'''.
Падрабязнасьці могуць быць знойдзеныя ў [{{fullurl:{{#Special:Log}}/suppress|page={{FULLPAGENAMEE}}}} журнале хаваньняў].
Вы можаце [$1 праглядзець гэтую вэрсію], калі жадаеце.",
'rev-deleted-text-view' => "Гэтая вэрсія старонкі была '''выдаленая'''.
Падрабязнасьці могуць быць знойдзеныя ў [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} журнале выдаленьняў].",
'rev-suppressed-text-view' => "Гэтая вэрсія старонкі была '''схаваная'''.
Вы можаце яе праглядзець; падрабязнасьці могуць быць знойдзеныя ў [{{fullurl:{{#Special:Log}}/suppress|page={{FULLPAGENAMEE}}}} журнале хаваньняў].",
'rev-deleted-no-diff' => "Вы ня можаце праглядаць гэтую розьніцу паміж вэрсіямі, таму што адна з вэрсіяў была '''выдаленая'''.
Магчыма, падрабязнасьці могуць быць знойдзеныя ў [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} журнале выдаленьняў].",
'rev-suppressed-no-diff' => "Вы ня можаце праглядзець гэтую розьніцу, таму што адна з вэрсіяў была '''выдаленая'''.",
'rev-deleted-unhide-diff' => "Адна з вэрсіяў гэтай старонкі была '''выдаленая'''.
Падрабязнасьці могуць быць знойдзеныя ў [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} журнале выдаленьняў].
Вы можаце праглядзець [$1 розьніцу паміж вэрсіямі], калі жадаеце.",
'rev-suppressed-unhide-diff' => "Адна з вэрсіяў гэтага параўнаньня была '''схаваная'''.
Падрабязнасьці могуць быць знойдзеныя ў [{{fullurl:{{#Special:Log}}/suppress|page={{FULLPAGENAMEE}}}} журнале хаваньняў].
Вы можаце [$1 паглядзець гэту розьніцу], калі жадаеце.",
'rev-deleted-diff-view' => "Адна з вэрсіяў гэтага параўнаньня была '''выдаленая'''.
Вы можаце праглядзець гэтую розьніцу паміж вэрсіямі. Падрабязнасьці могуць быць знойдзеныя ў [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} журнале выдаленьняў].",
'rev-suppressed-diff-view' => "Адна з вэрсіяў гэтага параўнаньня была '''схаваная'''.
Вы можаце праглядзець гэтую розьніцу паміж вэрсіямі; падрабязнасьці могуць быць знойдзеныя ў [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} журнале хаваньняў].",
'rev-delundel' => 'паказаць/схаваць',
'rev-showdeleted' => 'паказаць',
'revisiondelete' => 'Выдаліць/аднавіць вэрсіі',
'revdelete-nooldid-title' => 'Ня выбрана мэтавая вэрсія',
'revdelete-nooldid-text' => 'Вы ня выбралі мэтавую вэрсію (ці вэрсіі) для выкананьня гэтай функцыі, выбранай вэрсіі не існуе альбо Вы спрабуеце схаваць цяперашнюю вэрсію.',
'revdelete-nologtype-title' => 'Ня ўказаны тып журнала',
'revdelete-nologtype-text' => 'Вы не пазначылі тып журнала, у якім будзе выконвацца гэта дзеяньне.',
'revdelete-nologid-title' => 'Няслушны запіс у журнале',
'revdelete-nologid-text' => 'Вы не пазначылі запіс у журнале для выкананьня гэтай функцыі, альбо выбраны запіс не існуе.',
'revdelete-no-file' => 'Пазначаны файл не існуе.',
'revdelete-show-file-confirm' => 'Вы ўпэўненыя, што жадаеце паглядзець выдаленую вэрсію файла «<nowiki>$1</nowiki>» ад $2 $3?',
'revdelete-show-file-submit' => 'Так',
'revdelete-selected' => "'''{{PLURAL:$2|Выбраная вэрсія|Выбраныя вэрсіі}} старонкі [[:$1]]:'''",
'logdelete-selected' => "'''{{PLURAL:$1|Выбраны запіс|Выбраныя запісы}} журнала падзеяў:'''",
'revdelete-text' => "'''Выдаленыя вэрсіі і падзеі будуць паказвацца ў гісторыі старонкі і журналах, але частка іх зьместу ня будзе даступная для звычайных удзельнікаў.'''
Іншыя адміністратары {{GRAMMAR:родны|{{SITENAME}}}} будуць мець магчымасьць прагляду зьместу і аднаўленьня старонкі праз гэты інтэрфэйс, калі ня будуць уведзеныя дадатковыя абмежаваньні.",
'revdelete-confirm' => 'Калі ласка, пацьвердзіце, што Вы сапраўды жадаеце зрабіць гэта, разумееце наступствы і робіце гэта ў адпаведнасьці з [[{{MediaWiki:Policy-url}}|правіламі]].',
'revdelete-suppress-text' => "Схаваньні могуць выкарыстоўвацца '''толькі''' ў наступных выпадках:
* Раскрыцьцё асабістых зьвестак
*: ''хатнія адрасы, тэлефонныя нумары, нумары пашпартоў і г.д.''",
'revdelete-legend' => 'Усталяваць абмежаваньні бачнасьці',
'revdelete-hide-text' => 'Схаваць тэкст вэрсіі',
'revdelete-hide-image' => 'Схаваць зьмест файла',
'revdelete-hide-name' => 'Схаваць дзеяньне і мэту',
'revdelete-hide-comment' => 'Схаваць кароткае апісаньне зьменаў',
'revdelete-hide-user' => 'Схаваць імя/IP-адрас удзельніка',
'revdelete-hide-restricted' => 'Ужываць гэтыя абмежаваньні таксама і для адміністратараў',
'revdelete-radio-same' => '(не зьмяняць)',
'revdelete-radio-set' => 'Так',
'revdelete-radio-unset' => 'Не',
'revdelete-suppress' => 'Схаваць зьвесткі ад адміністратараў як і ад іншых удзельнікаў',
'revdelete-unsuppress' => 'Зьняць абмежаваньні з адноўленых вэрсіяў',
'revdelete-log' => 'Прычына:',
'revdelete-submit' => 'Ужыць для {{PLURAL:$1|выбранай вэрсіі|выбраных вэрсіяў}}',
'revdelete-success' => "'''Бачнасьць вэрсіі пасьпяхова абноўленая.'''",
'revdelete-failure' => "'''Немагчыма абнавіць бачнасьць вэрсіі:'''
$1",
'logdelete-success' => "'''Бачнасьць падзеі пасьпяхова зьмененая.'''",
'logdelete-failure' => "'''Немагчыма ўстанавіць бачнасьць у журнале:'''
$1",
'revdel-restore' => 'Зьмяніць бачнасьць',
'revdel-restore-deleted' => 'выдаленыя вэрсіі',
'revdel-restore-visible' => 'бачныя вэрсіі',
'pagehist' => 'Гісторыя старонкі',
'deletedhist' => 'Выдаленая гісторыя',
'revdelete-hide-current' => 'Памылка хаваньня запісу ад $2 $1: гэта цяперашняя вэрсія.
Запіс ня можа быць схаваны.',
'revdelete-show-no-access' => 'Памылка паказу запісу ад $2 $1: гэты запіс быў пазначаны як «абмежаваны».
Вы ня маеце да яго доступу.',
'revdelete-modify-no-access' => 'Памылка зьмены запісу ад $2 $1: гэты запіс быў пазначаны як «абмежаваны».
Вы ня маеце да яго доступу.',
'revdelete-modify-missing' => 'Памылка мадыфікацыі запісу з ідэнтыфікатарам $1: запіс не існуе ў базе зьвестак!',
'revdelete-no-change' => "'''Папярэджаньне:''' запіс ад $2 $1 ужо мае запатрабаваныя налады бачнасьці.",
'revdelete-concurrent-change' => 'Памылка зьмены запісу ад $2 $1: яго статус быў зьменены кімсьці іншым, пакуль Вы спрабавалі яго зьмяніць.
Калі ласка, праверце журналы.',
'revdelete-only-restricted' => 'Памылка хаваньня запісаў элемэнтаў $2, $1: Вы ня можаце схаваць запісы ад прагляду адміністратарамі бяз выбару адной зь іншых наладаў хаваньня.',
'revdelete-reason-dropdown' => '* Агульныя прычыны выдаленьня
** Парушэньне аўтарскіх правоў
** Інфармацыя, якая парушае прыватнасьць
** Недапушчальнае імя ўдзельніка
** Патэнцыйна паклёпніцкія зьвесткі',
'revdelete-otherreason' => 'Іншая/дадатковая прычына:',
'revdelete-reasonotherlist' => 'Іншая прычына',
'revdelete-edit-reasonlist' => 'Рэдагаваць прычыны выдаленьня',
'revdelete-offender' => 'Аўтар вэрсіі:',
# Suppression log
'suppressionlog' => 'Журнал схаваньняў',
'suppressionlogtext' => 'Ніжэй пададзены сьпіс выдаленьняў і блякаваньняў, схаваных нават ад адміністратараў.
Глядзіце [[Special:BlockList|сьпіс блякаваньняў]], каб паглядзець сьпіс цяперашніх блякаваньняў.',
# History merging
'mergehistory' => 'Аб’яднаць гісторыі старонак',
'mergehistory-header' => "Гэтая старонка дазваляе аб'яднаць гісторыю рэдагаваньняў адной старонкі з гісторыяй іншай, новай старонкі.
Упэўніцеся, што гэтыя зьмены не парушаць пасьлядоўнасьць гісторыі старонкі.",
'mergehistory-box' => 'Аб’яднаць гісторыі рэдагаваньняў дзьвюх старонак:',
'mergehistory-from' => 'Крынічная старонка:',
'mergehistory-into' => 'Мэтавая старонка:',
'mergehistory-list' => "Гісторыя рэдагаваньняў, якую магчыма аб'яднаць",
'mergehistory-merge' => "Наступныя вэрсіі [[:$1]] можна аб'яднаць у [[:$2]].
Карыстайцеся кнопкамі для аб'яднаньня толькі выбранага дыяпазону рэдагаваньняў.
Заўважце, што выкарыстаньне навігацыйных спасылак выдаліць зьвесткі ў гэтым слупку.",
'mergehistory-go' => "Паказаць вэрсіі, якія магчыма аб'яднаць",
'mergehistory-submit' => "Аб'яднаць гісторыі рэдагаваньняў",
'mergehistory-empty' => "Няма гісторыі рэдагаваньняў, якую магчыма аб'яднаць.",
'mergehistory-success' => '$3 {{PLURAL:$3|вэрсія|вэрсіі|вэрсіяў}} з [[:$1]] пасьпяхова аб’яднаныя ў [[:$2]].',
'mergehistory-fail' => "Не атрымалася аб'яднаць гісторыі старонак. Калі ласка, праверце парамэтры старонкі і часу.",
'mergehistory-no-source' => 'Не існуе крынічнай старонкі $1.',
'mergehistory-no-destination' => 'Не існуе мэтавай старонкі $1.',
'mergehistory-invalid-source' => 'Крынічная старонка мусіць мець карэктную назву.',
'mergehistory-invalid-destination' => 'Мэтавая старонка мусіць мець карэктную назву.',
'mergehistory-autocomment' => "Гісторыя [[:$1]] аб'яднаная ў [[:$2]]",
'mergehistory-comment' => "Гісторыя [[:$1]] аб'яднаная ў [[:$2]]: $3",
'mergehistory-same-destination' => 'Крынічная і мэтавая старонкі ня могуць супадаць',
'mergehistory-reason' => 'Прычына:',
# Merge log
'mergelog' => 'Журнал аб’яднаньняў',
'pagemerge-logentry' => 'аб’яднаная [[$1]] ў [[$2]] (гісторыя рэдагаваньняў да $3)',
'revertmerge' => 'Разьяднаць',
'mergelogpagetext' => "Ніжэй знаходзіцца сьпіс апошніх аб'яднаньняў гісторыяў старонак.",
# Diffs
'history-title' => '$1 — гісторыя зьменаў',
'difference-title' => '$1: розьніца паміж вэрсіямі',
'difference-title-multipage' => '«$1» і «$2» — розьніца паміж старонкамі',
'difference-multipage' => '(Розьніца паміж старонкамі)',
'lineno' => 'Радок $1:',
'compareselectedversions' => 'Параўнаць выбраныя вэрсіі',
'showhideselectedversions' => 'Паказаць/схаваць вызначаныя вэрсіі',
'editundo' => 'скасаваць',
'diff-multi' => '($1 {{PLURAL:$1|прамежная вэрсія|прамежныя вэрсіі|прамежных вэрсіяў}} $2 {{PLURAL:$2|удзельніка|удзельнікаў|удзельнікаў}} {{PLURAL:$1|не паказаная|не паказаныя|не паказаныя}})',
'diff-multi-manyusers' => '($1 {{PLURAL:$1|прамежная вэрсія|прамежныя вэрсіі|прамежных вэрсіяў}} $2 {{PLURAL:$2|удзельніка|удзельнікаў|удзельнікаў}} {{PLURAL:$1|не паказаная|не паказаныя|не паказаныя}})',
'difference-missing-revision' => '{{PLURAL:$2|Адна вэрсія|$2 вэрсіі}} з гэтымі адрозьненьнямі ($1) {{PLURAL:$2|не была|не былі}} знойдзеныя.
Звычайна гэта здараецца з-за перахода па састарэлай спасылцы на старонку, якая была выдаленая.
Падрабязнасьці можна знайсьці ў [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} журнале выдаленьняў].',
# Search results
'searchresults' => 'Вынікі пошуку',
'searchresults-title' => 'Вынікі пошуку для «$1»',
'searchresulttext' => 'Для атрыманьня больш падрабязнай інфармацыі пра пошук у {{GRAMMAR:месны|{{SITENAME}}}}, глядзіце [[{{MediaWiki:Helppage}}|{{int:help}}]].',
'searchsubtitle' => "Па запыце '''[[:$1]]''' ([[Special:Prefixindex/$1|усе старонкі, якія пачынаюцца з «$1»]]{{int:pipe-separator}}[[Special:WhatLinksHere/$1|усе старонкі, якія спасылаюцца на «$1»]])",
'searchsubtitleinvalid' => "Па запыце '''$1'''",
'toomanymatches' => 'Знойдзена зашмат супадзеньняў з запытам, калі ласка, паспрабуйце зьмяніць запыт',
'titlematches' => 'Супадзеньні ў назвах старонак',
'notitlematches' => 'Супадзеньні ў назвах старонак ня знойдзеныя',
'textmatches' => 'Супадзеньні ў тэкстах старонак',
'notextmatches' => 'Супадзеньні ў тэкстах старонак ня знойдзеныя',
'prevn' => '{{PLURAL:$1|папярэдняя|папярэднія|папярэднія}} $1',
'nextn' => '{{PLURAL:$1|наступная|наступныя|наступныя}} $1',
'prevn-title' => '{{PLURAL:$1|Папярэдні $1 вынік|Папярэднія $1 вынікі|Папярэднія $1 вынікаў}}',
'nextn-title' => '{{PLURAL:$1|Наступны $1 вынік|Наступныя $1 вынікі|Наступныя $1 вынікаў}}',
'shown-title' => 'Паказваць $1 {{PLURAL:$1|вынік|вынікі|вынікаў}} на старонцы',
'viewprevnext' => 'Паказаць ($1 {{int:pipe-separator}} $2) ($3)',
'searchmenu-legend' => 'Налады пошуку',
'searchmenu-exists' => "* Старонка '''[[$1]]'''",
'searchmenu-new' => "'''Стварыць старонку «[[:$1|$1]]» у {{GRAMMAR:месны|{{SITENAME}}}}!'''",
'searchhelp-url' => 'Help:Зьмест',
'searchmenu-prefix' => '[[Special:PrefixIndex/$1|Праглядзець старонкі з гэтым прэфіксам]]',
'searchprofile-articles' => 'Старонкі са зьместам',
'searchprofile-project' => 'Старонкі дапамогі і праекту',
'searchprofile-images' => 'Мультымэдыя',
'searchprofile-everything' => 'Усё',
'searchprofile-advanced' => 'Пашыраны',
'searchprofile-articles-tooltip' => 'Пошук у $1',
'searchprofile-project-tooltip' => 'Пошук у $1',
'searchprofile-images-tooltip' => 'Пошук файлаў',
'searchprofile-everything-tooltip' => 'Шукаць усюды (уключна са старонкамі абмеркаваньня)',
'searchprofile-advanced-tooltip' => 'Шукаць у дадатковых прасторах назваў',
'search-result-size' => '$1 ($2 {{PLURAL:$2|слова|словы|словаў}})',
'search-result-category-size' => '$1 {{PLURAL:$1|элемэнт|элемэнты|элемэнтаў}} ($2 {{PLURAL:$2|падкатэгорыя|падкатэгорыі|падкатэгорыяў}}, $3 {{PLURAL:|файл|файлы|файлаў}})',
'search-result-score' => 'Адпаведнасьць: $1%',
'search-redirect' => '(перанакіраваньне $1)',
'search-section' => '(сэкцыя $1)',
'search-suggest' => 'Магчыма, вы мелі на ўвазе: $1',
'search-interwiki-caption' => 'Сумежныя праекты',
'search-interwiki-default' => 'вынікі з $1:',
'search-interwiki-more' => '(яшчэ)',
'search-relatedarticle' => 'Зьвязаны',
'mwsuggest-disable' => 'Адключыць пошукавыя падказкі',
'searcheverything-enable' => 'Шукаць ва ўсіх прасторах назваў',
'searchrelated' => 'зьвязаны',
'searchall' => 'усе',
'showingresults' => "Ніжэй {{PLURAL:$1|паданы|паданыя|паданыя}} да '''$1''' {{PLURAL:$1|выніку|вынікаў|вынікаў}}, пачынаючы з #<b>$2</b>.",
'showingresultsnum' => "Ніжэй паказаны сьпіс з '''$3''' {{PLURAL:$3|выніка|вынікаў|вынікаў}}, пачынаючы ад № '''$2'''.",
'showingresultsheader' => "{{PLURAL:$5|Вынік '''$1''' з '''$3'''|Вынікі '''$1 - $2''' з '''$3'''}} для '''$4'''",
'nonefound' => "'''Увага''': Па змоўчваньні пошук вядзецца не ва ўсіх прасторах назваў. Трэба дапісаць да запыту ''усе:'' каб шукаць па ўсім зьмесьце (уключаючы абмеркаваньні, шаблёны і г.д.) альбо дадаць да запыту неабходную прастору назваў.",
'search-nonefound' => 'Супадзеньняў па запыце ня знойдзена.',
'powersearch' => 'Удасканалены пошук',
'powersearch-legend' => 'Удасканалены пошук',
'powersearch-ns' => 'Шукаць у прасторах назваў:',
'powersearch-redir' => 'Паказваць перанакіраваньні',
'powersearch-field' => 'Шукаць',
'powersearch-togglelabel' => 'Пазначыць:',
'powersearch-toggleall' => 'Усе',
'powersearch-togglenone' => 'Нічога',
'search-external' => 'Вонкавы пошук',
'searchdisabled' => 'Функцыя пошуку ў {{GRAMMAR:месны|{{SITENAME}}}} адключаная.
Вы можаце пашукаць з дапамогай Google, але заўважце, што там інфармацыя пра старонкі {{GRAMMAR:родны|{{SITENAME}}}} можа быць састарэлай.',
# Quickbar
'qbsettings' => 'Панэль хуткага доступу',
'qbsettings-none' => 'Не паказваць',
'qbsettings-fixedleft' => 'Замацаваная зьлева',
'qbsettings-fixedright' => 'Замацаваная справа',
'qbsettings-floatingleft' => 'Плавае зьлева',
'qbsettings-floatingright' => 'Плавае справа',
'qbsettings-directionality' => 'Замацаваная, у залежнасьці ад накірунку напісаньня ў Вашай мове',
# Preferences page
'preferences' => 'Налады',
'mypreferences' => 'Налады',
'prefs-edits' => 'Колькасьць рэдагаваньняў:',
'prefsnologin' => 'Вы не ўвайшлі ў сыстэму',
'prefsnologintext' => 'Вам трэба <span class="plainlinks">[{{fullurl:{{#Special:UserLogin}}|returnto=$1}} ўвайсьці ў сыстэму]</span>, каб зьмяняць свае налады.',
'changepassword' => 'Зьмяніць пароль',
'prefs-skin' => 'Афармленьне',
'skin-preview' => 'Папярэдні прагляд',
'datedefault' => 'Па змоўчаньні',
'prefs-beta' => 'Тэставыя магчымасьці',
'prefs-datetime' => 'Дата і час',
'prefs-labs' => 'Экспэрымэнтальныя магчымасьці',
'prefs-user-pages' => 'Старонкі ўдзельніка',
'prefs-personal' => 'Асабістыя зьвесткі',
'prefs-rc' => 'Апошнія зьмены',
'prefs-watchlist' => 'Сьпіс назіраньня',
'prefs-watchlist-days' => 'Колькасьць дзён для паказу ў сьпісе назіраньня:',
'prefs-watchlist-days-max' => '(максымальна $1 {{PLURAL:$1|дзень|дні|дзён}})',
'prefs-watchlist-edits' => 'Колькасьць рэдагаваньняў для паказу ў пашыраным сьпісе назіраньня:',
'prefs-watchlist-edits-max' => 'Максымальная колькасьць: 1000',
'prefs-watchlist-token' => 'Сакрэтны ключ сьпісу назіраньня:',
'prefs-misc' => 'Рознае',
'prefs-resetpass' => 'Зьмяніць пароль',
'prefs-changeemail' => 'Зьмяніць адрас электроннай пошты',
'prefs-setemail' => 'Устанавіць адрас электроннай пошты',
'prefs-email' => 'Налады электроннай пошты',
'prefs-rendering' => 'Выгляд',
'saveprefs' => 'Захаваць',
'resetprefs' => 'Скінуць',
'restoreprefs' => 'Скінуць да перадвызначаных наладаў',
'prefs-editing' => 'Рэдагаваньне',
'prefs-edit-boxsize' => 'Памер акна рэдагаваньня.',
'rows' => 'Радкоў:',
'columns' => 'Слупкоў:',
'searchresultshead' => 'Пошук',
'resultsperpage' => 'Колькасьць вынікаў на старонцы:',
'stub-threshold' => 'Максымальны памер старонкі для паказу спасылак <a href="#" class="stub">як на накід</a> (у байтах):',
'stub-threshold-disabled' => 'Выключаны',
'recentchangesdays' => 'Колькасьць дзён для паказу ў апошніх зьменах:',
'recentchangesdays-max' => '(максымальна $1 {{PLURAL:$1|дзень|дні|дзён}})',
'recentchangescount' => 'Колькасьць рэдагаваньняў для паказу па змоўчваньні:',
'prefs-help-recentchangescount' => 'Гэта датычыцца апошніх зьменах, гісторый старонак і журналаў.',
'prefs-help-watchlist-token' => 'Запаўненьне гэтага поля сакрэтным ключом створыць RSS-стужку для Вашага сьпісу назіраньня.
Кожны, хто ведае ключ у гэтым полі, зможа чытаць Ваш сьпіс назіраньня, таму выбірайце сакрэтнае значэньне.
Тут Вы зможаце выкарыстоўваць выпадковае значэньне: $1',
'savedprefs' => 'Вашыя налады былі захаваныя.',
'timezonelegend' => 'Часавы пояс:',
'localtime' => 'Мясцовы час:',
'timezoneuseserverdefault' => 'Выкарыстоўваць стандартныя налады {{GRAMMAR:родны|{{SITENAME}}}} ($1)',
'timezoneuseoffset' => 'Іншы (пазначце розьніцу ў часе)',
'timezoneoffset' => 'Розьніца¹:',
'servertime' => 'Час на сэрвэры:',
'guesstimezone' => 'Запоўніць з браўзэра',
'timezoneregion-africa' => 'Афрыка',
'timezoneregion-america' => 'Амэрыка',
'timezoneregion-antarctica' => 'Антарктыда',
'timezoneregion-arctic' => 'Арктыка',
'timezoneregion-asia' => 'Азія',
'timezoneregion-atlantic' => 'Атлянтычны акіян',
'timezoneregion-australia' => 'Аўстралія',
'timezoneregion-europe' => 'Эўропа',
'timezoneregion-indian' => 'Індыйскі акіян',
'timezoneregion-pacific' => 'Ціхі акіян',
'allowemail' => 'Дазволіць атрыманьне лістоў ад іншых удзельнікаў і ўдзельніц',
'prefs-searchoptions' => 'Пошук',
'prefs-namespaces' => 'Прасторы назваў',
'defaultns' => 'Інакш шукаць у наступных прасторах назваў:',
'default' => 'па змоўчваньні',
'prefs-files' => 'Файлы',
'prefs-custom-css' => 'Індывідуальны CSS',
'prefs-custom-js' => 'Індывідуальны JS',
'prefs-common-css-js' => 'Агульны CSS/JS для ўсіх афармленьняў:',
'prefs-reset-intro' => 'Вы можаце выкарыстоўваць гэтую старонку для замены Вашых наладаў на налады сайта па змоўчваньні.
Гэтае дзеяньне не можа быць адмененае.',
'prefs-emailconfirm-label' => 'Пацьверджаньне адрасу электроннай пошты:',
'prefs-textboxsize' => 'Памеры акна рэдагаваньня',
'youremail' => 'Адрас электроннай пошты:',
'username' => 'Імя ўдзельніка/ўдзельніцы:',
'uid' => 'ID удзельніка/ўдзельніцы:',
'prefs-memberingroups' => 'Удзельнік {{PLURAL:$1|групы|групаў}}:',
'prefs-registration' => 'Час рэгістрацыі:',
'yourrealname' => 'Сапраўднае імя:',
'yourlanguage' => 'Мова інтэрфэйсу:',
'yourvariant' => 'Варыянт мовы зьместу:',
'prefs-help-variant' => 'Выбраны Вамі альфабэт ці артаграфія для паказу старонак зьместу {{GRAMMAR:родны|{{SITENAME}}}}.',
'yournick' => 'Подпіс:',
'prefs-help-signature' => 'Камэнтары на старонцы абмеркаваньня павінны быць падпісаны праз даданьне сымбаляў «<nowiki>~~~~</nowiki>», якія будуць пераўтвораны ў Ваш подпіс і цяперашні час.',
'badsig' => 'Няслушны неапрацаваны подпіс; праверце HTML-тэгі.',
'badsiglength' => 'Ваш подпіс занадта доўгі.
Подпіс мусіць быць не даўжэй за $1 {{PLURAL:$1|сымбаль|сымбалі|сымбаляў}}.',
'yourgender' => 'Пол:',
'gender-unknown' => 'не пазначаны',
'gender-male' => 'мужчынскі',
'gender-female' => 'жаночы',
'prefs-help-gender' => 'Неабавязковая: выкарыстоўваецца ў паведамленьнях праграмнага забесьпячэньня, якія залежаць ад полу ўдзельніка/ўдзельніцы. Гэта інфармацыя будзе агульнадаступнай.',
'email' => 'Электронная пошта',
'prefs-help-realname' => 'Сапраўднае імя паведамляць неабавязкова.
Калі Вы яго пазначыце, яно будзе выкарыстоўвацца для пазначэньня Вашай працы.',
'prefs-help-email' => 'Адрас электроннай пошты неабавязковы, але ён дае магчымасьць даслаць Вам пароль, калі Вы забылі яго.',
'prefs-help-email-others' => 'Вы можаце таксама дазволіць іншым удзельнікам кантактаваць з Вамі праз Вашую асабістую старонку гутарак безь неабходнасьці раскрыцьця адрасу электроннай пошты.',
'prefs-help-email-required' => 'Патрабуецца адрас электроннай пошты.',
'prefs-info' => 'Асноўныя зьвесткі',
'prefs-i18n' => 'Інтэрнацыяналізацыя',
'prefs-signature' => 'Подпіс',
'prefs-dateformat' => 'Фармат даты',
'prefs-timeoffset' => 'Розьніца ў часе',
'prefs-advancedediting' => 'Дадатковыя налады',
'prefs-advancedrc' => 'Дадатковыя налады',
'prefs-advancedrendering' => 'Дадатковыя налады',
'prefs-advancedsearchoptions' => 'Дадатковыя налады',
'prefs-advancedwatchlist' => 'Дадатковыя налады',
'prefs-displayrc' => 'Налады паказу',
'prefs-displaysearchoptions' => 'Налады паказу',
'prefs-displaywatchlist' => 'Налады паказу',
'prefs-diffs' => 'Розьніцы вэрсіяў',
# User preference: email validation using jQuery
'email-address-validity-valid' => 'Выглядае слушна',
'email-address-validity-invalid' => 'Неабходны слушны адрас!',
# User rights
'userrights' => 'Кіраваньне правамі ўдзельнікаў і ўдзельніц',
'userrights-lookup-user' => 'Кіраваньне групамі ўдзельнікаў і ўдзельніц',
'userrights-user-editname' => 'Увядзіце імя ўдзельніка:',
'editusergroup' => 'Рэдагаваць групы ўдзельнікаў і ўдзельніц',
'editinguser' => "Зьмена правоў {{GENDER:$1|удзельніка|удзельніцы}} '''[[User:$1|$1]]''' $2",
'userrights-editusergroup' => 'Рэдагаваць групы ўдзельнікаў і ўдзельніц',
'saveusergroups' => 'Захаваць групы ўдзельнікаў і ўдзельніц',
'userrights-groupsmember' => 'Уваходзіць у:',
'userrights-groupsmember-auto' => 'Няяўны чалец:',
'userrights-groups-help' => 'Тут можна зьмяняць групы, да якіх належыць гэты ўдзельнік:
* Адзначанае поле побач з назвай групы пазначае прыналежнасьць удзельніка да групы.
* Пустое поле азначае, што ўдзельнік не належыць да групы.
* Знак * азначае, што Вы ня зможаце выдаліць удзельніка з групы, калі дададзіце яго да яе, і наадварот.',
'userrights-reason' => 'Прычына:',
'userrights-no-interwiki' => 'Вы ня маеце дазволу зьмяняць правы ўдзельнікаў іншых вікаў.',
'userrights-nodatabase' => 'Базы зьвестак $1 не існуе альбо яна не зьяўляецца лякальнай.',
'userrights-nologin' => 'Вы павінны [[Special:UserLogin|ўвайсьці ў сыстэму]] як адміністратар, каб прызначаць правы ўдзельнікам.',
'userrights-notallowed' => 'Ваш рахунак ня мае права прызначаць ці выдаляць правы ўдзельнікам.',
'userrights-changeable-col' => 'Групы, якія Вы можаце мяняць',
'userrights-unchangeable-col' => 'Групы, якія Вы ня можаце мяняць',
# Groups
'group' => 'Група:',
'group-user' => 'Удзельнікі',
'group-autoconfirmed' => 'Аўтаматычна пацьверджаныя ўдзельнікі',
'group-bot' => 'Робаты',
'group-sysop' => 'Адміністрацыя',
'group-bureaucrat' => 'Бюракраты',
'group-suppress' => 'Рэвізоры',
'group-all' => '(усе)',
'group-user-member' => '{{GENDER:$1|удзельнік|удзельніца}}',
'group-autoconfirmed-member' => '{{GENDER:$1|аўтаматычна пацьверджаны ўдзельнік|аўтаматычна пацьверджаная ўдзельніца}}',
'group-bot-member' => 'робат',
'group-sysop-member' => '{{GENDER:$1|адміністратар|адміністратарка}}',
'group-bureaucrat-member' => '{{GENDER:$1|бюракрат|бюракратка}}',
'group-suppress-member' => '{{GENDER:$1|рэвізор|рэвізорка}}',
'grouppage-user' => '{{ns:project}}:Удзельнікі',
'grouppage-autoconfirmed' => '{{ns:project}}:Аўтаматычна пацьверджаныя ўдзельнікі',
'grouppage-bot' => '{{ns:project}}:Робаты',
'grouppage-sysop' => '{{ns:project}}:Адміністрацыя',
'grouppage-bureaucrat' => '{{ns:project}}:Бюракраты',
'grouppage-suppress' => '{{ns:project}}:Рэвізоры',
# Rights
'right-read' => 'прагляд старонак',
'right-edit' => 'рэдагаваньне старонак',
'right-createpage' => 'стварэньне старонак (акрамя старонак абмеркаваньняў)',
'right-createtalk' => 'стварэньне старонак абмеркаваньня',
'right-createaccount' => 'стварэньне новых рахункаў удзельніка',
'right-minoredit' => 'пазначэньне рэдагаваньняў як дробныя',
'right-move' => 'перанос старонак',
'right-move-subpages' => 'перанос старонак разам зь іх падстаронкамі',
'right-move-rootuserpages' => 'Перанос карэнных старонак удзельнікаў',
'right-movefile' => 'перайменаваньне файлаў',
'right-suppressredirect' => 'не ствараць перанакіраваньне са старой назвы пасьля пераносу старонкі',
'right-upload' => 'загрузка файлаў',
'right-reupload' => 'перазапіс існуючых файлаў',
'right-reupload-own' => 'перазапіс уласных існуючых файлаў',
'right-reupload-shared' => 'перазапіс файлаў з агульнага сховішча лякальнымі',
'right-upload_by_url' => 'загрузка файлаў з URL-адрасу',
'right-purge' => 'ачыстка кэшу старонак бяз запыту пацьверджаньня',
'right-autoconfirmed' => 'рэдагаваньне часткова абароненых старонак',
'right-bot' => 'лічыцца аўтаматычным працэсам',
'right-nominornewtalk' => 'не паведамляць удзельнікам пра новыя паведамленьні на іх старонках гутарак, калі зробленыя там праўкі былі дробнымі',
'right-apihighlimits' => 'Менш абмежаваньняў на выкананьне API-запытаў',
'right-writeapi' => 'выкарыстаньне API для запісаў',
'right-delete' => 'выдаленьне старонак',
'right-bigdelete' => 'Выдаленьне старонак зь вялікімі гісторыямі',
'right-deletelogentry' => 'Выдаленьне і аднаўленьне асобных запісаў журналу',
'right-deleterevision' => 'выдаленьне і аднаўленьне асобных вэрсіяў старонак',
'right-deletedhistory' => 'прагляд выдаленай гісторыі старонак без доступу да выдаленага тэксту',
'right-deletedtext' => 'прагляд выдаленага тэксту і зьменаў паміж выдаленымі вэрсіямі старонак',
'right-browsearchive' => 'пошук выдаленых старонак',
'right-undelete' => 'аднаўленьне старонак',
'right-suppressrevision' => 'прагляд і аднаўленьне вэрсіяў, схаваных ад адміністратараў',
'right-suppressionlog' => 'прагляд прыватных журналаў',
'right-block' => 'блякаваньне іншых удзельнікаў ад рэдагаваньняў',
'right-blockemail' => 'блякаваньне іншых ўдзельнікаў ад дасылкі электроннай пошты',
'right-hideuser' => 'блякаваньне рахунку ўдзельніка і яго хаваньне',
'right-ipblock-exempt' => 'абход блякаваньняў IP-адрасоў, аўта-блякаваньняў і блякаваньняў дыяпазонаў',
'right-proxyunbannable' => 'абход аўтаматычных блякаваньняў проксі',
'right-unblockself' => 'разблякаваньне самога сябе',
'right-protect' => 'зьмена ўзроўню абароны старонак і рэдагаваньне абароненых старонак',
'right-editprotected' => 'рэдагаваньне абароненых старонак (без каскаднай абароны)',
'right-editinterface' => 'рэдагаваньне інтэрфэйса карыстальніка',
'right-editusercssjs' => 'рэдагаваньне CSS і JS файлаў іншых удзельнікаў',
'right-editusercss' => 'рэдагаваньне CSS файлаў іншых удзельнікаў',
'right-edituserjs' => 'рэдагаваньне JS файлаў іншых удзельнікаў',
'right-rollback' => 'хуткі адкат правак апошняга ўдзельніка, які рэдагаваў старонку',
'right-markbotedits' => 'пазначэньне адкатаў як рэдагаваньне робатам',
'right-noratelimit' => 'няма абмежаваньняў па хуткасьці',
'right-import' => 'імпарт старонак зь іншых вікі',
'right-importupload' => 'імпарт старонак праз загрузку файлаў',
'right-patrol' => 'пазначэньне рэдагаваньняў як «патруляваныя»',
'right-autopatrol' => 'аўтаматычнае пазначэньне рэдагаваньняў як «патруляваных»',
'right-patrolmarks' => 'прагляд пазначэньняў пра патруляваньне ў апошніх зьменах',
'right-unwatchedpages' => 'прагляд сьпісу старонак, за якімі ніхто не назірае',
'right-mergehistory' => 'аб’яднаньне гісторыі старонак',
'right-userrights' => 'рэдагаваньне правоў усіх удзельнікаў',
'right-userrights-interwiki' => 'рэдагаваньне правоў удзельнікаў у іншых вікі',
'right-siteadmin' => 'блякаваньне і разблякаваньне базы зьвестак',
'right-override-export-depth' => 'экспартаваньне старонак, уключаючы зьвязаныя старонкі з глыбінёй да 5',
'right-sendemail' => 'адпраўка электронных лістоў іншым удзельнікам',
'right-passwordreset' => 'прагляд электронных лістоў з ачысткай паролю',
# User rights log
'rightslog' => 'Журнал правоў удзельнікаў',
'rightslogtext' => 'Гэта журнал зьменаў правоў удзельнікаў.',
'rightslogentry' => 'зьменена прыналежнасьць $1 з групы $2 да $3',
'rightslogentry-autopromote' => 'быў аўтаматычна падвышаны з $2 да $3',
'rightsnone' => '(няма)',
# Associated actions - in the sentence "You do not have permission to X"
'action-read' => 'чытаньне гэтай старонкі',
'action-edit' => 'рэдагаваньне гэтай старонкі',
'action-createpage' => 'стварэньне старонак',
'action-createtalk' => 'стварэньне старонак абмеркаваньняў',
'action-createaccount' => 'стварэньне гэтага рахунку ўдзельніка',
'action-minoredit' => 'пазначэньне гэтай праўкі як дробнай',
'action-move' => 'перанос гэтай старонкі',
'action-move-subpages' => 'перанос гэтай старонкі і яе падстаронак',
'action-move-rootuserpages' => 'перанос карэнных старонак удзельнікаў',
'action-movefile' => 'перайменаваць гэты файл',
'action-upload' => 'загрузку гэтага файла',
'action-reupload' => 'перазапіс гэтага файла',
'action-reupload-shared' => 'перакрыцьцё гэтага файла ў агульным сховішчы',
'action-upload_by_url' => 'загрузку гэтага файла з URL-адрасу',
'action-writeapi' => 'выкарыстаньне API для запісаў',
'action-delete' => 'выдаленьне гэтай старонкі',
'action-deleterevision' => 'выдаленьне гэтай вэрсіі',
'action-deletedhistory' => 'прагляд выдаленай гісторыі гэтай старонкі',
'action-browsearchive' => 'пошук выдаленых старонак',
'action-undelete' => 'аднаўленьне гэтай старонкі',
'action-suppressrevision' => 'прагляд і аднаўленьне гэтай схаванай вэрсіі',
'action-suppressionlog' => 'прагляд гэтага прыватнага журнала',
'action-block' => 'блякаваньне гэтага ўдзельніка ад рэдагаваньняў',
'action-protect' => 'зьмену ўзроўню абароны гэтай старонкі',
'action-rollback' => 'хуткі адкат рэдагаваньняў апошняга ўдзельніка, які рэдагаваў старонку',
'action-import' => 'імпарт гэтай старонкі зь іншай вікі',
'action-importupload' => 'імпарт гэтай старонкі праз загрузку файла',
'action-patrol' => 'пазначэньне чужых рэдагаваньняў як «патруляваныя»',
'action-autopatrol' => 'пазначэньне ўласных рэдагаваньняў як «патруляваныя»',
'action-unwatchedpages' => 'прагляд сьпісу старонак, за якімі ніхто не назірае',
'action-mergehistory' => "аб'яднаньне гісторыі гэтай старонкі",
'action-userrights' => 'рэдагаваньне правоў усіх удзельнікаў',
'action-userrights-interwiki' => 'рэдагаваньне правоў удзельнікаў у іншых вікі',
'action-siteadmin' => 'блякаваньне і разблякаваньне базы зьвестак',
'action-sendemail' => 'адпраўляць лісты іншым удзельнікам',
# Recent changes
'nchanges' => '$1 {{PLURAL:$1|зьмена|зьмены|зьменаў}}',
'recentchanges' => 'Апошнія зьмены',
'recentchanges-legend' => 'Налады апошніх зьменаў',
'recentchanges-summary' => 'Сачыце за апошнімі зьменамі ў {{GRAMMAR:месны|{{SITENAME}}}} на гэтай старонцы.',
'recentchanges-feed-description' => 'Сачыце за апошнімі зьменамі ў {{GRAMMAR:месны|{{SITENAME}}}} праз гэтую стужку.',
'recentchanges-label-newpage' => 'Гэтым рэдагаваньнем была створаная новая старонка',
'recentchanges-label-minor' => 'Гэтае рэдагаваньне — дробнае',
'recentchanges-label-bot' => 'Гэтае рэдагаваньне зробленае робатам',
'recentchanges-label-unpatrolled' => 'Гэтае рэдагаваньне яшчэ не было адпатруляванае',
'rcnote' => "Ніжэй {{PLURAL:$1|пададзена '''$1''' апошняя зьмена|пададзеныя '''$1''' апошнія зьмены|пададзеныя '''$1''' апошніх зьменаў}} за {{PLURAL:$2|апошні '''$2''' дзень|апошнія '''$2''' дні|апошнія '''$2''' дзён}}, па стане на $5, $4.",
'rcnotefrom' => "Ніжэй знаходзяцца зьмены з '''$2''' (да '''$1''' на старонку).",
'rclistfrom' => 'Паказаць зьмены з $1',
'rcshowhideminor' => '$1 дробныя праўкі',
'rcshowhidebots' => '$1 робатаў',
'rcshowhideliu' => '$1 зарэгістраваных',
'rcshowhideanons' => '$1 ананімаў',
'rcshowhidepatr' => '$1 патруляваныя праўкі',
'rcshowhidemine' => '$1 мае праўкі',
'rclinks' => 'Паказаць апошнія $1 зьменаў за мінулыя $2 дзён<br />$3',
'diff' => 'розьн',
'hist' => 'гіст',
'hide' => 'Схаваць',
'show' => 'Паказаць',
'minoreditletter' => 'д',
'newpageletter' => 'Н',
'boteditletter' => 'р',
'number_of_watching_users_pageview' => '[$1 {{PLURAL:$1|назіральнік|назіральнікі|назіральнікаў}}]',
'rc_categories' => 'Абмежаваць катэгорыямі (разьдзяляйце знакам «|»)',
'rc_categories_any' => 'Усе',
'rc-change-size-new' => '$1 {{PLURAL:$1|байт|байта|байтаў}} пасьля зьмены',
'newsectionsummary' => '/* $1 */ новая сэкцыя',
'rc-enhanced-expand' => 'Паказаць падрабязнасьці (патрабуе JavaScript)',
'rc-enhanced-hide' => 'Схаваць падрабязнасьці',
'rc-old-title' => 'зь першапачатковай назвай «$1»',
# Recent changes linked
'recentchangeslinked' => 'Зьвязаныя праўкі',
'recentchangeslinked-feed' => 'Зьвязаныя праўкі',
'recentchangeslinked-toolbox' => 'Зьвязаныя праўкі',
'recentchangeslinked-title' => 'Зьвязаныя праўкі для «$1»',
'recentchangeslinked-noresult' => 'Не было ніякіх зьменаў на зьвязаных старонках за вызначаны пэрыяд.',
'recentchangeslinked-summary' => "Гэта сьпіс апошніх зьменаў старонак, на якія спасылаецца азначаная старонка (ці ўсіх старонак, якія належаць азначанай катэгорыі).
Старонкі з [[Special:Watchlist|Вашага сьпісу назіраньня]] пазначаныя '''тлустым шрыфтам'''.",
'recentchangeslinked-page' => 'Назва старонкі:',
'recentchangeslinked-to' => 'Замест гэтага паказваць зьмены на старонках, што спасылаюцца на гэтую старонку',
# Upload
'upload' => 'Загрузіць файл',
'uploadbtn' => 'Загрузіць файл',
'reuploaddesc' => 'Скасаваць загрузку і вярнуцца да формы загрузкі',
'upload-tryagain' => 'Даслаць зьмененае апісаньне файла',
'uploadnologin' => 'Вы не ўвайшлі ў сыстэму',
'uploadnologintext' => 'Вам трэба [[Special:UserLogin|ўвайсьці ў сыстэму]] для загрузкі файлаў.',
'upload_directory_missing' => 'Загрузачная дырэкторыя ($1) адсутнічае і ня можа быць створаная сэрвэрам.',
'upload_directory_read_only' => 'Сэрвэр ня мае правоў на запіс у дырэкторыю загружаных файлаў ($1).',
'uploaderror' => 'Памылка загрузкі',
'upload-recreate-warning' => "'''Увага: файл з такой назвай быў выдалены альбо перанесены.'''
Журнал выдаленьняў і пераносаў гэтай старонкі для зручнасьці пададзены тут:",
'uploadtext' => "Ужывайце форму ніжэй для загрузкі файлаў.
Каб паглядзець ці адшукаць раней загружаныя файлы, глядзіце [[Special:FileList|сьпіс загружаных файлаў]], загрузкі таксама запісваюцца ў [[Special:Log/upload|журнал загрузак]], а выдаленьні — у [[Special:Log/delete|журнал выдаленьняў]].
Каб улучыць файл у старонку, ужывайце адзін з наступных варыянтаў:
* '''<code><nowiki>[[</nowiki>{{ns:file}}<nowiki>:File.jpg]]</nowiki></code>''' для поўнай вэрсіі файла
* '''<code><nowiki>[[</nowiki>{{ns:file}}<nowiki>:File.png|200px|thumb|left|Подпіс да выявы]]</nowiki></code>''' для выявы шырынёй 200 піксэляў у рамцы і тэкстам «Подпіс да выявы» ў якасьці подпісу
* '''<code><nowiki>[[</nowiki>{{ns:media}}<nowiki>:File.ogg]]</nowiki></code>''' для простай спасылкі на файл безь яго адлюстраваньня.",
'upload-permitted' => 'Дазволеныя тыпы файлаў: $1.',
'upload-preferred' => 'Пажаданыя тыпы файлаў: $1.',
'upload-prohibited' => 'Забароненыя тыпы файлаў: $1.',
'uploadlog' => 'журнал загрузак',
'uploadlogpage' => 'Журнал загрузак',
'uploadlogpagetext' => 'Сьпіс апошніх загружаных файлаў.',
'filename' => 'Назва файла',
'filedesc' => 'Апісаньне',
'fileuploadsummary' => 'Апісаньне:',
'filereuploadsummary' => 'Зьмены ў файле:',
'filestatus' => 'Умовы распаўсюджаньня і выкарыстаньня:',
'filesource' => 'Крыніца:',
'uploadedfiles' => 'Загружаныя файлы',
'ignorewarning' => 'Праігнараваць папярэджаньне і захаваць файл',
'ignorewarnings' => 'Ігнараваць усе папярэджаньні',
'minlength1' => 'Назва файла павінна ўтрымліваць хаця б адзін сымбаль.',
'illegalfilename' => 'Назва файла «$1» зьмяшчае сымбалі, якія нельга выкарыстоўваць у назвах старонак. Калі ласка, зьмяніце назву файла і паспрабуйце загрузіць яго зноў.',
'filename-toolong' => 'Назвы файлаў ня могуць быць даўжэй 240 байтаў.',
'badfilename' => 'Назва файла была зьмененая на «$1».',
'filetype-mime-mismatch' => 'Пашырэньне файла «.$1» не адпавядае выяўленаму MIME-тыпу файла ($2).',
'filetype-badmime' => 'Загрузка файлаў тыпу MIME «$1» забароненая.',
'filetype-bad-ie-mime' => 'Немагчыма загрузіць гэты файл, таму што Internet Explorer вызначыў яго як «$1», што азначае, што тып гэтага файла забаронены і патэнцыяльна небясьпечны.',
'filetype-unwanted-type' => "'''«.$1»''' — непажаданы тып файла.
{{PLURAL:$3|Пажаданым тыпам файла зьяўляецца|Пажаданымі тыпамі файлаў зьяўляюцца}} $2.",
'filetype-banned-type' => "'''«.$1»''' — {{PLURAL:$4|забаронены тып файлаў|забароненыя тыпы файлаў}}.
{{PLURAL:$3|Дазволены тып файлаў|Дазволеныя тыпы файлаў}}: $2.",
'filetype-missing' => 'Файл ня мае пашырэньня (напрыклад, «.jpg»).',
'empty-file' => 'Дасланы Вамі файл пусты.',
'file-too-large' => 'Дасланы Вамі файл занадта вялікі.',
'filename-tooshort' => 'Назва файла занадта кароткая.',
'filetype-banned' => 'Гэты тып файла забаронены.',
'verification-error' => 'Гэты файл не прайшоў вэрыфікацыю.',
'hookaborted' => 'Прапанаваная Вамі зьмена была адхіленая апрацоўшчыкам пашырэньня.',
'illegal-filename' => 'Недазволеная назва файла.',
'overwrite' => 'Замена існуючага файла забароненая.',
'unknown-error' => 'Узьнікла невядомая памылка.',
'tmp-create-error' => 'Немагчыма стварыць часовы файл.',
'tmp-write-error' => 'Памылка запісу часовага файла.',
'large-file' => 'Рэкамэндаваны памер файлаў — ня болей $1;
памер гэтага файла — $2.',
'largefileserver' => 'Памер гэтага файла перавышае максымальна дазволены.',
'emptyfile' => 'Загружаны файл, здаецца, пусты. Магчыма гэты адбылося з-за памылкі ў назьве файла.
Удакладніце, ці Вы сапраўды жадаеце загрузіць гэты файл.',
'windows-nonascii-filename' => 'Гэтая вікі не падтрымлівае назвы файлаў з спэцыяльнымі сымбалямі.',
'fileexists' => 'Файл з такой назвай ужо існуе. Калі ласка, праверце <strong>[[:$1]]</strong>, калі Вы ня ўпэўненыя, што жадаеце яго замяніць. [[$1|thumb]]',
'filepageexists' => 'Старонка апісаньня для гэтага файла ўжо існуе як <strong>[[:$1]]</strong>, але файла з такой назвай няма.
Апісаньне якое Вы дадалі ня зьявіцца на старонцы апісаньня.
Каб яно там зьявілася, Вам трэба рэдагаваць яе самастойна.
[[$1|thumb]]',
'fileexists-extension' => 'Файл з падобнай назвай ужо існуе: [[$2|thumb]]
* Назва загружанага файла: <strong>[[:$1]]</strong>
* Назва існуючага файла: <strong>[[:$2]]</strong>
Калі ласка, выбярыце іншую назву.',
'fileexists-thumbnail-yes' => "Верагодна файл зьяўляецца паменшанай копіяй ''(мініятурай)''. [[$1|thumb]]
Калі ласка, праверце файл <strong>[[:$1]]</strong>.
Калі правераны файл зьяўляецца той жа выявай, то загрузка мініятуры ня мае сэнсу.",
'file-thumbnail-no' => "Назва файла пачынаецца з <strong>$1</strong>.
Верагодна гэта паменшаная копія выявы ''(мініятура)''.
Калі Вы маеце гэтую выяву ў поўным памеры, загрузіце яе, альбо зьмяніце назву файла.",
'fileexists-forbidden' => 'Файл з такой назвай ужо існуе і ня можа быць перапісаны.
Калі ласка, вярніцеся назад і загрузіце гэты файл з новай назвай. [[File:$1|thumb|center|$1]]',
'fileexists-shared-forbidden' => 'Файл з такой назвай ужо існуе ў агульным сховішчы файлаў.
Калі Вы жадаеце загрузіць Ваш файл, вярніцеся назад і загрузіце гэты файл з новай назвай. [[File:$1|thumb|center|$1]]',
'file-exists-duplicate' => 'Гэты файл дублюе {{PLURAL:$1|наступны файл|наступныя файлы}}:',
'file-deleted-duplicate' => 'Падобны файл ([[:$1]]) ужо выдаляўся. Калі ласка, паглядзіце гісторыю выдаленьняў гэтага файла перад яго паўторнай загрузкай.',
'uploadwarning' => 'Папярэджаньне',
'uploadwarning-text' => 'Калі ласка, зьмяніце апісаньне файла ніжэй і паспрабуйце ізноў.',
'savefile' => 'Захаваць файл',
'uploadedimage' => 'загружаная «[[$1]]»',
'overwroteimage' => 'загружаная новая вэрсія «[[$1]]»',
'uploaddisabled' => 'Загрузка файлаў забароненая',
'copyuploaddisabled' => 'Загрузка праз URL-адрас адключаная.',
'uploadfromurl-queued' => 'Ваша загрузка далучаная да чаргі.',
'uploaddisabledtext' => 'Загрузка файлаў забароненая.',
'php-uploaddisabledtext' => 'Загрузка файлаў была адключаная ў парамэтрах канфігурацыі PHP. Калі ласка, праверце значэньне парамэтра «file_uploads».',
'uploadscripted' => 'Гэты файл утрымлівае HTML-код альбо скрыпт, які можа памылкова апрацоўвацца браўзэрам.',
'uploadvirus' => 'Файл утрымлівае вірус! Падрабязнасьці: $1',
'uploadjava' => 'Файл зьяўляецца ZIP-архівам, які зьмяшчае .class-файл Java.
Загрузка Java-файлаў забароненая ў мэтах бясьпекі.',
'upload-source' => 'Крынічны файл',
'sourcefilename' => 'Пачатковая назва файла:',
'sourceurl' => 'URL-адрас крыніцы:',
'destfilename' => 'Канчатковая назва файла:',
'upload-maxfilesize' => 'Максымальны памер файла: $1',
'upload-description' => 'Апісаньне файла',
'upload-options' => 'Налады загрузкі',
'watchthisupload' => 'Назіраць за гэтым файлам',
'filewasdeleted' => 'Файл з такой назвай загружаўся, але быў выдалены.
Вам трэба праверыць $1 перад новай загрузкай.',
'filename-bad-prefix' => "Назва файла, які Вы загружаеце, пачынаецца з '''«$1»'''. Падобныя бессэнсоўныя назвы звычайна ствараюцца аўтаматычна лічбавымі фотаапаратамі. Калі ласка, абярыце больш зразумелую назву для Вашага файла.",
'upload-success-subj' => 'Загрузка пасьпяхова скончылася',
'upload-success-msg' => 'Вашая загрузка з [$2] была пасьпяховая. Яна даступная тут: [[:{{ns:file}}:$1]]',
'upload-failure-subj' => 'Праблема загрузкі',
'upload-failure-msg' => 'Узьнікла праблема пад час Вашай загрузкі з [$2]:
$1',
'upload-warning-subj' => 'Папярэджаньне загрузкі',
'upload-warning-msg' => 'Узьнікла праблема з Вашай загрузкай з [$2]. Вы можаце вярнуцца на [[Special:Upload/stash/$1|форму загрузкі]] для вырашэньня гэтай праблемы.',
'upload-proto-error' => 'Няслушны пратакол',
'upload-proto-error-text' => 'Аддаленая загрузка файлаў патрабуе URL-адрас, які пачынаецца з <code>http://</code> альбо <code>ftp://</code>.',
'upload-file-error' => 'Унутраная памылка',
'upload-file-error-text' => 'Адбылася ўнутраная памылка пад час спробы стварыць часовы файл на сэрвэры.
Калі ласка, зьвярніцеся да [[Special:ListUsers/sysop|сыстэмнага адміністратара]].',
'upload-misc-error' => 'Невядомая памылка загрузкі',
'upload-misc-error-text' => 'Адбылася невядомая памылка пад час загрузкі.
Калі ласка, упэўніцеся, што URL-адрас слушны, і паспрабуйце ізноў.
Калі памылка паўтарыцца, зьвярніцеся да [[Special:ListUsers/sysop|сыстэмнага адміністратара]].',
'upload-too-many-redirects' => 'URL-адрас утрымлівае зашмат перанакіраваньняў',
'upload-unknown-size' => 'Невядомы памер',
'upload-http-error' => 'Узьнікла памылка HTTP: $1',
'upload-copy-upload-invalid-domain' => 'Капіяваньне загрузак не дазволенае ў гэтым дамэне.',
# File backend
'backend-fail-stream' => 'Немагчыма накіраваць файл $1.',
'backend-fail-backup' => 'Немагчыма зрабіць рэзэрвовую копію файла $1.',
'backend-fail-notexists' => 'Файл $1 не існуе.',
'backend-fail-hashes' => 'Немагчыма атрымаць хэшы файлаў для параўнаньня.',
'backend-fail-notsame' => 'Неідэнтыфікаваны файл ужо існуе $1.',
'backend-fail-invalidpath' => '$1 не зьяўляецца слушным шляхам да сховішча.',
'backend-fail-delete' => 'Немагчыма выдаліць файл $1.',
'backend-fail-alreadyexists' => 'Файл $1 ужо існуе.',
'backend-fail-store' => 'Немагчыма захаваць файл $1 у $2.',
'backend-fail-copy' => 'Немагчыма скапіяваць файл $1 у $2.',
'backend-fail-move' => 'Немагчыма перанесьці файл $1 у $2.',
'backend-fail-opentemp' => 'Немагчыма адкрыць часовы файл.',
'backend-fail-writetemp' => 'Немагчыма запісаць часовы файл.',
'backend-fail-closetemp' => 'Немагчыма закрыць часовы файл.',
'backend-fail-read' => 'Немагчыма прачытаць файл $1.',
'backend-fail-create' => 'Немагчыма запісаць файл $1.',
'backend-fail-maxsize' => 'Не атрымалася запісаць файл $1, бо яго памер перавышае {{PLURAL:$2|$2 байт|$2 байта|$2 байтаў}}.',
'backend-fail-readonly' => 'Сэрвэр сховішча «$1» у рэжыме толькі чытаньня. Прычына: «$2»',
'backend-fail-synced' => 'Стан файла «$1» адрозьніваецца ад стану на ўнутраным сэрвэры сховішча',
'backend-fail-connect' => 'Немагчыма далучыцца да сэрвэра сховішча «$1».',
'backend-fail-internal' => 'Узьнікла невядомая памылка на сэрвэры сховішча «$1».',
'backend-fail-contenttype' => 'Немагчыма вызначыць тып зьместу файла, які мусіць быць захаваны ў «$1».',
'backend-fail-batchsize' => 'Cховішча атрымала блёк з $1 {{PLURAL:$1|файлавай апэрацыі|файлавых апэрацыяў|файлавых апэрацыяў}}; абмежаваньне складае $2 {{PLURAL:$2|апэрацыю|апэрацыі|апэрацыяў}}.',
'backend-fail-usable' => 'Не атрымалася прачытаць ці запісаць файл «$1» з-за недастачы правоў ці адсутнасьці дырэкторыяў або кантэйнэраў.',
# File journal errors
'filejournal-fail-dbconnect' => 'Не атрымалася злучыцца з базай зьвестак журнала для сховішча «$1».',
'filejournal-fail-dbquery' => 'Не атрымалася абнавіць базу зьвестак журнала для сховішча «$1».',
# Lock manager
'lockmanager-notlocked' => 'Немагчыма разблякаваць «$1», які не заблякаваны.',
'lockmanager-fail-closelock' => 'Немагчыма закрыць файл блякаваньня для «$1».',
'lockmanager-fail-deletelock' => 'Немагчыма выдаліць файл блякаваньня для «$1».',
'lockmanager-fail-acquirelock' => 'Немагчыма здабыць блякаваньне для «$1».',
'lockmanager-fail-openlock' => 'Немагчыма адкрыць файл блякаваньня для «$1».',
'lockmanager-fail-releaselock' => 'Немагчыма зьняць блякаваньне для «$1».',
'lockmanager-fail-db-bucket' => 'Немагчыма скантактавацца з дастатковай колькасьцю базаў блякавньняў на ўчастку $1.',
'lockmanager-fail-db-release' => 'Немагчыма зьняць блякаваньні для базы зьвестак $1.',
'lockmanager-fail-svr-acquire' => 'Немагчыма запытаць блякаваньні на сэрвэры $1.',
'lockmanager-fail-svr-release' => 'Немагчыма зьняць блякаваньні для сэрвэра $1.',
# ZipDirectoryReader
'zip-file-open-error' => 'Падчас адкрыцьця файла для праверкі архіву адбылася памылка.',
'zip-wrong-format' => 'Пазначаны файл не зьяўляецца ZIP-архівам.',
'zip-bad' => 'ZIP-файл пашкоджаны ці ня можа быць прачытаны.
Немагчыма праверыць яго бясьпечнасьць.',
'zip-unsupported' => 'Гэты ZIP-файл выкарыстоўвае магчымасьці, якія MediaWiki не падтрымлівае.
Немагчыма праверыць яго бясьпечнасьць.',
# Special:UploadStash
'uploadstash' => 'Схаваная загрузка',
'uploadstash-summary' => 'Гэтая старонка прадстаўляе доступ да файлаў, якія загружаныя (ці знаходзяцца ў працэсе загрузкі), але яшчэ не апублікаваныя ў {{GRAMMAR:месны|{{SITENAME}}}}. Гэтыя файлы нябачныя нікому, акрамя ўдзельнікаў, якія іх загрузілі.',
'uploadstash-clear' => 'Ачысьціць схаваныя файлы',
'uploadstash-nofiles' => 'Вы ня маеце схаваных файлаў.',
'uploadstash-badtoken' => 'Немагчыма выканаць гэтае дзеяньне, верагодна скончыўся тэрмін дзеяньня Вашага дазволу на рэдагаваньне. Паспрабуйце зноў.',
'uploadstash-errclear' => 'Немагчыма ачысьціць файлы.',
'uploadstash-refresh' => 'Абнавіць сьпіс файлаў.',
'invalid-chunk-offset' => 'Няслушнае зрушэньне фрагмэнту',
# img_auth script messages
'img-auth-accessdenied' => 'Доступ забаронены',
'img-auth-nopathinfo' => 'Адсутнічае PATH_INFO.
Ваш сэрвэр не ўстаноўлены на пропуск гэтай інфармацыі.
Магчма, ён працуе праз CGI і не падтрымлівае img_auth.
Глядзіце https://www.mediawiki.org/wiki/Manual:Image_Authorization.',
'img-auth-notindir' => 'Неабходнага шляху няма ў дырэкторыі загрузкі, пазначанай у канфігурацыі.',
'img-auth-badtitle' => 'Немагчыма стварыць слушную назву з «$1».',
'img-auth-nologinnWL' => 'Вы не ўвайшлі ў сыстэму, а «$1» не знаходзіцца ў белым сьпісе.',
'img-auth-nofile' => 'Файл «$1» не існуе.',
'img-auth-isdir' => 'Вы спрабуеце атрымаць доступ да дырэкторыі «$1».
Дазволены толькі доступ да файлаў.',
'img-auth-streaming' => 'Перадача струменя «$1».',
'img-auth-public' => 'Функцыя img_auth.php ужываецца для файла выхаду з прыватнай вікі.
Гэта вікі ўсталявана як публічная вікі.
Для найлепшай бясьпекі img_auth.php выключана.',
'img-auth-noread' => 'Удзельнік ня мае доступу на чытаньне «$1».',
'img-auth-bad-query-string' => 'URL-адрас утрымлівае няслушны радок запыту.',
# HTTP errors
'http-invalid-url' => 'Няслушны URL-адрас: $1',
'http-invalid-scheme' => 'URL-адрасы схемы «$1» не падтрымліваюцца',
'http-request-error' => 'HTTP-запыт не атрымаўся ў выніку невядомай памылкі.',
'http-read-error' => 'Памылка чытаньня HTTP.',
'http-timed-out' => 'Скончыўся час чаканьня HTTP-запыту.',
'http-curl-error' => 'Памылка выбаркі URL-адрасу: $1',
'http-host-unreachable' => 'Немагчыма дасягнуць URL-адрас',
'http-bad-status' => 'Адбылася памылка пад час выкананьня HTTP-запыту: $1 $2',
# Some likely curl errors. More could be added from <http://curl.haxx.se/libcurl/c/libcurl-errors.html>
'upload-curl-error6' => 'Немагчыма дасягнуць URL-адрас',
'upload-curl-error6-text' => 'Немагчыма адкрыць пазначаны URL-адрас.
Калі ласка, упэўніцеся, што адрас слушны і сайт працуе.',
'upload-curl-error28' => 'Ліміт часу загрузкі скончыўся',
'upload-curl-error28-text' => 'Сайт доўга не адказвае.
Калі ласка, упэўніцеся што сайт працуе, і празь некаторы час паспрабуйце яшчэ раз.
Вы можаце паспрабаваць пад час меншай загрузкі сайта.',
'license' => 'Ліцэнзія:',
'license-header' => 'Ліцэнзія',
'nolicense' => 'Ня выбраная',
'license-nopreview' => '(Прагляд недаступны)',
'upload_source_url' => ' (слушны, агульнадаступны URL-адрас)',
'upload_source_file' => ' (файл на Вашым кампутары)',
# Special:ListFiles
'listfiles-summary' => 'На гэтай спэцыяльнай старонцы паказаныя ўсе загружаныя файлы.
Падчас фільтрацыі па ўдзельніку, паказваюцца толькі файлы, апошнія вэрсіі якіх загрузіў удзельнік.',
'listfiles_search_for' => 'Пошук па назьве файла:',
'imgfile' => 'файл',
'listfiles' => 'Сьпіс файлаў',
'listfiles_thumb' => 'Мініятура',
'listfiles_date' => 'Дата',
'listfiles_name' => 'Назва',
'listfiles_user' => 'Удзельнік',
'listfiles_size' => 'Памер',
'listfiles_description' => 'Апісаньне',
'listfiles_count' => 'Вэрсіі',
# File description page
'file-anchor-link' => 'Файл',
'filehist' => 'Гісторыя файла',
'filehist-help' => 'Націсьніце на дату/час, каб паглядзець, як тады выглядаў файл.',
'filehist-deleteall' => 'выдаліць усе',
'filehist-deleteone' => 'выдаліць',
'filehist-revert' => 'вярнуць',
'filehist-current' => 'цяперашняя',
'filehist-datetime' => 'Дата і час',
'filehist-thumb' => 'Мініятура',
'filehist-thumbtext' => 'Мініятура вэрсіі ад $1',
'filehist-nothumb' => 'Няма мініятуры',
'filehist-user' => 'Удзельнік',
'filehist-dimensions' => 'Памеры',
'filehist-filesize' => 'Памер файла',
'filehist-comment' => 'Камэнтар',
'filehist-missing' => 'Файл адсутнічае',
'imagelinks' => 'Выкарыстаньне файла',
'linkstoimage' => '{{PLURAL:$1|Наступная старонка спасылаецца|Наступныя старонкі спасылаюцца}} на гэты файл:',
'linkstoimage-more' => 'Больш чым $1 {{PLURAL:$1|старонка спасылаецца|старонкі спасылаюцца|старонак спасылаюцца}} на гэты файл.
У гэтым сьпісе толькі $1 {{PLURAL:$1|спасылка|спасылкі|спасылак}} на гэты файл.
Даступны таксама [[Special:WhatLinksHere/$2|поўны сьпіс]].',
'nolinkstoimage' => 'Ніводная старонка не спасылаецца на гэты файл.',
'morelinkstoimage' => 'Паказаць [[Special:WhatLinksHere/$1|болей спасылак]] на гэты файл.',
'linkstoimage-redirect' => '$1 (перанакіраваньне на файл) $2',
'duplicatesoffile' => '{{PLURAL:$1|Наступны файл дублюе|Наступныя файлы дублююць}} гэты файл ([[Special:FileDuplicateSearch/$2|падрабязнасьці]]):',
'sharedupload' => 'Гэты файл паходзіць з $1 і можа выкарыстоўвацца іншымі праектамі.',
'sharedupload-desc-there' => 'Гэты файл паходзіць з $1 і можа выкарыстоўвацца іншымі праектамі.
Калі ласка, глядзіце падрабязнасьці на [$2 старонцы апісаньня файла].',
'sharedupload-desc-here' => 'Гэты файл паходзіць з $1 і можа выкарыстоўвацца іншымі праектамі.
Апісаньне са [$2 старонкі апісаньня файла] пададзенае ніжэй.',
'sharedupload-desc-edit' => 'Гэты файл паходзіць з $1 і можа выкарыстоўвацца іншымі праектамі.
Калі спатрэбіцца, вы можаце зьмяніць апісаньне файла на [$2 адпаведнай старонцы].',
'sharedupload-desc-create' => 'Гэты файл паходзіць з $1 і можа выкарыстоўвацца іншымі праектамі.
Калі спатрэбіцца, вы можаце зьмяніць апісаньне на [$2 адпаведнай старонцы].',
'filepage-nofile' => 'Файл з гэтай назвай не існуе.',
'filepage-nofile-link' => 'Файл з гэтай назвай не існуе, але Вы можаце [$1 загрузіць яго].',
'uploadnewversion-linktext' => 'Загрузіць новую вэрсію гэтага файла',
'shared-repo-from' => '$1',
'shared-repo' => 'агульнага сховішча',
'shared-repo-name-wikimediacommons' => 'Вікісховішча',
'upload-disallowed-here' => 'Вы ня можаце перазапісаць гэты файл.',
# File reversion
'filerevert' => 'Вярнуць $1',
'filerevert-legend' => 'Вярнуць папярэднюю вэрсію файла',
'filerevert-intro' => "Вы вяртаеце '''[[Media:$1|$1]]''' да [вэрсіі $4 ад $3, $2].",
'filerevert-comment' => 'Прычына:',
'filerevert-defaultcomment' => 'Вернутая вэрсія ад $2, $1',
'filerevert-submit' => 'Вярнуць',
'filerevert-success' => "'''[[Media:$1|$1]]''' быў вернуты да [вэрсіі $4 ад $3, $2].",
'filerevert-badversion' => 'Не існуе папярэдняй лякальнай вэрсіі гэтага файла з пазначанай датай.',
# File deletion
'filedelete' => 'Выдаліць $1',
'filedelete-legend' => 'Выдаліць файл',
'filedelete-intro' => "Вы выдаляеце файл '''[[Media:$1|$1]]''' з усёй яго гісторыяй.",
'filedelete-intro-old' => "Вы выдаляеце вэрсію '''[[Media:$1|$1]]''' ад [$4 $3, $2].",
'filedelete-comment' => 'Прычына:',
'filedelete-submit' => 'Выдаліць',
'filedelete-success' => "'''$1''' выдалены.",
'filedelete-success-old' => "Вэрсія '''[[Media:$1|$1]]''' ад $3, $2 была выдаленая.",
'filedelete-nofile' => "Файл '''$1''' не існуе.",
'filedelete-nofile-old' => "Не існуе архіўнай вэрсіі '''$1''' з пазначанымі атрыбутамі.",
'filedelete-otherreason' => 'Іншая/дадатковая прычына:',
'filedelete-reason-otherlist' => 'Іншая прычына',
'filedelete-reason-dropdown' => '* Звычайныя прычыны выдаленьня
** парушэньне аўтарскіх правоў
** файл-дублікат',
'filedelete-edit-reasonlist' => 'Рэдагаваць прычыны выдаленьня',
'filedelete-maintenance' => 'Выдаленьне і аднаўленьне файлаў часова забароненае па прычыне падтрымкі.',
'filedelete-maintenance-title' => 'Немагчыма выдаліць файл',
# MIME search
'mimesearch' => 'Пошук па MIME',
'mimesearch-summary' => 'Гэта старонка дазваляе адбор файлаў па іх MIME-тыпе.
Фармат уводу: тып_зьместу/падтып, напрыклад, <code>image/jpeg</code>.',
'mimetype' => 'Тып MIME:',
'download' => 'загрузіць',
# Unwatched pages
'unwatchedpages' => 'Старонкі, за якімі ніхто не назірае',
# List redirects
'listredirects' => 'Сьпіс перанакіраваньняў',
# Unused templates
'unusedtemplates' => 'Шаблёны, якія не выкарыстоўваюцца',
'unusedtemplatestext' => 'На гэтай старонцы зьмешчаны сьпіс усіх старонак прасторы назваў «{{ns:template}}», якія ня ўключаныя ў іншыя старонкі.
Не забывайцеся праверыць іншыя спасылкі на шаблёны перад іх выдаленьнем.',
'unusedtemplateswlh' => 'іншыя спасылкі',
# Random page
'randompage' => 'Выпадковая старонка',
'randompage-nopages' => 'Няма старонак у {{PLURAL:$2|наступнай прасторы|наступных прасторах}} назваў: $1.',
# Random redirect
'randomredirect' => 'Выпадковае перанакіраваньне',
'randomredirect-nopages' => 'У прасторы назваў «$1» няма перанакіраваньняў.',
# Statistics
'statistics' => 'Статыстыка',
'statistics-header-pages' => 'Статыстыка старонак',
'statistics-header-edits' => 'Статыстыка рэдагаваньняў',
'statistics-header-views' => 'Статыстыка праглядаў',
'statistics-header-users' => 'Статыстыка ўдзелу',
'statistics-header-hooks' => 'Іншая статыстыка',
'statistics-articles' => 'Колькасьць старонак са зьместам',
'statistics-pages' => 'Колькасьць старонак',
'statistics-pages-desc' => 'Усе старонкі ў вікі, улучна з абмеркаваньнямі, перанакіраваньнямі і г.д.',
'statistics-files' => 'Колькасьць загружаных файлаў',
'statistics-edits' => 'Агульная колькасьць рэдагаваньняў',
'statistics-edits-average' => 'Сярэдняя колькасьць рэдагаваньняў на старонку',
'statistics-views-total' => 'Агульная колькасьць праглядаў',
'statistics-views-total-desc' => 'Прагляды неіснуючых старонак і спэцыяльных старонак не ўлічаныя',
'statistics-views-peredit' => 'Колькасьць праглядаў на рэдагаваньне',
'statistics-users' => '[[Special:ListUsers|Зарэгістраваныя ўдзельнікі]]',
'statistics-users-active' => 'Актыўныя ўдзельнікі',
'statistics-users-active-desc' => 'Удзельнікі, якія выканалі нейкае дзеяньне цягам {{PLURAL:$1|апошняга $1 дня|апошніх $1 дзён|апошніх $1 дзён}}',
'statistics-mostpopular' => 'Найпапулярнейшыя старонкі',
'disambiguations' => 'Старонкі, якія спасылаюцца на старонкі-неадназначнасьці',
'disambiguationspage' => 'Template:Неадназначнасьць',
'disambiguations-text' => "Наступныя старонкі спасылаюцца на '''старонкі-неадназначнасьці'''.
Замест гэтага, яны павінны спасылацца на пэўныя старонкі.<br />
Старонка лічыцца шматзначнай, калі яна ўтрымлівае шаблён назва якога знаходзіцца на старонцы [[MediaWiki:Disambiguationspage]]",
'doubleredirects' => 'Двайныя перанакіраваньні',
'doubleredirectstext' => 'На гэтай старонцы пададзены сьпіс перанакіраваньняў на іншыя перанакіраваньні. Кожны радок утрымлівае спасылкі на першае і другое перанакіраваньне, а таксама мэтавую старонку другога перанакіраваньня, якая звычайна зьяўляецца «сапраўднай» мэтавай старонкай, куды павіннае спасылацца першае перанакіраваньне.
<del>Закрэсьленыя</del> элемэнты былі выпраўленыя.',
'double-redirect-fixed-move' => '[[$1]] была перанесеная, яна цяпер перанакіроўвае на [[$2]]',
'double-redirect-fixed-maintenance' => 'Выпраўленьне падвойнага перанакіраваньня з [[$1]] на [[$2]].',
'double-redirect-fixer' => 'Выпраўленьне перанакіраваньняў',
'brokenredirects' => 'Некарэктныя перанакіраваньні',
'brokenredirectstext' => 'Наступныя перанакіраваньні спасылаюцца на неіснуючыя старонкі:',
'brokenredirects-edit' => 'рэдагаваць',
'brokenredirects-delete' => 'выдаліць',
'withoutinterwiki' => 'Старонкі без спасылак на іншыя моўныя вэрсіі',
'withoutinterwiki-summary' => 'Наступныя старонкі ня ўтрымліваюць спасылак на іншамоўныя вэрсіі:',
'withoutinterwiki-legend' => 'Прэфікс',
'withoutinterwiki-submit' => 'Паказаць',
'fewestrevisions' => 'Старонкі з найменшай колькасьцю рэдагаваньняў',
# Miscellaneous special pages
'nbytes' => '$1 {{PLURAL:$1|байт|байты|байтаў}}',
'ncategories' => '$1 {{PLURAL:$1|катэгорыя|катэгорыі|катэгорыяў}}',
'ninterwikis' => '$1 {{PLURAL:$1|інтэрвікі|інтэрвікі}}',
'nlinks' => '$1 {{PLURAL:$1|спасылка|спасылкі|спасылак}}',
'nmembers' => '$1 {{PLURAL:$1|элемэнт|элемэнты|элемэнтаў}}',
'nrevisions' => '$1 {{PLURAL:$1|вэрсія|вэрсіі|вэрсіяў}}',
'nviews' => '$1 {{PLURAL:$1|прагляд|прагляды|праглядаў}}',
'nimagelinks' => 'Выкарыстоўваецца на $1 {{PLURAL:$1|старонцы|старонках|старонках}}',
'ntransclusions' => 'выкарыстоўваецца на $1 {{PLURAL:$1|старонцы|старонках|старонках}}',
'specialpage-empty' => 'Гэтая старонка — пустая.',
'lonelypages' => 'Старонкі-сіраціны',
'lonelypagestext' => 'На наступныя старонкі няма спасылак і яны ня ўлучаныя ў іншыя старонкі {{GRAMMAR:родны|{{SITENAME}}}}.',
'uncategorizedpages' => 'Некатэгарызаваныя старонкі',
'uncategorizedcategories' => 'Некатэгарызаваныя катэгорыі',
'uncategorizedimages' => 'Некатэгарызаваныя файлы',
'uncategorizedtemplates' => 'Некатэгарызаваныя шаблёны',
'unusedcategories' => 'Катэгорыі, якія не выкарыстоўваюцца',
'unusedimages' => 'Файлы, якія не выкарыстоўваюцца',
'popularpages' => 'Папулярныя старонкі',
'wantedcategories' => 'Запатрабаваныя катэгорыі',
'wantedpages' => 'Запатрабаваныя старонкі',
'wantedpages-badtitle' => 'Няслушная назва сярод вынікаў: $1',
'wantedfiles' => 'Запатрабаваныя файлы',
'wantedfiletext-cat' => 'Наступныя файлы выкарыстоўваюцца, але іх няма. Файлы са зьнешніх сховішчаў могуць знаходзіцца ў сьпісе без уліку іх існаваньня. Любыя такія няслушныя ўваходжаньні будуць <del>выкрасьленыя</del>. Дадаткова, старонкі, якія ўбудоўваюць неіснуючыя файлы прыведзеныя на [[:$1]].',
'wantedfiletext-nocat' => 'Наступныя файлы выкарыстоўваюцца, але іх няма. Файлы са зьнешніх сховішчаў могуць знаходзіцца ў сьпісе без уліку іх існаваньня. Любыя такія няслушныя ўваходжаньні будуць <del>выкрасьленыя</del>.',
'wantedtemplates' => 'Запатрабаваныя шаблёны',
'mostlinked' => 'Старонкі, на якія найчасьцей спасылаюцца',
'mostlinkedcategories' => 'Катэгорыі з найбольшай колькасьцю старонак',
'mostlinkedtemplates' => 'Шаблёны, якія найчасьцей выкарыстоўваюцца',
'mostcategories' => 'Старонкі з найбольшай колькасьцю катэгорыяў',
'mostimages' => 'Файлы, на якія найчасьцей спасылаюцца',
'mostinterwikis' => 'Старонкі з найбольшай колькасьцю інтэрвікі',
'mostrevisions' => 'Старонкі з найбольшай колькасьцю рэдагаваньняў',
'prefixindex' => 'Усе старонкі з пачаткам назваў',
'prefixindex-namespace' => 'Усе старонкі з прэфіксам (прастора назваў $1)',
'shortpages' => 'Кароткія старонкі',
'longpages' => 'Доўгія старонкі',
'deadendpages' => 'Тупіковыя старонкі',
'deadendpagestext' => 'Наступныя старонкі не спасылаюцца на іншыя старонкі {{GRAMMAR:родны|{{SITENAME}}}}.',
'protectedpages' => 'Абароненыя старонкі',
'protectedpages-indef' => 'Толькі бестэрміновыя абароны',
'protectedpages-cascade' => 'Толькі каскадныя абароны',
'protectedpagestext' => 'Наступныя старонкі абароненыя ад пераносаў і рэдагаваньняў',
'protectedpagesempty' => 'Цяпер няма абароненых старонак з пазначанымі парамэтрамі.',
'protectedtitles' => 'Забароненыя старонкі',
'protectedtitlestext' => 'Стварэньне наступных старонак забароненае',
'protectedtitlesempty' => 'Цяпер няма абароненых назваў з пазначанымі парамэтрамі.',
'listusers' => 'Сьпіс удзельнікаў і ўдзельніц',
'listusers-editsonly' => 'Паказаць толькі ўдзельнікаў, якія маюць рэдагаваньні',
'listusers-creationsort' => 'Адсартаваць па даце стварэньня',
'usereditcount' => '$1 {{PLURAL:$1|рэдагаваньне|рэдагаваньні|рэдагаваньняў}}',
'usercreated' => '{{GENDER:$3|Створаны|Створаная}} $1 у $2',
'newpages' => 'Новыя старонкі',
'newpages-username' => 'Імя ўдзельніка:',
'ancientpages' => 'Найстарэйшыя старонкі',
'move' => 'Перанесьці',
'movethispage' => 'Перанесьці гэтую старонку',
'unusedimagestext' => 'Наступныя файлы існуюць, але не выкарыстоўваюцца ні на адной старонцы.
Калі ласка, заўважце, што іншыя сайты могуць спасылацца на гэты файл празь непасрэдную спасылку (URL), і ён можа актыўна выкарыстоўвацца нягледзячы на знаходжаньне ў гэтым сьпісе.',
'unusedcategoriestext' => 'Існуюць наступныя катэгорыі, якія ня ўтрымліваюць старонак ці іншых катэгорыяў.',
'notargettitle' => 'Не пазначаная мэта',
'notargettext' => 'Вы не пазначылі мэтавую старонку альбо ўдзельніка для гэтага дзеяньня.',
'nopagetitle' => 'Мэтавая старонка не існуе',
'nopagetext' => 'Пазначанай мэтавай старонкі не існуе.',
'pager-newer-n' => '$1 {{PLURAL:$1|навейшая|навейшыя|навейшых}}',
'pager-older-n' => '$1 {{PLURAL:$1|старэйшая|старэйшыя|старэйшых}}',
'suppress' => 'Рэвізаваць',
'querypage-disabled' => 'Гэта спэцыяльная старонка адключаная для падвышэньня прадукцыйнасьці',
# Book sources
'booksources' => 'Пошук кніг',
'booksources-search-legend' => 'Пошук кніг',
'booksources-isbn' => 'ISBN:',
'booksources-go' => 'Паказаць',
'booksources-text' => 'Ніжэй знаходзіцца сьпіс спасылак на іншыя сайты, якія прадаюць новыя і патрыманыя кнігі, і могуць таксама мець інфармацыю пра кнігі, якія Вы шукаеце:',
'booksources-invalid-isbn' => 'Пададзены няслушны ISBN; праверце, магчыма ўзьніклі памылкі пры пераносе нумару з арыгінальнай крыніцы.',
# Special:Log
'specialloguserlabel' => 'Выканаўца:',
'speciallogtitlelabel' => 'Мэта (назва ці удзельнік):',
'log' => 'Журналы падзеяў',
'all-logs-page' => 'Усе публічныя журналы падзеяў',
'alllogstext' => 'Сумесны паказ усіх журналаў падзеяў {{GRAMMAR:родны|{{SITENAME}}}}.
Вы можаце адфільтраваць вынікі па тыпе журналу, удзельніку ці старонцы.',
'logempty' => 'Падобных запісаў у журнале няма.',
'log-title-wildcard' => 'Шукаць назвы, якія пачынаюцца з гэтага тэксту',
'showhideselectedlogentries' => 'Паказаць/схаваць выбраныя запісы ў журнале',
# Special:AllPages
'allpages' => 'Усе старонкі',
'alphaindexline' => 'ад $1 да $2',
'nextpage' => 'Наступная старонка ($1)',
'prevpage' => 'Папярэдняя старонка ($1)',
'allpagesfrom' => 'Паказаць старонкі, пачынаючы з:',
'allpagesto' => 'Паказаць старонкі да:',
'allarticles' => 'Усе старонкі',
'allinnamespace' => 'Усе старонкі (прастора назваў: $1)',
'allnotinnamespace' => 'Усе старонкі (не ў прасторы назваў $1)',
'allpagesprev' => 'Папярэднія',
'allpagesnext' => 'Наступныя',
'allpagessubmit' => 'Паказаць',
'allpagesprefix' => 'Паказаць старонкі, назвы якіх пачынаюцца з:',
'allpagesbadtitle' => 'Пададзеная назва старонкі была няслушная ці пачыналася зь міжмоўнай ці міжвікі спасылкі. Яна яшчэ можа ўтрымліваць сымбалі, якія ня могуць ужывацца ў назвах.',
'allpages-bad-ns' => '{{SITENAME}} ня мае прасторы назваў «$1».',
'allpages-hide-redirects' => 'Схаваць перанакіраваньні',
# SpecialCachedPage
'cachedspecial-viewing-cached-ttl' => 'Вы праглядаеце закэшаваную вэрсію старонкі, якая магла быць абноўленая $1 таму.',
'cachedspecial-viewing-cached-ts' => 'Вы праглядаеце закэшаваную вэрсію старонкі, якая можа быць неактуальнай.',
'cachedspecial-refresh-now' => 'Пабачыць апошнюю вэрсію.',
# Special:Categories
'categories' => 'Катэгорыі',
'categoriespagetext' => '{{PLURAL:$1|Наступная катэгорыя зьмяшчае|Наступныя катэгорыі зьмяшчаюць}} старонкі і/альбо мэдыяфайлы.
Тут не паказаныя [[Special:UnusedCategories|катэгорыі, якія не выкарыстоўваюцца]].
Глядзіце таксама [[Special:WantedCategories|сьпіс запатрабаваных катэгорыяў]].',
'categoriesfrom' => 'Паказаць катэгорыі, пачынаючы з:',
'special-categories-sort-count' => 'сартаваць паводле колькасьці',
'special-categories-sort-abc' => 'сартаваць паводле альфабэту',
# Special:DeletedContributions
'deletedcontributions' => 'Выдалены ўнёсак удзельніка',
'deletedcontributions-title' => 'Выдалены ўнёсак удзельніка',
'sp-deletedcontributions-contribs' => 'унёсак',
# Special:LinkSearch
'linksearch' => 'Пошук вонкавых спасылках',
'linksearch-pat' => 'Узор для пошуку:',
'linksearch-ns' => 'Прастора назваў:',
'linksearch-ok' => 'Шукаць',
'linksearch-text' => 'Можна ўжываць сымбалі падстаноўкі, напрыклад, «*.wikipedia.org».<br />
Неабходны дамэн першага ўзроўню, напрыклад, «*.org».<br />
Пратаколы, якія падтрымліваюцца: <code>$1</code> (дапомна http://, калі пратакол не пазначаны).',
'linksearch-line' => 'Спасылка на $1 з $2',
'linksearch-error' => 'Сымбалі падстаноўкі могуць ужывацца толькі ў пачатку адрасоў.',
# Special:ListUsers
'listusersfrom' => 'Паказаць удзельнікаў, пачынаючы з:',
'listusers-submit' => 'Паказаць',
'listusers-noresult' => 'Удзельнікі ня знойдзеныя.',
'listusers-blocked' => '({{GENDER:$1|заблякаваны|заблякаваная}})',
# Special:ActiveUsers
'activeusers' => 'Сьпіс актыўных удзельнікаў',
'activeusers-intro' => 'Гэта сьпіс удзельнікаў, якія былі актыўнымі на працягу $1 {{PLURAL:$1|апошняга дня|апошніх дзён|апошніх дзён}}.',
'activeusers-count' => '$1 {{PLURAL:$1|дзеяньне|дзеяньні|дзеяньняў}} за $3 {{PLURAL:$3|апошні дзень|апошнія дні|апошніх дзён}}',
'activeusers-from' => 'Паказваць ўдзельнікаў, пачынаючы з:',
'activeusers-hidebots' => 'Схаваць робатаў',
'activeusers-hidesysops' => 'Схаваць адміністратараў',
'activeusers-noresult' => 'Удзельнікі ня знойдзеныя.',
# Special:Log/newusers
'newuserlogpage' => 'Журнал стварэньня рахункаў',
'newuserlogpagetext' => 'Гэта журнал стварэньня рахункаў удзельнікаў і ўдзельніц.',
# Special:ListGroupRights
'listgrouprights' => 'Правы групаў удзельнікаў',
'listgrouprights-summary' => 'Ніжэй пададзены сьпіс групаў удзельнікаў {{GRAMMAR:родны|{{SITENAME}}}}, разам зь іх правамі.
Таксама можна паглядзець [[{{MediaWiki:Listgrouprights-helppage}}|дадатковую інфармацыю]] пра асабістыя правы.',
'listgrouprights-key' => '* <span class="listgrouprights-granted">Прызначаныя правы</span>
* <span class="listgrouprights-revoked">Адабраныя правы</span>',
'listgrouprights-group' => 'Група',
'listgrouprights-rights' => 'Правы',
'listgrouprights-helppage' => 'Help:Правы групаў удзельнікаў',
'listgrouprights-members' => '(сьпіс удзельнікаў групы)',
'listgrouprights-addgroup' => 'можа дадаваць {{PLURAL:$2|групу|групы}}: $1',
'listgrouprights-removegroup' => 'можа выдаляць {{PLURAL:$2|групу|групы}}: $1',
'listgrouprights-addgroup-all' => 'можа дадаваць усе групы',
'listgrouprights-removegroup-all' => 'можа выдаляць усе групы',
'listgrouprights-addgroup-self' => 'Можа дадаць уласны рахунак да {{PLURAL:$2|групы|групаў}}: $1',
'listgrouprights-removegroup-self' => 'Можа выдаліць уласны рахунак з {{PLURAL:$2|групы|групаў}}: $1',
'listgrouprights-addgroup-self-all' => 'Можа дадаць уласны рахунак да ўсіх груп',
'listgrouprights-removegroup-self-all' => 'Можа выдаліць уласны рахунак з ўсіх груп',
# Email user
'mailnologin' => 'Няма адрасу атрымальніка',
'mailnologintext' => 'Вам неабходна [[Special:UserLogin|ўвайсьці ў сыстэму]] і мець пацьверджаны адрас электроннай пошты ў Вашых [[Special:Preferences|наладах]], каб дасылаць лісты іншым удзельнікам.',
'emailuser' => 'Даслаць ліст',
'emailuser-title-target' => 'Адправіць гэта па электроннай пошце {{GENDER:$1|гэтаму ўдзельніку|гэтай удзельніцы}}',
'emailuser-title-notarget' => 'Даслаць ліст ўдзельніку ці ўдзельніцы па электроннай пошце',
'emailpage' => 'Даслаць ліст ўдзельніку ці ўдзельніцы па электроннай пошце',
'emailpagetext' => 'Вы можаце выкарыстаць форму ніжэй, каб даслаць {{GENDER:$1|гэтаму ўдзельніку|гэтай удзельніцы}} ліст па электроннай пошце.
Адрас электроннай пошты, які Вы пазначалі ў [[Special:Preferences|сваіх наладах]], будзе пазначаны ў полі ліста «Ад», і {{GENDER:$1|ўдзельнік|ўдзельніца}} зможа даслаць на гэты адрас адказ.',
'usermailererror' => 'Пры адсыланьні пошты адбылася памылка:',
'defemailsubject' => 'Ліст з {{GRAMMAR:родны|{{SITENAME}}}} ад {{GENDER:$1|удзельніка|удзельніцы}} «$1»',
'usermaildisabled' => 'Электронная пошта ўдзельніка адключаная',
'usermaildisabledtext' => 'Вы ня можаце дасылаць электронныя лісты іншым удзельнікам {{GRAMMAR:родны|{{SITENAME}}}}',
'noemailtitle' => 'Адрас электроннай пошты адсутнічае',
'noemailtext' => 'Гэты удзельнік не пазначыў слушны адрас электроннай пошты.',
'nowikiemailtitle' => 'Атрыманьне лістоў па электроннай пошце забароненае',
'nowikiemailtext' => 'Гэты ўдзельнік не дазволіў атрымліваць лісты па электроннай пошце ад іншых удзельнікаў.',
'emailnotarget' => 'Неіснуючае ці няслушнае імя атрымальніка.',
'emailtarget' => 'Увядзіце імя атрымальніка',
'emailusername' => 'Імя ўдзельніка:',
'emailusernamesubmit' => 'Даслаць',
'email-legend' => 'Даслаць ліст электроннай пошты іншаму ўдзельніку {{GRAMMAR:родны|{{SITENAME}}}}',
'emailfrom' => 'Ад:',
'emailto' => 'Да:',
'emailsubject' => 'Тэма:',
'emailmessage' => 'Паведамленьне:',
'emailsend' => 'Даслаць',
'emailccme' => 'Даслаць мне копію ліста.',
'emailccsubject' => 'Копія Вашага ліста да $1: $2',
'emailsent' => 'Ліст адасланы',
'emailsenttext' => 'Ваш ліст быў адасланы.',
'emailuserfooter' => 'Гэты ліст быў дасланы ўдзельнікам $1 да {{GENDER:$2|ўдзельніка|ўдзельніцы}} $2 з дапамогай функцыі «Даслаць ліст» {{GRAMMAR:родны|{{SITENAME}}}}.',
# User Messenger
'usermessage-summary' => 'Паведамленьне пра выхад з сыстэмы.',
'usermessage-editor' => 'Дастаўка сыстэмных паведамленьняў',
# Watchlist
'watchlist' => 'Сьпіс назіраньня',
'mywatchlist' => 'Сьпіс назіраньня',
'watchlistfor2' => 'Для $1 $2',
'nowatchlist' => 'Ваш сьпіс назіраньня пусты.',
'watchlistanontext' => 'Вам патрэбна $1, каб праглядаць альбо рэдагаваць сьпіс назіраньня.',
'watchnologin' => 'Вы не ўвайшлі ў сыстэму',
'watchnologintext' => 'Вам неабходна [[Special:UserLogin|ўвайсьці ў сыстэму]], каб зьмяніць Ваш сьпіс назіраньня.',
'addwatch' => 'Дадаць ў сьпіс назіраньня',
'addedwatchtext' => 'Старонка «[[:$1]]» была дададзеная да Вашага [[Special:Watchlist|сьпісу назіраньня]].
Наступныя зьмены ў гэтай старонцы і зьвязанай зь ёю старонцы абмеркаваньняў будуць бачныя там.',
'removewatch' => 'Выдаліць са сьпісу назіраньня',
'removedwatchtext' => 'Старонка «[[:$1]]» была выдаленая з [[Special:Watchlist|Вашага сьпісу назіраньня]].',
'watch' => 'Назіраць',
'watchthispage' => 'Назіраць за гэтай старонкай',
'unwatch' => 'Не назіраць',
'unwatchthispage' => 'Перастаць назіраць',
'notanarticle' => 'Не старонка зьместу',
'notvisiblerev' => 'Вэрсія была выдаленая',
'watchnochange' => 'Нічога з Вашага сьпісу назіраньня не зьмянілася за паказаны пэрыяд.',
'watchlist-details' => 'У Вашым сьпісе назіраньня $1 {{PLURAL:$1|старонка|старонкі|старонак}} за выключэньнем старонак абмеркаваньня.',
'wlheader-enotif' => '* Дасылка паведамленьняў па электроннай пошце ўключаная.',
'wlheader-showupdated' => "* Старонкі, якія былі зьмененыя пасьля Вашага апошняга візыту, вылучаныя '''тоўстым''' шрыфтам",
'watchmethod-recent' => 'прагляд апошніх зьменаў у старонках са сьпісу назіраньня',
'watchmethod-list' => 'прагляд старонак са сьпісу назіраньня дзеля апошніх зьменах',
'watchlistcontains' => 'Ваш сьпіс назіраньня зьмяшчае $1 {{PLURAL:$1|старонка|старонкі|старонак}}.',
'iteminvalidname' => 'Праблема з элемэнтам «$1», няслушная назва…',
'wlnote' => "Ніжэй {{PLURAL:$1|паказаная '''$1''' апошняя зьмена|паказаныя '''$1''' апошнія зьмены|паказаныя '''$1''' апошніх зьменаў}} за '''$2''' {{PLURAL:$2|гадзіну|гадзіны|гадзінаў}}, па стане на $3, $4.",
'wlshowlast' => 'Паказаць: за апошнія $1 гадзінаў, $2 дзён, $3',
'watchlist-options' => 'Налады сьпісу назіраньня',
# Displayed when you click the "watch" button and it is in the process of watching
'watching' => 'Дадаецца ў сьпіс назіраньня…',
'unwatching' => 'Выдаляецца са сьпісу назіраньня…',
'watcherrortext' => 'Узьнікла памылка падчас зьмены Вашага сьпісу назіраньня для «$1».',
'enotif_mailer' => 'Служба паштовага апавяшчэньня {{GRAMMAR:родны|{{SITENAME}}}}',
'enotif_reset' => 'Пазначыць усе старонкі як прагледжаныя',
'enotif_newpagetext' => 'Гэта новая старонка.',
'enotif_impersonal_salutation' => 'Удзельнік {{GRAMMAR:родны|{{SITENAME}}}}',
'changed' => 'зьмененая',
'created' => 'створаная',
'enotif_subject' => 'Старонка {{GRAMMAR:родны|{{SITENAME}}}} $PAGETITLE была $CHANGEDORCREATED ўдзельнікам $PAGEEDITOR',
'enotif_lastvisited' => 'Глядзіце на $1 усе апошнія зьмены, якія адбыліся пасьля Вашага апошняга наведваньня.',
'enotif_lastdiff' => 'Глядзіце $1, каб пабачыць гэтую зьмену.',
'enotif_anon_editor' => 'ананімны ўдзельнік $1',
'enotif_body' => 'Шаноўны $WATCHINGUSERNAME,
Старонка $PAGETITLE {{GRAMMAR:родны|{{SITENAME}}}} была $CHANGEDORCREATED $PAGEEDITDATE $PAGEEDITOR, глядзіце цяперашнюю вэрсію на $PAGETITLE_URL.
$NEWPAGE
Кароткае апісаньне зьменаў: $PAGESUMMARY $PAGEMINOREDIT
Зьвязацца з аўтарам:
электронная пошта: $PAGEEDITOR_EMAIL
вікі-старонка: $PAGEEDITOR_WIKI
Паведамленьні ня будуць дасылацца ў выпадку паўторных рэдагаваньняў, пакуль Вы не наведаеце гэтую старонку.
Вы можаце пазначыць сьцяжкі дасылкі паведамленьняў для ўсіх старонках назіраньня Вашага сьпісу назіраньня.
Сыстэма паведамленьняў {{GRAMMAR:родны|{{SITENAME}}}}
--
Каб зьмяніць налады абвяшчэньня праз электронную пошту, наведайце:
{{canonicalurl:{{#special:Preferences}}}}
Каб зьмяніць налады сьпісу назіраньня, наведайце:
{{canonicalurl:{{#special:Preferences}}}}
Каб выдаліць старонку з Вашага сьпісу назіраньня, наведайце:
$UNWATCHURL
Зваротная сувязь і дапамога:
{{canonicalurl:{{MediaWiki:Helppage}}}}',
# Delete
'deletepage' => 'Выдаліць старонку',
'confirm' => 'Пацьвердзіць',
'excontent' => 'колішні зьмест: «$1»',
'excontentauthor' => "зьмест быў: «$1» (і адзіным аўтарам быў '[[Special:Contributions/$2|$2]]')",
'exbeforeblank' => 'зьмест да ачысткі: «$1»',
'exblank' => 'старонка была пустая',
'delete-confirm' => 'Выдаліць «$1»',
'delete-legend' => 'Выдаліць',
'historywarning' => "'''Папярэджаньне''': старонка, якую Вы зьбіраецеся выдаліць, мае гісторыю з прыкладна $1 {{PLURAL:$1|вэрсіі|вэрсіяў|вэрсіяў}}:",
'confirmdeletetext' => 'Зараз Вы выдаліце старонку разам з усёй гісторыяй зьменаў.
Калі ласка, пацьвердзіце, што Вы зьбіраецеся гэта зрабіць і што Вы разумееце ўсе наступствы, а таксама робіце гэта ў адпаведнасьці з [[{{MediaWiki:Policy-url}}|правіламі]].',
'actioncomplete' => 'Дзеяньне выкананае',
'actionfailed' => 'Дзеяньне ня выкананае',
'deletedtext' => '«$1» была выдаленая.
Запісы пра выдаленыя старонкі зьмяшчаюцца ў $2.',
'dellogpage' => 'Журнал выдаленьняў',
'dellogpagetext' => 'Сьпіс апошніх выдаленьняў.',
'deletionlog' => 'журнал выдаленьняў',
'reverted' => 'Вернутая да папярэдняй вэрсіі',
'deletecomment' => 'Прычына:',
'deleteotherreason' => 'Іншая/дадатковая прычына:',
'deletereasonotherlist' => 'Іншая прычына',
'deletereason-dropdown' => '* Агульныя прычыны выдаленьня
** Запыт аўтара/аўтаркі
** Парушэньне аўтарскіх правоў
** Вандалізм',
'delete-edit-reasonlist' => 'Рэдагаваць прычыны выдаленьня',
'delete-toobig' => 'Гэтая старонка мае доўгую гісторыю рэдагаваньняў, болей за $1 {{PLURAL:$1|вэрсію|вэрсіі|вэрсіяў}}.
Выдаленьне такіх старонак было забароненае, каб пазьбегнуць праблемаў у працы {{GRAMMAR:родны|{{SITENAME}}}}.',
'delete-warning-toobig' => 'Гэтая старонка мае доўгую гісторыю рэдагаваньняў, больш за $1 {{PLURAL:$1|вэрсію|вэрсіі|вэрсіяў}}.
Яе выдаленьне можа выклікаць праблемы ў працы базы зьвестак {{GRAMMAR:родны|{{SITENAME}}}}; будзьце асьцярожны.',
# Rollback
'rollback' => 'Адкаціць рэдагаваньні',
'rollback_short' => 'Адкат',
'rollbacklink' => 'адкат',
'rollbacklinkcount' => 'адкаціць $1 {{PLURAL:$1|рэдагаваньне|рэдагаваньні|рэдагаваньняў}}',
'rollbacklinkcount-morethan' => 'адкаціць больш за $1 {{PLURAL:$1|рэдагаваньне|рэдагаваньні|рэдагаваньняў}}',
'rollbackfailed' => 'Памылка адкату',
'cantrollback' => 'Немагчыма адкаціць зьмену; апошні рэдактар — адзіны аўтар гэтай старонкі.',
'alreadyrolled' => 'Немагчыма адкаціць апошнюю зьмену [[:$1]], якую {{GENDER:$2|зрабіў|зрабіла}} [[User:$2|$2]] ([[User talk:$2|гутаркі]]{{int:pipe-separator}}[[Special:Contributions/$2|{{int:contribslink}}]]); нехта іншы ўжо зьмяніў старонку альбо адкаціў зьмены.
Апошнія зьмены зробленыя [[User:$3|$3]] ([[User talk:$3|гутаркі]]{{int:pipe-separator}}[[Special:Contributions/$3|{{int:contribslink}}]]).',
'editcomment' => "Кароткае апісаньне зьменаў было: «''$1''».",
'revertpage' => 'Рэдагаваньні [[Special:Contributions/$2|$2]] ([[User talk:$2|гутаркі]]) скасаваныя да папярэдняй вэрсіі [[User:$1|$1]]',
'revertpage-nouser' => 'Рэдагаваньні (імя ўдзельніка выдаленае) скасаваныя да папярэдняй вэрсіі [[User:$1|$1]]',
'rollback-success' => 'Адмененыя рэдагаваньні $1;
вернутая папярэдняя вэрсія $2.',
# Edit tokens
'sessionfailure-title' => 'Памылка сэсіі',
'sessionfailure' => 'Магчыма ўзьніклі праблемы ў Вашым цяперашнім сэансе працы;
гэта дзеяньне было скасавана для прадухіленьня перахопу сэансу.
Калі ласка, націсьніце «назад» і перазагрузіце старонку, зь якой Вы прыйшлі, і паспрабуйце ізноў.',
# Protect
'protectlogpage' => 'Журнал абаронаў',
'protectlogtext' => 'Ніжэй пададзены сьпіс зьменаў абароны старонкі.
Глядзіце [[Special:ProtectedPages|сьпіс абароненых старонак на цяперашні момант]].',
'protectedarticle' => 'абароненая «[[$1]]»',
'modifiedarticleprotection' => 'зьменены ўзровень абароны старонкі «[[$1]]»',
'unprotectedarticle' => 'зьнятая абарона з «[[$1]]»',
'movedarticleprotection' => 'перанесеныя налады абароны з «[[$2]]» на «[[$1]]»',
'protect-title' => 'Абарона «$1»',
'protect-title-notallowed' => 'Прагляд узроўню абароны «$1»',
'prot_1movedto2' => '[[$1]] перанесеная ў [[$2]]',
'protect-badnamespace-title' => 'Прастора назваў, у якой немагчыма абараняць старонкі',
'protect-badnamespace-text' => 'Старонкі ў гэтай прасторы назваў ня могуць быць абароненыя.',
'protect-legend' => 'Пацьверджаньне абароны',
'protectcomment' => 'Прычына:',
'protectexpiry' => 'Тэрмін:',
'protect_expiry_invalid' => 'Няслушны час сканчэньня абароны.',
'protect_expiry_old' => 'Тэрмін абароны прайшоў.',
'protect-unchain-permissions' => 'Выкарыстоўваць дадатковыя налады абароны',
'protect-text' => "Тут можна паглядзець і зьмяніць узровень абароны старонкі '''$1'''.",
'protect-locked-blocked' => "Вы ня можаце зьмяняць узровень абароны, пакуль Вы заблякаваны.
Цяперашнія налады для старонкі '''$1''':",
'protect-locked-dblock' => "Узровень абароны ня можа быць зьменены, таму што база зьвестак заблякаваная.
Цяперашнія налады для старонкі '''$1''':",
'protect-locked-access' => "Вы ня маеце правоў для зьмены ўзроўню абароны старонкі.
Цяперашнія налады для старонкі '''$1''':",
'protect-cascadeon' => 'Гэтая старонка часова абароненая, таму што яна ўключаная ў {{PLURAL:$1|наступную старонку, якая абароненая|наступныя старонкі, якія абароненыя|наступныя старонкі, якія абароненыя}} каскаднай абаронай.
Вы можаце зьмяніць узровень абароны, але гэта не паўплывае на каскадную абарону.',
'protect-default' => 'Дазволіць усім удзельнікам',
'protect-fallback' => 'Дазволіць толькі ўдзельнікам з дазволам «$1»',
'protect-level-autoconfirmed' => 'Дазволіць толькі аўтаматычна пацьверджаным',
'protect-level-sysop' => 'Дазволіць толькі адміністратарам',
'protect-summary-cascade' => 'каскадная',
'protect-expiring' => 'сканчаецца $1 (UTC)',
'protect-expiring-local' => 'канчаецца $1',
'protect-expiry-indefinite' => 'бестэрмінова',
'protect-cascade' => 'Абараняць старонкі, якія ўключаныя ў гэтую старонку (каскадная абарона)',
'protect-cantedit' => 'Вы ня можаце зьмяніць узровень абароны гэтай старонкі, таму што Вы ня маеце дазволу на яе рэдагаваньне.',
'protect-othertime' => 'Іншы тэрмін:',
'protect-othertime-op' => 'іншы тэрмін',
'protect-existing-expiry' => 'Наяўны час сканчэньня: $3, $2',
'protect-otherreason' => 'Іншая/дадатковая прычына:',
'protect-otherreason-op' => 'Іншая прычына',
'protect-dropdown' => '*Звычайныя прычыны абароны
** Часты вандалізм
** Празьмерны спам
** Непрадуктыўная вайна рэдагаваньняў
** Папулярная старонка',
'protect-edit-reasonlist' => 'Рэдагаваць прычыны абароны',
'protect-expiry-options' => '1 гадзіна:1 hour,1 дзень:1 day,1 тыдзень:1 week,2 тыдні:2 weeks,1 месяц:1 month,3 месяцы:3 months,6 месяцаў:6 months,1 год:1 year,назаўсёды:infinite',
'restriction-type' => 'Дазвол:',
'restriction-level' => 'Узровень абмежаваньня:',
'minimum-size' => 'Мінімальны памер',
'maximum-size' => 'Максымальны памер:',
'pagesize' => '(у байтах)',
# Restrictions (nouns)
'restriction-edit' => 'Рэдагаваньне',
'restriction-move' => 'Перанос',
'restriction-create' => 'Стварэньне',
'restriction-upload' => 'Загрузка',
# Restriction levels
'restriction-level-sysop' => 'поўнасьцю абароненая',
'restriction-level-autoconfirmed' => 'часткова абароненая',
'restriction-level-all' => 'усе ўзроўні',
# Undelete
'undelete' => 'Паказаць выдаленыя старонкі',
'undeletepage' => 'Прагляд і аднаўленьне выдаленых старонак',
'undeletepagetitle' => "'''Ніжэй паданыя выдаленыя вэрсіі [[:$1|$1]]'''.",
'viewdeletedpage' => 'Паказаць выдаленыя старонкі',
'undeletepagetext' => '{{PLURAL:$1|Наступная старонка была выдаленая, але яна знаходзяцца ў архіве і можа быць адноўленая|Наступныя старонкі былі выдаленыя, але яны знаходзяцца ў архіве і могуць быць адноўленыя}}.
Архіў пэрыядычна чысьціцца.',
'undelete-fieldset-title' => 'Аднавіць вэрсіі',
'undeleteextrahelp' => "Для поўнага аднаўленьня гісторыі рэдагаваньня старонкі, пакіньце ўсе адзнакі нявызначнымі і націсьніце '''''{{int:undeletebtn}}'''''.
Для частковага аднаўленьня, пазначце тыя вэрсіі старонкі, якія трэба аднавіць і націсьніце '''''{{int:undeletebtn}}'''''.",
'undeleterevisions' => 'У архіве $1 {{PLURAL:$1|вэрсія|вэрсіі|вэрсіяў}}',
'undeletehistory' => 'Калі Вы адновіце старонку, будуць адноўленыя ўсе яе вэрсіі разам з журналам падзеяў.
Калі пасьля выдаленьня была створаная новая старонка з такой жа назвай, адноўленыя вэрсіі зьявяцца ў гісторыі перад новымі вэрсіямі.',
'undeleterevdel' => 'Аднаўленьня не адбудзецца, калі ў яго выніку будзе выдаленая апошняя вэрсія старонкі ці файла.
У гэтым выпадку, Вам трэба зьняць адзнакі, ці паказаць апошнія выдаленыя вэрсіі.',
'undeletehistorynoadmin' => 'Гэтая старонка была выдаленая.
Прычына выдаленьня пададзена ніжэй, разам са зьвесткамі ўдзельніка, які рэдагаваў старонку перад выдаленьнем.
Тэкст выдаленай старонкі могуць глядзець толькі адміністратары.',
'undelete-revision' => 'Выдаленая вэрсія $1 (ад $5 $4) ўдзельніка $3:',
'undeleterevision-missing' => 'Некарэктная ці неіснуючая вэрсія.
Верагодна Вы карысталіся няслушнай спасылкай, альбо, магчыма, вэрсія была выдаленая з архіву.',
'undelete-nodiff' => 'Папярэдняя вэрсія ня знойдзеная.',
'undeletebtn' => 'Аднавіць',
'undeletelink' => 'паглядзець/аднавіць',
'undeleteviewlink' => 'паказаць',
'undeletereset' => 'Скінуць',
'undeleteinvert' => 'Адваротны выбар',
'undeletecomment' => 'Прычына:',
'undeletedrevisions' => '{{PLURAL:$1|адноўленая $1 вэрсія|адноўленыя $1 вэрсіі|адноўленыя $1 вэрсіяў}}',
'undeletedrevisions-files' => 'адноўленыя $1 {{PLURAL:$1|вэрсія|вэрсіі|вэрсіяў}} і $2 {{PLURAL:$2|файл|файлы|файлаў}}',
'undeletedfiles' => '{{PLURAL:$1|адноўлены $1 файл|адноўленыя $1 файлы|адноўленыя $1 файлаў}}',
'cannotundelete' => 'Аднаўленьне не адбылося; нехта іншы мог пасьпець аднавіць старонку раней.',
'undeletedpage' => "'''Старонка $1 была адноўленая'''
Глядзіце [[Special:Log/delete|журнал выдаленьняў]] для прагляду апошніх выдаленьняў і аднаўненьняў.",
'undelete-header' => 'Глядзіце [[Special:Log/delete|журнал выдаленьняў]] для прагляду апошніх выдаленьняў.',
'undelete-search-title' => 'Пошук выдаленых старонак',
'undelete-search-box' => 'Пошук выдаленых старонак',
'undelete-search-prefix' => 'Паказаць старонкі, назвы якіх пачынаюцца з:',
'undelete-search-submit' => 'Паказаць',
'undelete-no-results' => 'У архіве выдаленьняў ня знойдзеныя адпаведныя старонкі.',
'undelete-filename-mismatch' => 'Немагчыма аднавіць вэрсію файла з датай $1: несупадзеньне назвы файла',
'undelete-bad-store-key' => 'Немагчыма аднавіць вэрсію файла з датай $1: файл адсутнічаў да выдаленьня.',
'undelete-cleanup-error' => 'Памылка выдаленьня архіўнага файла «$1», які не выкарыстоўваўся.',
'undelete-missing-filearchive' => 'Немагчыма аднавіць файл з ідэнтыфікатарам $1, таму што ён адсутнічае ў базе зьвестак.
Магчыма ён быў ужо адноўлены.',
'undelete-error' => 'Памылка аднаўленьня старонкі',
'undelete-error-short' => 'Памылка аднаўленьня файла: $1',
'undelete-error-long' => 'Пад час аднаўленьня файла адбыліся памылкі:
$1',
'undelete-show-file-confirm' => 'Вы ўпэўненыя, што жадаеце паглядзець выдаленую вэрсію файла «<nowiki>$1</nowiki>» ад $2 $3?',
'undelete-show-file-submit' => 'Так',
# Namespace form on various pages
'namespace' => 'Прастора назваў:',
'invert' => 'Адваротны выбар',
'tooltip-invert' => 'Пазначце гэтае поле каб схаваць зьмены ў старонках з выбранай прасторы назваў (і зьвязнай прасторы назваў, калі пазначана)',
'namespace_association' => 'Зьвязаная прастора назваў',
'tooltip-namespace_association' => 'Пазначце гэтае поле каб уключыць простору назваў абмеркаваньняў (альбо прадметную), зьвязаных з выбранай прасторай назваў',
'blanknamespace' => '(Асноўная)',
# Contributions
'contributions' => 'Унёсак',
'contributions-title' => 'Унёсак {{GENDER:$1|удзельніка|удзельніцы}} $1',
'mycontris' => 'Унёсак',
'contribsub2' => 'Для $1 ($2)',
'nocontribs' => 'Ня знойдзена зьменаў, якія адпавядаюць гэтым крытэрыям.',
'uctop' => ' (апошняя)',
'month' => 'Ад месяца (і раней):',
'year' => 'Ад году (і раней):',
'sp-contributions-newbies' => 'Паказаць унёсак толькі з новых рахункаў',
'sp-contributions-newbies-sub' => 'Унёсак пачынаючых',
'sp-contributions-newbies-title' => 'Унёсак удзельнікаў з новых рахункаў',
'sp-contributions-blocklog' => 'журнал блякаваньняў',
'sp-contributions-deleted' => 'выдалены ўнёсак удзельніка',
'sp-contributions-uploads' => 'загрузкі',
'sp-contributions-logs' => 'журналы падзеяў',
'sp-contributions-talk' => 'гутаркі',
'sp-contributions-userrights' => 'кіраваньне правамі ўдзельнікаў і ўдзельніц',
'sp-contributions-blocked-notice' => '{{GENDER:$1|Гэты ўдзельнік у дадзены момант заблякаваны|Гэтая ўдзельніца ў дадзены момант заблякаваная}}. Апошні запіс з журнала блякаваньняў пададзены ніжэй для даведкі:',
'sp-contributions-blocked-notice-anon' => 'Гэты IP-адрас у дадзены момант заблякаваны.
Апошні запіс з журнала блякаваньняў пададзены ніжэй для даведкі:',
'sp-contributions-search' => 'Пошук унёску',
'sp-contributions-username' => 'IP-адрас альбо імя ўдзельніка/ўдзельніцы:',
'sp-contributions-toponly' => 'Паказваць толькі зьмены, якія зьяўляюцца апошнімі вэрсіямі',
'sp-contributions-submit' => 'Шукаць',
# What links here
'whatlinkshere' => 'Спасылкі на старонку',
'whatlinkshere-title' => 'Старонкі, якія спасылаюцца на $1',
'whatlinkshere-page' => 'Старонка:',
'linkshere' => "Наступныя старонкі спасылаюцца на '''[[:$1]]''':",
'nolinkshere' => "Ніводная старонка не спасылаецца на '''[[:$1]]'''.",
'nolinkshere-ns' => "Ніводная старонка не спасылаецца на '''[[:$1]]''' з выбранай прасторы назваў.",
'isredirect' => 'старонка-перанакіраваньне',
'istemplate' => 'уключэньне',
'isimage' => 'спасылка на файл',
'whatlinkshere-prev' => '{{PLURAL:$1|папярэдняя|папярэднія|папярэднія}} $1',
'whatlinkshere-next' => '{{PLURAL:$1|наступная|наступныя|наступныя}} $1',
'whatlinkshere-links' => '← спасылкі',
'whatlinkshere-hideredirs' => '$1 перанакіраваньні',
'whatlinkshere-hidetrans' => '$1 уключэньні',
'whatlinkshere-hidelinks' => '$1 спасылкі',
'whatlinkshere-hideimages' => '$1 спасылкі на выявы',
'whatlinkshere-filters' => 'Фільтры',
# Block/unblock
'autoblockid' => 'Аўтаматычнае блякаваньне №$1',
'block' => 'Заблякаваць удзельніка',
'unblock' => 'Разблякаваць удзельніка',
'blockip' => 'Заблякаваць',
'blockip-title' => 'Блякаваньне ўдзельнікаў',
'blockip-legend' => 'Заблякаваць удзельніка',
'blockiptext' => 'Наступная форма дазваляе заблякаваць магчымасьць рэдагаваньня з пэўнага IP-адрасу альбо імя ўдзельніка. Гэта трэба рабіць толькі дзеля прадухіленьня вандалізму і згодна з [[{{MediaWiki:Policy-url}}|правіламі]]. Пазначце ніжэй дакладную прычыну (напрыклад, пералічыце асобныя старонкі, на якіх былі парушэньні).',
'ipadressorusername' => 'IP-адрас альбо імя ўдзельніка/ўдзельніцы:',
'ipbexpiry' => 'Тэрмін:',
'ipbreason' => 'Прычына:',
'ipbreasonotherlist' => 'Іншая прычына',
'ipbreason-dropdown' => '* Агульныя прычыны блякаваньняў
** Даданьне ілжывай інфармацыі
** Выдаленьне зьместу старонак
** Спам
** Даданьне бязглузьдзіцы
** Абразы/пагрозы
** Злоўжываньне некалькімі рахункамі
** Недапушчальнае імя ўдзельніка',
'ipb-hardblock' => 'Забараніць увайшоўшым удзельнікам рэдагаваць з гэтага IP-адрасу',
'ipbcreateaccount' => 'Забараніць стварэньне рахункаў',
'ipbemailban' => 'Забараніць удзельніку дасылаць лісты па электроннай пошце',
'ipbenableautoblock' => 'Аўтаматычна блякаваць апошні IP-адрас гэтага ўдзельніка, і ўсіх наступных IP-адрасоў зь якіх ён будзе спрабаваць рэдагаваць',
'ipbsubmit' => 'Заблякаваць гэтага ўдзельніка',
'ipbother' => 'Іншы тэрмін:',
'ipboptions' => '2 гадзіны:2 hours,1 дзень:1 day,3 дні:3 days,1 тыдзень:1 week,2 тыдні:2 weeks,1 месяц:1 month,3 месяцы:3 months,6 месяцаў:6 months,1 год:1 year,назаўсёды:infinite',
'ipbotheroption' => 'іншы',
'ipbotherreason' => 'Іншая/дадатковая прычына:',
'ipbhidename' => 'Схаваць імя ўдзельніка ў рэдагаваньнях і сьпісах',
'ipbwatchuser' => 'Назіраць за старонкай удзельніка і яго гутаркамі',
'ipb-disableusertalk' => 'Забараніць удзельніку рэдагаваньне ўласнай старонкі гутарак падчас блякаваньня',
'ipb-change-block' => 'Зьмяніць парамэтры блякаваньня',
'ipb-confirm' => 'Пацьвердзіць блякаваньне',
'badipaddress' => 'Некарэктны IP-адрас',
'blockipsuccesssub' => 'Блякаваньне пасьпяховае',
'blockipsuccesstext' => '[[Special:Contributions/$1|$1]] {{GENDER:$1|быў заблякаваны|была заблякаваная}}.<br />
Глядзіце [[Special:BlockList|сьпіс блякаваньняў]] дзеля іх перагляду.',
'ipb-blockingself' => 'Вы зьбіраецеся заблякаваць самога сябе! Вы ўпэўнены, што жадаеце гэта зрабіць?',
'ipb-confirmhideuser' => 'Вы зьбіраецеся заблякаваць удзельніка са статусам «схаваны». Гэтае дзеяньне прывядзе да таго, што яго імя зьявіцца ва ўсіх сьпісах і журналах уваходу. Вы ўпэўнены, што жадаеце гэта зрабіць?',
'ipb-edit-dropdown' => 'Рэдагаваць прычыны блякіровак',
'ipb-unblock-addr' => 'Разблякаваць $1',
'ipb-unblock' => 'Разблякаваць рахунак ўдзельніка ці IP-адрас',
'ipb-blocklist' => 'Паказаць існуючыя блякаваньні',
'ipb-blocklist-contribs' => 'Унёсак $1',
'unblockip' => 'Разблякаваць удзельніка',
'unblockiptext' => 'Карыстайцеся пададзенай ніжэй формай для аднаўленьня магчымасьці рэдагаваньня для раней заблякаванага IP-адрасу альбо рахунку ўдзельніка.',
'ipusubmit' => 'Зьняць гэта блякаваньне',
'unblocked' => '[[User:$1|$1]] быў разблякаваны.',
'unblocked-range' => '$1 быў разблякаваны',
'unblocked-id' => 'Блякаваньне $1 зьнятае',
'blocklist' => 'Заблякаваныя ўдзельнікі',
'ipblocklist' => 'Заблякаваныя ўдзельнікі',
'ipblocklist-legend' => 'Пошук заблякаванага ўдзельніка',
'blocklist-userblocks' => 'Схаваць блякаваньні рахункаў',
'blocklist-tempblocks' => 'Схаваць часовыя блякаваньні',
'blocklist-addressblocks' => 'Схаваць блякаваньні асобных IP-адрасоў',
'blocklist-rangeblocks' => 'хаваньне блякаваньняў дыяпазонаў',
'blocklist-timestamp' => 'Дата/час',
'blocklist-target' => 'Мэта',
'blocklist-expiry' => 'Сканчаецца',
'blocklist-by' => 'Адміністратар, які заблякаваў',
'blocklist-params' => 'Парамэтры блякаваньня',
'blocklist-reason' => 'Прычына',
'ipblocklist-submit' => 'Шукаць',
'ipblocklist-localblock' => 'Лякальнае блякаваньне',
'ipblocklist-otherblocks' => '{{PLURAL:$1|Іншае блякаваньне|Іншыя блякаваньні}}',
'infiniteblock' => 'назаўсёды',
'expiringblock' => 'канчаецца $1 $2',
'anononlyblock' => 'толькі ананімаў',
'noautoblockblock' => 'аўтаматычнае блякаваньне адключанае',
'createaccountblock' => 'стварэньне рахунку заблякаванае',
'emailblock' => 'дасылка лістоў забароненая',
'blocklist-nousertalk' => 'ня можа рэдагаваць уласную старонку гутарак',
'ipblocklist-empty' => 'Сьпіс блякаваньняў пусты.',
'ipblocklist-no-results' => 'Паданы IP-адрас альбо імя ўдзельніка не заблякаваныя.',
'blocklink' => 'заблякаваць',
'unblocklink' => 'разблякаваць',
'change-blocklink' => 'зьмяніць блякаваньне',
'contribslink' => 'унёсак',
'emaillink' => 'даслаць ліст',
'autoblocker' => "Вы аўтаматычна заблякаваныя, таму што Ваш IP-адрас нядаўна ўжываўся «[[User:$1|$1]]». Прычына блякаваньня $1 наступная: «'''$2'''»",
'blocklogpage' => 'Журнал блякаваньняў',
'blocklog-showlog' => 'Гэты ўдзельнік ужо заблякаваны. Журнал блякаваньняў пададзены ніжэй:',
'blocklog-showsuppresslog' => 'Гэты ўдзельнік ужо заблякаваны і схаваны. Журнал хаваньняў пададзены ніжэй:',
'blocklogentry' => 'заблякаваны [[$1]] на тэрмін: $2 $3',
'reblock-logentry' => 'зьмененыя парамэтры блякаваньня для [[$1]] на тэрмін: з $2 да $3',
'blocklogtext' => 'Гэта журнал уліку блякаваньняў і разблякаваньняў удзельнікаў.
Аўтаматычна заблякаваныя IP-адрасы не пазначаныя.
Глядзіце [[Special:BlockList|сьпіс блякаваньняў]], каб пабачыць дзейныя ў гэты момант блякаваньні.',
'unblocklogentry' => 'разблякаваны $1',
'block-log-flags-anononly' => 'толькі ананімныя ўдзельнікі',
'block-log-flags-nocreate' => 'стварэньне рахункаў забароненае',
'block-log-flags-noautoblock' => 'аўтаматычнае блякаваньне адключанае',
'block-log-flags-noemail' => 'электронная пошта заблякаваная',
'block-log-flags-nousertalk' => 'ня можа рэдагаваць уласную старонку гутарак',
'block-log-flags-angry-autoblock' => 'уключанае палепшанае аўтаблякаваньне',
'block-log-flags-hiddenname' => 'імя ўдзельніка схаванае',
'range_block_disabled' => 'Адміністратарам забаронена блякаваць дыяпазоны.',
'ipb_expiry_invalid' => 'Няслушны тэрмін блякаваньня.',
'ipb_expiry_temp' => 'Блякаваньні са схаваньнем імя ўдзельніка павінны быць бестэрміновымі.',
'ipb_hide_invalid' => 'Немагчыма схаваць гэты рахунак; верагодна зь яго зроблена зашмат рэдагаваньняў.',
'ipb_already_blocked' => '«$1» ужо заблякаваны',
'ipb-needreblock' => '$1 ужо заблякаваны. Вы жадаеце зьмяніць парамэтры?',
'ipb-otherblocks-header' => '{{PLURAL:$1|Іншае блякаваньне|Іншыя блякаваньні}}',
'unblock-hideuser' => 'Вы ня можаце разблякаваць гэтага ўдзельніка, таму што яго імя было схаванае.',
'ipb_cant_unblock' => 'Памылка: ID блякаваньня $1 ня знойдзена. Верагодна яно было ўжо зьнятае.',
'ipb_blocked_as_range' => 'Памылка: IP-адрас $1 быў заблякаваны наўпрост і ня можа быць разблякаваны.
Тым ня менш, ён належыць да дыяпазону $2, які можа быць разблякаваны.',
'ip_range_invalid' => 'Некарэктны дыяпазон IP-адрасоў.',
'ip_range_toolarge' => 'Блякаваньні дыяпазонаў, большых за /$1, не дазволеныя.',
'blockme' => 'Заблякуйце мяне',
'proxyblocker' => 'Блякаваньне проксі',
'proxyblocker-disabled' => 'Гэта функцыя выключаная.',
'proxyblockreason' => "Ваш IP-адрас быў заблякаваны таму што ён належыць адкрытаму проксі.
Калі ласка, зьвяжыцеся з Вашым Інтэрнэт-правайдарам альбо са службай тэхнічнай падтрымкі і паведаміце ім пра гэтую сур'ёзную праблему бясьпекі.",
'proxyblocksuccess' => 'Зроблена.',
'sorbsreason' => 'Ваш IP-адрас знаходзіцца ў сьпісе адкрытых проксі ў DNSBL, якім карыстаецца {{SITENAME}}.',
'sorbs_create_account_reason' => 'Ваш IP-адрас знаходзіцца ў сьпісе адкрытых проксі ў DNSBL, якім карыстаецца {{SITENAME}}.
Вы ня зможаце стварыць рахунак',
'cant-block-while-blocked' => 'Вы ня можаце блякаваць іншых удзельнікаў, пакуль Вы самі заблякаваныя.',
'cant-see-hidden-user' => 'Удзельнік, якога Вы спрабуеце заблякаваць, ужо заблякаваны і схаваны. З-за таго, што Вы ня маеце правоў хаваньня ўдзельнікаў, Вы ня можаце бачыць альбо зьмяняць блякаваньне удзельніка.',
'ipbblocked' => 'Вы ня можаце блякаваць ці раблякоўваць іншых удзельнікаў, таму што заблякаваныя самі',
'ipbnounblockself' => 'Вы ня можаце раблякоўваць сябе',
# Developer tools
'lockdb' => 'Заблякаваць базу зьвестак',
'unlockdb' => 'Разблякаваць базу зьвестак',
'lockdbtext' => 'Блякаваньне базы зьвестак прыпыніць для ўсіх удзельнікаў магчымасьць рэдагаваць старонкі, зьмяняць налады, рэдагаваць сьпісы назіраньня, і іншыя дзеяньні, якія патрабуюць доступ да базы зьвестак.
Калі ласка, пацьвердзіце, што гэта тое, што Вы зьбіраецеся зрабіць, і што Вы здыміце блякаваньне базы зьвестак, адразу пасьля сканчэньня абслугоўваньня.',
'unlockdbtext' => 'Разблякаваньне базы зьвестак адновіць для ўсіх удзельнікаў магчымасьць рэдагаваць старонкі, зьмяняць налады, рэдагаваць сьпісы назіраньня, і іншыя дзеяньні, якія патрабуюць доступ да базы зьвестак.
Калі ласка, пацьвердзіце, што гэта тое, што Вы зьбіраецеся зрабіць.',
'lockconfirm' => 'Так, я сапраўды жадаю заблякаваць базу зьвестак.',
'unlockconfirm' => 'Так, я сапраўды жадаю разблякаваць базу зьвестак.',
'lockbtn' => 'Заблякаваць базу зьвестак',
'unlockbtn' => 'Разблякаваць базу зьвестак',
'locknoconfirm' => 'Вы не пазначылі пацьверджаньне.',
'lockdbsuccesssub' => 'База зьвестак заблякаваная',
'unlockdbsuccesssub' => 'База зьвестак разблякаваная',
'lockdbsuccesstext' => 'База зьвестак была заблякаваная.<br />
Не забудзьцеся [[Special:UnlockDB|зьняць блякаваньне]] пасьля сканчэньня абслугоўваньня.',
'unlockdbsuccesstext' => 'База зьвестак была разблякаваная.',
'lockfilenotwritable' => 'Немагчыма запісаць у файл блякаваньняў базы зьвестак.
Блякаваньне ці разблякаваньне базы зьвестак патрабуе, каб вэб-сэрвэр меў дазвол на запіс у гэты файл.',
'databasenotlocked' => 'База зьвестак не заблякаваная.',
'lockedbyandtime' => '($1 $2 у $3)',
# Move page
'move-page' => 'Перанесьці $1',
'move-page-legend' => 'Перанесьці старонку',
'movepagetext' => "З дапамогай гэтай формы Вы можаце перанесьці старонку, і разам зь ёй усю гісторыю.
Старая назва будзе перанакіроўваць на новую.
Вы можаце аўтаматычна абнавіць перанакіраваньні на першапачатковую назву.
Калі вы адмовіцеся, упэўніцеся ў адсутнасьці [[Special:DoubleRedirects|падвойных]] ці [[Special:BrokenRedirects|няслушных перанакіраваньняў]].
Адказнасьць за дакладнасьць спасылак ляжыць на тым, хто перанёс старонку.
Заўважце, што старонка '''ня будзе''' перанесеная, калі пад новай назвай ужо існуе іншая старонка, за выключэньнем выпадкаў, калі яна пустая альбо зьяўляецца перанакіраваньнем і ня мае гісторыі рэдагаваньняў. Гэта азначае, што існуе магчымасьць скасаваць зьмену назвы, калі Вы памыліліся, але немагчыма выдаліць існую старонку.
'''Увага!'''
Зьмена назвы папулярных старонак можна стацца вельмі нечаканай і рэзкай;
калі ласка, упэўніцеся, што Вы разумееце наступствы такіх зьменаў.",
'movepagetext-noredirectfixer' => "Скарыстаўшыся гэтай формай, Вы перанесяце старонку з усёй гісторыяй зьменаў да новай назвы.
Старонка са старой назвай будзе перанакіроўваць на старонку з новай.
Калі ласка, праверце існаваньне [[Special:DoubleRedirects|падвоеных]] і [[Special:BrokenRedirects|няслушных перанакіраваньняў]].
Вы адказныя за тое, каб спасылкі працягвалі весьці туды, куды яны павінны.
Заўважце, калі ласка, што старонка '''ня будзе''' перанесеная, калі ўжо існуе старонка з новай назвай, акрамя выпадкаў, калі яна пустая ці зьмяшчае перанакіраваньне, а таксама ня мае папярэдняй гісторыі рэдагаваньняў.
Гэта значыць, што Вы можаце перанесьці старонку назад, калі зробіце памылку, але ня можаце выпадкова перазапісаць існуючую старонку.
'''Папярэджаньне!'''
Перанос можа быць маштабным і нечаканым для ''папулярных'' старонак.
Упэўніцеся, калі ласка, што Вы разумееце ўсе магчымыя наступствы пераносу.",
'movepagetalktext' => "Старонка абмеркаваньня будзе перанесеная разам з асноўнай старонкай, '''за выключэньнем:'''
* Не пустая старонка абмеркаваньня ўжо існуе пад новай назвай, альбо
* Вы не паставілі адзнаку ў полі ніжэй.
У такіх выпадках Вы можаце перанесьці ці аб’яднаць старонку абмеркаваньня самастойна.",
'movearticle' => 'Перанесьці старонку:',
'moveuserpage-warning' => "'''Папярэджаньне:''' Вы зьбіраецеся перанесьці старонку ўдзельніка. Калі ласка заўважце, што старонка будзе перанесеная, але імя ўдзельніка ''ня'' будзе зьмененае.",
'movenologin' => 'Вы не ўвайшлі ў сыстэму',
'movenologintext' => 'Вам неабходна [[Special:UserLogin|ўвайсьці ў сыстэму]], каб перанесьці старонкі.',
'movenotallowed' => 'Вы ня маеце дазволу на перанос старонак.',
'movenotallowedfile' => 'Вы ня маеце правоў на перайменаваньне файлаў.',
'cant-move-user-page' => 'Вы ня маеце правоў для пераносу старонак удзельнікаў (апрача падстаронак).',
'cant-move-to-user-page' => 'Вы ня маеце правоў для пераносу старонкі ў прастору ўдзельніка (апрача падстаронак).',
'newtitle' => 'Новая назва:',
'move-watch' => 'Назіраць за гэтай старонкай',
'movepagebtn' => 'Перанесьці старонку',
'pagemovedsub' => 'Пасьпяховы перанос',
'movepage-moved' => "'''Старонка «$1» была перанесеная ў «$2»'''",
'movepage-moved-redirect' => 'Перанакіраваньне было створана.',
'movepage-moved-noredirect' => 'Перанакіраваньне не было створанае.',
'articleexists' => 'Старонка з такой назвай ужо існуе, альбо абраная Вамі назва недапушчальная. Калі ласка, абярыце іншую назву.',
'cantmove-titleprotected' => 'Немагчыма перанесьці старонку, таму што новая назва знаходзіцца ў сьпісе забароненых',
'talkexists' => "'''Старонка пасьпяхова перанесеная, але не атрымалася перанесьці старонку абмеркаваньня, таму што старонка з такой назвай ужо існуе. Калі ласка, аб'яднайце тэксты самастойна.'''",
'movedto' => 'перанесеная ў',
'movetalk' => 'Перанесьці таксама старонку абмеркаваньня',
'move-subpages' => 'Перанесьці ўсе падстаронкі (да $1)',
'move-talk-subpages' => 'Перанесьці ўсе падстаронкі старонкі абмеркаваньня (да $1)',
'movepage-page-exists' => 'Старонка $1 ужо існуе і ня можа быць перапісана аўтаматычна.',
'movepage-page-moved' => 'Старонка $1 перанесеная ў $2.',
'movepage-page-unmoved' => 'Старонка $1 ня можа быць перанесеная ў $2.',
'movepage-max-pages' => '$1 {{PLURAL:$1|старонка была перанесеная|старонкі былі перанесеныя|старонак былі перанесеныя}} — гэта дазволены максымум, больш аўтаматычных пераносаў ня будзе.',
'movelogpage' => 'Журнал пераносаў',
'movelogpagetext' => 'Ніжэй пададзены сьпіс перанесеных старонак.',
'movesubpage' => '{{PLURAL:$1|Падстаронка|Падстаронкі}}',
'movesubpagetext' => 'Гэтая старонка мае $1 {{PLURAL:$1|падстаронку|падстаронкі|падстаронак}}, {{PLURAL:$1|якая паказаная ніжэй|якія паказаныя ніжэй}}.',
'movenosubpage' => 'Гэтая старонка ня мае падстаронак.',
'movereason' => 'Прычына:',
'revertmove' => 'адкат',
'delete_and_move' => 'Выдаліць і перанесьці',
'delete_and_move_text' => '==Патрабуецца выдаленьне==
Мэтавая старонка «[[:$1]]» ужо існуе.
Ці жадаеце Вы яе выдаліць, каб вызваліць месца для пераносу?',
'delete_and_move_confirm' => 'Так, выдаліць старонку',
'delete_and_move_reason' => 'Выдаленая, каб вызваліць месца для пераносу «[[$1]]»',
'selfmove' => 'Крынічная і мэтавая назвы супадаюць;
немагчыма перанесьці старонку саму на сябе.',
'immobile-source-namespace' => 'Немагчыма пераносіць старонкі ў прасторы назваў «$1»',
'immobile-target-namespace' => 'Немагчыма пераносіць старонкі ў прастору назваў «$1»',
'immobile-target-namespace-iw' => 'Інтэрвікі-спасылка — няслушная назва для пераносу старонкі.',
'immobile-source-page' => 'Гэтую старонку нельга пераносіць.',
'immobile-target-page' => 'Немагчыма перанесьці старонку пад гэтую назву.',
'imagenocrossnamespace' => 'Нельга перанесьці файл у ня-файлавую прастору назваў',
'nonfile-cannot-move-to-file' => 'Нельга перанесьці ня файл у прастору назваў файлаў',
'imagetypemismatch' => 'Новае пашырэньне файла не адпавядае яго тыпу',
'imageinvalidfilename' => 'Няслушная назва мэтавага файла',
'fix-double-redirects' => 'Абнавіць усе перанакіраваньні на першапачатковую назву',
'move-leave-redirect' => 'Пакінуць перанакіраваньне',
'protectedpagemovewarning' => "'''Папярэджаньне:''' Гэтая старонка была абароненая, і яе могуць пераносіць толькі ўдзельнікі з правамі адміністратара.
Апошні запіс з журнала пададзены ніжэй для даведкі:",
'semiprotectedpagemovewarning' => "'''Заўвага:''' Гэта старонка была абароненая, і яе могуць пераносіць толькі зарэгістраваныя ўдзельнікі.
Апошні запіс з журнала пададзены ніжэй для даведкі:",
'move-over-sharedrepo' => '== Файл існуе ==
[[:$1]] існуе ў агульным сховішчы. Перайменаваньне файла ў гэтую назву закрые агульны файл.',
'file-exists-sharedrepo' => 'Выбраная назва файла ўжо выкарыстоўваецца ў агульным сховішчы.
Калі ласка, выберыце іншую назву.',
# Export
'export' => 'Экспартаваць старонкі',
'exporttext' => 'Вы можаце экспартаваць тэкст і гісторыю рэдагаваньняў асобнай старонкі ці набору старонак у XML-фармаце.
Гэта потым можа быць імпартаванае ў іншую вікі, якая выкарыстоўвае MediaWiki праз [[Special:Import|старонку імпартаваньня]].
Каб экспартаваць старонкі, увядзіце назвы старонак у тэкставае поле ніжэй, адну назву ў адзін радок, і абярыце жадаеце Вы цяперашнюю вэрсію разам з усімі папярэднімі вэрсіямі і гісторыяй рэдагаваньняў, ці толькі цяперашнюю вэрсію з інфармацыяй пра апошняе рэдагаваньне.
У апошнім выпадку Вы можаце таксама скарыстацца спасылкай, напрыклад, [[{{#Special:Export}}/{{MediaWiki:Mainpage}}]] для «[[{{MediaWiki:Mainpage}}]]».',
'exportall' => 'Экспартаваць усе старонкі',
'exportcuronly' => 'Экспартаваць толькі цяперашнюю вэрсію, бяз поўнай гісторыі',
'exportnohistory' => "----
'''Заўвага:''' экспартаваньне поўнай гісторыі старонак з дапамогай гэтай формы было адключанае праз прычыны прадукцыйнасьці сыстэмы.",
'exportlistauthors' => 'Дадае поўны сьпіс аўтараў для кожнай старонкі',
'export-submit' => 'Экспартаваць',
'export-addcattext' => 'Дадаць старонкі з катэгорыі:',
'export-addcat' => 'Дадаць',
'export-addnstext' => 'Дадаць старонкі з прасторы назваў:',
'export-addns' => 'Дадаць',
'export-download' => 'Захаваць як файл',
'export-templates' => 'Разам з шаблёнамі',
'export-pagelinks' => 'Уключыць зьвязаныя старонкі да глыбіні:',
# Namespace 8 related
'allmessages' => 'Сыстэмныя паведамленьні',
'allmessagesname' => 'Назва',
'allmessagesdefault' => 'Тэкст па змоўчаньні',
'allmessagescurrent' => 'Цяперашні тэкст',
'allmessagestext' => 'Сьпіс усіх сыстэмных паведамленьняў, якія існуюць у прасторы назваў MediaWiki.
Калі ласка, наведайце [//www.mediawiki.org/wiki/Localisation старонку пра лякалізацыю MediaWiki] і [//translatewiki.net translatewiki.net], калі Вы жадаеце ўдзельнічаць у перакладзе MediaWiki.',
'allmessagesnotsupportedDB' => "'''{{ns:special}}:AllMessages''' не падтрымліваецца, таму што адключанае '''\$wgUseDatabaseMessages'''.",
'allmessages-filter-legend' => 'Фільтар',
'allmessages-filter' => 'Фільтар па стане зьменаў:',
'allmessages-filter-unmodified' => 'Ня зьмененыя',
'allmessages-filter-all' => 'Усе',
'allmessages-filter-modified' => 'Зьмененыя',
'allmessages-prefix' => 'Фільтар па прэфіксе:',
'allmessages-language' => 'Мова:',
'allmessages-filter-submit' => 'Паказаць',
# Thumbnails
'thumbnail-more' => 'Павялічыць',
'filemissing' => 'Файл адсутны',
'thumbnail_error' => 'Памылка стварэньня мініятуры: $1',
'djvu_page_error' => 'Старонка DjVu па-за прамежкам',
'djvu_no_xml' => 'Немагчыма атрымаць XML для DjVu-файла',
'thumbnail-temp-create' => 'Немагчыма стварыць часовы файл мініятуры',
'thumbnail-dest-create' => 'Немагчыма захаваць мініятуру ў месцы прызначэньня',
'thumbnail_invalid_params' => 'Няслушныя парамэтры мініятуры',
'thumbnail_dest_directory' => 'Немагчыма стварыць мэтавую дырэкторыю',
'thumbnail_image-type' => 'Тып выявы не падтрымліваецца',
'thumbnail_gd-library' => 'Няпоўная канфігурацыя бібліятэкі GD: няма функцыі $1',
'thumbnail_image-missing' => 'Верагодна няма файла $1',
# Special:Import
'import' => 'Імпартаваць старонкі',
'importinterwiki' => 'Імпартаваньне зь іншых вікі',
'import-interwiki-text' => 'Абярыце вікі і назву старонкі для імпартаваньня.
Даты зьменаў і імёны аўтараў будуць захаваныя.
Усе дзеяньні імпартаваньня паміж вікі запісваюцца ў [[Special:Log/import|журнал імпартаваньняў]].',
'import-interwiki-source' => 'Крынічная вікі/старонка:',
'import-interwiki-history' => 'Капіяваць гісторыю старонкі цалкам',
'import-interwiki-templates' => 'Уключыць усе шаблёны',
'import-interwiki-submit' => 'Імпартаваць',
'import-interwiki-namespace' => 'Мэтавая прастора назваў:',
'import-interwiki-rootpage' => 'Мэтавая карнявая старонка (неабавязкова):',
'import-upload-filename' => 'Назва файла:',
'import-comment' => 'Камэнтар:',
'importtext' => 'Калі ласка, экспартуйце файл з крынічнай вікі з дапамогай [[Special:Export|прылады экспарту]].
Захавайце яго на свой кампутар, а потым загрузіце сюды.',
'importstart' => 'Імпартаваньне старонак…',
'import-revision-count' => '$1 {{PLURAL:$1|вэрсія|вэрсіі|вэрсіяў}}',
'importnopages' => 'Няма старонак для імпартаваньня.',
'imported-log-entries' => '{{PLURAL:$1|Імпартаваны $1 запіс журнала|Імпартаваныя $1 запісы журнала|Імпартаваныя $1 запісаў журнала}}.',
'importfailed' => 'Немагчыма імпартаваць: $1',
'importunknownsource' => 'Невядомы тып крыніцы імпарту',
'importcantopen' => 'Немагчыма адкрыць файл імпарту',
'importbadinterwiki' => 'Няслушная спасылка на іншую моўную вэрсію',
'importnotext' => 'Тэкст адсутнічае',
'importsuccess' => 'Імпартаваньне скончанае!',
'importhistoryconflict' => 'Канфлікт вэрсіяў у гісторыі рэдагаваньняў (магчыма, гэтую старонку імпартавалі раней)',
'importnosources' => 'Крыніцы імпарту паміж вікі не былі вызначаныя і наўпроставая загрузка гісторыі адключаная.',
'importnofile' => 'Файл для імпартаваньня ня быў загружаны.',
'importuploaderrorsize' => 'Не атрымалася загрузіць файл імпартаваньня.
Памер файла болей за дазволены для загрузкі.',
'importuploaderrorpartial' => 'Не атрымалася загрузіць файл імпартаваньня.
Ён быў загружаны толькі часткова.',
'importuploaderrortemp' => 'Немагчыма загрузіць файл імпартаваньня.
Не стае часовай дырэкторыі.',
'import-parse-failure' => 'Памылка разбору XML пры імпартаваньні',
'import-noarticle' => 'Няма старонкі для імпартаваньня!',
'import-nonewrevisions' => 'Усе вэрсіі былі імпартаваныя раней.',
'xml-error-string' => '$1 у радку $2, пазыцыі $3 (байт $4): $5',
'import-upload' => 'Загрузіць XML-зьвесткі',
'import-token-mismatch' => 'Страчаныя зьвесткі сэсіі. Калі ласка, паспрабуйце ізноў.',
'import-invalid-interwiki' => 'Немагчыма імпартаваць з вызначанай вікі.',
'import-error-edit' => 'Старонка «$1» не імпартаваная, бо Вы ня маеце правоў на яе рэдагаваньне.',
'import-error-create' => 'Старонка «$1» не імпартаваная, бо Вы ня маеце правоў на яе стварэньне.',
'import-error-interwiki' => 'Старонка «$1» не была імпартаваная, таму што гэтая назва зарэзэрваваная для інтэрвікі.',
'import-error-special' => 'Старонка «$1» не была імпартаваная, таму што яна належыць да спэцыяльнай прасторы назваў, старонкі ў якой не дазволеныя.',
'import-error-invalid' => 'Старонка «$1» не была імпартаваная з-за няслушнасьці назвы.',
'import-options-wrong' => '{{PLURAL:$2|Няслушная налада|Няслушныя налады}}: <nowiki>$1</nowiki>',
'import-rootpage-invalid' => 'Пазначаная назва карнявой старонкі няслушная.',
'import-rootpage-nosubpage' => 'Падстаронкі ў прасторы назваў «$1» карнявой старонкі не дазволеныя.',
# Import log
'importlogpage' => 'Журнал імпартаваньняў',
'importlogpagetext' => 'Імпартаваньне адміністратарамі старонак з гісторыяй зьменаў зь іншых вікі.',
'import-logentry-upload' => 'імпартавана [[$1]] праз загрузку файла',
'import-logentry-upload-detail' => '$1 {{PLURAL:$1|вэрсія|вэрсіі|вэрсіяў}}',
'import-logentry-interwiki' => 'імпартавана зь іншай вікі $1',
'import-logentry-interwiki-detail' => '$1 {{PLURAL:$1|вэрсія|вэрсіі|вэрсіяў}} з $2',
# JavaScriptTest
'javascripttest' => 'Тэставаньне JavaScript',
'javascripttest-disabled' => 'Гэтая функцыя не была ўключаная ў гэтай вікі.',
'javascripttest-title' => 'Праводзіцца тэставаньне $1',
'javascripttest-pagetext-noframework' => 'Гэтая старонка трымаецца для правядзеньня тэстаў JavaScript.',
'javascripttest-pagetext-unknownframework' => 'Невядомая бібліятэка тэставаньня «$1».',
'javascripttest-pagetext-frameworks' => 'Калі ласка, выберыце адну з прапанаваных бібліятэка тэставаньня: $1',
'javascripttest-pagetext-skins' => 'Выберыце афармленьне для тэставаньня:',
'javascripttest-qunit-intro' => 'Глядзіце [$1 дакумэнтацыю па тэставаньні] на mediawiki.org.',
'javascripttest-qunit-heading' => 'Набор QUnit-тэстаў для MediaWiki JavaScript',
# Tooltip help for the actions
'tooltip-pt-userpage' => 'Вашая ўласная старонка',
'tooltip-pt-anonuserpage' => 'Старонка ўдзельніка для IP-адрасу, зь якога Вы рэдагуеце',
'tooltip-pt-mytalk' => 'Ваша старонка гутарак',
'tooltip-pt-anontalk' => 'Старонка гутарак пра рэдагаваньні, зробленыя з гэтага IP-адрасу',
'tooltip-pt-preferences' => 'Вашыя налады',
'tooltip-pt-watchlist' => 'Сьпіс старонак, за зьменамі якіх Вы назіраеце',
'tooltip-pt-mycontris' => 'Ваш унёсак',
'tooltip-pt-login' => 'Вас запрашаюць увайсьці, хаця гэта і неабавязкова.',
'tooltip-pt-anonlogin' => 'Уваход у сыстэму вітаецца, хаця ён не абавязковы.',
'tooltip-pt-logout' => 'Выйсьці',
'tooltip-ca-talk' => 'Абмеркаваньне зьместу старонкі',
'tooltip-ca-edit' => 'Вы можаце рэдагаваць гэтую старонку. Калі ласка, ужывайце кнопку прагляду перад захаваньнем.',
'tooltip-ca-addsection' => 'Пачаць новую сэкцыю',
'tooltip-ca-viewsource' => 'Гэтая старонка абароненая.
Але можна паглядзець яе крынічны тэкст',
'tooltip-ca-history' => 'Мінулыя вэрсіі гэтай старонкі.',
'tooltip-ca-protect' => 'Абараніць гэтую старонку',
'tooltip-ca-unprotect' => 'Зьмяніць абарону старонкі',
'tooltip-ca-delete' => 'Выдаліць гэтую старонку',
'tooltip-ca-undelete' => 'Аднавіць рэдагаваньні, зробленыя да выдаленьня гэтай старонкі',
'tooltip-ca-move' => 'Перанесьці гэтую старонку',
'tooltip-ca-watch' => 'Дадаць гэтую старонку ў Ваш сьпіс назіраньня',
'tooltip-ca-unwatch' => 'Выдаліць гэтую старонку з Вашага сьпісу назіраньня',
'tooltip-search' => 'Шукаць у {{GRAMMAR:месны|{{SITENAME}}}}',
'tooltip-search-go' => 'Перайсьці да старонкі з гэтай назвай, калі старонка існуе',
'tooltip-search-fulltext' => 'Шукаць гэты тэкст на старонках',
'tooltip-p-logo' => 'Наведаць галоўную старонку',
'tooltip-n-mainpage' => 'Наведаць галоўную старонку',
'tooltip-n-mainpage-description' => 'Наведаць галоўную старонку',
'tooltip-n-portal' => 'Пра праект, што Вы можаце зрабіць, дзе што знайсьці',
'tooltip-n-currentevents' => 'Атрымаць інфармацыю пра актуальныя падзеі',
'tooltip-n-recentchanges' => 'Сьпіс апошніх зьменаў у {{GRAMMAR:месны|{{SITENAME}}}}.',
'tooltip-n-randompage' => 'Паказаць выпадковую старонку',
'tooltip-n-help' => 'Месца, каб пра ўсё даведацца',
'tooltip-t-whatlinkshere' => 'Сьпіс усіх старонак, якія спасылаюцца на гэтую',
'tooltip-t-recentchangeslinked' => 'Апошнія зьмены ў старонках, на якія спасылаецца гэтая старонка',
'tooltip-feed-rss' => 'RSS-стужка для гэтай старонкі',
'tooltip-feed-atom' => 'Atom-стужка для гэтай старонкі',
'tooltip-t-contributions' => 'Паказаць унёсак гэтага удзельніка/гэтай удзельніцы',
'tooltip-t-emailuser' => 'Даслаць ліст гэтаму ўдзельніку/гэтай удзельніцы па электроннай пошце',
'tooltip-t-upload' => 'Загрузіць файл',
'tooltip-t-specialpages' => 'Сьпіс усіх спэцыяльных старонак',
'tooltip-t-print' => 'Вэрсія гэтай старонкі для друку',
'tooltip-t-permalink' => 'Сталая спасылка на гэтую вэрсію старонкі',
'tooltip-ca-nstab-main' => 'Паказаць зьмест старонкі',
'tooltip-ca-nstab-user' => 'Паказаць старонку ўдзельніка',
'tooltip-ca-nstab-media' => 'Паказаць старонку мэдыяфайла',
'tooltip-ca-nstab-special' => 'Гэта спэцыяльная старонка, і Вы ня можаце яе рэдагаваць',
'tooltip-ca-nstab-project' => 'Паказаць старонку праекту',
'tooltip-ca-nstab-image' => 'Паказаць старонку файла',
'tooltip-ca-nstab-mediawiki' => 'Паказаць сыстэмнае паведамленьне',
'tooltip-ca-nstab-template' => 'Паказаць шаблён',
'tooltip-ca-nstab-help' => 'Паказаць старонку дапамогі',
'tooltip-ca-nstab-category' => 'Паказаць старонку катэгорыі',
'tooltip-minoredit' => 'Пазначыць гэтую зьмену як дробную',
'tooltip-save' => 'Захаваць Вашы зьмены',
'tooltip-preview' => 'Праглядзець Вашы зьмены. Калі ласка, выкарыстоўвайце гэтую магчымасьць перад тым, як захаваць старонку!',
'tooltip-diff' => 'Паказаць зробленыя Вамі зьмены ў тэксьце.',
'tooltip-compareselectedversions' => 'Пабачыць розьніцу паміж дзьвюма абранымі вэрсіямі гэтай старонкі.',
'tooltip-watch' => 'Дадаць гэтую старонку ў Ваш сьпіс назіраньня',
'tooltip-watchlistedit-normal-submit' => 'Выдаліць пазначаныя старонкі',
'tooltip-watchlistedit-raw-submit' => 'Абнавіць сьпіс назіраньня',
'tooltip-recreate' => 'Аднавіць старонку, ня гледзячы на тое, што яна была выдаленая',
'tooltip-upload' => 'Пачаць загрузку',
'tooltip-rollback' => '«Адкат» вяртае рэдагаваньні папярэдняга ўдзельніка адным клікам.',
'tooltip-undo' => '«Скасаваць» — скасоўвае гэтае рэдагаваньне і адкрывае акно рэдагаваньня ў рэжыме прагляду.
Дазваляе дадаваць прычыну адкату ў апісаньне зьменаў.',
'tooltip-preferences-save' => 'Захаваць налады',
'tooltip-summary' => 'Увядзіце кароткае апісаньне',
# Metadata
'notacceptable' => 'Вікі-сэрвэр ня можа адлюстраваць зьвесткі ў выглядзе, які здольны прачытаць Ваш браўзэр.',
# Attribution
'anonymous' => '{{PLURAL:$1|Ананімны ўдзельнік ці ўдзельніца|Ананімныя ўдзельнікі і ўдзельніцы}} {{GRAMMAR:родны|{{SITENAME}}}}',
'siteuser' => 'Удзельнік/удзельніца {{GRAMMAR:родны|{{SITENAME}}}} $1',
'anonuser' => 'Ананімны ўдзельнік {{GRAMMAR:родны|{{SITENAME}}}} $1',
'lastmodifiedatby' => 'Гэтую старонку апошні раз рэдагаваў $3 $2, $1.',
'othercontribs' => 'На аснове працы $1.',
'others' => 'іншыя',
'siteusers' => '{{PLURAL:$2|Удзельнік|Удзельнікі}} {{GRAMMAR:родны|{{SITENAME}}}} $1',
'anonusers' => '{{PLURAL:$2|Ананімны ўдзельнік|Ананімныя ўдзельнікі}} {{GRAMMAR:родны|{{SITENAME}}}} $1',
'creditspage' => 'Падзякі',
'nocredits' => 'Няма інфармацыі пра аўтараў гэтай старонкі.',
# Spam protection
'spamprotectiontitle' => 'Фільтар для абароны ад спаму',
'spamprotectiontext' => 'Старонка, якую Вы жадаеце захаваць, была заблякаваная спам-фільтрам.
Верагодна яна ўтрымлівае спасылку на вонкавы сайт.',
'spamprotectionmatch' => 'Спам-фільтар даслаў наступнае паведамленьне: $1',
'spambot_username' => 'Чыстка спаму MediaWiki',
'spam_reverting' => 'Адкат да апошняй вэрсіі без спасылак на $1',
'spam_blanking' => 'Усе вэрсіі ўтрымліваюць спасылкі на $1, чыстка',
'spam_deleting' => 'Усе вэрсіі ўтрымлівалі спасылкі на $1, выдаляем',
# Info page
'pageinfo-title' => 'Інфармацыя пра «$1»',
'pageinfo-not-current' => 'Даруйце, мы ня можам падаць гэтыя зьвесткі для старых вэрсіяў.',
'pageinfo-header-basic' => 'Асноўныя зьвесткі',
'pageinfo-header-edits' => 'Рэдагаваньні',
'pageinfo-header-restrictions' => 'Абарона старонкі',
'pageinfo-header-properties' => 'Уласьцівасьці старонкі',
'pageinfo-display-title' => 'Загаловак для адлюстраваньня',
'pageinfo-default-sort' => 'Перадвызначаны ключ сартаваньня',
'pageinfo-length' => 'Памер старонкі (у байтах)',
'pageinfo-article-id' => 'Ідэнтыфікатар старонкі',
'pageinfo-robot-policy' => 'Індэксацыя пашукавікамі',
'pageinfo-robot-index' => 'Індэксуецца',
'pageinfo-robot-noindex' => 'Не індэксуецца',
'pageinfo-views' => 'Колькасьць праглядаў',
'pageinfo-watchers' => 'Колькасьць назіральнікаў і назіральніц',
'pageinfo-redirects-name' => 'Перанакіраваньняў на гэтую старонку',
'pageinfo-subpages-name' => 'Колькасьць падстаронак',
'pageinfo-subpages-value' => '$1 ($2 {{PLURAL:$2|перанакіраваньне|перанакіраваньні|перанакіраваньняў}}; $3 {{PLURAL:$3|звычайная|звычайныя|звычайных}})',
'pageinfo-firstuser' => 'Стваральнік старонкі',
'pageinfo-firsttime' => 'Дата стварэньня',
'pageinfo-lastuser' => 'Апошні рэдактар',
'pageinfo-lasttime' => 'Дата апошняга рэдагаваньня',
'pageinfo-edits' => 'Колькасьць рэдагаваньняў',
'pageinfo-authors' => 'Колькасьць аўтараў',
'pageinfo-recent-edits' => 'Колькасьць апошніх рэдагаваньняў (за $1)',
'pageinfo-recent-authors' => 'Колькасьць апошніх аўтараў',
'pageinfo-magic-words' => '{{PLURAL:$1|Магічнае слова|Магічныя словы}} ($1)',
'pageinfo-hidden-categories' => '{{PLURAL:$1|Схаваная катэгорыя|Схаваныя катэгорыі}} ($1)',
'pageinfo-templates' => '{{PLURAL:$1|Шаблён|Шаблёны}} ($1)',
# Skin names
'skinname-standard' => 'Клясычнае',
'skinname-nostalgia' => 'Настальгія',
'skinname-cologneblue' => 'Кёльнскі смутак',
'skinname-monobook' => 'Монакніга',
'skinname-myskin' => 'MySkin',
'skinname-chick' => 'Цыпа',
'skinname-simple' => 'Простае',
'skinname-modern' => 'Сучаснае',
'skinname-vector' => 'Вэктар',
# Patrolling
'markaspatrolleddiff' => 'Пазначыць як «патруляваную»',
'markaspatrolledtext' => 'Пазначыць гэтую старонку як «патруляваную»',
'markedaspatrolled' => 'Пазначаная як «патруляваная»',
'markedaspatrolledtext' => 'Выбраная вэрсія [[:$1]] пазначаная як «патруляваная».',
'rcpatroldisabled' => 'Патруляваньне апошніх зьменаў адключанае',
'rcpatroldisabledtext' => 'Магчымасьць патруляваньня апошніх зьменаў цяпер адключаная.',
'markedaspatrollederror' => 'Немагчыма пазначыць як «патруляваную»',
'markedaspatrollederrortext' => 'Вы мусіце абраць вэрсію, каб пазначыць яе «патруляванай».',
'markedaspatrollederror-noautopatrol' => 'Вам не дазволена пазначаць Вашыя ўласныя зьмены як «патруляваныя».',
# Patrol log
'patrol-log-page' => 'Журнал патруляваньняў',
'patrol-log-header' => 'Гэта журнал патруляваных вэрсіяў.',
'log-show-hide-patrol' => '$1 журнал патруляваньняў',
# Image deletion
'deletedrevision' => 'Выдаленая старая вэрсія $1',
'filedeleteerror-short' => 'Памылка выдаленьня файла: $1',
'filedeleteerror-long' => 'У часе выдаленьня файла ўзьніклі наступныя памылкі:
$1',
'filedelete-missing' => 'Немагчыма выдаліць файл «$1», таму што ён не існуе.',
'filedelete-old-unregistered' => 'Пазначанай вэрсіі файла «$1» няма ў базе зьвестак.',
'filedelete-current-unregistered' => 'Пазначанага файла «$1» няма ў базе зьвестак.',
'filedelete-archive-read-only' => 'Архіўная дырэкторыя «$1» не даступная для запісу вэб-сэрвэра.',
# Browsing diffs
'previousdiff' => '← Папярэдняя зьмена',
'nextdiff' => 'Наступная зьмена →',
# Media information
'mediawarning' => "'''Папярэджаньне''': гэты тып файл можа ўтрымліваць зламысны код. Яго выкананьне можа нашкодзіць вашай сыстэме.",
'imagemaxsize' => "Абмежаваньне памеру выяваў: <br />''(для старонак апісаньня файлаў)''",
'thumbsize' => 'Памер паменшанай вэрсіі выявы:',
'widthheightpage' => '$1 × $2, $3 {{PLURAL:$3|старонка|старонкі|старонак}}',
'file-info' => 'памер файла: $1, тып MIME: $2',
'file-info-size' => '$1 × $2 {{PLURAL:$2|піксэль|піксэлі|піксэляў}}, памер файла: $3, тып MIME: $4',
'file-info-size-pages' => '$1 × $2 піксэлаў, памер файла: $3, MIME-тып: $4, $5 {{PLURAL:$5|старонка|старонкі|старонак}}',
'file-nohires' => 'Няма вэрсіі зь лепшым разрозьненьнем.',
'svg-long-desc' => 'SVG-файл, намінальна $1 × $2 {{PLURAL:$2|піксэл|піксэлы|піксэлаў}}, памер файла: $3.',
'svg-long-desc-animated' => 'Анімаваны SVG-файл, намінальна $1 × $2 {{PLURAL:$2|піксэл|піксэлы|піксэлаў}}, памер файла: $3',
'show-big-image' => 'Найлепшае разрозьненьне',
'show-big-image-preview' => 'Памер прагляду: $1.',
'show-big-image-other' => '{{PLURAL:$2|Іншае разрозьненьне|Іншыя разрозьненьні}}: $1.',
'show-big-image-size' => '$1 × $2 піксэлаў',
'file-info-gif-looped' => 'паўтараючыся',
'file-info-gif-frames' => '$1 {{PLURAL:$1|кадар|кадры|кадраў}}',
'file-info-png-looped' => 'паўтараючыся',
'file-info-png-repeat' => 'паўтораны $1 {{PLURAL:$1|раз|разы|разоў}}',
'file-info-png-frames' => '$1 {{PLURAL:$1|кадар|кадры|кадраў}}',
'file-no-thumb-animation' => "'''Заўвага: з-за тэхнічных абмежаваньняў мініятуры гэтага файла ня будуць анімаваныя.'''",
'file-no-thumb-animation-gif' => "'''Заўвага: з-за тэхнічных абмежаваньняў мініятуры GIF-выяваў высокага разрозьненьня ствараюцца без анімацыі.'''",
# Special:NewFiles
'newimages' => 'Галерэя новых файлаў',
'imagelisttext' => "Ніжэй пададзены сьпіс з '''$1''' {{PLURAL:$1|файла|файлаў|файлаў}}, адсартаваных $2.",
'newimages-summary' => 'Гэтая спэцыяльная старонка паказвае нядаўна загружаныя файлы.',
'newimages-legend' => 'Фільтар',
'newimages-label' => 'Назва файла (альбо яе частка):',
'showhidebots' => '($1 робатаў)',
'noimages' => 'Выявы адсутнічаюць.',
'ilsubmit' => 'Шукаць',
'bydate' => 'па даце',
'sp-newimages-showfrom' => 'Паказаць новыя файлы, загружаныя пазьней за $2, $1',
# Video information, used by Language::formatTimePeriod() to format lengths in the above messages
'seconds-abbrev' => '$1 с',
'minutes-abbrev' => '$1 хв',
'hours-abbrev' => '$1 г',
'days-abbrev' => '$1 дз',
'seconds' => '$1 {{PLURAL:$1|сэкунда|сэкунды|сэкундаў}}',
'minutes' => '$1 {{PLURAL:$1|хвіліна|хвіліны|хвілінаў}}',
'hours' => '$1 {{PLURAL:$1|гадзіна|гадзіны|гадзінаў}}',
'days' => '$1 {{PLURAL:$1|дзень|дні|дзён}}',
'ago' => '$1 таму',
# Bad image list
'bad_image_list' => 'Фармат наступны:
Разглядаюцца толькі элемэнты сьпісу (радкі, якія пачынаюцца з *).
Першая спасылка ў радку мусіць быць спасылкай на кепскую выяву.
Усе наступныя спасылкі ў тым жа радку будуць разглядацца як выключэньні, напрыклад, старонкі, дзе можа зьяўляцца выява.',
# Metadata
'metadata' => 'Мэтазьвесткі',
'metadata-help' => 'Гэты файл утрымлівае дадатковую інфармацыю, хутчэй за ўсё дададзеную зь лічбавай фотакамэры ці сканэра.
Калі файл рэдагаваўся пасьля стварэньня, то частка зьвестак можа не адпавядаць зьмененаму файлу.',
'metadata-expand' => 'Паказаць падрабязнасьці',
'metadata-collapse' => 'Схаваць падрабязнасьці',
'metadata-fields' => 'Палі мэта-зьвестак выявы з гэтага сьпісу будуць паказаныя на старонцы выявы, калі табліца мэта-зьвестак будзе згорнутая.
* make
* model
* datetimeoriginal
* exposuretime
* fnumber
* isospeedratings
* focallength
* artist
* copyright
* imagedescription
* gpslatitude
* gpslongitude
* gpsaltitude',
# EXIF tags
'exif-imagewidth' => 'Шырыня',
'exif-imagelength' => 'Вышыня',
'exif-bitspersample' => 'Глыбіня колеру',
'exif-compression' => 'Мэтад сьцісканьня',
'exif-photometricinterpretation' => 'Колеравая мадэль',
'exif-orientation' => 'Арыентацыя кадра',
'exif-samplesperpixel' => 'Колькасьць колеравых кампанэнтаў',
'exif-planarconfiguration' => 'Прынцып арганізацыі зьвестак',
'exif-ycbcrsubsampling' => 'Суадносіны памераў кампанэнтаў Y і C',
'exif-ycbcrpositioning' => 'Парадак разьмяшчэньня кампанэнтаў Y і C',
'exif-xresolution' => 'Гарызантальнае разрозьненьне',
'exif-yresolution' => 'Вэртыкальнае разрозьненьне',
'exif-stripoffsets' => 'Разьмяшчэньне блёку зьвестак',
'exif-rowsperstrip' => 'Колькасьць радкоў у блёку',
'exif-stripbytecounts' => 'Памер сьціснутага блёку',
'exif-jpeginterchangeformat' => 'Разьмяшчэньне пачатку блёку JPEG SOI',
'exif-jpeginterchangeformatlength' => 'Байты JPEG-зьвестак',
'exif-whitepoint' => 'Колернасьць белага пункту',
'exif-primarychromaticities' => 'Колернасьць асноўных колераў',
'exif-ycbcrcoefficients' => 'Каэфіцыенты пераўтварэньня колеравай прасторы',
'exif-referenceblackwhite' => 'Становішча белага і чорнага пунктаў',
'exif-datetime' => 'Дата і час зьмены файла',
'exif-imagedescription' => 'Назва выявы',
'exif-make' => 'Вытворца фотаапарата',
'exif-model' => 'Мадэль фотаапарата',
'exif-software' => 'Праграмнае забесьпячэньне',
'exif-artist' => 'Аўтар',
'exif-copyright' => 'Уласьнік аўтарскіх правоў',
'exif-exifversion' => 'Вэрсія Exif',
'exif-flashpixversion' => 'Вэрсія Flashpix, якая падтрымліваецца',
'exif-colorspace' => 'Колеравая прастора',
'exif-componentsconfiguration' => 'Канфігурацыя колеравых кампанэнтаў',
'exif-compressedbitsperpixel' => 'Глыбіня колеру пасьля сьцісканьня',
'exif-pixelydimension' => 'Шырыня выявы',
'exif-pixelxdimension' => 'Вышыня выявы',
'exif-usercomment' => 'Камэнтары карыстальніка',
'exif-relatedsoundfile' => 'Датычны аўдыё-файл',
'exif-datetimeoriginal' => 'Дата і час утварэньня зьвестак',
'exif-datetimedigitized' => 'Дата і час лічбаваньня',
'exif-subsectime' => 'Доля сэкундаў часу зьмяненьня файла',
'exif-subsectimeoriginal' => 'Долі сэкундаў арыгінальнага часу',
'exif-subsectimedigitized' => 'Долі сэкундаў часу лічбаваньня',
'exif-exposuretime' => 'Час насьвятленьня',
'exif-exposuretime-format' => '$1 сэк ($2)',
'exif-fnumber' => 'Лік дыяфрагмы',
'exif-exposureprogram' => 'Праграма насьвятленьня',
'exif-spectralsensitivity' => 'Спэктральная адчувальнасьць',
'exif-isospeedratings' => 'Сьветаадчувальнасьць ISO',
'exif-shutterspeedvalue' => 'Вытрымка',
'exif-aperturevalue' => 'Дыяфрагма',
'exif-brightnessvalue' => 'Яркасьць',
'exif-exposurebiasvalue' => 'Кампэнсацыя насьвятленьня',
'exif-maxaperturevalue' => 'Мінімальны лік дыяфрагмы',
'exif-subjectdistance' => "Адлегласьць да аб'екту",
'exif-meteringmode' => 'Лад вымярэньня насьвятленьня',
'exif-lightsource' => 'Крыніца сьвятла',
'exif-flash' => 'Успышка',
'exif-focallength' => "Фокусная адлегласьць аб'ектыва",
'exif-focallength-format' => '$1 мм',
'exif-subjectarea' => "Плошча аб'екту",
'exif-flashenergy' => 'Энэргія бліску',
'exif-focalplanexresolution' => 'Разрозьненьне ў фокуснай плоскасьці па восі X',
'exif-focalplaneyresolution' => 'Разрозьненьне ў фокуснай плоскасьці па восі Y',
'exif-focalplaneresolutionunit' => 'Адзінка разрозьненьня фокуснай плоскасьці',
'exif-subjectlocation' => "Месцазнаходжаньне аб'екту",
'exif-exposureindex' => 'Індэкс насьвятленьня',
'exif-sensingmethod' => 'Тып сэнсару',
'exif-filesource' => 'Крыніца файла',
'exif-scenetype' => 'Тып сцэны',
'exif-customrendered' => 'Дадатковая апрацоўка',
'exif-exposuremode' => 'Лад насьвятленьня',
'exif-whitebalance' => 'Балянс белага',
'exif-digitalzoomratio' => 'Каэфіцыент лічбавага павелічэньня',
'exif-focallengthin35mmfilm' => 'Эквівалентная фокусная адлегласьць (для 35 мм стужкі)',
'exif-scenecapturetype' => 'Тып сцэны пры здымцы',
'exif-gaincontrol' => 'Падвышэньне яркасьці',
'exif-contrast' => 'Кантраст',
'exif-saturation' => 'Насычанасьць',
'exif-sharpness' => 'Рэзкасьць',
'exif-devicesettingdescription' => 'Апісаньне наладаў прыстасаваньня',
'exif-subjectdistancerange' => "Адлегласьць да аб'екту",
'exif-imageuniqueid' => 'Унікальны ідэнтыфікатар выявы',
'exif-gpsversionid' => 'Вэрсія блёку GPS-інфармацыі',
'exif-gpslatituderef' => 'Паўночная ці паўднёвая шырата',
'exif-gpslatitude' => 'Шырата',
'exif-gpslongituderef' => 'Усходняя ці заходняя даўгата',
'exif-gpslongitude' => 'Даўгата',
'exif-gpsaltituderef' => 'Пункт адліку вышыні',
'exif-gpsaltitude' => 'Вышыня',
'exif-gpstimestamp' => 'Час GPS (атамны гадзіньнік)',
'exif-gpssatellites' => 'Спадарожнікі, ужытыя для вымярэньня',
'exif-gpsstatus' => 'Статус прымача',
'exif-gpsmeasuremode' => 'Лад вымярэньня',
'exif-gpsdop' => 'Дакладнасьць вымярэньня',
'exif-gpsspeedref' => 'Адзінка вымярэньня хуткасьці',
'exif-gpsspeed' => 'Хуткасьць руху GPS-прымача',
'exif-gpstrackref' => 'Тып азімуту GPS-прымача',
'exif-gpstrack' => 'Кірунак руху',
'exif-gpsimgdirectionref' => 'Тып азімуту выявы',
'exif-gpsimgdirection' => 'Кірунак выявы',
'exif-gpsmapdatum' => 'Скарыстаная геадэзічная сыстэма каардынатаў',
'exif-gpsdestlatituderef' => "Пункт адліку шыраты аб'екту",
'exif-gpsdestlatitude' => "Шырата аб'екту",
'exif-gpsdestlongituderef' => "Пункт адліку даўгаты аб'екту",
'exif-gpsdestlongitude' => "Даўгата аб'екту",
'exif-gpsdestbearingref' => "Тып пэленгу аб'екту",
'exif-gpsdestbearing' => "Пэленг аб'екту",
'exif-gpsdestdistanceref' => "Пункт адліку адлегласьці да аб'екту",
'exif-gpsdestdistance' => "Адлегласьць да аб'екту",
'exif-gpsprocessingmethod' => 'Назва мэтаду вылічэньня GPS',
'exif-gpsareainformation' => 'Назва GPS-зоны',
'exif-gpsdatestamp' => 'Дата GPS',
'exif-gpsdifferential' => 'Дыфэрэнцыяльная папраўка GPS',
'exif-jpegfilecomment' => 'Камэнтар да JPEG-файла',
'exif-keywords' => 'Ключавыя словы',
'exif-worldregioncreated' => 'Рэгіён сьвету, дзе была зробленая выява',
'exif-countrycreated' => 'Краіна, дзе была зробленая выява',
'exif-countrycodecreated' => 'Код краіны, дзе была зробленая выява',
'exif-provinceorstatecreated' => 'Вобласьць, правінцыя ці штат, дзе была зробленая выява',
'exif-citycreated' => 'Горад, дзе была зробленая выява',
'exif-sublocationcreated' => 'Раён гораду, дзе была зробленая выява',
'exif-worldregiondest' => 'Паказаны рэгіён сьвету',
'exif-countrydest' => 'Паказаная краіна',
'exif-countrycodedest' => 'Код паказанай краіны',
'exif-provinceorstatedest' => 'Паказаная вобласьць, правінцыя ці штат',
'exif-citydest' => 'Паказаны горад',
'exif-sublocationdest' => 'Паказаны раён гораду',
'exif-objectname' => 'Кароткая назва',
'exif-specialinstructions' => 'Спэцыяльныя інструкцыі',
'exif-headline' => 'Загаловак',
'exif-credit' => 'Падаўшы выяву',
'exif-source' => 'Крыніца',
'exif-editstatus' => 'Рэдакцыйны статус выявы',
'exif-urgency' => 'Тэрміновасьць',
'exif-fixtureidentifier' => 'Назва слупка',
'exif-locationdest' => 'Паказанае месца',
'exif-locationdestcode' => 'Код паказанага месца',
'exif-objectcycle' => 'Час дня, для якога ўласьцівае мэдыя',
'exif-contact' => 'Кантактная інфармацыя',
'exif-writer' => 'Аўтар',
'exif-languagecode' => 'Мова',
'exif-iimversion' => 'Вэрсія IIM',
'exif-iimcategory' => 'Катэгорыя',
'exif-iimsupplementalcategory' => 'Дадатковыя катэгорыі',
'exif-datetimeexpires' => 'Не выкарыстоўваць пасьля',
'exif-datetimereleased' => 'Апублікаванае',
'exif-originaltransmissionref' => 'Код месца пачатковай перадачы',
'exif-identifier' => 'Ідэнтыфікатар',
'exif-lens' => 'Выкарыстаны аб’ектыў',
'exif-serialnumber' => 'Сэрыйны нумар фотакамэры',
'exif-cameraownername' => 'Уласьнік фотакамэры',
'exif-label' => 'Метка',
'exif-datetimemetadata' => 'Дата апошняй зьмены мэта-зьвестак',
'exif-nickname' => 'Нефармальная назва выявы',
'exif-rating' => 'Адзнака (да 5)',
'exif-rightscertificate' => 'Сэртыфікат кіраваньня правамі',
'exif-copyrighted' => 'Статус аўтарскіх правоў',
'exif-copyrightowner' => 'Уласьнік аўтарскіх правоў',
'exif-usageterms' => 'Умовы выкарыстаньня',
'exif-webstatement' => 'Зьвесткі пра аўтарскія правы он-лайн',
'exif-originaldocumentid' => 'Унікальны ідэнтыфікатар ці арыгінальны дакумэнт',
'exif-licenseurl' => 'URL-адрас аўтарскай ліцэнзіі',
'exif-morepermissionsurl' => 'Інфармацыя пра ўмовы карыстаньня на ўмовах іншых ліцэнзіяў',
'exif-attributionurl' => 'Выкарыстоўваючы гэтую працу, калі ласка, спасылайцеся на',
'exif-preferredattributionname' => 'Выкарыстоўваючы гэтую працу, калі ласка, пазначайце аўтара',
'exif-pngfilecomment' => 'Камэнтар да PNG-файла',
'exif-disclaimer' => 'Адмова ад адказнасьці',
'exif-contentwarning' => 'Папярэджаньне пра зьмест',
'exif-giffilecomment' => 'Камэнтар да GIF-файла',
'exif-intellectualgenre' => 'Тып элемэнту',
'exif-subjectnewscode' => 'Код тэмы',
'exif-scenecode' => 'Код сцэны IPTC',
'exif-event' => 'Паказаная падзея',
'exif-organisationinimage' => 'Паказаная арганізацыя',
'exif-personinimage' => 'Паказаная асоба',
'exif-originalimageheight' => 'Вышыня выявы да кадраваньня',
'exif-originalimagewidth' => 'Шырыня выявы да кадраваньня',
# EXIF attributes
'exif-compression-1' => 'Нясьціснуты',
'exif-compression-2' => 'CCITT Група 3 аднамернае абноўленае кадаваньне адлегласьці Хафмана',
'exif-compression-3' => 'CCITT Група 3 факсымільнае кадаваньне',
'exif-compression-4' => 'CCITT Група 4 факсымільнае кадаваньне',
'exif-copyrighted-true' => 'Ахоўваецца аўтарскім правам',
'exif-copyrighted-false' => 'Грамадзкі набытак',
'exif-unknowndate' => 'Невядомая дата',
'exif-orientation-1' => 'Звычайная',
'exif-orientation-2' => 'Адлюстраваная па гарызанталі',
'exif-orientation-3' => 'Павернутая на 180°',
'exif-orientation-4' => 'Адлюстраваная па вэртыкалі',
'exif-orientation-5' => 'Павернутая на 90° супраць руху гадзіньнікавай стрэлкі і адлюстраваная вэртыкальна',
'exif-orientation-6' => 'Павернутая на 90° супраць руху гадзіньнікавай стрэлкі',
'exif-orientation-7' => 'Павернутая на 90° па руху гадзіньнікавай стрэлкі і адлюстраваная вэртыкальна',
'exif-orientation-8' => 'Павернутая на 90° па руху гадзіньнікавай стрэлкі',
'exif-planarconfiguration-1' => 'фармат «chunky»',
'exif-planarconfiguration-2' => 'фармат «planar»',
'exif-xyresolution-i' => '$1 пунктаў на цалю',
'exif-xyresolution-c' => '$1 пунктаў на сантымэтар',
'exif-colorspace-65535' => 'Некалібраванае',
'exif-componentsconfiguration-0' => 'не існуе',
'exif-exposureprogram-0' => 'Ня вызначана',
'exif-exposureprogram-1' => 'Ручны лад',
'exif-exposureprogram-2' => 'Праграмны лад',
'exif-exposureprogram-3' => 'Прыярытэт дыяфрагмы',
'exif-exposureprogram-4' => 'Прыярытэт затвора',
'exif-exposureprogram-5' => 'Творчы лад (перавага глыбіні рэзкасьці)',
'exif-exposureprogram-6' => 'Лад руху (перавага хуткасьці затвора)',
'exif-exposureprogram-7' => 'Партрэтны лад (здымкі ў набліжэньня, з фонам ня ў фокусе)',
'exif-exposureprogram-8' => 'Пэйзажны лад (для здымкаў краявідаў, з фонам у фокусе)',
'exif-subjectdistance-value' => '$1 мэтры',
'exif-meteringmode-0' => 'Невядома',
'exif-meteringmode-1' => 'Сярэдні',
'exif-meteringmode-2' => 'Сярэдне-ўзважаны',
'exif-meteringmode-3' => 'Кропкавы',
'exif-meteringmode-4' => 'Шматкропкавы',
'exif-meteringmode-5' => 'Матрычны',
'exif-meteringmode-6' => 'Частковы',
'exif-meteringmode-255' => 'Іншы',
'exif-lightsource-0' => 'Невядомая',
'exif-lightsource-1' => 'Дзённае сьвятло',
'exif-lightsource-2' => 'Люмінісцэнтная',
'exif-lightsource-3' => 'Вальфрам (лямпа накальваньня)',
'exif-lightsource-4' => 'Успышка',
'exif-lightsource-9' => "Выдатнае надвор'е",
'exif-lightsource-10' => "Хмарнае надвор'е",
'exif-lightsource-11' => 'Цень',
'exif-lightsource-12' => 'Лямпа дзённага сьвятла (D 5700 – 7100K)',
'exif-lightsource-13' => 'Лямпа дзённага сьвятла (N 4600 – 5400K)',
'exif-lightsource-14' => 'Лямпа дзённага сьвятла (W 3900 – 4500K)',
'exif-lightsource-15' => 'Лямпа дзённага сьвятла (WW 3200 – 3700K)',
'exif-lightsource-17' => 'Стандартнае асьвятленьне A',
'exif-lightsource-18' => 'Стандартнае асьвятленьне B',
'exif-lightsource-19' => 'Стандартнае асьвятленьне C',
'exif-lightsource-24' => 'студыйная лямпа стандарту ISO',
'exif-lightsource-255' => 'Іншая крыніца сьвятла',
# Flash modes
'exif-flash-fired-0' => 'Успышка не спрацавала',
'exif-flash-fired-1' => 'Успышка спрацавала',
'exif-flash-return-0' => 'бяз функцыі папярэдняй успышкі',
'exif-flash-return-2' => 'адваротны імпульс папярэдняй успышкі не атрыманы',
'exif-flash-return-3' => 'адваротны імпульс папярэдняй успышкі атрыманы',
'exif-flash-mode-1' => 'прымусовая ўспышка',
'exif-flash-mode-2' => 'прымусовае падаўленьне ўспышкі',
'exif-flash-mode-3' => 'аўтаматычны рэжым',
'exif-flash-function-1' => 'Без успышкі',
'exif-flash-redeye-1' => 'рэжым памяншэньня эфэкту чырвоных вачэй',
'exif-focalplaneresolutionunit-2' => 'цаляў',
'exif-sensingmethod-1' => 'Нявызначаны',
'exif-sensingmethod-2' => 'Аднакрысталічны матрычны колеравы сэнсар',
'exif-sensingmethod-3' => 'Двухкрысталічны матрычны колеравы сэнсар',
'exif-sensingmethod-4' => 'Трохкрысталічны матрычны колеравы сэнсар',
'exif-sensingmethod-5' => 'Каляровы матрычны сэквэнцыйны сэнсар',
'exif-sensingmethod-7' => 'Трохлінейны сэнсар',
'exif-sensingmethod-8' => 'Лінейны сэнсар з пасьлядоўнай зьменай колеру',
'exif-filesource-3' => 'Лічбавы фотаапарат',
'exif-scenetype-1' => 'Непасрэдна сфатаграфаваная выява',
'exif-customrendered-0' => 'Звычайны працэс',
'exif-customrendered-1' => 'Нестандартны працэс',
'exif-exposuremode-0' => 'Аўтаматычны лад насьвятленьня',
'exif-exposuremode-1' => 'Ручная наладка парамэтраў насьвятленьня',
'exif-exposuremode-2' => 'Брэкетынг',
'exif-whitebalance-0' => 'Аўтаматычны балянс белага',
'exif-whitebalance-1' => 'Ручны балянс белага',
'exif-scenecapturetype-0' => 'Стандартны',
'exif-scenecapturetype-1' => 'Ляндшафт',
'exif-scenecapturetype-2' => 'Партрэт',
'exif-scenecapturetype-3' => 'Начны здымак',
'exif-gaincontrol-0' => 'Няма',
'exif-gaincontrol-1' => 'Невялікае павелічэньне',
'exif-gaincontrol-2' => 'Значнае павелічэньне',
'exif-gaincontrol-3' => 'Невялікае памяншэньне',
'exif-gaincontrol-4' => 'Значнае памяншэньне',
'exif-contrast-0' => 'Звычайны',
'exif-contrast-1' => 'Мяккі',
'exif-contrast-2' => 'Значнае павышэньне',
'exif-saturation-0' => 'Звычайная',
'exif-saturation-1' => 'Невялікая насычанасьць',
'exif-saturation-2' => 'Вялікая насычанасьць',
'exif-sharpness-0' => 'Звычайная',
'exif-sharpness-1' => 'Мяккая',
'exif-sharpness-2' => 'Значнае павышэньне',
'exif-subjectdistancerange-0' => 'Невядомы',
'exif-subjectdistancerange-1' => 'Макраздымка',
'exif-subjectdistancerange-2' => 'Выгляд зблізку',
'exif-subjectdistancerange-3' => 'Выгляд здалёку',
# Pseudotags used for GPSLatitudeRef and GPSDestLatitudeRef
'exif-gpslatitude-n' => 'паўночнай шыраты',
'exif-gpslatitude-s' => 'паўднёвай шыраты',
# Pseudotags used for GPSLongitudeRef and GPSDestLongitudeRef
'exif-gpslongitude-e' => 'усходняй даўгаты',
'exif-gpslongitude-w' => 'заходняй даўгаты',
# Pseudotags used for GPSAltitudeRef
'exif-gpsaltitude-above-sealevel' => '$1 {{PLURAL:$1|мэтар|мэтры|мэтраў}} над узроўнем мора',
'exif-gpsaltitude-below-sealevel' => '$1 {{PLURAL:$1|мэтар|мэтры|мэтраў}} ніжэй за ўзровень мора',
'exif-gpsstatus-a' => 'Адбываецца вымярэньне',
'exif-gpsstatus-v' => 'Ацэнка магчымасьці ўзаемадзеяньня сетак',
'exif-gpsmeasuremode-2' => 'Вымярэньне двухмерных каардынатаў',
'exif-gpsmeasuremode-3' => 'Вымярэньне трохмерных каардынатаў',
# Pseudotags used for GPSSpeedRef
'exif-gpsspeed-k' => 'Кілямэтраў за гадзіну',
'exif-gpsspeed-m' => 'міляў за гадзіну',
'exif-gpsspeed-n' => 'вузлоў',
# Pseudotags used for GPSDestDistanceRef
'exif-gpsdestdistance-k' => 'Кілямэтраў',
'exif-gpsdestdistance-m' => 'Міляў',
'exif-gpsdestdistance-n' => 'Марскіх міляў',
'exif-gpsdop-excellent' => 'Выдатная ($1)',
'exif-gpsdop-good' => 'Добрая ($1)',
'exif-gpsdop-moderate' => 'Сярэдняя ($1)',
'exif-gpsdop-fair' => 'Прыймальная ($1)',
'exif-gpsdop-poor' => 'Дрэнная ($1)',
'exif-objectcycle-a' => 'Толькі ўранку',
'exif-objectcycle-p' => 'Толькі ўвечары',
'exif-objectcycle-b' => 'Уранку і ўвечары',
# Pseudotags used for GPSTrackRef, GPSImgDirectionRef and GPSDestBearingRef
'exif-gpsdirection-t' => 'Сапраўдны накірунак',
'exif-gpsdirection-m' => 'магнітны кірунак',
'exif-ycbcrpositioning-1' => 'Цэнтраваны',
'exif-ycbcrpositioning-2' => 'Сумяшчоныя',
'exif-dc-contributor' => 'Аўтары',
'exif-dc-coverage' => 'Прасторавыя ці часавыя абмежаваньні мэдыя',
'exif-dc-date' => 'Дата(ы)',
'exif-dc-publisher' => 'Выдавецтва',
'exif-dc-relation' => 'Зьвязаныя мэдыя',
'exif-dc-rights' => 'Правы',
'exif-dc-source' => 'Крынічнае мэдыя',
'exif-dc-type' => 'Тып мэдыя',
'exif-rating-rejected' => 'Адхіленае',
'exif-isospeedratings-overflow' => 'Больш за 65535',
'exif-iimcategory-ace' => 'Мастацтва, культура і забавы',
'exif-iimcategory-clj' => 'Крымінал і права',
'exif-iimcategory-dis' => 'Катастрофы і здарэньні',
'exif-iimcategory-fin' => 'Эканоміка і бізнэс',
'exif-iimcategory-edu' => 'Адукацыя',
'exif-iimcategory-evn' => 'Навакольнае асяродзьдзе',
'exif-iimcategory-hth' => 'Здароўе',
'exif-iimcategory-hum' => 'Зацікаўленасьці',
'exif-iimcategory-lab' => 'Праца',
'exif-iimcategory-lif' => 'Стыль жыцьця і вольны час',
'exif-iimcategory-pol' => 'Палітыка',
'exif-iimcategory-rel' => 'Рэлігія і вера',
'exif-iimcategory-sci' => 'Навука і тэхналёгіі',
'exif-iimcategory-soi' => 'Сацыяльныя праблемы',
'exif-iimcategory-spo' => 'Спорт',
'exif-iimcategory-war' => 'Вайна, канфлікты і беспарадкі',
'exif-iimcategory-wea' => 'Надвор’е',
'exif-urgency-normal' => 'Звычайная ($1)',
'exif-urgency-low' => 'Нізкая ($1)',
'exif-urgency-high' => 'Высокая ($1)',
'exif-urgency-other' => 'Прыярытэт вызначаны карыстальнікам ($1)',
# External editor support
'edit-externally' => 'Рэдагаваць гэты файл з выкарыстаньнем вонкавай праграмы',
'edit-externally-help' => '(Глядзіце падрабязнасьці ў [//www.mediawiki.org/wiki/Manual:External_editors інструкцыі па наладцы] (па-ангельску))',
# 'all' in various places, this might be different for inflected languages
'watchlistall2' => 'усё',
'namespacesall' => 'усе',
'monthsall' => 'усе',
'limitall' => 'усе',
# Email address confirmation
'confirmemail' => 'Пацьвердзіць адрас электроннай пошты',
'confirmemail_noemail' => 'Вы не пазначылі слушны адрас электроннай пошты ў Вашых [[Special:Preferences|наладах удзельніка]].',
'confirmemail_text' => '{{SITENAME}} патрабуе, каб Вы пацьвердзілі Ваш адрас электроннай пошты перад ўжываньнем магчымасьцяў электроннай пошты. Актывізуйце кнопку ніжэй, каб даслаць ліст з пацьверджаньнем на Ваш адрас. Ліст будзе ўтрымліваць спасылку з кодам; загрузіце спасылку ў Вашым браўзэры, каб пацьвердзіць, што Ваш адрас электроннай пошты зьяўляецца слушным.',
'confirmemail_pending' => 'Код пацьверджаньня ужо быў дасланы Вам праз электронную пошту; калі Вы нядаўна стварылі рахунак, Вам варта пачакаць код некалькі хвілінаў перад спробай запыту новага коду.',
'confirmemail_send' => 'Даслаць код пацьверджаньня',
'confirmemail_sent' => 'Ліст для пацьверджаньня дасланы.',
'confirmemail_oncreate' => 'Код пацьверджаньня быў адпраўлены на Ваш адрас электроннай пошты. Гэты код не патрэбны, каб увайсьці, але Вам трэба будзе падаць яго перад ужываньнем магчымасьцяў, заснаваных на электроннай пошце, у {{GRAMMAR:месны|{{SITENAME}}}}.',
'confirmemail_sendfailed' => '{{SITENAME}} ня можа даслаць пацьвярджальны ліст. Праверце адрас на наяўнасьць няслушных сымбаляў.
Адказ паштовага сэрвэра: $1',
'confirmemail_invalid' => 'Няслушны код пацьверджаньня. Магчыма, скончыўся яго тэрмін дзеяньня.',
'confirmemail_needlogin' => 'Вам трэба $1, каб пацьвердзіць Ваш адрас электроннай пошты.',
'confirmemail_success' => 'Ваш адрас электроннай пошты быў пацьверджаны. Зараз Вы можаце ўвайсьці.',
'confirmemail_loggedin' => 'Ваш адрас электроннай пошты быў пацьверджаны.',
'confirmemail_error' => 'Нешта пайшло ня так у часе захаваньня вашага пацьверджаньня.',
'confirmemail_subject' => '{{SITENAME}}: Пацьверджаньне адрасу электроннай пошты',
'confirmemail_body' => 'Нехта, магчыма Вы, з IP-адрасу $1, стварыў рахунак «$2» з гэтым адрасам электроннай пошты ў праекце {{SITENAME}}.
Каб пацьвердзіць, што гэты рахунак належыць Вам і актывізаваць магчымасьці электроннай пошты ў {{GRAMMAR:месны|{{SITENAME}}}}, адкрыйце гэтую спасылку у Вашым браўзэры:
$3
Калі рахунак стварылі *ня* Вы, адкрыйце наступную спасылку для таго, каб не пацьвердзіць адрас электроннай пошты.
$5
Код дзейнічае да $4.',
'confirmemail_body_changed' => 'Нехта, магчыма Вы, з IP-адрасу $1, зьмяніў адрас электроннай пошты рахунку «$2» у праекце {{SITENAME}}.
Каб пацьвердзіць, што гэты рахунак належыць Вам і актывізаваць магчымасьці электроннай пошты ў {{GRAMMAR:месны|{{SITENAME}}}} зноў, перайдзіце па наступнай спасылцы ў Вашым браўзэры:
$3
Калі рахунак належыць *ня* Вам, перайдзіце па наступнай спасылцы для таго, каб скасаваць пацьверджаньне адрасу электроннай пошты:
$5
Код пацьверджаньня зьяўляецца дзейсным да $4.',
'confirmemail_body_set' => 'Нехта, магчыма Вы, з IP-адраса $1,
устанавіў адрас электроннай пошты для рахунку «$2» у {{GRAMMAR:месны|{{SITENAME}}}}.
Каб пацьвердзіць, што гэты рахунак сапраўды належыць Вам, і каб актывізаваць новы магчымасьці электроннай пошты ў {{GRAMMAR:месны|{{SITENAME}}}}, адкрыйце гэтую спасылку у Вашым браўзэры:
$3
Калі рахунак Вам *не* належыць, перайдзіце па гэтай спасылцы
каб скасаваць пацьверджаньне па электроннай пошце:
$5
Гэты код пацьверджаньня дзейнічае да $4.',
'confirmemail_invalidated' => 'Пацьверджаньне адрасу электроннай пошты адмененае',
'invalidateemail' => 'Скасаваць пацьверджаньне адрасу электроннай пошты',
# Scary transclusion
'scarytranscludedisabled' => '[Улучэньне інтэрвікі было адключанае]',
'scarytranscludefailed' => '[Памылка атрыманьня шаблёну $1]',
'scarytranscludetoolong' => '[Занадта даўгі URL-адрас]',
# Delete conflict
'deletedwhileediting' => "'''Увага''': Гэтая старонка была выдаленая пасьля таго, як Вы пачалі яе рэдагаваньне!",
'confirmrecreate' => "{{GENDER:$1|Удзельнік|Удзельніца}} [[User:$1|$1]] ([[User talk:$1|гутаркі]]) {{GENDER:$1|выдаліў|выдаліла}} гэтую старонку, перад тым як Вы пачалі яе рэдагаваць, з прычыны:
: ''$2''
Калі ласка, пацьвердзіце, што Вы сапраўды жадаеце стварыць нанава гэтую старонку.",
'confirmrecreate-noreason' => '{{GENDER:$1|Удзельнік|Удзельніца}} [[User:$1|$1]] ([[User talk:$1|гутаркі]]) {{GENDER:$1|выдаліў|выдаліла}} гэтую старонку, пасьля таго як Вы пачалі яе рэдагаваць. Калі ласка, пацьвердзіце, што Вы сапраўды жадаеце стварыць гэтую старонку ізноў.',
'recreate' => 'Стварыць ізноў',
'unit-pixel' => 'пкс',
# action=purge
'confirm_purge_button' => 'Добра',
'confirm-purge-top' => 'Ачысьціць кэш гэтай старонкі?',
'confirm-purge-bottom' => 'Ачыстка кэшу старонкі прывядзе да адлюстраваньня яе апошняй вэрсіі.',
# action=watch/unwatch
'confirm-watch-button' => 'Добра',
'confirm-watch-top' => 'Дадаць гэтую старонку ў Ваш сьпіс назіраньня?',
'confirm-unwatch-button' => 'Добра',
'confirm-unwatch-top' => 'Выдаліць гэтую старонку з Вашага сьпісу назіраньня?',
# Multipage image navigation
'imgmultipageprev' => '← папярэдняя старонка',
'imgmultipagenext' => 'наступная старонка →',
'imgmultigo' => 'Перайсьці!',
'imgmultigoto' => 'Перайсьці на старонку $1',
# Table pager
'ascending_abbrev' => 'узраст.',
'descending_abbrev' => 'зьмянш.',
'table_pager_next' => 'Наступная старонка',
'table_pager_prev' => 'Папярэдняя старонка',
'table_pager_first' => 'Першая старонка',
'table_pager_last' => 'Апошняя старонка',
'table_pager_limit' => 'Паказваць $1 элемэнтаў на старонцы',
'table_pager_limit_label' => 'Запісаў на старонку:',
'table_pager_limit_submit' => 'Перайсьці',
'table_pager_empty' => 'Вынікаў няма',
# Auto-summaries
'autosumm-blank' => 'Выдалены ўвесь зьмест старонкі',
'autosumm-replace' => "Старонка замененая на '$1'",
'autoredircomment' => 'Перанакіроўвае на [[$1]]',
'autosumm-new' => "Створана старонка са зьместам '$1'",
# Size units
'size-bytes' => '$1 б',
'size-kilobytes' => '$1 кб',
'size-megabytes' => '$1 Мб',
'size-gigabytes' => '$1 Гб',
'size-terabytes' => '$1 ТБ',
'size-petabytes' => '$1 ПБ',
'size-exabytes' => '$1 ЭБ',
'size-zetabytes' => '$1 ЗБ',
'size-yottabytes' => '$1 ЁБ',
# Live preview
'livepreview-loading' => 'Загрузка…',
'livepreview-ready' => 'Загрузка… Гатова!',
'livepreview-failed' => 'Немагчыма ўжыць хуткі папярэдні прагляд!
Паспрабуйце ўжыць звычайны папярэдні прагляд.',
'livepreview-error' => 'Немагчыма далучыцца да: $1 «$2».
Паспрабуйце ўжыць звычайны папярэдні прагляд.',
# Friendlier slave lag warnings
'lag-warn-normal' => 'Зьмены, зробленыя меней чым $1 {{PLURAL:$1|сэкунду|сэкунды|сэкундаў}} таму, могуць ня трапіць у гэты сьпіс.',
'lag-warn-high' => 'У выніку значнага адставаньня ў сынхранізацыі сэрвэраў базаў зьвестак зьмены, зробленыя раней за $1 {{PLURAL:$1|сэкунду|сэкунды|сэкундаў}} таму, могуць быць не паказаныя ў гэтым сьпісе.',
# Watchlist editor
'watchlistedit-numitems' => 'Ваш сьпіс назіраньня ўтрымлівае $1 {{PLURAL:$1|запіс|запісы|запісаў}}, без уліку старонак абмеркаваньня.',
'watchlistedit-noitems' => 'Ваш сьпіс назіраньня пусты.',
'watchlistedit-normal-title' => 'Рэдагаваньне сьпісу назіраньня',
'watchlistedit-normal-legend' => 'Выдаленьне старонак са сьпісу назіраньня',
'watchlistedit-normal-explain' => 'Ніжэй паданыя старонкі з Вашага сьпісу назіраньня.
Для выдаленьня старонкі са сьпісу пазначце адпаведныя пазыцыі і націсьніце кнопку «{{int:Watchlistedit-normal-submit}}».
Таксама Вы можаце [[Special:EditWatchlist/raw|рэдагаваць нефарматаваны сьпіс назіраньня]].',
'watchlistedit-normal-submit' => 'Выдаліць са сьпісу',
'watchlistedit-normal-done' => '$1 {{PLURAL:$1|запіс быў выдалены|запісы былі выдаленыя|запісаў былі выдаленыя}} з Вашага сьпісу назіраньня:',
'watchlistedit-raw-title' => 'Рэдагаваць нефарматаваны сьпіс назіраньня',
'watchlistedit-raw-legend' => 'Рэдагаваць нефарматаваны сьпіс назіраньня',
'watchlistedit-raw-explain' => 'Ніжэй пададзены сьпіс старонак Вашага сьпісу назіраньня, і Вы можаце яго рэдагаваць, дадаючы і выдаляючы радкі з назвамі старонак;
адна назва старонкі ў радку.
Пасьля заканчэньня рэдагаваньня, націсьніце «{{int:Watchlistedit-raw-submit}}».
Таксама Вы можаце [[Special:EditWatchlist|выкарыстаць стандартны інтэрфэйс рэдагаваньня]].',
'watchlistedit-raw-titles' => 'Назвы:',
'watchlistedit-raw-submit' => 'Абнавіць сьпіс назіраньня',
'watchlistedit-raw-done' => 'Ваш сьпіс назіраньня быў абноўлены.',
'watchlistedit-raw-added' => '$1 {{PLURAL:$1|запіс быў дададзены|запісы былі дададзеныя|запісаў былі дададзеныя}}:',
'watchlistedit-raw-removed' => '$1 {{PLURAL:$1|запіс быў выдалены|запісы былі выдаленыя|запісаў былі выдаленыя}}:',
# Watchlist editing tools
'watchlisttools-view' => 'Паказаць зьмены ў старонках зь сьпісу',
'watchlisttools-edit' => 'Праглядзець альбо рэдагаваць сьпіс назіраньня',
'watchlisttools-raw' => 'Рэдагаваць як тэкст',
# Signatures
'signature' => '[[{{ns:user}}:$1|$2]] ([[{{ns:user_talk}}:$1|гутаркі]])',
'timezone-utc' => 'UTC',
# Core parser functions
'unknown_extension_tag' => 'Невядомы тэг пашырэньня «$1»',
'duplicate-defaultsort' => 'Папярэджаньне: Ключ сартыроўкі па змоўчваньні «$2» замяняе папярэдні ключ сартыроўкі па змоўчваньні «$1».',
# Special:Version
'version' => 'Вэрсія',
'version-extensions' => 'Усталяваныя пашырэньні',
'version-specialpages' => 'Спэцыяльныя старонкі',
'version-parserhooks' => 'Працэдуры-перахопнікі парсэра',
'version-variables' => 'Зьменныя',
'version-antispam' => 'Абарона ад спаму',
'version-skins' => 'Афармленьні',
'version-api' => 'API',
'version-other' => 'Іншыя',
'version-mediahandlers' => 'Апрацоўшчыкі мэдыя',
'version-hooks' => 'Працэдуры-перахопнікі',
'version-extension-functions' => 'Функцыі пашырэньняў',
'version-parser-extensiontags' => 'Тэгі пашырэньняў парсэра',
'version-parser-function-hooks' => 'Перахопнікі функцыяў парсэра',
'version-hook-name' => 'Назва працэдуры-перахопніка',
'version-hook-subscribedby' => 'Падпісаны на',
'version-version' => '(Вэрсія $1)',
'version-svn-revision' => '(r$2)',
'version-license' => 'Ліцэнзія',
'version-poweredby-credits' => "{{SITENAME}} працуе на праграмным забесьпячэньні '''[//www.mediawiki.org/ MediaWiki]''', copyright © 2001-$1 $2.",
'version-poweredby-others' => 'іншыя',
'version-license-info' => 'MediaWiki зьяўляецца вольным праграмным забесьпячэньнем, якое Вы можаце распаўсюджваць і/ці зьмяняць на ўмовах ліцэнзіі GNU General Public License вэрсіі 2 ці болей позьняй, апублікаванай Фундацыяй вольнага праграмнага забесьпячэньня (Free Software Foundation).
MediaWiki распаўсюджваецца з надзеяй, што будзе карысным, але БЕЗ АНІЯКІХ ГАРАНТЫЯЎ, нават без меркаваных гарантыяў КАМЭРЦЫЙНАЙ КАШТОЎНАСЬЦІ ці ПРЫДАТНАСЬЦІ ДА ПЭЎНАЙ МЭТЫ. Глядзіце ліцэнзію GNU General Public License для болей падрабязных зьвестак.
Вы мусілі атрымаць [{{SERVER}}{{SCRIPTPATH}}/COPYING копію GNU General Public License] разам з гэтым праграмным забесьпячэньнем. Калі не, напішыце Free Software Foundation, Inc. па адрасе 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA, альбо прачытайце [//www.gnu.org/licenses/old-licenses/gpl-2.0.html он-лайн копію ліцэнзіі].',
'version-software' => 'Усталяванае праграмнае забесьпячэньне',
'version-software-product' => 'Прадукт',
'version-software-version' => 'Вэрсія',
'version-entrypoints' => 'Уваходныя адрасы',
'version-entrypoints-header-entrypoint' => 'Пункт уваходу',
'version-entrypoints-header-url' => 'URL',
'version-entrypoints-articlepath' => '[https://www.mediawiki.org/wiki/Manual:$wgArticlePath Шлях да артыкула]',
'version-entrypoints-scriptpath' => '[https://www.mediawiki.org/wiki/Manual:$wgScriptPath Пуць да скрыпту]',
# Special:FilePath
'filepath' => 'Шлях да файла',
'filepath-page' => 'Файл:',
'filepath-submit' => 'Перайсьці',
'filepath-summary' => 'Гэтая спэцыяльная старонка вяртае поўны шлях да файла.
Выявы паказаныя ў поўным выглядзе, астатнія тыпы файлаў адкрываюцца прыпісанымі да іх праграмамі.',
# Special:FileDuplicateSearch
'fileduplicatesearch' => 'Пошук дублікатаў файлаў',
'fileduplicatesearch-summary' => 'Пошук аднолькавых файлаў на падставе іх хэшаў.',
'fileduplicatesearch-legend' => 'Пошук аднолькавых файлаў',
'fileduplicatesearch-filename' => 'Назва файла:',
'fileduplicatesearch-submit' => 'Шукаць',
'fileduplicatesearch-info' => '$1 × $2 піксэляў<br />Памер файла: $3<br />Тып MIME: $4',
'fileduplicatesearch-result-1' => 'Файл «$1» ня мае ідэнтычных копіяў.',
'fileduplicatesearch-result-n' => 'Файл «$1» мае $2 {{PLURAL:$2|ідэнтычную копію|ідэнтычныя копіі|ідэнтычных копіяў}}.',
'fileduplicatesearch-noresults' => 'Файл з назвай «$1» ня знойдзены.',
# Special:SpecialPages
'specialpages' => 'Спэцыяльныя старонкі',
'specialpages-note' => '----
* Звычайныя спэцыяльныя старонкі.
* <strong class="mw-specialpagerestricted">Спэцыяльныя старонкі з абмежаваным доступам.</strong>
* <span class="mw-specialpagecached">Кэшаваныя спэцыяльныя старонкі (могуць быць састарэлымі).</span>',
'specialpages-group-maintenance' => 'Тэхнічныя справаздачы',
'specialpages-group-other' => 'Іншыя спэцыяльныя старонкі',
'specialpages-group-login' => 'Уваход / стварэньне рахунку',
'specialpages-group-changes' => 'Апошнія зьмены і журналы падзеяў',
'specialpages-group-media' => 'Справаздачы пра мэдыяфайлы і загрузка',
'specialpages-group-users' => 'Удзельнікі і правы',
'specialpages-group-highuse' => 'Частаўжываныя старонкі',
'specialpages-group-pages' => 'Сьпісы старонак',
'specialpages-group-pagetools' => 'Інструмэнты для старонак',
'specialpages-group-wiki' => 'Зьвесткі і прылады',
'specialpages-group-redirects' => 'Спэцыяльныя старонкі-перанакіраваньні',
'specialpages-group-spam' => 'Інструмэнты для барацьбы са спамам',
# Special:BlankPage
'blankpage' => 'Пустая старонка',
'intentionallyblankpage' => 'Гэтая старонка наўмысна пакінутая пустой',
# External image whitelist
'external_image_whitelist' => ' #Пакіньце гэты радок такім, які ён ёсьць<pre>
#Зьмясьціце часткі рэгулярных выразаў (толькі частку якая знаходзіцца паміж //) ніжэй
#Яны будуць суаднесеныя з URL-адрасамі вонкавых выяваў
#Тыя, якія будуць пасаваць будуць паказвацца як выявы, астатнія толькі як спасылкі
#Радкі, пазначаныя #, лічыцца камэнтарамі
#Рэгістар сымбаляў ня ўлічваецца
#Зьмясьціце ўсе часткі рэгулярных выразаў над гэтым радком. Сам радок пакіньце ў такім жа выглядзе</pre>',
# Special:Tags
'tags' => 'Слушныя тэгі зьменаў',
'tag-filter' => 'Фільтар [[Special:Tags|тэгаў]]:',
'tag-filter-submit' => 'Фільтар',
'tags-title' => 'Тэгі',
'tags-intro' => 'На гэтай старонцы знаходзіцца сьпіс тэгаў, якімі праграмнае забесьпячэньне можа пазначыць рэдагаваньне, і іх значэньне.',
'tags-tag' => 'Назва тэга',
'tags-display-header' => 'Новыя запісы ў сьпісе зьменаў',
'tags-description-header' => 'Поўнае апісаньне значэньня',
'tags-hitcount-header' => 'Пазначаныя зьмены',
'tags-edit' => 'рэдагаваць',
'tags-hitcount' => '$1 {{PLURAL:$1|зьмена|зьмены|зьменаў}}',
# Special:ComparePages
'comparepages' => 'Параўнаньне старонак',
'compare-selector' => 'Параўнаньне вэрсіяў старонак',
'compare-page1' => 'Старонка 1',
'compare-page2' => 'Старонка 2',
'compare-rev1' => 'Вэрсія 1',
'compare-rev2' => 'Вэрсія 2',
'compare-submit' => 'Параўнаць',
'compare-invalid-title' => 'Пазначаная няслушная назва.',
'compare-title-not-exists' => 'Пазначаная старонка не існуе.',
'compare-revision-not-exists' => 'Пазначаная вэрсія не існуе.',
# Database error messages
'dberr-header' => 'Гэтая вікі не функцыянуе спраўна',
'dberr-problems' => 'Прабачце! На гэтым сайце ўзьніклі тэхнічныя цяжкасьці.',
'dberr-again' => 'Паспрабуйце пачакаць некалькі хвілінаў і абнавіць.',
'dberr-info' => '(Немагчыма злучыцца з сэрвэрам базы зьвестак: $1)',
'dberr-usegoogle' => 'Вы можаце пакуль паспрабаваць пашукаць праз Google.',
'dberr-outofdate' => 'Увага, індэксы нашага зьместу могуць быць састарэлымі.',
'dberr-cachederror' => 'Наступная старонка была загружана з кэшу і можа быць састарэлай.',
# HTML forms
'htmlform-invalid-input' => 'Узьніклі праблемы з некаторымі з Вашых уваходных зьвестак',
'htmlform-select-badoption' => 'Значэньне, якое Вы выбралі, не зьяўляецца слушным.',
'htmlform-int-invalid' => 'Значэньне, якое Вы выбралі, не зьяўляецца цэлым лікам.',
'htmlform-float-invalid' => 'Значэньне, якое Вы выбралі, не зьяўляецца лікам.',
'htmlform-int-toolow' => 'Значэньне, якое вы выбралі, менш за $1',
'htmlform-int-toohigh' => 'Значэньне, якое Вы выбралі, больш за $1',
'htmlform-required' => 'Гэтае значэньне — неабходнае',
'htmlform-submit' => 'Захаваць',
'htmlform-reset' => 'Адмяніць зьмены',
'htmlform-selectorother-other' => 'Іншае',
# SQLite database support
'sqlite-has-fts' => '$1 з падтрымкай поўнатэкстнага пошуку',
'sqlite-no-fts' => '$1 без падтрымкі поўнатэкстнага пошуку',
# New logging system
'logentry-delete-delete' => '$1 выдаліў старонку $3',
'logentry-delete-restore' => '$1 аднавіў старонку $3',
'logentry-delete-event' => '$1 зьмяніў бачнасьць $5 {{PLURAL:$5|падзеі ў журнале|падзеяў у журнале|падзеяў у журнале}} на $3: $4',
'logentry-delete-revision' => '$1 зьмяніў бачнасьць $5 {{PLURAL:$5|вэрсіі|вэрсіяў|вэрсіяў}} старонкі $3: $4',
'logentry-delete-event-legacy' => '$1 зьмяніў бачнасьць падзеяў у журнале на $3',
'logentry-delete-revision-legacy' => '$1 зьмяніў бачнасьць вэрсіяў старонкі $3',
'logentry-suppress-delete' => '$1 схаваў старонку $3',
'logentry-suppress-event' => '$1 прыхавана зьмяніў бачнасьць $5 {{PLURAL:$5|падзеі ў журнале|падзеяў у журнале|падзеяў у журнале}} на $3: $4',
'logentry-suppress-revision' => '$1 прыхавана зьмяніў бачнасьць $5 {{PLURAL:$5|вэрсіі|вэрсіяў|вэрсіяў}} старонкі $3: $4',
'logentry-suppress-event-legacy' => '$1 прыхавана зьмяніў бачнасьць падзеяў у журнале на $3',
'logentry-suppress-revision-legacy' => '$1 прыхавана зьмяніў бачнасьць вэрсіяў старонкі $3',
'revdelete-content-hid' => 'зьмест схаваны',
'revdelete-summary-hid' => 'апісаньне рэдагаваньня схаванае',
'revdelete-uname-hid' => 'імя ўдзельніка схаванае',
'revdelete-content-unhid' => 'зьмест адкрыты',
'revdelete-summary-unhid' => 'апісаньне рэдагаваньня адкрытае',
'revdelete-uname-unhid' => 'імя ўдзельніка адкрытае',
'revdelete-restricted' => 'ужыць абмежаваньні для адміністратараў',
'revdelete-unrestricted' => 'зьнятыя абмежаваньні для адміністратараў',
'logentry-move-move' => '$1 перанёс старонку $3 у $4',
'logentry-move-move-noredirect' => '$1 перанёс старонку $3 у $4 без пакінутага перанакіраваньня',
'logentry-move-move_redir' => '$1 перанёс старонку $3 у $4 паўзьверх перанакіраваньня',
'logentry-move-move_redir-noredirect' => '$1 перанёс старонку $3 у $4 паўзьверх перанакіраваньня без пакінутага перанакіраваньня',
'logentry-patrol-patrol' => '$1 пазначыў вэрсію $4 старонкі $3 як правераную',
'logentry-patrol-patrol-auto' => '$1 аўтаматычна пазначыў вэрсію $4 старонкі $3 як правераную',
'logentry-newusers-newusers' => 'Быў створаны рахунак $1',
'logentry-newusers-create' => 'Быў створаны рахунак $1',
'logentry-newusers-create2' => '$1 стварыў рахунак $3',
'logentry-newusers-autocreate' => 'Рахунак $1 быў створаны аўтаматычна',
'newuserlog-byemail' => 'Пароль адасланы па электроннай пошце',
# Feedback
'feedback-bugornote' => 'Калі Вы гатовы падрабязна апісаць тэхнічную праблему, калі ласка [$1 паведаміце пра памылку].
У адваротным выпадку, Вы можаце выкарыстоўваць простую форму пададзеную ніжэй. Ваш камэнтар будзе дададзены на старонку «[$3 $2]», разам з Вашым іменем удзельніка і выкарыстоўваемым браўзэрам.',
'feedback-subject' => 'Тэма:',
'feedback-message' => 'Паведамленьне:',
'feedback-cancel' => 'Скасаваць',
'feedback-submit' => 'Даслаць водгук',
'feedback-adding' => 'Даданьне водгуку на старонку…',
'feedback-error1' => 'Памылка: невядомы вынік з API',
'feedback-error2' => 'Памылка рэдагаваньня',
'feedback-error3' => 'Памылка: няма адказу ад API',
'feedback-thanks' => 'Дзякуй! Ваш водгук быў разьмешчаны на старонцы «[$2 $1]».',
'feedback-close' => 'Выканана',
'feedback-bugcheck' => 'Выдатна! Толькі праверце, магчыма гэтыя памылкі ўжо [$1 вядомыя].',
'feedback-bugnew' => 'Я праверыў. Гэта новая памылка',
# Search suggestions
'searchsuggest-search' => 'Пошук',
'searchsuggest-containing' => 'утрымлівае...',
# API errors
'api-error-badaccess-groups' => 'У Вас няма дазволу загружаць файлы ў гэтую вікі.',
'api-error-badtoken' => 'Унутраная памылка: няслушны ключ.',
'api-error-copyuploaddisabled' => 'Загрузка з URL-адрасу забароненая на гэтым сэрвэры.',
'api-error-duplicate' => 'Ужо {{PLURAL:$1|існуе [$2 іншы файл]|існуюць [$2 іншыя файлы]}} з такім жа зьместам.',
'api-error-duplicate-archive' => 'Раней на сайце {{PLURAL:$1|ўжо быў [$2 файл]|былі [$2 файлы]}} з дакладна такім жа зьместам, але {{PLURAL:$1|ён быў выдалены|яны былі выдаленыя}}.',
'api-error-duplicate-archive-popup-title' => 'Дублікаты {{PLURAL:$1|файла, які ўжо быў выдалены|файлаў, якія ўжо былі выдаленыя}}',
'api-error-duplicate-popup-title' => '{{PLURAL:$1|Ідэнтычны файл|Ідэнтычныя файлы}}',
'api-error-empty-file' => 'Дасланы Вамі файл быў пусты.',
'api-error-emptypage' => 'Стварэньне новых пустых старонак забаронена.',
'api-error-fetchfileerror' => 'Унутраная памылка: падчас атрыманьня файла штосьці здарылася.',
'api-error-fileexists-forbidden' => 'Файл з назвай «$1» ужо існуе і ня можа быць перазапісаны.',
'api-error-fileexists-shared-forbidden' => 'Файл з назвай «$1» ужо існуе ў супольным сховішчы файлаў і ня можа быць перазапісаны.',
'api-error-file-too-large' => 'Дасланы Вамі файл занадта вялікі.',
'api-error-filename-tooshort' => 'Назва файла занадта кароткая.',
'api-error-filetype-banned' => 'Гэты тып файла забаронены.',
'api-error-filetype-banned-type' => '$1 — {{PLURAL:$4|забаронены тып файлаў|забароненыя тыпы файлаў}}. {{PLURAL:$3|Дазволены тып файлаў|Дазволеныя тыпы файлаў}}: $2.',
'api-error-filetype-missing' => 'У файла няма пашырэньня.',
'api-error-hookaborted' => 'Прапанаваная Вамі зьмена была адхіленая апрацоўшчыкам пашырэньня.',
'api-error-http' => 'Унутраная памылка: немагчыма далучыцца да сэрвэра.',
'api-error-illegal-filename' => 'Недазволеная назва файла.',
'api-error-internal-error' => 'Унутраная памылка: падчас апрацоўкі Вашага файла штосьці здарылася.',
'api-error-invalid-file-key' => 'Унутраная памылка: ня быў знойдзены часовы файл.',
'api-error-missingparam' => 'Унутраная памылка: запыт бракуе парамэтраў.',
'api-error-missingresult' => 'Унутраная памылка: немагчыма вызначыць, ці пасьпяхова зробленае капіяваньне.',
'api-error-mustbeloggedin' => 'Для загрузкі файлаў неабходна ўвайсьці ў сыстэму.',
'api-error-mustbeposted' => 'Памылка гэтага праграмнага забесьпячэньня; яно не выкарыстоўвае слушны HTTP-мэтад.',
'api-error-noimageinfo' => 'Файл загружаны, але сэрвэр ня даў пра яго ніякай інфармацыі.',
'api-error-nomodule' => 'Унутраная памылка: ня выбраны модуль загрузкі.',
'api-error-ok-but-empty' => 'Унутраная памылка: няма адказу ад сэрвэра.',
'api-error-overwrite' => 'Замена існуючага файла забароненая.',
'api-error-stashfailed' => 'Унутраная памылка: сэрвэр ня змог захаваць часовы файл.',
'api-error-timeout' => 'Сэрвэр не адказаў у чаканы тэрмін.',
'api-error-unclassified' => 'Узьнікла невядомая памылка',
'api-error-unknown-code' => 'Невядомая памылка: «$1».',
'api-error-unknown-error' => 'Унутраная памылка: падчас загрузкі файла здарылася штосьці невядомае.',
'api-error-unknown-warning' => 'Невядомае папярэджаньне: $1',
'api-error-unknownerror' => 'Невядомая памылка: «$1».',
'api-error-uploaddisabled' => 'Загрузка ў гэтую вікі адключаная.',
'api-error-verification-error' => 'Гэты файл можа быць пашкоджаны, ці мае няслушнае пашырэньне.',
# Durations
'duration-seconds' => '$1 {{PLURAL:$1|сэкунда|сэкунды|сэкундаў}}',
'duration-minutes' => '$1 {{PLURAL:$1|хвіліна|хвіліны|хвілінаў}}',
'duration-hours' => '$1 {{PLURAL:$1|гадзіна|гадзіны|гадзінаў}}',
'duration-days' => '$1 {{PLURAL:$1|дзень|дні|дзён}}',
'duration-weeks' => '$1 {{PLURAL:$1|тыдзень|тыдні|тыдняў}}',
'duration-years' => '$1 {{PLURAL:$1|год|гады|гадоў}}',
'duration-decades' => '$1 {{PLURAL:$1|дзесяцігодзьдзе|дзесяцігодзьдзі|дзесяцігодзьдзяў}}',
'duration-centuries' => '$1 {{PLURAL:$1|стагодзьдзе|стагодзьдзі|стагодзьдзяў}}',
'duration-millennia' => '$1 {{PLURAL:$1|тысячагодзьдзе|тысячагодзьдзі|тысячагодзьдзяў}}',
);
| gpl-2.0 |
macarena/aulas | 2017/devel_cobrinha/cobra.py | 1104 | class Cobra:
corpo = []
cor = color(0,255,0)
dir = PVector(1,0)
def __init__(self,escala):
global width, height
self.s = escala
x= 600 / 2 / self.s
y= 600 / 2 / self.s
for i in range(4):
q = PVector(x - i, y)
self.corpo.append(q)
def desenha(self,comida):
self.anda(comida)
fill(self.cor)
for qua in self.corpo:
x = qua.x * self.s
y = qua.y * self.s
w = self.s
h = self.s
rect(x, y, w, h)
def anda(self,comida):
#adicionando mais um quadrado a frente
x = self.corpo[0].x
y = self.corpo[0].y
q = PVector(x,y) + self.dir
self.corpo.insert(0, q)
#removendo ultimo quadrado
if not self.comendo(comida):
del(self.corpo[-1])
def comendo(self,comida):
print(self.corpo[0])
print(comida.pos)
if self.corpo[0] == comida.pos:
return True
else:
return False | gpl-2.0 |
ranaldmiao/noiref | ds/cpp/fwrmq.cpp | 219 | int fw[N]; //initialize everything to 0
void update(int x, int v) {
for (; x<N; x+=x&(-x)) fw[x] = max(fw[x], v);
}
int sum(int x) {
int res = 0;
for(; x; x-=x&(-x)) res = max(res, fw[x]);
return res;
} | gpl-2.0 |
cmouse/buildbot | master/setup.py | 22767 | #!/usr/bin/env python
#
# This file is part of Buildbot. Buildbot 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.
#
# 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.
#
# Copyright Buildbot Team Members
"""
Standard setup script.
"""
from setuptools import setup # isort:skip
import glob
import inspect
import os
import pkg_resources
import sys
from distutils.command.install_data import install_data
from distutils.command.sdist import sdist
from pkg_resources import parse_version
from buildbot import version
BUILDING_WHEEL = bool("bdist_wheel" in sys.argv)
def include(d, e):
"""Generate a pair of (directory, file-list) for installation.
'd' -- A directory
'e' -- A glob pattern"""
return (d, [f for f in glob.glob('{}/{}'.format(d, e)) if os.path.isfile(f)])
def include_statics(d):
r = []
for root, ds, fs in os.walk(d):
r.append((root, [os.path.join(root, f) for f in fs]))
return r
class install_data_twisted(install_data):
"""make sure data files are installed in package.
this is evil.
copied from Twisted/setup.py.
"""
def finalize_options(self):
self.set_undefined_options('install',
('install_lib', 'install_dir'),
)
super().finalize_options()
def run(self):
super().run()
# ensure there's a buildbot/VERSION file
fn = os.path.join(self.install_dir, 'buildbot', 'VERSION')
open(fn, 'w').write(version)
self.outfiles.append(fn)
class our_sdist(sdist):
def make_release_tree(self, base_dir, files):
sdist.make_release_tree(self, base_dir, files)
# ensure there's a buildbot/VERSION file
fn = os.path.join(base_dir, 'buildbot', 'VERSION')
open(fn, 'w').write(version)
# ensure that NEWS has a copy of the latest release notes, with the
# proper version substituted
src_fn = os.path.join('docs', 'relnotes/index.rst')
with open(src_fn) as f:
src = f.read()
src = src.replace('|version|', version)
dst_fn = os.path.join(base_dir, 'NEWS')
with open(dst_fn, 'w') as f:
f.write(src)
def define_plugin_entry(name, module_name):
"""
helper to produce lines suitable for setup.py's entry_points
"""
if isinstance(name, tuple):
entry, name = name
else:
entry = name
return '{} = {}:{}'.format(entry, module_name, name)
def concat_dicts(*dicts):
result = dict()
for d in dicts:
result.update(d)
return result
def define_plugin_entries(groups):
"""
helper to all groups for plugins
"""
result = dict()
for group, modules in groups:
tempo = []
for module_name, names in modules:
tempo.extend([define_plugin_entry(name, module_name)
for name in names])
result[group] = tempo
return result
__file__ = inspect.getframeinfo(inspect.currentframe()).filename
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as long_d_f:
long_description = long_d_f.read()
setup_args = {
'name': "buildbot",
'version': version,
'description': "The Continuous Integration Framework",
'long_description': long_description,
'author': "Brian Warner",
'author_email': "[email protected]",
'maintainer': "Dustin J. Mitchell",
'maintainer_email': "[email protected]",
'url': "http://buildbot.net/",
'classifiers': [
'Development Status :: 5 - Production/Stable',
'Environment :: No Input/Output (Daemon)',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',
'Topic :: Software Development :: Build Tools',
'Topic :: Software Development :: Testing',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
],
'packages': [
"buildbot",
"buildbot.configurators",
"buildbot.worker",
"buildbot.worker.protocols",
"buildbot.changes",
"buildbot.clients",
"buildbot.data",
"buildbot.db",
"buildbot.db.migrate.versions",
"buildbot.db.types",
"buildbot.machine",
"buildbot.monkeypatches",
"buildbot.mq",
"buildbot.plugins",
"buildbot.process",
"buildbot.process.users",
"buildbot.reporters",
"buildbot.reporters.generators",
"buildbot.schedulers",
"buildbot.scripts",
"buildbot.secrets",
"buildbot.secrets.providers",
"buildbot.statistics",
"buildbot.statistics.storage_backends",
"buildbot.steps",
"buildbot.steps.package",
"buildbot.steps.package.deb",
"buildbot.steps.package.rpm",
"buildbot.steps.source",
"buildbot.util",
"buildbot.wamp",
"buildbot.www",
"buildbot.www.hooks",
"buildbot.www.authz",
] + ([] if BUILDING_WHEEL else [ # skip tests for wheels (save 50% of the archive)
"buildbot.test",
"buildbot.test.util",
"buildbot.test.fake",
"buildbot.test.fakedb",
"buildbot.test.fuzz",
"buildbot.test.integration",
"buildbot.test.integration.interop",
"buildbot.test.regressions",
"buildbot.test.unit",
]),
'data_files': [
include("buildbot/reporters/templates", "*.txt"),
("buildbot/db/migrate", [
"buildbot/db/migrate/migrate.cfg",
]),
include("buildbot/db/migrate/versions", "*.py"),
("buildbot/scripts", [
"buildbot/scripts/sample.cfg",
"buildbot/scripts/buildbot_tac.tmpl",
]),
include("buildbot/spec", "*.raml"),
include("buildbot/spec/types", "*.raml"),
include("buildbot/test/unit/test_templates_dir", "*.html"),
include("buildbot/test/unit/test_templates_dir/plugin", "*.*"),
include("buildbot/test/integration/pki", "*.*"),
include("buildbot/test/integration/pki/ca", "*.*"),
] + include_statics("buildbot/www/static"),
'cmdclass': {'install_data': install_data_twisted,
'sdist': our_sdist},
'entry_points': concat_dicts(define_plugin_entries([
('buildbot.changes', [
('buildbot.changes.mail', [
'MaildirSource', 'CVSMaildirSource',
'SVNCommitEmailMaildirSource',
'BzrLaunchpadEmailMaildirSource']),
('buildbot.changes.bitbucket', ['BitbucketPullrequestPoller']),
('buildbot.changes.github', ['GitHubPullrequestPoller']),
('buildbot.changes.gerritchangesource', [
'GerritChangeSource', 'GerritEventLogPoller']),
('buildbot.changes.gitpoller', ['GitPoller']),
('buildbot.changes.hgpoller', ['HgPoller']),
('buildbot.changes.p4poller', ['P4Source']),
('buildbot.changes.pb', ['PBChangeSource']),
('buildbot.changes.svnpoller', ['SVNPoller'])
]),
('buildbot.schedulers', [
('buildbot.schedulers.basic', [
'SingleBranchScheduler', 'AnyBranchScheduler']),
('buildbot.schedulers.dependent', ['Dependent']),
('buildbot.schedulers.triggerable', ['Triggerable']),
('buildbot.schedulers.forcesched', ['ForceScheduler']),
('buildbot.schedulers.timed', [
'Periodic', 'Nightly', 'NightlyTriggerable']),
('buildbot.schedulers.trysched', [
'Try_Jobdir', 'Try_Userpass'])
]),
('buildbot.secrets', [
('buildbot.secrets.providers.file', ['SecretInAFile']),
('buildbot.secrets.providers.passwordstore', ['SecretInPass']),
('buildbot.secrets.providers.vault', ['HashiCorpVaultSecretProvider'])
]),
('buildbot.worker', [
('buildbot.worker.base', ['Worker']),
('buildbot.worker.ec2', ['EC2LatentWorker']),
('buildbot.worker.libvirt', ['LibVirtWorker']),
('buildbot.worker.openstack', ['OpenStackLatentWorker']),
('buildbot.worker.docker', ['DockerLatentWorker']),
('buildbot.worker.kubernetes', ['KubeLatentWorker']),
('buildbot.worker.local', ['LocalWorker']),
]),
('buildbot.machine', [
('buildbot.machine.base', ['Machine']),
]),
('buildbot.steps', [
('buildbot.process.buildstep', ['BuildStep']),
('buildbot.steps.cmake', ['CMake']),
('buildbot.steps.cppcheck', ['Cppcheck']),
('buildbot.steps.gitdiffinfo', ['GitDiffInfo']),
('buildbot.steps.http', [
'HTTPStep', 'POST', 'GET', 'PUT', 'DELETE', 'HEAD',
'OPTIONS',
'HTTPStepNewStyle', 'POSTNewStyle', 'GETNewStyle', 'PUTNewStyle', 'DELETENewStyle',
'HEADNewStyle', 'OPTIONSNewStyle']),
('buildbot.steps.master', [
'MasterShellCommand', 'MasterShellCommandNewStyle',
'SetProperty', 'SetProperties', 'LogRenderable', "Assert"]),
('buildbot.steps.maxq', ['MaxQ']),
('buildbot.steps.mswin', ['Robocopy']),
('buildbot.steps.package.deb.lintian', ['DebLintian']),
('buildbot.steps.package.deb.pbuilder', [
'DebPbuilder', 'DebCowbuilder', 'UbuPbuilder',
'UbuCowbuilder']),
('buildbot.steps.package.rpm.mock', [
'Mock', 'MockBuildSRPM', 'MockRebuild']),
('buildbot.steps.package.rpm.rpmbuild', ['RpmBuild']),
('buildbot.steps.package.rpm.rpmlint', ['RpmLint']),
('buildbot.steps.python', [
'BuildEPYDoc', 'PyFlakes', 'PyLint', 'Sphinx']),
('buildbot.steps.python_twisted', [
'HLint', 'Trial', 'RemovePYCs']),
('buildbot.steps.shell', [
'ShellCommand', 'ShellCommandNewStyle', 'TreeSize',
'SetPropertyFromCommand', 'SetPropertyFromCommandNewStyle',
'Configure', 'ConfigureNewStyle',
'WarningCountingShellCommand', 'WarningCountingShellCommandNewStyle',
'Compile', 'CompileNewStyle',
'Test', 'TestNewStyle', 'PerlModuleTest']),
('buildbot.steps.shellsequence', ['ShellSequence']),
('buildbot.steps.source.bzr', ['Bzr']),
('buildbot.steps.source.cvs', ['CVS']),
('buildbot.steps.source.darcs', ['Darcs']),
('buildbot.steps.source.gerrit', ['Gerrit']),
('buildbot.steps.source.git', ['Git', 'GitCommit', 'GitPush', 'GitTag']),
('buildbot.steps.source.github', ['GitHub']),
('buildbot.steps.source.gitlab', ['GitLab']),
('buildbot.steps.source.mercurial', ['Mercurial']),
('buildbot.steps.source.mtn', ['Monotone']),
('buildbot.steps.source.p4', ['P4']),
('buildbot.steps.source.repo', ['Repo']),
('buildbot.steps.source.svn', ['SVN']),
('buildbot.steps.subunit', ['SubunitShellCommand']),
('buildbot.steps.transfer', [
'FileUpload', 'DirectoryUpload', 'MultipleFileUpload',
'FileDownload', 'StringDownload', 'JSONStringDownload',
'JSONPropertiesDownload']),
('buildbot.steps.trigger', ['Trigger']),
('buildbot.steps.vstudio', [
'VC6', 'VC7', 'VS2003', 'VC8', 'VS2005', 'VCExpress9', 'VC9',
'VS2008', 'VC10', 'VS2010', 'VC11', 'VS2012', 'VC12', 'VS2013',
'VC14', 'VS2015', 'VC141', 'VS2017', 'MsBuild4', 'MsBuild',
'MsBuild12', 'MsBuild14', 'MsBuild141']),
('buildbot.steps.worker', [
'SetPropertiesFromEnv', 'FileExists', 'CopyDirectory',
'RemoveDirectory', 'MakeDirectory']),
]),
('buildbot.reporters', [
('buildbot.reporters.generators.build', [
'BuildStatusGenerator',
'BuildStartEndStatusGenerator'
]),
('buildbot.reporters.generators.buildrequest', [
'BuildRequestGenerator'
]),
('buildbot.reporters.generators.buildset', ['BuildSetStatusGenerator']),
('buildbot.reporters.generators.worker', ['WorkerMissingGenerator']),
('buildbot.reporters.mail', ['MailNotifier']),
('buildbot.reporters.pushjet', ['PushjetNotifier']),
('buildbot.reporters.pushover', ['PushoverNotifier']),
('buildbot.reporters.message', [
'MessageFormatter',
'MessageFormatterEmpty',
'MessageFormatterFunction',
'MessageFormatterMissingWorker',
'MessageFormatterRenderable',
]),
('buildbot.reporters.gerrit', ['GerritStatusPush']),
('buildbot.reporters.gerrit_verify_status',
['GerritVerifyStatusPush']),
('buildbot.reporters.http', ['HttpStatusPush']),
('buildbot.reporters.github', ['GitHubStatusPush', 'GitHubCommentPush']),
('buildbot.reporters.gitlab', ['GitLabStatusPush']),
('buildbot.reporters.bitbucketserver', [
'BitbucketServerStatusPush',
'BitbucketServerCoreAPIStatusPush',
'BitbucketServerPRCommentPush'
]),
('buildbot.reporters.bitbucket', ['BitbucketStatusPush']),
('buildbot.reporters.irc', ['IRC']),
('buildbot.reporters.telegram', ['TelegramBot']),
('buildbot.reporters.zulip', ['ZulipStatusPush']),
]),
('buildbot.util', [
# Connection seems to be a way too generic name, though
('buildbot.worker.libvirt', ['Connection']),
('buildbot.changes.filter', ['ChangeFilter']),
('buildbot.changes.gerritchangesource', ['GerritChangeFilter']),
('buildbot.changes.svnpoller', [
('svn.split_file_projects_branches',
'split_file_projects_branches'),
('svn.split_file_branches', 'split_file_branches'),
('svn.split_file_alwaystrunk', 'split_file_alwaystrunk')]),
('buildbot.configurators.janitor', ['JanitorConfigurator']),
('buildbot.config', ['BuilderConfig']),
('buildbot.locks', [
'MasterLock',
'WorkerLock',
]),
('buildbot.manhole', [
'AuthorizedKeysManhole', 'PasswordManhole', 'TelnetManhole']),
('buildbot.process.builder', [
'enforceChosenWorker',
]),
('buildbot.process.factory', [
'BuildFactory', 'GNUAutoconf', 'CPAN', 'Distutils', 'Trial',
'BasicBuildFactory', 'QuickBuildFactory', 'BasicSVN']),
('buildbot.process.logobserver', ['LogLineObserver']),
('buildbot.process.properties', [
'FlattenList', 'Interpolate', 'Property', 'Transform',
'WithProperties', 'renderer', 'Secret']),
('buildbot.process.users.manual', [
'CommandlineUserManager']),
('buildbot.revlinks', ['RevlinkMatch']),
('buildbot.reporters.utils', ['URLForBuild']),
('buildbot.schedulers.forcesched', [
'AnyPropertyParameter', 'BooleanParameter',
'ChoiceStringParameter',
'CodebaseParameter', 'FileParameter', 'FixedParameter', 'InheritBuildParameter',
'IntParameter', 'NestedParameter', 'ParameterGroup',
'PatchParameter',
'StringParameter', 'TextParameter', 'UserNameParameter',
'WorkerChoiceParameter',
]),
('buildbot.process.results', [
'Results', 'SUCCESS', 'WARNINGS', 'FAILURE', 'SKIPPED',
'EXCEPTION', 'RETRY', 'CANCELLED']),
('buildbot.steps.source.repo', [
('repo.DownloadsFromChangeSource',
'RepoDownloadsFromChangeSource'),
('repo.DownloadsFromProperties',
'RepoDownloadsFromProperties')]),
('buildbot.steps.shellsequence', ['ShellArg']),
('buildbot.util.kubeclientservice', [
'KubeHardcodedConfig', 'KubeCtlProxyConfigLoader', 'KubeInClusterConfigLoader'
]),
('buildbot.www.avatar', ['AvatarGravatar', 'AvatarGitHub']),
('buildbot.www.auth', [
'UserPasswordAuth', 'HTPasswdAuth', 'RemoteUserAuth', 'CustomAuth']),
('buildbot.www.ldapuserinfo', ['LdapUserInfo']),
('buildbot.www.oauth2', [
'GoogleAuth', 'GitHubAuth', 'GitLabAuth', 'BitbucketAuth']),
('buildbot.db.dbconfig', [
'DbConfig']),
('buildbot.www.authz', [
'Authz', 'fnmatchStrMatcher', 'reStrMatcher']),
('buildbot.www.authz.roles', [
'RolesFromEmails', 'RolesFromGroups', 'RolesFromOwner', 'RolesFromUsername',
'RolesFromDomain']),
('buildbot.www.authz.endpointmatchers', [
'AnyEndpointMatcher', 'StopBuildEndpointMatcher', 'ForceBuildEndpointMatcher',
'RebuildBuildEndpointMatcher', 'AnyControlEndpointMatcher',
'EnableSchedulerEndpointMatcher'
]),
]),
('buildbot.webhooks', [
('buildbot.www.hooks.base', ['base']),
('buildbot.www.hooks.bitbucket', ['bitbucket']),
('buildbot.www.hooks.github', ['github']),
('buildbot.www.hooks.gitlab', ['gitlab']),
('buildbot.www.hooks.gitorious', ['gitorious']),
('buildbot.www.hooks.poller', ['poller']),
('buildbot.www.hooks.bitbucketcloud', ['bitbucketcloud']),
('buildbot.www.hooks.bitbucketserver', ['bitbucketserver'])
])
]), {
'console_scripts': [
'buildbot=buildbot.scripts.runner:run',
# this will also be shipped on non windows :-(
'buildbot_windows_service=buildbot.scripts.windows_service:HandleCommandLine',
]}
)
}
# set zip_safe to false to force Windows installs to always unpack eggs
# into directories, which seems to work better --
# see http://buildbot.net/trac/ticket/907
if sys.platform == "win32":
setup_args['zip_safe'] = False
py_36 = sys.version_info[0] > 3 or (
sys.version_info[0] == 3 and sys.version_info[1] >= 6)
if not py_36:
raise RuntimeError("Buildbot master requires at least Python-3.6")
# pip<1.4 doesn't have the --pre flag, and will thus attempt to install alpha
# and beta versions of Buildbot. Prevent that from happening.
VERSION_MSG = """
This is a pre-release version of Buildbot, which can only be installed with
pip-1.4 or later Try installing the latest stable version of Buildbot instead:
pip install buildbot==0.8.12
See https://pypi.python.org/pypi/buildbot to verify the current stable version.
"""
if 'a' in version or 'b' in version:
try:
pip_dist = pkg_resources.get_distribution('pip')
except pkg_resources.DistributionNotFound:
pip_dist = None
if pip_dist:
if parse_version(pip_dist.version) < parse_version('1.4'):
raise RuntimeError(VERSION_MSG)
twisted_ver = ">= 17.9.0"
autobahn_ver = ">= 0.16.0"
txaio_ver = ">= 2.2.2"
bundle_version = version.split("-")[0]
# dependencies
setup_args['install_requires'] = [
'setuptools >= 8.0',
'Twisted ' + twisted_ver,
'Jinja2 >= 2.1',
# required for tests, but Twisted requires this anyway
'zope.interface >= 4.1.1',
'sqlalchemy >= 1.2.0, < 1.4',
'sqlalchemy-migrate>=0.13',
'python-dateutil>=1.5',
'txaio ' + txaio_ver,
'autobahn ' + autobahn_ver,
'PyJWT',
'pyyaml'
]
# Unit test dependencies.
test_deps = [
# http client libraries
'treq',
'txrequests',
# pypugjs required for custom templates tests
'pypugjs',
# boto3 and moto required for running EC2 tests
'boto3',
'moto',
'mock>=2.0.0',
'parameterized',
]
if sys.platform != 'win32':
test_deps += [
# LZ4 fails to build on Windows:
# https://github.com/steeve/python-lz4/issues/27
# lz4 required for log compression tests.
'lz4',
]
setup_args['tests_require'] = test_deps
setup_args['extras_require'] = {
'test': [
'setuptools_trial',
'isort',
# spellcheck introduced in version 1.4.0
'pylint<1.7.0',
'pyenchant',
'flake8~=2.6.0',
] + test_deps,
'bundle': [
"buildbot-www=={0}".format(bundle_version),
"buildbot-worker=={0}".format(bundle_version),
"buildbot-waterfall-view=={0}".format(bundle_version),
"buildbot-console-view=={0}".format(bundle_version),
"buildbot-grid-view=={0}".format(bundle_version),
],
'tls': [
'Twisted[tls] ' + twisted_ver,
# There are bugs with extras inside extras:
# <https://github.com/pypa/pip/issues/3516>
# so we explicitly include Twisted[tls] dependencies.
'pyopenssl >= 16.0.0',
'service_identity',
'idna >= 0.6',
],
'docs': [
'docutils>=0.16.0',
'sphinx>=3.2.0',
'sphinx-rtd-theme>=0.5',
'sphinxcontrib-blockdiag',
'sphinxcontrib-spelling',
'sphinxcontrib-websupport',
'pyenchant',
'sphinx-jinja',
'towncrier',
],
}
if '--help-commands' in sys.argv or 'trial' in sys.argv or 'test' in sys.argv:
setup_args['setup_requires'] = [
'setuptools_trial',
]
if os.getenv('NO_INSTALL_REQS'):
setup_args['install_requires'] = None
setup_args['extras_require'] = None
if __name__ == '__main__':
setup(**setup_args)
# Local Variables:
# fill-column: 71
# End:
| gpl-2.0 |
codesallday/flannel_wordpress_legacy | home.php | 2420 | <?php
/**
* This is the homepage.
* Based off index.php...
*
* @package Flannel
*/
get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<div class="front-page-slider">
<ul>
<li class="slide slide-first">
<h1>We play 90's Songs</h1>
<h2>And we really do like rocking flannel...</h2>
</li>
<li class="slide">
<h1>At the Buff...</h1>
<div class="slide-comment">
<p>With Stay-Tuned's halloween-esque fog machine making the vernue look like rush hour in Beijing.</p>
</div>
</li>
<li class="slide slide-last">
<h1>And the Shakedown</h1>
<div class="slide-comment">
<p>Mixin' things up with some Ben Folds Five and a dash
<br>of the Real Slim Shady.</p>
</div>
</li>
</ul>
</div>
<?php if ( have_posts() ) : ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
/* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );
?>
<?php endwhile; ?>
<?php flannel_content_nav( 'nav-below' ); ?>
<?php else : ?>
<?php get_template_part( 'content', 'none' ); ?>
<?php endif; ?>
</main><!-- #main -->
</div><!-- #primary -->
<script type="text/javascript">
jQuery('.front-page-slider').unslider({
speed: 1000, // The speed to animate each slide (in milliseconds)
delay: 5000, // The delay between slide animations (in milliseconds)
complete: function() {}, // A function that gets called after every slide animation
keys: true, // Enable keyboard (left, right) arrow shortcuts
//dots: true, // Display dot navigation
fluid: false // Support responsive design. May break non-responsive designs
});
</script>
<?php get_footer(); ?>
| gpl-2.0 |
mrunix/streambase | tools/dump_data/task_server_main.cc | 3330 | #include <set>
#include <getopt.h>
#include <string.h>
#include "tblog.h"
#include "task_server.h"
#include "task_server_param.h"
using namespace std;
using namespace sb::common;
using namespace sb::tools;
static const int64_t SLEEP_TIME = 4000; // 4s
static const int64_t TIMEOUT = 1000 * 1000 * 10; // 10s
void print_usage() {
fprintf(stderr, "task_server [OPTION]\n");
fprintf(stderr, " -f|--conf server conf file\n");
fprintf(stderr, " -t|--table dump table name\n");
fprintf(stderr, " -h|--help usage help\n");
}
int main_routine(const set<string>& tables, const TaskServerParam& param);
int main(int argc, char** argv) {
int ret = OB_SUCCESS;
const char* opt_string = "f:t:h";
struct option longopts[] = {
{"conf", 1, NULL, 'f'},
{"table", 1, NULL, 't'},
{"help", 0, NULL, 'h'},
{0, 0, 0, 0}
};
int opt = 0;
const char* conf = NULL;
TaskServerParam param;
std::set<std::string> tables;
while ((opt = getopt_long(argc, argv, opt_string, longopts, NULL)) != -1) {
switch (opt) {
case 'f':
conf = optarg;
break;
case 't':
tables.insert(std::string(optarg));
break;
case 'h':
default:
print_usage();
exit(1);
}
}
if (NULL == conf) {
conf = "task_server.conf";
}
ret = param.load_from_config(conf);
if (ret != OB_SUCCESS) {
TBSYS_LOG(ERROR, "load conf failed:conf[%s], ret[%d]", conf, ret);
} else {
TBSYS_LOGGER.setFileName(param.get_log_name());
TBSYS_LOGGER.setLogLevel(param.get_log_level());
TBSYS_LOGGER.setMaxFileSize(param.get_max_log_size() * 1024L * 1024L);
signal(SIGPIPE, SIG_IGN);
ob_init_memory_pool();
ret = main_routine(tables, param);
}
return ret;
}
int main_routine(const set<string>& tables, const TaskServerParam& param) {
int ret = OB_SUCCESS;
ObServer name_server(ObServer::IPV4, param.get_root_server_ip(), param.get_root_server_port());
TaskServer server(param.get_result_file(), param.get_timeout_times(), param.get_max_visit_count(),
param.get_network_timeout(), name_server);
RpcStub rpc(server.get_client(), server.get_buffer());
//
TaskFactory& task_factory = server.get_task_factory();
set<string>::const_iterator it;
for (it = tables.begin(); it != tables.end(); ++it) {
ret = task_factory.add_table((*it).c_str());
if (ret != OB_SUCCESS) {
TBSYS_LOG(ERROR, "add table failed:table[%s], ret[%d]", (*it).c_str(), ret);
}
}
// init run
BaseServerRunner server_run(server);
tbsys::CThread server_thread;
if (OB_SUCCESS == ret) {
ret = server.init(param.get_thread_count(), param.get_queue_size(), &rpc,
param.get_dev_name(), param.get_task_server_port());
if (ret != OB_SUCCESS) {
TBSYS_LOG(ERROR, "check server init failed:ret[%d]", ret);
} else {
server_thread.start(&server_run, NULL);
}
}
if (OB_SUCCESS == ret) {
/// sleep for server thread init
usleep(SLEEP_TIME);
ret = server.init_service();
if (ret != OB_SUCCESS) {
TBSYS_LOG(ERROR, "check init service failed:ret[%d]", ret);
} else {
if (0 == server.get_task_manager().get_count()) {
TBSYS_LOG(INFO, "%s", "check no task for doing");
} else {
server_thread.join();
}
}
}
return ret;
}
| gpl-2.0 |
norcalli/list-comprehension-cpp | main.cc | 12850 | #include <iostream>
#include <functional>
#include <tuple>
#include "lambda.h"
#include "print-utils.h"
#include "variadic-utils.h"
#include "syntactic-sugar.h"
#include <cmath>
// #define DOUT(x) std::cout << #x " = " << (x) << std::endl;
#define DOUT(x) std::cout << #x " = " << (x) << '\n';
using namespace lambda;
std::string operator "" _s(const char* s, size_t n) { return std::string(s); }
struct Notifier {
};
struct Times2 {
template<class T>
T operator()(const T& t) {
return t*2;
}
};
//////////
template<class Function>
std::string str(const Lambda<Function>& fn);
template<class Arg, class Function>
std::string str(const lambda::templates::phoenix_unary<Arg, Function>& f);
template<class Left, class Right, class Function>
std::string str(const lambda::templates::phoenix_binary_left<Left, Right, Function>& f);
template<class Left, class Right, class Function>
std::string str(const lambda::templates::phoenix_binary_right<Left, Right, Function>& f);
template<class Left, class Right, class Function>
std::string str(const lambda::templates::phoenix_binary<Left, Right, Function>& f);
template<class Function, class... Args>
std::string str(const lambda::templates::phoenix_nary<Function, Args...>& f);
template<class T, class = enable_if<std::is_fundamental<T>::value> >
std::string str(const T& t) {
return std::to_string(t);
}
template<class T, int = sizeof(decltype(std::declval<T>().str()))>
std::string str(const T& t) {
return t.str();
}
template<size_t n>
std::string str(const lambda::placeholder<n>&) {
return std::string("_") + char('1' + n);
}
template<size_t n>
std::string str(const lambda::Lambda<lambda::Get<n> >&) {
return std::string("_") + char('1' + n);
}
template<class Arg, class Function>
std::string str(const lambda::templates::phoenix_unary<Arg, Function>& f) {
return f.fn.str(str(f.param));
}
template<class Left, class Right, class Function>
std::string str(const lambda::templates::phoenix_binary_left<Left, Right, Function>& f) {
return f.fn.str(str(f.expr), str(f.right));
}
template<class Left, class Right, class Function>
std::string str(const lambda::templates::phoenix_binary_right<Left, Right, Function>& f) {
return f.fn.str(str(f.left), str(f.expr));
}
template<class Left, class Right, class Function>
std::string str(const lambda::templates::phoenix_binary<Left, Right, Function>& f) {
return f.fn.str(str(f.left), str(f.right));
}
template<class Function, class... Args, int... idx>
std::string str_helper(const lambda::templates::phoenix_nary<Function, Args...>& f, tuple_indices<idx...>) {
return f.fn.str(str(std::get<idx>(f.params))...);
}
template<class Function, class... Args>
std::string str(const lambda::templates::phoenix_nary<Function, Args...>& f) {
return str_helper(f, make_tuple_indices<Args...>());
}
template<class Function>
std::string str(const Lambda<Function>& fn) {
return str(fn.f);
}
// template<class T, class... Args, class = typename std::enable_if<!lambda::is_lambda<T>::value>::type>
struct Eval {
template<class... Args>
auto operator()(Args&&... args) -> decltype(eval(args...)) const {
return eval(args...);
}
};
template <class... t_args>
struct storage;
template <class t_arg>
struct storage<t_arg> {
storage(t_arg t) : m_var(t) {}
template<class t_func, class... tt_args>
inline auto operator()(t_func fn, tt_args... p) -> decltype(fn(p..., std::declval<t_arg>())) {
return fn(p..., m_var);
}
t_arg m_var;
};
template <class t_arg, class t_arg2, class... t_args>
struct storage<t_arg, t_arg2, t_args...> {
storage(t_arg t, t_arg2 t2, t_args... p) : m_var(t), m_storage(t2, p...) {}
template<class t_func, class... tt_args>
inline auto operator()(t_func fn, tt_args... p)
-> decltype(std::declval<storage<t_arg2, t_args...>>()(fn, p..., std::declval<t_arg>())) {
return m_storage(fn, p..., m_var);
}
t_arg m_var;
storage<t_arg2, t_args...> m_storage;
};
template<class... Args>
storage<Args...> make_storage(Args&&... args) {
return storage<Args...>(args...);
}
template <class... t_args>
struct lambda_storage;
template <class t_arg>
struct lambda_storage<t_arg> {
lambda_storage(t_arg t) : m_var(t) {}
template<class Function, class Evaluator, class... tt_args>
inline auto operator()(Function fn, const Evaluator& e, tt_args... p)
-> decltype(fn(p..., e(std::declval<t_arg>()))) {
return fn(p..., e(m_var));
}
t_arg m_var;
};
template <class t_arg, class t_arg2, class... Params>
struct lambda_storage<t_arg, t_arg2, Params...> {
lambda_storage(t_arg t, t_arg2 t2, Params... p) : m_var(t), m_storage(t2, p...) {}
template<class Function, class Evaluator, class... Args>
inline auto operator()(Function fn, const Evaluator& e, Args... args)
-> decltype(std::declval<lambda_storage<t_arg2, Params...>>()(fn, e, args..., e(std::declval<t_arg>()))) {
return m_storage(fn, e, args..., e(m_var));
}
t_arg m_var;
lambda_storage<t_arg2, Params...> m_storage;
};
// TODO: Possible to generalize for postincrement?
// template<class Function, class... Args>
// auto Evaluate(Function fn, Args&&... args) -> decltype(fn(args...)) {
// return fn(args...);
// }
// std::string join(const std::string& j, std::initializer_list<std::string> array) {
// std::string result;
// auto it = std::begin(array), end = std::end(array);
// result += *it;
// while (++it != end) {
// result += j;
// result += *it;
// }
// return result;
// }
struct Evaluator {
template<class Function, class... Args>
auto operator()(Function fn, Args&&... args) -> decltype(fn(args...)) {
return fn(args...);
}
template<class... Strings>
std::string str(Strings... strings) const {
return std::string("lambda::bind(") + join(", ", {strings...}) + ")";
}
};
struct threesum {
template<class A, class B, class C>
auto operator()(A a, B b, C c) -> decltype(a+b+c) {
return a + b + c;
}
};
NARY_LAMBDA(threesum, sum3);
NARY_LAMBDA(Evaluator, Evaluate);
// TODO: Binary function evaluation.
template<class Name, class... Args>
lambda::templates::phoenix_nary<Name, Args...> make_phoenix(Args&&... args) {
return lambda::templates::phoenix_nary<Name, Args...>(std::forward<Args>(args)...);
}
template<class T>
std::ostream& operator<<(std::ostream& stream, const Lambda<T>& l) {
return stream << str(l);
}
template<class T>
auto identity(T&& t) -> decltype(std::forward<T>(t)) {
return std::forward<T>(t);
}
template<class T>
void ido(T&& t) {
t = 123;
}
template<class... Args>
bool lambdas_test(Args&&...) {
return any_lambdas<Args...>::value;
}
// TODO: Rename MACROS as NARY_WRAPPER when they include the functor definition.
// TODO: Adapters and wrappers, wrapper + adapter = nary_lambda
// TODO: Epsilon signalling tag that is just the identity function, turns whatever it interacts with into a lambda
#include <cstdlib>
std::string adjectives[] = {"stupid", "great", "lame"};
// TODO: rename Evaluate to lambda::bind
// TODO: add operator[] support
// TODO: Update all macros and functions to accept rvalues and std::forward them.
#include <random>
namespace std {
template<class T>
auto size(T&& t) -> decltype(t.size()) {
return t.size();
}
// template<class T, size_t n>
// size_t size(T array[n]) {
// return n;
// }
template<class T, size_t n>
constexpr size_t size(T&&) {
return 1;
}
template<class T>
constexpr auto size(T&& array) -> decltype(sizeof(array)/sizeof(array[0])) {
return sizeof(array)/sizeof(array[0]);
}
}
// TODO: Generator is iterator that calls generator function.
// TODO: Implement yield ideal.
// TODO: List comprehension syntax.
// TODO: bool conversion operator?
// TODO: Template conversion operator for lambdas?
#include "stats.h"
// Possible syntaxes:
// list = [x*x for x in list if x < 3]
// To only apply list comprehension when it is used, can add implicit conversion
// operator which only converts to iterables.
// Apply filter and map to pair of iterators or iterable object.
// list = list | map(_1*_1) | if(_1 < 3)
// list = map(_1*_1) | list | if(_1 < 3)
// map(_1*_1) | if(_1 < 3) | in({0, 1, 2, 3, 4, 5})
struct MapFilter {
};
#include "extended-type-traits.h"
template<class Function, class... Args>
bool CallableTest(Function, Args...) {
return is_callable<Function, Args...>::value;
}
int main(int argc, char *argv[]) {
const auto pi = atan(1)*4;
std::random_device rd;
std::default_random_engine re(rd());
std::uniform_int_distribution<> dist{0, std::size(adjectives) - 1};
auto rando = [&](){ return dist(re); };
auto moo = std::bind(rando);
auto boo = lambda::bind(rando);
DOUT(CallableTest(rando, 4));
DOUT(CallableTest(rando));
DOUT(CallableTest(moo, 4));
DOUT(CallableTest(boo));
DOUT(is_callable<decltype(boo)>::value);
DOUT(CallableTest(4, 5));
DOUT(CallableTest(std::sin(_1), 5));
DOUT(CallableTest(lambda::bind(functors::Sin(), pi/6), 5));
DOUT(CallableTest(_1, 5));
DOUT(CallableTest(_1*2, 5));
DOUT(CallableTest(lambda::ref(std::cout), 5));
DOUT(lambda::bind(functors::Sin(), pi/6)());
DOUT(moo());
DOUT(boo()); // TODO: Figure out why you can't pass no arguments (to nary). Guess: eval is being called with a single argument, and just being returned (correct).
DOUT(boo(4));
srand(time(0));
std::cout << std::boolalpha;
// auto greet = lambda::ref(std::cout) << "Hello: " << _1 << ", nice to meet you. " << _1 << " is a " << lambda::ref(adjectives)[lambda::bind(rand) % 3] << " name.\n";
auto greet = lambda::ref(std::cout) << "Hello: " << _1 << ", nice to meet you. " << _1 << " is a " << lambda::ref(adjectives)[lambda::bind(rando)] << " name\n";
// auto greet = lambda::ref(std::cout) << "Hello: " << _1 << ", nice to meet you. " << _1 << " is a " << adjectives[rand() % 3] << " name\n";
int ref_test = 9;
DOUT(&ref_test);
DOUT(&lambda::ref(ref_test)());
DOUT(&ref_test == (&lambda::ref(ref_test))());
DOUT(&ref_test == &lambda::ref(ref_test)());
greet("john 117");
greet("343 guilty spark");
greet(80085);
DOUT(lambdas_test(_1, 4));
DOUT(lambdas_test(1, 4));
DOUT(lambdas_test(_1, _2));
int test = 8;
DOUT(test == identity(test));
DOUT(&test == &identity(test));
identity(test) = 5;
DOUT(&test == &identity(test));
DOUT(identity(test));
ido(test);
ido(584);
DOUT(test);
auto p1 = make_phoenix<threesum>(_1, _2, _1*_2);
DOUT(p1(1.1, 1.2));
// auto p1 = phoenix_nary<threesum, double, double>(1.1, 1.2);
// auto p2 = make_lambda(p1);
// DOUT(p2(_1, _2, _1*_2));
auto aa = sum3(_1, _2, _1*_2);
DOUT(aa(1.1, 1.2));
DOUT(1.1 + 1.2 + 1.1*1.2);
auto asdf = std::make_tuple(_1, _2, _1*_2);
DOUT(eval(5, 1));
DOUT(eval(_1 * 2, 1));
auto kk = std::bind(functors::Sqrt(), _1);
auto ev = Evaluate(_1, _2);
DOUT(ev);
DOUT(ev(functors::Sqrt(), 5));
auto t1 = [](double d) { return d * 2; };
auto t2 = _1 * 2;
auto t3 = Times2();
auto t4 = std::sqrt(_1) + _1*4;
auto t5 = 4.4 * _2;
DOUT(t4);
DOUT(t5);
auto and_comp = 3 <= _1 && _1 <= 9;
// TODO: investigate what happens when you reassign, and/or assign to a lambda
// Do I want the expression that the lambda is pointing to to be replaced?
// Analysis: Uses the assignment operator and returns an expression assigning to the current expression.
auto t6 = t4 < t5;
DOUT(and_comp);
DOUT(t6);
#if 1
// std::cout << t(t4, t5, t6, and_comp) << std::endl;
for (int i = 0; i < 20; i++) {
std::cout << t(t4(i,i), t5(i,i), t6(i,i), and_comp(i,i)) << std::endl;
// std::cout << t4 << " = " << t4(i, i) << std::endl;
// std::cout << t5 << " = " << t5(i, i) << std::endl;
// std::cout << t6 << " = " << t6(i, i) << std::endl;
// std::cout << and_comp << " = " << and_comp(i, i) << std::endl;
}
DOUT(t1(6));
DOUT(t2(6));
DOUT(t3(6));
const lambda::placeholder<0> x;
const lambda::placeholder<1> y;
auto hypot = std::sqrt(x*x + y*y);
auto hypot2 = std::hypot(x, y);
DOUT(hypot(1, 1));
DOUT(hypot2(1, 1));
int alpha = 59;
DOUT(alpha);
DOUT(&(alpha));
DOUT((&_1)(alpha));
DOUT((&(_1 = 5))(alpha));
DOUT((alpha = 4) = 2 * alpha);
DOUT((alpha = 4) += 2 * alpha);
DOUT(((_1 = 4) = 2*_1)(alpha));
DOUT(((_1 = 4) += 2*_1)(alpha));
DOUT(&_1);
DOUT(&(_1 = 5));
DOUT((_1 = 4) += 2*_1);
DOUT((_1 = 4) = 2*_1);
DOUT((_1 += 9)(alpha));
DOUT((_1 * _2)(4, 5));
DOUT(alpha);
// auto expr = (_1 * 3) < 2;
auto expr = _1 * (pi + _1 * (1 + _1));
for (int i = 0; i < 10; ++i) {
auto test = i/pi;
DOUT(t(test, expr(test)));
}
DOUT((_1 < 2)(4));
DOUT(std::get<2>(0, 1, 2, 3));
int a = 2, b = 4, c = 5;
DOUT(t(a,b));
// t(a, b) = t(b+0, a);
t(a, b) = t(b+0, a);
DOUT(t(a,b));
t(a, b, c) = t(a, a+b, a+b+c);
DOUT(t(a,b,c));
#endif
return 0;
}
| gpl-2.0 |
sklrrzn/dokuwiki | inc/lang/gl/lang.php | 21089 | <?php
/**
* galician language file
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Medúlio <[email protected]>
* @author Oscar M. Lage <[email protected]>
* @author Rodrigo Rega <[email protected]>
*/
$lang['encoding'] = 'utf-8';
$lang['direction'] = 'ltr';
$lang['doublequoteopening'] = '“';
$lang['doublequoteclosing'] = '”';
$lang['singlequoteopening'] = '‘';
$lang['singlequoteclosing'] = '’';
$lang['apostrophe'] = '’';
$lang['btn_edit'] = 'Editar esta páxina';
$lang['btn_source'] = 'Amosar a fonte da páxina';
$lang['btn_show'] = 'Amosar páxina';
$lang['btn_create'] = 'Crear esta páxina';
$lang['btn_search'] = 'Procurar';
$lang['btn_save'] = 'Gardar';
$lang['btn_preview'] = 'Previsualizar';
$lang['btn_top'] = 'Comezo da páxina';
$lang['btn_newer'] = '<< máis recente';
$lang['btn_older'] = 'menos recente >>';
$lang['btn_revs'] = 'Revisións antigas';
$lang['btn_recent'] = 'Trocos recentes';
$lang['btn_upload'] = 'Subir';
$lang['btn_cancel'] = 'Cancelar';
$lang['btn_index'] = 'Índice';
$lang['btn_secedit'] = 'Editar';
$lang['btn_login'] = 'Iniciar sesión';
$lang['btn_logout'] = 'Rematar sesión';
$lang['btn_admin'] = 'Administración';
$lang['btn_update'] = 'Actualizar';
$lang['btn_delete'] = 'Borrar';
$lang['btn_back'] = 'Atrás';
$lang['btn_backlink'] = 'Ligazóns con isto';
$lang['btn_subscribe'] = 'Avísame dos trocos na páxina';
$lang['btn_profile'] = 'Actualizar Perfil';
$lang['btn_reset'] = 'Reiniciar';
$lang['btn_resendpwd'] = 'Establecer novo contrasinal';
$lang['btn_draft'] = 'Editar borrador';
$lang['btn_recover'] = 'Recuperar borrador';
$lang['btn_draftdel'] = 'Eliminar borrador';
$lang['btn_revert'] = 'Restaurar';
$lang['btn_register'] = 'Rexístrate';
$lang['btn_apply'] = 'Aplicar';
$lang['btn_media'] = 'Xestor de Arquivos-Media';
$lang['loggedinas'] = 'Iniciaches sesión como:';
$lang['user'] = 'Nome de Usuario';
$lang['pass'] = 'Contrasinal';
$lang['newpass'] = 'Novo Contrasinal';
$lang['oldpass'] = 'Confirmar contrasinal actual';
$lang['passchk'] = 'de novo';
$lang['remember'] = 'Lémbrame';
$lang['fullname'] = 'Nome Completo';
$lang['email'] = 'Correo-e';
$lang['profile'] = 'Perfil de Usuario';
$lang['badlogin'] = 'Sentímolo, mais o nome de usuario ou o contrasinal non son correctos.';
$lang['minoredit'] = 'Trocos Menores';
$lang['draftdate'] = 'Borrador gardado automaticamente en';
$lang['nosecedit'] = 'A páxina mudou entrementres, a información da sección estaba desfasada polo que se cargou a páxina completa no seu lugar.';
$lang['searchcreatepage'] = "Se non atopaches o que estabas a procurar, podes crear ou editar a páxina co nome relacionado coa túa procura empregando o botón axeitado.";
$lang['regmissing'] = 'Sentímolo, mais tes que cubrir todos os campos.';
$lang['reguexists'] = 'Sentímolo, mais xa existe un usuario con ese nome.';
$lang['regsuccess'] = 'O usuario foi creado e o contrasinal enviado por correo-e.';
$lang['regsuccess2'] = 'O usuario foi creado.';
$lang['regmailfail'] = 'Semella que houbo un erro ao tentar enviar o correo-e co contrasinal. Por favor, contacta co administrador!';
$lang['regbadmail'] = 'O enderezo de correo-e proporcionado semella incorrecto - se consideras que isto é un erro, contacta co administrador';
$lang['regbadpass'] = 'Os dous contrasinais inseridos non coinciden, por favor téntao de novo.';
$lang['regpwmail'] = 'O teu contrasinal do DokuWiki';
$lang['reghere'] = 'Aínda non tes unha conta? Crea a túa';
$lang['profna'] = 'Este wiki non permite modificacións dos perfís';
$lang['profnochange'] = 'Non hai trocos, nada que facer.';
$lang['profnoempty'] = 'Non se permite un nome ou un enderezo de correo-e baleiros.';
$lang['profchanged'] = 'Perfil de usuario actualizado correctamente.';
$lang['pwdforget'] = 'Esqueceches o teu contrasinal? Consegue un novo';
$lang['resendna'] = 'Este wiki non permite o reenvío de contrasinais.';
$lang['resendpwd'] = 'Establecer novo contrasinal para';
$lang['resendpwdmissing'] = 'Sentímolo, tes que cubrir todos os campos.';
$lang['resendpwdnouser'] = 'Sentímolo, non atopamos este usuario no noso banco de datos.';
$lang['resendpwdbadauth'] = 'Sentímolo, mais este código de autorización non é válido. Asegúrate de que usaches a ligazón completa de confirmación.';
$lang['resendpwdconfirm'] = 'Enviouse unha ligazón de confirmación por correo-e.';
$lang['resendpwdsuccess'] = 'O teu novo contrasinal foi enviado por correo-e.';
$lang['license'] = 'O contido deste wiki, agás onde se indique o contrario, ofrécese baixo da seguinte licenza:';
$lang['licenseok'] = 'Nota: Ao editares esta páxina estás a aceptar o licenciamento do contido baixo da seguinte licenza:';
$lang['searchmedia'] = 'Procurar nome de arquivo:';
$lang['searchmedia_in'] = 'Procurar en %s';
$lang['txt_upload'] = 'Escolle o arquivo para subir:';
$lang['txt_filename'] = 'Subir como (opcional):';
$lang['txt_overwrt'] = 'Sobrescribir arquivo existente';
$lang['maxuploadsize'] = 'Subida máxima %s por arquivo.';
$lang['lockedby'] = 'Bloqueado actualmente por:';
$lang['lockexpire'] = 'O bloqueo remata o:';
$lang['js']['willexpire'] = 'O teu bloqueo para editares esta páxina vai caducar nun minuto.\nPara de evitar conflitos, emprega o botón de previsualización para reiniciares o contador do tempo de bloqueo.';
$lang['js']['notsavedyet'] = 'Perderanse os trocos non gardados.
Está certo de quereres continuar?';
$lang['js']['searchmedia'] = 'Procurar ficheiros';
$lang['js']['keepopen'] = 'Manter a fiestra aberta na selección';
$lang['js']['hidedetails'] = 'Agochar Pormenores';
$lang['js']['mediatitle'] = 'Configuración de ligazón';
$lang['js']['mediadisplay'] = 'Tipo de ligazón';
$lang['js']['mediaalign'] = 'Aliñamento';
$lang['js']['mediasize'] = 'Tamaño de imaxe';
$lang['js']['mediatarget'] = 'Albo da ligazón';
$lang['js']['mediaclose'] = 'Fechar';
$lang['js']['mediainsert'] = 'Inserir';
$lang['js']['mediadisplayimg'] = 'Amosar a imaxe';
$lang['js']['mediadisplaylnk'] = 'Amosar só a ligazón';
$lang['js']['mediasmall'] = 'Versión reducida';
$lang['js']['mediamedium'] = 'Versión media';
$lang['js']['medialarge'] = 'Versión grande';
$lang['js']['mediaoriginal'] = 'Versión orixinal';
$lang['js']['medialnk'] = 'Ligazón para a páxina de pormenores';
$lang['js']['mediadirect'] = 'Ligazón directa para o orixinal';
$lang['js']['medianolnk'] = 'Sen ligazón';
$lang['js']['medianolink'] = 'Non ligar a imaxe';
$lang['js']['medialeft'] = 'Aliñar a imaxe á esquerda';
$lang['js']['mediaright'] = 'Aliñar a imaxe á dereita';
$lang['js']['mediacenter'] = 'Aliñar a iamxe ao medio';
$lang['js']['medianoalign'] = 'Non empregar aliñamento';
$lang['js']['nosmblinks'] = 'A ligazón aos compartidos do Windows só funciona no Microsoft Internet Explorer.
Sempre podes copiar e colar a ligazón.';
$lang['js']['linkwiz'] = 'Asistente de ligazóns';
$lang['js']['linkto'] = 'Ligazón para:';
$lang['js']['del_confirm'] = 'Estás certo de quereres eliminar os elementos seleccionados?';
$lang['js']['restore_confirm'] = 'Realmente desexas restaurar esta versión?';
$lang['js']['media_diff'] = 'Ver as diferencias:';
$lang['js']['media_diff_both'] = 'Cara a Cara';
$lang['js']['media_diff_opacity'] = 'Opacidade';
$lang['js']['media_diff_portions'] = 'Porcións';
$lang['js']['media_select'] = 'Selecciona arquivos...';
$lang['js']['media_upload_btn'] = 'Subir';
$lang['js']['media_done_btn'] = 'Feito';
$lang['js']['media_drop'] = 'Solta aquí os arquivos a subir';
$lang['js']['media_cancel'] = 'eliminar';
$lang['js']['media_overwrt'] = 'Sobreescribir os arquivos existentes';
$lang['rssfailed'] = 'Houbo un erro ao tentar obter esta corrente RSS: ';
$lang['nothingfound'] = 'Non se atopou nada.';
$lang['mediaselect'] = 'Arquivos-Media';
$lang['uploadsucc'] = 'Subida correcta';
$lang['uploadfail'] = 'Erra na subida. Pode que sexa un problema de permisos?';
$lang['uploadwrong'] = 'Subida denegada. Esta extensión de arquivo non está permitida!';
$lang['uploadexist'] = 'Xa existe o arquivo. Non se fixo nada.';
$lang['uploadbadcontent'] = 'O contido subido non concorda coa extensión do arquivo %s.';
$lang['uploadspam'] = 'A subida foi bloqueada pola lista negra de correo-lixo.';
$lang['uploadxss'] = 'A subida foi bloqueada por un posíbel contido malicioso.';
$lang['uploadsize'] = 'O arquivo subido é grande de máis. (máx. %s)';
$lang['deletesucc'] = 'O arquivo "%s" foi eliminado.';
$lang['deletefail'] = '"%s" non puido ser eliminado - comproba os permisos.';
$lang['mediainuse'] = 'O arquivo "%s" non foi eliminado - aínda está en uso.';
$lang['namespaces'] = 'Nomes de espazos';
$lang['mediafiles'] = 'Arquivos dispoñíbeis en';
$lang['accessdenied'] = 'Non tes permitido ver esta páxina.';
$lang['mediausage'] = 'Emprega a seguinte sintaxe para inserires unha referencia a este arquivo:';
$lang['mediaview'] = 'Ver arquivo orixinal';
$lang['mediaroot'] = 'raigaña';
$lang['mediaupload'] = 'Sube aquí un arquivo ao nome de espazo actual. Para creares sub-nomes de espazos deberás antepoñelos ao nome indicado en "Subir como" separados por dous puntos.';
$lang['mediaextchange'] = 'Extensión de arquivo mudada de .%s a .%s!';
$lang['reference'] = 'Referencias para';
$lang['ref_inuse'] = 'O arquivo non pode ser eliminado, xa que aínda está a ser usado polas seguintes páxinas:';
$lang['ref_hidden'] = 'Algunhas referencias están en páxinas para as cales non tes permisos de lectura';
$lang['hits'] = 'Vistas';
$lang['quickhits'] = 'Nomes de páxinas coincidentes';
$lang['toc'] = 'Táboa de Contidos';
$lang['current'] = 'actual';
$lang['yours'] = 'A túa Versión';
$lang['diff'] = 'Amosar diferenzas coa versión actual';
$lang['diff2'] = 'Amosar diferenzas entre as revisións seleccionadas';
$lang['difflink'] = 'Enlazar a esta vista de comparación';
$lang['diff_type'] = 'Ver diferenzas:';
$lang['diff_inline'] = 'Por liña';
$lang['diff_side'] = 'Cara a Cara';
$lang['line'] = 'Liña';
$lang['breadcrumb'] = 'Trazado:';
$lang['youarehere'] = 'Estás aquí:';
$lang['lastmod'] = 'Última modificación:';
$lang['by'] = 'por';
$lang['deleted'] = 'eliminado';
$lang['created'] = 'creado';
$lang['restored'] = 'revisión antiga restaurada (%s)';
$lang['external_edit'] = 'edición externa';
$lang['summary'] = 'Resumo da edición';
$lang['noflash'] = 'Precísase o <a href="http://www.adobe.com/products/flashplayer/">Extensión Adobe Flash</a> para amosar este contido.';
$lang['download'] = 'Descargar Retallo (Snippet)';
$lang['tools'] = 'Ferramentas';
$lang['user_tools'] = 'Ferramentas de usuario';
$lang['site_tools'] = 'Ferramentas do sitio';
$lang['page_tools'] = 'Ferramentas de páxina';
$lang['skip_to_content'] = 'Pasar ao contido';
$lang['sidebar'] = 'Barra lateral';
$lang['mail_newpage'] = 'páxina engadida:';
$lang['mail_changed'] = 'páxina mudada:';
$lang['mail_subscribe_list'] = 'páxinas mudadas en nome de espazo:';
$lang['mail_new_user'] = 'Novo usuario:';
$lang['mail_upload'] = 'arquivo subido:';
$lang['changes_type'] = 'Ver cambios';
$lang['pages_changes'] = 'Páxinas';
$lang['media_changes'] = 'Arquivos-Media';
$lang['both_changes'] = 'Ambos, páxinas e arquivos-media';
$lang['qb_bold'] = 'Texto Resaltado';
$lang['qb_italic'] = 'Texto en Cursiva';
$lang['qb_underl'] = 'Texto Subliñado';
$lang['qb_code'] = 'Texto de Código';
$lang['qb_strike'] = 'Texto Riscado';
$lang['qb_h1'] = 'Liña de Cabeceira de Nivel 1';
$lang['qb_h2'] = 'Liña de Cabeceira de Nivel 2';
$lang['qb_h3'] = 'Liña de Cabeceira de Nivel 3';
$lang['qb_h4'] = 'Liña de Cabeceira de Nivel 4';
$lang['qb_h5'] = 'Liña de Cabeceira de Nivel 5';
$lang['qb_h'] = 'Liña de Cabeceira';
$lang['qb_hs'] = 'Escoller Liña de Cabeceira';
$lang['qb_hplus'] = 'Liña de Cabeceira Máis Alta';
$lang['qb_hminus'] = 'Liña de Cabeceira Máis Baixa';
$lang['qb_hequal'] = 'Liña de Cabeceira ao Mesmo Nivel';
$lang['qb_link'] = 'Ligazón Interna';
$lang['qb_extlink'] = 'Ligazón Externa';
$lang['qb_hr'] = 'Liña Horizontal';
$lang['qb_ol'] = 'Elemento de Lista Ordenada';
$lang['qb_ul'] = 'Elemento de Lista Desordenada';
$lang['qb_media'] = 'Engadir Imaxes e Outros Arquivos';
$lang['qb_sig'] = 'Inserir Sinatura';
$lang['qb_smileys'] = 'Risoños';
$lang['qb_chars'] = 'Caracteres Especiais';
$lang['upperns'] = 'choutar ao nome de espazo pai';
$lang['metaedit'] = 'Editar Metadatos';
$lang['metasaveerr'] = 'Non se puideron escribir os metadatos';
$lang['metasaveok'] = 'Metadatos gardados';
$lang['btn_img_backto'] = 'Volver a %s';
$lang['img_title'] = 'Título:';
$lang['img_caption'] = 'Lenda:';
$lang['img_date'] = 'Data:';
$lang['img_fname'] = 'Nome de arquivo:';
$lang['img_fsize'] = 'Tamaño:';
$lang['img_artist'] = 'Fotógrafo:';
$lang['img_copyr'] = 'Copyright:';
$lang['img_format'] = 'Formato:';
$lang['img_camera'] = 'Cámara:';
$lang['img_keywords'] = 'Verbas chave:';
$lang['img_width'] = 'Ancho:';
$lang['img_height'] = 'Alto:';
$lang['btn_mediaManager'] = 'Ver no xestor de arquivos-media';
$lang['subscr_subscribe_success'] = 'Engadido %s á lista de subscrición para %s';
$lang['subscr_subscribe_error'] = 'Erro ao tentar engadir %s á lista de subscrición para %s';
$lang['subscr_subscribe_noaddress'] = 'Non hai enderezos asociados co teu inicio de sesión, non é posíbel engadirte á lista de subscrición';
$lang['subscr_unsubscribe_success'] = 'Eliminado %s da lista de subscrición para %s';
$lang['subscr_unsubscribe_error'] = 'Erro ao tentar eliminar %s da lista de subscrición para %s';
$lang['subscr_already_subscribed'] = '%s xa está subscrito a %s';
$lang['subscr_not_subscribed'] = '%s non está subscrito a %s';
$lang['subscr_m_not_subscribed'] = 'Agora mesmo non estás subscrito á páxina ou nome de espazo actual';
$lang['subscr_m_new_header'] = 'Engadir subscrición';
$lang['subscr_m_current_header'] = 'Subscricións actuais';
$lang['subscr_m_unsubscribe'] = 'Desubscribir';
$lang['subscr_m_subscribe'] = 'Subscribir';
$lang['subscr_m_receive'] = 'Recibir';
$lang['subscr_style_every'] = 'correo-e en cada troco';
$lang['authtempfail'] = 'A autenticación de usuario non está dispoñible de xeito temporal. De persistir esta situación, por favor, informa ao Administrador do teu Wiki.';
$lang['i_chooselang'] = 'Escolle o teu idioma';
$lang['i_installer'] = 'Instalador do DokuWiki';
$lang['i_wikiname'] = 'Nome do Wiki';
$lang['i_enableacl'] = 'Activar ACL (recomendado)';
$lang['i_superuser'] = 'Super-usuario';
$lang['i_problems'] = 'O instalador atopou algúns problemas, que se amosan de seguido. Non poderás continuar até que os soluciones.';
$lang['i_modified'] = 'Por razóns de seguridade este script só funcionará cunha instalación nova e sen modificar do Dokuwiki.
Podes ou ben extraer de novo os arquivos dende o paquete descargado ou consultar as
<a href="http://dokuwiki.org/install">instruccións completas de instalación do Dokuwiki</a>';
$lang['i_funcna'] = 'A función <code>%s</code> do PHP non está dispoñíbel. Pode que o teu provedor de hospedaxe a desactivase por algún motivo?';
$lang['i_phpver'] = 'A túa versión <code>%s</code> do PHP é inferior á <code>%s</code> precisa. Debes actualizar a túa instalación do PHP.';
$lang['i_permfail'] = '<code>%s</code> non é escribíbel polo DokuWiki. Debes corrixir a configuración de permisos deste directorio!';
$lang['i_confexists'] = '<code>%s</code> xa existe';
$lang['i_writeerr'] = 'Non se puido crear <code>%s</code>. Terás de comprobar os permisos do directorio/arquivo e crear o ficheiro de xeito manual.';
$lang['i_badhash'] = 'dokuwiki.php irrecoñecíbel ou modificado (hash=<code>%s</code>)';
$lang['i_badval'] = '<code>%s</code> - ilegal ou valor baleiro';
$lang['i_success'] = 'A configuración rematou correctamente. Agora podes eliminar o arquivo install.php. Continúa deica o
<a href="doku.php">teu novo DokuWiki</a>.';
$lang['i_failure'] = 'Houbo algúns erros ao tentar escribir os arquivos de configuración. Pode que precises solucionalos de xeito manual antes
de poderes empregar <a href="doku.php">o teu novo DokuWiki</a>.';
$lang['i_policy'] = 'Regras iniciais da ACL';
$lang['i_pol0'] = 'Wiki Aberto (lectura, escritura, subida de arquivos para todas as persoas)';
$lang['i_pol1'] = 'Wiki Público (lectura para todas as persoas, escritura e subida de arquivos para usuarios rexistrados)';
$lang['i_pol2'] = 'Wiki Fechado (lectura, escritura, subida de arquivos só para usuarios rexistrados)';
$lang['i_retry'] = 'Tentar de novo';
$lang['i_license'] = 'Por favor escolla a licenza para o contido:';
$lang['recent_global'] = 'Agora mesmo estás a ver os trocos no nome de espazo <b>%s</b>. Tamén podes <a href="%s">ver os trocos recentes no Wiki enteiro</a>.';
$lang['years'] = 'hai %d anos';
$lang['months'] = 'hai %d meses';
$lang['weeks'] = 'hai %d semanas';
$lang['days'] = 'hai %d días';
$lang['hours'] = 'hai %d horas';
$lang['minutes'] = 'hai %d minutos';
$lang['seconds'] = 'hai %d segundos';
$lang['wordblock'] = 'Non se gardaron os cambios porque conteñen texto bloqueado (spam).';
$lang['media_uploadtab'] = 'Subir';
$lang['media_searchtab'] = 'Buscar';
$lang['media_file'] = 'Arquivo';
$lang['media_viewtab'] = 'Ver';
$lang['media_edittab'] = 'Editar';
$lang['media_historytab'] = 'Histórico';
$lang['media_list_thumbs'] = 'Miniaturas';
$lang['media_list_rows'] = 'Filas';
$lang['media_sort_name'] = 'Nome';
$lang['media_sort_date'] = 'Data';
$lang['media_namespaces'] = 'Escolla espazo';
$lang['media_files'] = 'Arquivos en %s';
$lang['media_upload'] = 'Subir a %s';
$lang['media_search'] = 'Buscar en %s';
$lang['media_view'] = '%s';
$lang['media_viewold'] = '%s en %s';
$lang['media_edit'] = 'Editar %s';
$lang['media_history'] = 'Historia de %s';
$lang['media_meta_edited'] = 'datos meta editados';
$lang['media_perm_read'] = 'Sentímolo, non tes permisos suficientes para ler arquivos.';
$lang['media_perm_upload'] = 'Sentímolo, non tes permisos suficientes para subir arquivos.';
$lang['media_update'] = 'Subir nova versión';
$lang['media_restore'] = 'Restaurar esta versión';
| gpl-2.0 |
dtulyakov/php | old/test.php | 587 | <?PHP
// Определяем что такое машины, что она умеет делать и как.
class car
{
var $color = 'White';
function tut_tut() { echo "BIp BIp"; }
}
$honda = new car; // присваиваем переменной honda объект - Машину
echo $honda->color; // Выводим свойство машины - цвет
//
//$ch = curl_init('http://www.php.su');
//curl_exec($ch); // выполняем запрос curl - обращаемся к сервера php.su
//curl_close($ch);
?>
| gpl-2.0 |
mangosthree/server | src/modules/SD3/scripts/eastern_kingdoms/scholomance/instance_scholomance.cpp | 19204 | /**
* ScriptDev3 is an extension for mangos providing enhanced features for
* area triggers, creatures, game objects, instances, items, and spells beyond
* the default database scripting in mangos.
*
* Copyright (C) 2006-2013 ScriptDev2 <http://www.scriptdev2.com/>
* Copyright (C) 2014-2021 MaNGOS <https://getmangos.eu>
*
* 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
*
* World of Warcraft, and all World of Warcraft or Warcraft art, images,
* and lore are copyrighted by Blizzard Entertainment, Inc.
*/
/**
* ScriptData
* SDName: Instance_Scholomance
* SD%Complete: 99
* SDComment: Possible some D2 or other exotic missing
* SDCategory: Scholomance
* EndScriptData
*/
#include "precompiled.h"
#include "scholomance.h"
struct is_scholomance : public InstanceScript
{
is_scholomance() : InstanceScript("instance_scholomance") {}
class instance_scholomance : public ScriptedInstance
{
public:
instance_scholomance(Map* pMap) : ScriptedInstance(pMap),
m_uiGandlingEvent(0)
{
Initialize();
}
~instance_scholomance() {}
void Initialize() override
{
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
for (uint8 i = 0; i < MAX_EVENTS; ++i)
{
m_mGandlingData[aGandlingEvents[i]] = GandlingEventData();
}
}
void OnCreatureEnterCombat(Creature* pCreature) override
{
switch (pCreature->GetEntry())
{
case NPC_KIRTONOS:
SetData(TYPE_KIRTONOS, IN_PROGRESS);
break;
case NPC_RATTLEGORE:
SetData(TYPE_RATTLEGORE, IN_PROGRESS);
break;
case NPC_RAS_FROSTWHISPER:
SetData(TYPE_RAS_FROSTWHISPER, IN_PROGRESS);
break;
case NPC_THEOLEN_KRASTINOV:
SetData(TYPE_THEOLEN, IN_PROGRESS);
break;
case NPC_LOREKEEPER_POLKELT:
SetData(TYPE_POLKELT, IN_PROGRESS);
break;
case NPC_RAVENIAN:
SetData(TYPE_RAVENIAN, IN_PROGRESS);
break;
case NPC_ILLUCIA_BAROV:
SetData(TYPE_ILLUCIA_BAROV, IN_PROGRESS);
break;
case NPC_ALEXEI_BAROV:
SetData(TYPE_ALEXEI_BAROV, IN_PROGRESS);
break;
case NPC_INSTRUCTOR_MALICIA:
SetData(TYPE_MALICIA, IN_PROGRESS);
break;
case NPC_DARKMASTER_GANDLING:
SetData(TYPE_GANDLING, IN_PROGRESS);
break;
case NPC_BONE_MINION:
for (GandlingEventMap::iterator itr = m_mGandlingData.begin(); itr != m_mGandlingData.end(); ++itr)
{
// if there are no minions for a room, skip it
if (!itr->second.m_sAddGuids.empty())
{
// set data to fail in case of player death
if (itr->second.m_sAddGuids.find(pCreature->GetGUIDLow()) != itr->second.m_sAddGuids.end())
{
HandlePortalEvent(itr->first, IN_PROGRESS);
break;
}
}
}
break;
}
}
void OnCreatureEvade(Creature* pCreature) override
{
switch (pCreature->GetEntry())
{
case NPC_KIRTONOS:
SetData(TYPE_KIRTONOS, FAIL);
break;
case NPC_RATTLEGORE:
SetData(TYPE_RATTLEGORE, FAIL);
break;
case NPC_RAS_FROSTWHISPER:
SetData(TYPE_RAS_FROSTWHISPER, FAIL);
break;
case NPC_THEOLEN_KRASTINOV:
SetData(TYPE_THEOLEN, FAIL);
break;
case NPC_LOREKEEPER_POLKELT:
SetData(TYPE_POLKELT, FAIL);
break;
case NPC_RAVENIAN:
SetData(TYPE_RAVENIAN, FAIL);
break;
case NPC_ILLUCIA_BAROV:
SetData(TYPE_ILLUCIA_BAROV, FAIL);
break;
case NPC_ALEXEI_BAROV:
SetData(TYPE_ALEXEI_BAROV, FAIL);
break;
case NPC_INSTRUCTOR_MALICIA:
SetData(TYPE_MALICIA, FAIL);
break;
case NPC_DARKMASTER_GANDLING:
SetData(TYPE_GANDLING, FAIL);
break;
case NPC_BONE_MINION:
for (GandlingEventMap::iterator itr = m_mGandlingData.begin(); itr != m_mGandlingData.end(); ++itr)
{
// if there are no minions for a room, skip it
if (!itr->second.m_sAddGuids.empty())
{
// set data to fail in case of player death
if (itr->second.m_sAddGuids.find(pCreature->GetGUIDLow()) != itr->second.m_sAddGuids.end())
{
HandlePortalEvent(itr->first, FAIL);
break;
}
}
}
break;
}
}
void OnCreatureDeath(Creature* pCreature) override
{
switch (pCreature->GetEntry())
{
case NPC_KIRTONOS:
SetData(TYPE_KIRTONOS, DONE);
break;
case NPC_RATTLEGORE:
SetData(TYPE_RATTLEGORE, DONE);
break;
case NPC_RAS_FROSTWHISPER:
SetData(TYPE_RAS_FROSTWHISPER, DONE);
break;
case NPC_THEOLEN_KRASTINOV:
SetData(TYPE_THEOLEN, DONE);
break;
case NPC_LOREKEEPER_POLKELT:
SetData(TYPE_POLKELT, DONE);
break;
case NPC_RAVENIAN:
SetData(TYPE_RAVENIAN, DONE);
break;
case NPC_ILLUCIA_BAROV:
SetData(TYPE_ILLUCIA_BAROV, DONE);
break;
case NPC_ALEXEI_BAROV:
SetData(TYPE_ALEXEI_BAROV, DONE);
break;
case NPC_INSTRUCTOR_MALICIA:
SetData(TYPE_MALICIA, DONE);
break;
case NPC_DARKMASTER_GANDLING:
SetData(TYPE_GANDLING, DONE);
break;
case NPC_BONE_MINION:
for (GandlingEventMap::iterator itr = m_mGandlingData.begin(); itr != m_mGandlingData.end(); ++itr)
{
// if there are no minions for a room, skip it
if (!itr->second.m_sAddGuids.empty())
{
// search for the dead minion and erase it
if (itr->second.m_sAddGuids.find(pCreature->GetGUIDLow()) != itr->second.m_sAddGuids.end())
{
itr->second.m_sAddGuids.erase(pCreature->GetGUIDLow());
// if the current list is empty; set event id as done
if (itr->second.m_sAddGuids.empty())
{
HandlePortalEvent(itr->first, DONE);
break;
}
}
}
}
break;
}
}
void OnCreatureCreate(Creature* pCreature) override
{
switch (pCreature->GetEntry())
{
case NPC_DARKMASTER_GANDLING:
m_mNpcEntryGuidStore[NPC_DARKMASTER_GANDLING] = pCreature->GetObjectGuid();
break;
case NPC_BONE_MINION:
GandlingEventMap::iterator find = m_mGandlingData.find(m_uiGandlingEvent);
if (find != m_mGandlingData.end())
{
find->second.m_sAddGuids.insert(pCreature->GetGUIDLow());
}
break;
}
}
void OnObjectCreate(GameObject* pGo) override
{
switch (pGo->GetEntry())
{
case GO_GATE_KIRTONOS:
case GO_GATE_RAS:
case GO_GATE_GANDLING:
m_mGoEntryGuidStore[pGo->GetEntry()] = pGo->GetObjectGuid();
break;
case GO_GATE_MALICIA:
m_mGandlingData[EVENT_ID_MALICIA].m_doorGuid = pGo->GetObjectGuid();
break;
case GO_GATE_THEOLEN:
m_mGandlingData[EVENT_ID_THEOLEN].m_doorGuid = pGo->GetObjectGuid();
break;
case GO_GATE_POLKELT:
m_mGandlingData[EVENT_ID_POLKELT].m_doorGuid = pGo->GetObjectGuid();
break;
case GO_GATE_RAVENIAN:
m_mGandlingData[EVENT_ID_RAVENIAN].m_doorGuid = pGo->GetObjectGuid();
break;
case GO_GATE_BAROV:
m_mGandlingData[EVENT_ID_BAROV].m_doorGuid = pGo->GetObjectGuid();
break;
case GO_GATE_ILLUCIA:
m_mGandlingData[EVENT_ID_ILLUCIA].m_doorGuid = pGo->GetObjectGuid();
break;
case GO_VIEWING_ROOM_DOOR:
// In normal flow of the instance, this door is opened by a dropped key
if (m_auiEncounter[TYPE_RATTLEGORE] == DONE)
{
pGo->SetGoState(GO_STATE_ACTIVE);
}
break;
}
}
void OnPlayerEnter(Player* /*pPlayer*/) override
{
// Summon Gandling if can
DoSpawnGandlingIfCan(true);
}
void SetData(uint32 uiType, uint32 uiData) override
{
switch (uiType)
{
case TYPE_KIRTONOS:
// This door is initially closed by DB-scripts, so only use it in case of FAIL, DONE, or on aggro after wipe
if (m_auiEncounter[uiType] != FAIL && uiData == IN_PROGRESS)
{
return;
}
m_auiEncounter[uiType] = uiData;
DoUseDoorOrButton(GO_GATE_KIRTONOS);
break;
case TYPE_RATTLEGORE:
m_auiEncounter[uiType] = uiData;
break;
case TYPE_RAS_FROSTWHISPER:
m_auiEncounter[uiType] = uiData;
DoUseDoorOrButton(GO_GATE_RAS);
break;
case TYPE_MALICIA: // TODO this code can be simplified, when it is known which event-ids correspond to which room
m_auiEncounter[uiType] = uiData;
DoUseDoorOrButton(m_mGandlingData[EVENT_ID_MALICIA].m_doorGuid);
break;
case TYPE_THEOLEN:
m_auiEncounter[uiType] = uiData;
DoUseDoorOrButton(m_mGandlingData[EVENT_ID_THEOLEN].m_doorGuid);
break;
case TYPE_POLKELT:
m_auiEncounter[uiType] = uiData;
DoUseDoorOrButton(m_mGandlingData[EVENT_ID_POLKELT].m_doorGuid);
break;
case TYPE_RAVENIAN:
m_auiEncounter[uiType] = uiData;
DoUseDoorOrButton(m_mGandlingData[EVENT_ID_RAVENIAN].m_doorGuid);
break;
case TYPE_ALEXEI_BAROV:
m_auiEncounter[uiType] = uiData;
DoUseDoorOrButton(m_mGandlingData[EVENT_ID_BAROV].m_doorGuid);
break;
case TYPE_ILLUCIA_BAROV:
m_auiEncounter[uiType] = uiData;
DoUseDoorOrButton(m_mGandlingData[EVENT_ID_ILLUCIA].m_doorGuid);
break;
case TYPE_GANDLING:
m_auiEncounter[uiType] = uiData;
// Close the door to main room, because the encounter will take place only in the main hall and random around all the 6 rooms
DoUseDoorOrButton(GO_GATE_GANDLING);
break;
case TYPE_SIGNAL:
HandlePortalEvent(uiData, SPECIAL);
return;
}
// Summon Gandling
if (uiData == DONE)
{
DoSpawnGandlingIfCan(false);
}
if (uiData == DONE)
{
OUT_SAVE_INST_DATA;
std::ostringstream saveStream;
saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " "
<< m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5] << " "
<< m_auiEncounter[6] << " " << m_auiEncounter[7] << " " << m_auiEncounter[8] << " " << m_auiEncounter[9];
m_strInstData = saveStream.str();
SaveToDB();
OUT_SAVE_INST_DATA_COMPLETE;
}
}
uint32 GetData(uint32 uiType) const override
{
if (uiType < MAX_ENCOUNTER)
{
return m_auiEncounter[uiType];
}
return 0;
}
const char* Save() const override { return m_strInstData.c_str(); }
void Load(const char* chrIn) override
{
if (!chrIn)
{
OUT_LOAD_INST_DATA_FAIL;
return;
}
OUT_LOAD_INST_DATA(chrIn);
std::istringstream loadStream(chrIn);
loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] >> m_auiEncounter[4]
>> m_auiEncounter[5] >> m_auiEncounter[6] >> m_auiEncounter[7] >> m_auiEncounter[8] >> m_auiEncounter[9];
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS)
{
m_auiEncounter[i] = NOT_STARTED;
}
OUT_LOAD_INST_DATA_COMPLETE;
}
private:
void HandlePortalEvent(uint32 uiEventId, uint32 uiData)
{
GandlingEventMap::iterator find = m_mGandlingData.find(uiEventId);
if (find == m_mGandlingData.end())
{
return;
}
if (uiData == SPECIAL)
{
// Set current Event index
m_uiGandlingEvent = uiEventId;
// Close door if needed
if (!find->second.m_bIsActive)
{
find->second.m_bIsActive = true;
DoUseDoorOrButton(find->second.m_doorGuid);
}
}
// Toggle door and event state in case of state-switch
else
{
if ((uiData == IN_PROGRESS && !find->second.m_bIsActive) ||
(uiData == FAIL && find->second.m_bIsActive) ||
(uiData == DONE && find->second.m_bIsActive))
{
find->second.m_bIsActive = !find->second.m_bIsActive;
DoUseDoorOrButton(find->second.m_doorGuid);
}
}
}
void DoSpawnGandlingIfCan(bool bByPlayerEnter)
{
// Do not summon, if event finished
if (m_auiEncounter[TYPE_GANDLING] == DONE)
{
return;
}
// Summon only once
if (GetSingleCreatureFromStorage(NPC_DARKMASTER_GANDLING))
{
return;
}
Player* pPlayer = GetPlayerInMap();
if (!pPlayer)
{
return;
}
// Check if all the six bosses are done first
if (m_auiEncounter[TYPE_MALICIA] == DONE && m_auiEncounter[TYPE_THEOLEN] == DONE && m_auiEncounter[TYPE_POLKELT] == DONE &&
m_auiEncounter[TYPE_RAVENIAN] == DONE && m_auiEncounter[TYPE_ALEXEI_BAROV] == DONE && m_auiEncounter[TYPE_ILLUCIA_BAROV] == DONE)
{
if (Creature* pGandling = pPlayer->SummonCreature(NPC_DARKMASTER_GANDLING, aGandlingSpawnLocs[0].m_fX, aGandlingSpawnLocs[0].m_fY, aGandlingSpawnLocs[0].m_fZ, aGandlingSpawnLocs[0].m_fO, TEMPSPAWN_DEAD_DESPAWN, 0))
{
if (!bByPlayerEnter)
{
DoScriptText(SAY_GANDLING_SPAWN, pGandling);
}
}
}
}
uint32 m_auiEncounter[MAX_ENCOUNTER];
std::string m_strInstData;
uint32 m_uiGandlingEvent;
GandlingEventMap m_mGandlingData;
};
InstanceData* GetInstanceData(Map* pMap) override
{
return new instance_scholomance(pMap);
}
};
struct event_spell_gandling_shadow_portal : public MapEventScript
{
event_spell_gandling_shadow_portal() : MapEventScript("event_spell_gandling_shadow_portal") {}
bool OnReceived(uint32 uiEventId, Object* pSource, Object* /*pTarget*/, bool /*bIsStart*/) override
{
if (pSource->GetTypeId() == TYPEID_UNIT)
{
if (InstanceData* pInstance = ((Creature*)pSource)->GetInstanceData())
{
// Check if we are handling an event associated with the room events of gandling
for (uint8 i = 0; i < MAX_EVENTS; ++i)
{
if (uiEventId == aGandlingEvents[i])
{
// Set data in progress for the current event and store current event
pInstance->SetData(TYPE_SIGNAL, uiEventId);
// return false, to allow the DB-scripts to summon some NPCSs
return false;
}
}
}
}
return false;
}
};
void AddSC_instance_scholomance()
{
Script* s;
s = new is_scholomance();
s->RegisterSelf();
s = new event_spell_gandling_shadow_portal();
s->RegisterSelf();
//pNewScript = new Script;
//pNewScript->Name = "instance_scholomance";
//pNewScript->GetInstanceData = &GetInstanceData_instance_scholomance;
//pNewScript->RegisterSelf();
//pNewScript = new Script;
//pNewScript->Name = "event_spell_gandling_shadow_portal";
//pNewScript->pProcessEventId = &ProcessEventId_event_spell_gandling_shadow_portal;
//pNewScript->RegisterSelf();
}
| gpl-2.0 |
asikatw/ref-legacy | components/com_ref/views/result/tmpl/default.php | 9520 | <?php
/**
* @version 1.0.0
* @package com_ref
* @copyright Copyright (C) 2012. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author Created by AKHelper - http://asikart.com
*/
// no direct access
defined('_JEXEC') or die;
JHtml::_('behavior.tooltip');
// RefHelper::_('include.bootstrap');
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder = $this->state->get('list.ordering');
$listDirn = $this->state->get('list.direction');
$canOrder = $user->authorise('core.edit.state', 'com_ref');
$saveOrder = $listOrder == 'a.ordering';
?>
<script type="text/javascript">
var n_num = <?php echo count($this->entry->get('eng_name', array(1))); ?> ;
var addNameInput = function(n) {
c = n.getParent();
num = c.get('n-num');
if(num != n_num) return ;
c2 = c.clone();
c2.set('n-num', num+1);
i = c2.getElements('input') ;
i.set('value', '');
c2.inject(c, 'after');
n_num = num+1 ;
}
window.addEvent('domready', function(){
var weboSlide = new Fx.Slide('webo-url');
<?php if( !isset($this->q->database->webometrics) ): ?>
weboSlide.hide();
<?php endif; ?>
$$('#webo-check').addEvent('click', function(e){
weboSlide.toggle();
});
});
</script>
<form action="<?php echo 'index.php?option=com_ref'; ?>" method="post" name="adminForm" id="adminForm">
<div id="ref-wrap" class="container-fluid entries<?php echo $this->get('pageclass_sfx');?>">
<div id="ref-wrap-inner">
<div class="row-fluid" style="text-align: left;">
<div class="span9">
<fleldset>
<legend>搜尋</legend>
<div class="form-horizontal">
<div class="control-group">
<label class="control-label" for="name">教師中文名</label>
<div class="controls">
<input type="text" name="name" id="name" placeholder="Name" value="<?php echo $this->entry->get('chinese_name'); ?>">
</div>
</div>
<div class="control-group">
<label class="control-label" for="first_name">英文名</label>
<?php foreach( $this->entry->eng_name as $k => $name ): ?>
<div class="controls eng-name" n-num="<?php echo $k+1; ?>">
<input type="text" name="first_name[]" class="span5" id="first_name" placeholder="First Name" onfocus="addNameInput(this);" value="<?php echo $name->first; ?>">
<input type="text" name="last_name[]" class="span5" id="last_name" placeholder="Last Name" onfocus="addNameInput(this);" value="<?php echo $name->last; ?>">
</div>
<?php endforeach; ?>
</div>
</div>
<div class="form-inline">
<label class="checkbox">
<input type="checkbox" name="database[syllabus]" value="1" <?php echo isset($this->q->database->syllabus) ? 'checked' : ''; ?>> 課程大綱
</label>
|
<label class="checkbox">
<input type="checkbox" name="database[ndltd]" value="1" <?php echo isset($this->q->database->ndltd) ? 'checked' : ''; ?>> 博碩士論文資料庫
</label>
|
<label class="checkbox">
<input type="checkbox" name="database[udn]" value="1" <?php echo isset($this->q->database->udn) ? 'checked' : ''; ?>> 報紙資料庫
</label>
|
<label class="checkbox">
<input type="checkbox" name="database[readopac]" value="1" <?php echo isset($this->q->database->readopac) ? 'checked' : ''; ?>> 雜誌資料庫
</label>
|
<label class="checkbox">
<input type="checkbox" name="database[wiki]" value="1" <?php echo isset($this->q->database->wiki) ? 'checked' : ''; ?>> 維基百科
</label>
|
<label class="checkbox">
<input type="checkbox" name="database[webometrics]" id="webo-check" value="1" <?php echo isset($this->q->database->webometrics) ? 'checked' : ''; ?>> Webometrics
</label>
<br /><br />
</div>
<div id="webo-url" style="">
<fieldset>
<?php foreach( $this->q->site as $site ): ?>
<input type="text" name="site[]" class="span8 input-site" onfocus="addInputSite(this);" placeholder="" value="<?php echo $site; ?>" />
<?php endforeach; ?>
</fieldset>
</div>
<script type="text/javascript">
var s = $$('.input-site') ;
var sn = 0 ;
s.each(function(e){
e.set('num', sn) ;
sn++;
});
var addInputSite = function(e){
if(e.get('num') == (sn - 1)) {
e2 = e.clone();
e2.set('value', '');
e2.set('num', sn);
e2.inject(e, 'after');
sn++;
var warp = $$('#webo-url')[0].getParent();
warp.setStyle('height', warp.getHeight() + 40);
}
}
</script>
<button class="btn">重新搜尋</button>
</fieldset>
<br />
<br />
<br />
<fieldset>
<legend>檢索結果</legend>
<table class="table table-bordered">
<tbody>
<?php if( isset($this->q->database->syllabus) ): ?>
<!--課程大綱-->
<tr>
<th rowspan="2" width="20%">課程大綱</th>
<td width="20%">被引用</td>
<td><?php echo $this->results['syllabus']->cited; ?></td>
</tr>
<tr>
<td>自我引用</td>
<td><?php echo $this->results['syllabus']->self_cited; ?></td>
</tr>
<?php endif; ?>
<?php if( isset($this->q->database->ndltd) ): ?>
<!--博碩士論文資料庫-->
<tr>
<th rowspan="2">博碩士論文資料庫</th>
<td>指導論文次數</td>
<td><?php echo $this->results['ndltd']->guidance; ?></td>
</tr>
<tr>
<td>論文參考文獻次數</td>
<td><?php echo $this->results['ndltd']->cited; ?></td>
</tr>
<?php endif; ?>
<?php if( isset($this->q->database->udn) ): ?>
<!--報紙資料庫-->
<tr>
<th rowspan="2">報紙資料庫</th>
<td>著作篇數</td>
<td><?php echo $this->results['udn']->writings; ?></td>
</tr>
<tr>
<td>被提及次數</td>
<td><?php echo $this->results['udn']->mentioned; ?></td>
</tr>
<?php endif; ?>
<?php if( isset($this->q->database->readopac) ): ?>
<!--雜誌資料庫-->
<tr>
<th rowspan="2">雜誌資料庫</th>
<td>著作篇數</td>
<td><?php echo $this->results['readopac']->writings; ?></td>
</tr>
<tr>
<td>被提及次數</td>
<td><?php echo $this->results['readopac']->mentioned; ?></td>
</tr>
<?php endif; ?>
<?php if( isset($this->q->database->webometrics) && $this->webometrics ): ?>
<!--Webometrics-->
<tr>
<th rowspan="4">Webometrics</th>
<td>網頁規模</td>
<td><?php echo $this->webometrics->web_scale; ?></td>
</tr>
<tr>
<td>能見度</td>
<td><?php echo $this->webometrics->visibility; ?></td>
</tr>
<tr>
<td>檔案</td>
<td><?php echo $this->webometrics->files; ?></td>
</tr>
<tr>
<td>學術文件</td>
<td><?php echo $this->webometrics->scholarly; ?></td>
</tr>
<?php endif; ?>
<?php if( isset($this->q->database->wiki) ): ?>
<!--維基百科-->
<tr>
<th rowspan="2">維基百科</th>
<!--<td>條目</td>
<td><?php echo $this->results['wiki']->entries; ?></td>
</tr>
<tr>-->
<td>被提及與列為參考文獻</td>
<td><?php echo $this->results['wiki']->mentioned; ?></td>
</tr>
<?php endif; ?>
<!--課程大綱-->
<!--<tr>
<th rowspan="2">課程大綱</th>
<td>被引用</td>
<td></td>
</tr>
<tr>
<td>自我引用</td>
<td></td>
</tr>-->
</tbody>
</table>
</fieldset>
<br /><br />
</div>
<div class="span3">
<fieldset>
<legend>相關搜索</legend>
<h4></h>您現在搜索的是:</h4>
<p><?php echo $this->entry->title; ?></p>
<h4>其他相關搜索:</h4>
<?php if( $this->relative ): ?>
<ul class="nav nav-list">
<?php foreach( $this->relative as $relavive): ?>
<li>
<a href="<?php echo $relavive->link; ?>">
<?php echo $relavive->title; ?>
</a>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</fieldset>
</div>
</div>
</div>
</div>
<div>
<input type="hidden" name="task" value="entry.save" />
<input type="hidden" name="boxchecked" value="0" />
<!--<input type="hidden" name="return" id="return_url" value="<?php echo base64_encode(JFactory::getURI()->toString()); ?>" />-->
<?php echo JHtml::_('form.token'); ?>
</div>
</form> | gpl-2.0 |
Nakard/phonebook | models/Entity/PhoneNumber.php | 2413 | <?php
/**
* PhoneNumber.php
*
* Creation date: 2014-04-24
* Creation time: 18:43
*
* @author Arkadiusz Moskwa <[email protected]>
*/
namespace Phonebook\Entity;
use Phonebook\Exceptions\UniquePersonPhoneNumberException;
use Doctrine\ORM\Mapping\Table;
use Doctrine\ORM\Mapping\HasLifecycleCallbacks;
use Doctrine\ORM\Mapping\Id;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\GeneratedValue;
use Doctrine\ORM\Mapping\ManyToOne;
/**
* Class PhoneNumber
* @package Phonebook\Entity
*
* @Entity(repositoryClass="Phonebook\Repository\PhoneNumberRepository")
* @Table(name="phone_numbers")
* @HasLifecycleCallbacks
*/
class PhoneNumber {
/**
* @var int $id
* @Id
* @Column(type="integer")
* @GeneratedValue
*/
protected $id;
/**
* @var int $person
* @ManyToOne(targetEntity="Person", inversedBy="phoneNumbers", cascade={"persist"})
*/
protected $person;
/**
* @var int $phoneNumber
* @Column(type="string", columnDefinition="CHAR(9) NOT NULL")
*/
protected $phoneNumber;
/**
* @param int $phoneNumber
*/
public function setPhoneNumber($phoneNumber)
{
$this->assertNumberUniqueness($phoneNumber);
$this->phoneNumber = $phoneNumber;
}
/**
* @return int
*/
public function getPhoneNumber()
{
return $this->phoneNumber;
}
/**
* @param Person $person
*/
public function setPerson(Person $person)
{
$this->person = $person;
}
/**
* @return Person
*/
public function getPerson()
{
return $this->person;
}
/**
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Checks if phone number is unique for a person
*
* @param string $number
* @throws UniquePersonPhoneNumberException
*/
public function assertNumberUniqueness($number)
{
$person = $this->getPerson();
if(is_null($person))
return;
$personPhoneNumbers = $person->getPhoneNumbers();
/**
* @var PhoneNumber $phoneNumber
*/
foreach($personPhoneNumbers as $phoneNumber)
{
if((int)$phoneNumber->getPhoneNumber() === (int)$number)
throw new UniquePersonPhoneNumberException();
}
}
} | gpl-2.0 |
MikkelSandbag/seElgg | actions/admin/user/removeadmin.php | 643 | <?php
/**
* Revokes admin privileges from a user.
*
* @package Elgg.Core
* @subpackage Administration.User
*/
$guid = get_input ( 'guid' );
$user = get_entity ( $guid );
if ($guid == elgg_get_logged_in_user_guid ()) {
register_error ( elgg_echo ( 'admin:user:self:removeadmin:no' ) );
forward ( REFERER );
}
if (($user instanceof ElggUser) && ($user->canEdit ())) {
if ($user->removeAdmin ()) {
system_message ( elgg_echo ( 'admin:user:removeadmin:yes' ) );
} else {
register_error ( elgg_echo ( 'admin:user:removeadmin:no' ) );
}
} else {
register_error ( elgg_echo ( 'admin:user:removeadmin:no' ) );
}
forward ( REFERER );
| gpl-2.0 |
AeroQuad/AeroQuadCommunicator | Documentation/html/search/functions_c.js | 2554 | var searchData=
[
['saveroute',['saveRoute',['../class_route.html#af7ee1d4d9a5786e9fa69ac9241780f35',1,'Route']]],
['scrolltobottom',['scrollToBottom',['../class_panel_firmware.html#a938e9f48484c25c81feadb69ddc26f46',1,'PanelFirmware']]],
['selectconfig',['selectConfig',['../class_panel_config.html#a150c70890753e6cb676b64bea1d840ad',1,'PanelConfig']]],
['selectdescription',['selectDescription',['../class_panel_config.html#a23f5d237d9e7a41304505e5355966e12',1,'PanelConfig']]],
['selectplot',['selectPlot',['../class_panel_plot.html#a41a145ccc4044009ae3928a115ece05c',1,'PanelPlot']]],
['sendmessage',['sendMessage',['../class_panel_config.html#ae9f1915cc4794c6e5c9a661c65ef1532',1,'PanelConfig::sendMessage()'],['../class_menu_connect.html#a4957bac7fb68b58068fee3585ef006dd',1,'MenuConnect::sendMessage()'],['../class_panel_example.html#a3112359e9e31c1559fe4b7ae6478d782',1,'PanelExample::sendMessage()'],['../class_panel_firmware.html#aa017d4d802594bf8f4fe599ca90dbe08',1,'PanelFirmware::sendMessage()'],['../class_panel_monitor.html#a27ca34feded6db78aaef2d639bdd5513',1,'PanelMonitor::sendMessage()'],['../class_panel_plot.html#a70f0aa8db465bc607ec4bbf0aa89d5b8',1,'PanelPlot::sendMessage()'],['../class_panel_route.html#ab214932b80e9fd25cea8d0918bd6c596',1,'PanelRoute::sendMessage()']]],
['setconnection',['setConnection',['../class_menu_connect.html#ae5bef033d8053396a82f3744288efe60',1,'MenuConnect']]],
['setconnectionstate',['setConnectionState',['../class_menu_connect.html#a9ad318f0ed14fe68647aad10cdb4940f',1,'MenuConnect']]],
['setupconfiglist',['setupConfigList',['../class_panel_config.html#a8d1c4ca3eec3ab7c5e52bf40fcc053b5',1,'PanelConfig']]],
['setupplotlist',['setupPlotList',['../class_panel_plot.html#aa4a86ed1c46e848733421c16fb02a421',1,'PanelPlot']]],
['setupplotnames',['setupPlotNames',['../class_panel_plot.html#ae218ae45727572d14a396e41fa99e0d1',1,'PanelPlot']]],
['setuptableheader',['setupTableHeader',['../class_panel_config.html#abd4acb61d6e672e7ac0bd9d70d6992af',1,'PanelConfig']]],
['showevent',['showEvent',['../class_menu_connect.html#aadda661d3bf1cc830fa96762c7f43205',1,'MenuConnect']]],
['startfirmwareupload',['startFirmwareUpload',['../class_panel_firmware.html#a28cfcca4680526537869af350192af75',1,'PanelFirmware']]],
['startpositionrequest',['startPositionRequest',['../class_panel_route.html#adbc01581c7e43dfc0f09da89ce70acf7',1,'PanelRoute']]],
['stoppositionrequest',['stopPositionRequest',['../class_panel_route.html#a99881da6413b15e3505853970b70ee03',1,'PanelRoute']]]
];
| gpl-2.0 |
smartcitiescommunity/Civikmind | vendor/laminas/laminas-validator/src/Iban.php | 9388 | <?php
/**
* @see https://github.com/laminas/laminas-validator for the canonical source repository
* @copyright https://github.com/laminas/laminas-validator/blob/master/COPYRIGHT.md
* @license https://github.com/laminas/laminas-validator/blob/master/LICENSE.md New BSD License
*/
namespace Laminas\Validator;
use Laminas\Stdlib\ArrayUtils;
use Traversable;
/**
* Validates IBAN Numbers (International Bank Account Numbers)
*/
class Iban extends AbstractValidator
{
const NOTSUPPORTED = 'ibanNotSupported';
const SEPANOTSUPPORTED = 'ibanSepaNotSupported';
const FALSEFORMAT = 'ibanFalseFormat';
const CHECKFAILED = 'ibanCheckFailed';
/**
* Validation failure message template definitions
*
* @var array
*/
protected $messageTemplates = [
self::NOTSUPPORTED => 'Unknown country within the IBAN',
self::SEPANOTSUPPORTED => 'Countries outside the Single Euro Payments Area (SEPA) are not supported',
self::FALSEFORMAT => 'The input has a false IBAN format',
self::CHECKFAILED => 'The input has failed the IBAN check',
];
/**
* Optional country code by ISO 3166-1
*
* @var string|null
*/
protected $countryCode;
/**
* Optionally allow IBAN codes from non-SEPA countries. Defaults to true
*
* @var bool
*/
protected $allowNonSepa = true;
/**
* The SEPA country codes
*
* @var array<ISO 3166-1>
*/
protected static $sepaCountries = [
'AT', 'BE', 'BG', 'CY', 'CZ', 'DK', 'FO', 'GL', 'EE', 'FI', 'FR', 'DE',
'GI', 'GR', 'HU', 'IS', 'IE', 'IT', 'LV', 'LI', 'LT', 'LU', 'MT', 'MC',
'NL', 'NO', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE', 'CH', 'GB', 'SM',
'HR',
];
/**
* IBAN regexes by country code
*
* @var array
*/
protected static $ibanRegex = [
'AD' => 'AD[0-9]{2}[0-9]{4}[0-9]{4}[A-Z0-9]{12}',
'AE' => 'AE[0-9]{2}[0-9]{3}[0-9]{16}',
'AL' => 'AL[0-9]{2}[0-9]{8}[A-Z0-9]{16}',
'AT' => 'AT[0-9]{2}[0-9]{5}[0-9]{11}',
'AZ' => 'AZ[0-9]{2}[A-Z]{4}[A-Z0-9]{20}',
'BA' => 'BA[0-9]{2}[0-9]{3}[0-9]{3}[0-9]{8}[0-9]{2}',
'BE' => 'BE[0-9]{2}[0-9]{3}[0-9]{7}[0-9]{2}',
'BG' => 'BG[0-9]{2}[A-Z]{4}[0-9]{4}[0-9]{2}[A-Z0-9]{8}',
'BH' => 'BH[0-9]{2}[A-Z]{4}[A-Z0-9]{14}',
'BR' => 'BR[0-9]{2}[0-9]{8}[0-9]{5}[0-9]{10}[A-Z][A-Z0-9]',
'BY' => 'BY[0-9]{2}[A-Z0-9]{4}[0-9]{4}[A-Z0-9]{16}',
'CH' => 'CH[0-9]{2}[0-9]{5}[A-Z0-9]{12}',
'CR' => 'CR[0-9]{2}[0-9]{3}[0-9]{14}',
'CY' => 'CY[0-9]{2}[0-9]{3}[0-9]{5}[A-Z0-9]{16}',
'CZ' => 'CZ[0-9]{2}[0-9]{20}',
'DE' => 'DE[0-9]{2}[0-9]{8}[0-9]{10}',
'DO' => 'DO[0-9]{2}[A-Z0-9]{4}[0-9]{20}',
'DK' => 'DK[0-9]{2}[0-9]{14}',
'EE' => 'EE[0-9]{2}[0-9]{2}[0-9]{2}[0-9]{11}[0-9]{1}',
'ES' => 'ES[0-9]{2}[0-9]{4}[0-9]{4}[0-9]{1}[0-9]{1}[0-9]{10}',
'FI' => 'FI[0-9]{2}[0-9]{6}[0-9]{7}[0-9]{1}',
'FO' => 'FO[0-9]{2}[0-9]{4}[0-9]{9}[0-9]{1}',
'FR' => 'FR[0-9]{2}[0-9]{5}[0-9]{5}[A-Z0-9]{11}[0-9]{2}',
'GB' => 'GB[0-9]{2}[A-Z]{4}[0-9]{6}[0-9]{8}',
'GE' => 'GE[0-9]{2}[A-Z]{2}[0-9]{16}',
'GI' => 'GI[0-9]{2}[A-Z]{4}[A-Z0-9]{15}',
'GL' => 'GL[0-9]{2}[0-9]{4}[0-9]{9}[0-9]{1}',
'GR' => 'GR[0-9]{2}[0-9]{3}[0-9]{4}[A-Z0-9]{16}',
'GT' => 'GT[0-9]{2}[A-Z0-9]{4}[A-Z0-9]{20}',
'HR' => 'HR[0-9]{2}[0-9]{7}[0-9]{10}',
'HU' => 'HU[0-9]{2}[0-9]{3}[0-9]{4}[0-9]{1}[0-9]{15}[0-9]{1}',
'IE' => 'IE[0-9]{2}[A-Z]{4}[0-9]{6}[0-9]{8}',
'IL' => 'IL[0-9]{2}[0-9]{3}[0-9]{3}[0-9]{13}',
'IS' => 'IS[0-9]{2}[0-9]{4}[0-9]{2}[0-9]{6}[0-9]{10}',
'IT' => 'IT[0-9]{2}[A-Z]{1}[0-9]{5}[0-9]{5}[A-Z0-9]{12}',
'KW' => 'KW[0-9]{2}[A-Z]{4}[0-9]{22}',
'KZ' => 'KZ[0-9]{2}[0-9]{3}[A-Z0-9]{13}',
'LB' => 'LB[0-9]{2}[0-9]{4}[A-Z0-9]{20}',
'LI' => 'LI[0-9]{2}[0-9]{5}[A-Z0-9]{12}',
'LT' => 'LT[0-9]{2}[0-9]{5}[0-9]{11}',
'LU' => 'LU[0-9]{2}[0-9]{3}[A-Z0-9]{13}',
'LV' => 'LV[0-9]{2}[A-Z]{4}[A-Z0-9]{13}',
'MC' => 'MC[0-9]{2}[0-9]{5}[0-9]{5}[A-Z0-9]{11}[0-9]{2}',
'MD' => 'MD[0-9]{2}[A-Z0-9]{20}',
'ME' => 'ME[0-9]{2}[0-9]{3}[0-9]{13}[0-9]{2}',
'MK' => 'MK[0-9]{2}[0-9]{3}[A-Z0-9]{10}[0-9]{2}',
'MR' => 'MR13[0-9]{5}[0-9]{5}[0-9]{11}[0-9]{2}',
'MT' => 'MT[0-9]{2}[A-Z]{4}[0-9]{5}[A-Z0-9]{18}',
'MU' => 'MU[0-9]{2}[A-Z]{4}[0-9]{2}[0-9]{2}[0-9]{12}[0-9]{3}[A-Z]{3}',
'NL' => 'NL[0-9]{2}[A-Z]{4}[0-9]{10}',
'NO' => 'NO[0-9]{2}[0-9]{4}[0-9]{6}[0-9]{1}',
'PK' => 'PK[0-9]{2}[A-Z]{4}[A-Z0-9]{16}',
'PL' => 'PL[0-9]{2}[0-9]{8}[0-9]{16}',
'PS' => 'PS[0-9]{2}[A-Z]{4}[A-Z0-9]{21}',
'PT' => 'PT[0-9]{2}[0-9]{4}[0-9]{4}[0-9]{11}[0-9]{2}',
'RO' => 'RO[0-9]{2}[A-Z]{4}[A-Z0-9]{16}',
'RS' => 'RS[0-9]{2}[0-9]{3}[0-9]{13}[0-9]{2}',
'SA' => 'SA[0-9]{2}[0-9]{2}[A-Z0-9]{18}',
'SE' => 'SE[0-9]{2}[0-9]{3}[0-9]{16}[0-9]{1}',
'SI' => 'SI[0-9]{2}[0-9]{5}[0-9]{8}[0-9]{2}',
'SK' => 'SK[0-9]{2}[0-9]{4}[0-9]{6}[0-9]{10}',
'SM' => 'SM[0-9]{2}[A-Z]{1}[0-9]{5}[0-9]{5}[A-Z0-9]{12}',
'TN' => 'TN59[0-9]{2}[0-9]{3}[0-9]{13}[0-9]{2}',
'TR' => 'TR[0-9]{2}[0-9]{5}[A-Z0-9]{1}[A-Z0-9]{16}',
'VG' => 'VG[0-9]{2}[A-Z]{4}[0-9]{16}',
];
/**
* Sets validator options
*
* @param array|Traversable $options OPTIONAL
*/
public function __construct($options = [])
{
if ($options instanceof Traversable) {
$options = ArrayUtils::iteratorToArray($options);
}
if (array_key_exists('country_code', $options)) {
$this->setCountryCode($options['country_code']);
}
if (array_key_exists('allow_non_sepa', $options)) {
$this->setAllowNonSepa($options['allow_non_sepa']);
}
parent::__construct($options);
}
/**
* Returns the optional country code by ISO 3166-1
*
* @return string|null
*/
public function getCountryCode()
{
return $this->countryCode;
}
/**
* Sets an optional country code by ISO 3166-1
*
* @param string|null $countryCode
* @return $this provides a fluent interface
* @throws Exception\InvalidArgumentException
*/
public function setCountryCode($countryCode = null)
{
if ($countryCode !== null) {
$countryCode = (string) $countryCode;
if (! isset(static::$ibanRegex[$countryCode])) {
throw new Exception\InvalidArgumentException(
"Country code '{$countryCode}' invalid by ISO 3166-1 or not supported"
);
}
}
$this->countryCode = $countryCode;
return $this;
}
/**
* Returns the optional allow non-sepa countries setting
*
* @return bool
*/
public function allowNonSepa()
{
return $this->allowNonSepa;
}
/**
* Sets the optional allow non-sepa countries setting
*
* @param bool $allowNonSepa
* @return $this provides a fluent interface
*/
public function setAllowNonSepa($allowNonSepa)
{
$this->allowNonSepa = (bool) $allowNonSepa;
return $this;
}
/**
* Returns true if $value is a valid IBAN
*
* @param string $value
* @return bool
*/
public function isValid($value)
{
if (! is_string($value)) {
$this->error(self::FALSEFORMAT);
return false;
}
$value = str_replace(' ', '', strtoupper($value));
$this->setValue($value);
$countryCode = $this->getCountryCode();
if ($countryCode === null) {
$countryCode = substr($value, 0, 2);
}
if (! array_key_exists($countryCode, static::$ibanRegex)) {
$this->setValue($countryCode);
$this->error(self::NOTSUPPORTED);
return false;
}
if (! $this->allowNonSepa && ! in_array($countryCode, static::$sepaCountries)) {
$this->setValue($countryCode);
$this->error(self::SEPANOTSUPPORTED);
return false;
}
if (! preg_match('/^' . static::$ibanRegex[$countryCode] . '$/', $value)) {
$this->error(self::FALSEFORMAT);
return false;
}
$format = substr($value, 4) . substr($value, 0, 4);
$format = str_replace(
['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'],
['10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22',
'23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35'],
$format
);
$temp = intval(substr($format, 0, 1));
$len = strlen($format);
for ($x = 1; $x < $len; ++$x) {
$temp *= 10;
$temp += intval(substr($format, $x, 1));
$temp %= 97;
}
if ($temp != 1) {
$this->error(self::CHECKFAILED);
return false;
}
return true;
}
}
| gpl-2.0 |
openSUSE/connect | views/default/css.php | 53278 | <?php
/**
* Elgg Default Theme
* core CSS file
*
* Updated 30 Sept 09
*
* @package Elgg
* @subpackage Core
*
* @uses $vars['wwwroot'] The site URL
*/
?>
/* ***************************************
RESET BASE STYLES
*************************************** */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-weight: inherit;
font-style: inherit;
font-size: 100%;
font-family: inherit;
vertical-align: baseline;
}
/* remember to define focus styles! */
:focus {
outline: 0;
}
ol, ul {
list-style: none;
}
em, i {
font-style:italic;
}
/* tables still need cellspacing="0" (for ie6) */
table {
border-collapse: separate;
border-spacing: 0;
}
caption, th, td {
text-align: left;
font-weight: normal;
vertical-align: top;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: "";
}
blockquote, q {
quotes: "" "";
}
.clearfloat {
clear:both;
height:0;
font-size: 1px;
line-height: 0px;
}
/* ***************************************
DEFAULTS
*************************************** */
/* elgg open source blue #4690d6 */
/* elgg open source dark blue #0054a7 */
/* elgg open source light yellow #FDFFC3 */
/* elgg open source light blue #bbdaf7 */
body {
text-align:left;
margin:0 auto;
padding:0;
background: #dedede;
font: 80%/1.4 "Lucida Grande", Verdana, sans-serif;
color: #333333;
}
a {
color: #4690d6;
text-decoration: none;
-moz-outline-style: none;
outline: none;
}
a:visited {
}
a:hover {
color: #0054a7;
text-decoration: underline;
}
p {
margin: 0px 0px 15px 0;
}
img {
border: none;
}
ul {
margin: 5px 0px 15px;
padding-left: 20px;
}
ul li {
margin: 0px;
}
ol {
margin: 5px 0px 15px;
padding-left: 20px;
}
ul li {
margin: 0px;
}
form {
margin: 0px;
padding: 0px;
}
small {
font-size: 90%;
}
h1, h2, h3, h4, h5, h6 {
font-weight: bold;
line-height: normal;
}
h1 { font-size: 1.8em; }
h2 { font-size: 1.5em; }
h3 { font-size: 1.2em; }
h4 { font-size: 1.0em; }
h5 { font-size: 0.9em; }
h6 { font-size: 0.8em; }
dt {
margin: 0;
padding: 0;
font-weight: bold;
}
dd {
margin: 0 0 1em 1em;
padding: 0;
}
pre, code {
font-family:Monaco,"Courier New",Courier,monospace;
font-size:12px;
background:#EBF5FF;
overflow:auto;
overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
code {
padding:2px 3px;
}
pre {
padding:3px 15px;
margin:0px 0 15px 0;
line-height:1.3em;
}
blockquote {
padding:3px 15px;
margin:0px 0 15px 0;
line-height:1.3em;
background:#EBF5FF;
border:none !important;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
}
blockquote p {
margin:0 0 5px 0;
}
/* ***************************************
PAGE LAYOUT - MAIN STRUCTURE
*************************************** */
#page_container {
margin:0;
padding:0;
}
#page_wrapper {
width:990px;
margin:0 auto;
padding:0;
min-height: 300px;
}
#layout_header {
text-align:left;
width:100%;
height:67px;
background:#dedede;
}
#wrapper_header {
margin:0;
padding:10px 20px 20px 0px;
}
#wrapper_header h1 {
margin:10px 0 0 0;
letter-spacing: -0.03em;
}
#layout_canvas {
margin:0 0 20px 0;
padding:20px;
min-height: 360px;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
background: white;
border-bottom:1px solid #cccccc;
border-right:1px solid #cccccc;
}
/* canvas layout: 1 column, no sidebar */
#one_column {
/* width:928px; */
margin:0;
min-height: 360px;
background: #dedede;
padding:0 0 10px 0;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
}
/* canvas layout: 2 column left sidebar */
#two_column_left_sidebar {
width:210px;
margin:0 20px 0 0;
min-height:360px;
float:left;
background: #dedede;
padding:0px;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-bottom:1px solid #cccccc;
border-right:1px solid #cccccc;
}
#two_column_left_sidebar_maincontent {
width:718px;
margin:0;
min-height: 360px;
float:left;
background: #dedede;
padding:0 0 5px 0;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
}
#two_column_left_sidebar_maincontent_boxes {
margin:0 0px 20px 20px;
padding:0 0 5px 0;
width:718px;
background: #dedede;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
float:left;
}
#two_column_left_sidebar_boxes {
width:210px;
margin:0px 0 20px 0px;
min-height:360px;
float:left;
padding:0;
}
#two_column_left_sidebar_boxes .sidebarBox {
margin:0px 0 22px 0;
background: #dedede;
padding:4px 10px 10px 10px;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-bottom:1px solid #cccccc;
border-right:1px solid #cccccc;
}
#two_column_left_sidebar_boxes .sidebarBox h3 {
padding:0 0 5px 0;
font-size:1.25em;
line-height:1.2em;
color:#0054A7;
}
/* canvas layout: 2 column right sidebar */
#two_column_right_sidebar {
width:210px;
margin:0 0 0 20px;
min-height:360px;
float:left;
background: #dedede;
padding:0px;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-bottom:1px solid #cccccc;
border-right:1px solid #cccccc;
}
.contentWrapper {
background:white;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
padding:10px;
margin:0 10px 10px 10px;
}
span.contentIntro p {
margin:0 0 0 0;
}
.notitle {
margin-top:10px;
}
/* canvas layout: widgets (profile and dashboard) */
#widgets_left {
width:303px;
margin:0 20px 20px 0;
min-height:360px;
padding:0;
}
#widgets_middle {
width:303px;
margin:0 0 20px 0;
padding:0;
}
#widgets_right {
width:303px;
margin:0px 0 20px 20px;
float:left;
padding:0;
}
#widget_table td {
border:0;
padding:0;
margin:0;
text-align: left;
vertical-align: top;
}
/* IE6 fixes */
* html #widgets_right { float:none; }
* html #profile_info_column_left {
margin:0 10px 0 0;
width:200px;
}
* html #dashboard_info { width:585px; }
/* IE7 */
*:first-child+html #profile_info_column_left { width:200px; }
/* ***************************************
SPOTLIGHT
*************************************** */
#layout_spotlight {
margin:20px 0 20px 0;
padding:0;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
background: white;
border-bottom:1px solid #cccccc;
border-right:1px solid #cccccc;
}
#wrapper_spotlight {
margin:0;
padding:0;
height:auto;
}
#wrapper_spotlight #spotlight_table h2 {
color:#4690d6;
font-size:1.25em;
line-height:1.2em;
}
#wrapper_spotlight #spotlight_table li {
list-style: square;
line-height: 1.2em;
margin:5px 20px 5px 0;
color:#4690d6;
}
#wrapper_spotlight .collapsable_box_content {
margin:0;
padding:10px 10px 5px 10px;
background:none;
min-height:60px;
border:none;
border-top:1px solid #cccccc;
}
#spotlight_table {
margin:0 0 2px 0;
}
#spotlight_table .spotlightRHS {
float:right;
width:270px;
margin:0 0 0 50px;
}
/* IE7 */
*:first-child+html #wrapper_spotlight .collapsable_box_content {
width:958px;
}
#layout_spotlight .collapsable_box_content p {
padding:0;
}
#wrapper_spotlight .collapsable_box_header {
border: none;
background: none;
}
/* ***************************************
FOOTER
*************************************** */
#layout_footer {
background: #b6b6b6;
height:80px;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
margin:0 0 20px 0;
}
#layout_footer table {
margin:0 0 0 20px;
}
#layout_footer a, #layout_footer p {
color:#333333;
margin:0;
}
#layout_footer .footer_toolbar_links {
text-align:right;
padding:15px 0 0 0;
font-size:1.2em;
}
#layout_footer .footer_legal_links {
text-align:right;
}
/* ***************************************
HORIZONTAL ELGG TOPBAR
*************************************** */
#elgg_topbar {
background:#333333 url(<?php echo $vars['url']; ?>_graphics/toptoolbar_background.gif) repeat-x top left;
color:#eeeeee;
border-bottom:1px solid #000000;
min-width:998px;
position:relative;
width:100%;
height:24px;
z-index: 9000; /* if you have multiple position:relative elements, then IE sets up separate Z layer contexts for each one, which ignore each other */
}
#elgg_topbar_container_left {
float:left;
height:24px;
left:0px;
top:0px;
position:absolute;
text-align:left;
width:60%;
}
#elgg_topbar_container_right {
float:right;
height:24px;
position:absolute;
right:0px;
top:0px;
/* width:120px;*/
text-align:right;
}
#elgg_topbar_container_search {
float:right;
height:21px;
/*width:280px;*/
position:relative;
right:120px;
text-align:right;
margin:3px 0 0 0;
}
#elgg_topbar_container_left .toolbarimages {
float:left;
margin-right:20px;
}
#elgg_topbar_container_left .toolbarlinks {
margin:0 0 10px 0;
float:left;
}
#elgg_topbar_container_left .toolbarlinks2 {
margin:3px 0 0 0;
float:left;
}
#elgg_topbar_container_left a.loggedinuser {
color:#eeeeee;
font-weight:bold;
margin:0 0 0 5px;
}
#elgg_topbar_container_left a.pagelinks {
color:white;
margin:0 15px 0 5px;
display:block;
padding:3px;
}
#elgg_topbar_container_left a.pagelinks:hover {
background: #4690d6;
text-decoration: none;
}
#elgg_topbar_container_left a.privatemessages {
background:transparent url(<?php echo $vars['url']; ?>_graphics/toolbar_messages_icon.gif) no-repeat left 2px;
padding:0 0 4px 16px;
margin:0 15px 0 5px;
cursor:pointer;
}
#elgg_topbar_container_left a.privatemessages:hover {
text-decoration: none;
background:transparent url(<?php echo $vars['url']; ?>_graphics/toolbar_messages_icon.gif) no-repeat left -36px;
}
#elgg_topbar_container_left a.privatemessages_new {
background:transparent url(<?php echo $vars['url']; ?>_graphics/toolbar_messages_icon.gif) no-repeat left -17px;
padding:0 0 0 18px;
margin:0 15px 0 5px;
color:white;
}
/* IE6 */
* html #elgg_topbar_container_left a.privatemessages_new { background-position: left -18px; }
/* IE7 */
*+html #elgg_topbar_container_left a.privatemessages_new { background-position: left -18px; }
#elgg_topbar_container_left a.privatemessages_new:hover {
text-decoration: none;
}
#elgg_topbar_container_left a.usersettings {
margin:0 0 0 20px;
color:#999999;
padding:3px;
}
#elgg_topbar_container_left a.usersettings:hover {
color:#eeeeee;
}
#elgg_topbar_container_left img {
margin:0 0 0 5px;
}
#elgg_topbar_container_left .user_mini_avatar {
border:1px solid #eeeeee;
margin:0 0 0 20px;
}
#elgg_topbar_container_right {
padding:3px 0 0 0;
}
#elgg_topbar_container_right a {
color:#eeeeee;
margin:0 5px 0 0;
background:transparent url(<?php echo $vars['url']; ?>_graphics/elgg_toolbar_logout.gif) no-repeat top right;
padding:0 21px 0 0;
display:block;
height:20px;
}
/* IE6 fix */
* html #elgg_topbar_container_right a {
width: 120px;
}
#elgg_topbar_container_right a:hover {
background-position: right -21px;
}
#elgg_topbar_panel {
background:#333333;
color:#eeeeee;
height:200px;
width:100%;
padding:10px 20px 10px 20px;
display:none;
position:relative;
}
/* ***************************************
TOP BAR - VERTICAL TOOLS MENU
*************************************** */
/* elgg toolbar menu setup */
ul.topbardropdownmenu, ul.topbardropdownmenu ul {
margin:0;
padding:0;
display:inline;
float:left;
list-style-type: none;
z-index: 9000;
position: relative;
}
ul.topbardropdownmenu {
margin:0pt 20px 0pt 5px;
}
ul.topbardropdownmenu li {
display: block;
list-style: none;
margin: 0;
padding: 0;
float: left;
position: relative;
}
ul.topbardropdownmenu a {
display:block;
}
ul.topbardropdownmenu ul {
display: none;
position: absolute;
left: 0;
margin: 0;
padding: 0;
}
/* IE6 fix */
* html ul.topbardropdownmenu ul {
line-height: 1.1em;
}
/* IE6/7 fix */
ul.topbardropdownmenu ul a {
zoom: 1;
}
ul.topbardropdownmenu ul li {
float: none;
}
/* elgg toolbar menu style */
ul.topbardropdownmenu ul {
width: 150px;
top: 24px;
border-top:1px solid black;
}
ul.topbardropdownmenu *:hover {
background-color: none;
}
ul.topbardropdownmenu a {
padding:3px;
text-decoration:none;
color:white;
}
ul.topbardropdownmenu li.hover a {
background-color: #4690d6;
text-decoration: none;
}
ul.topbardropdownmenu ul li.drop a {
font-weight: normal;
}
/* IE7 fixes */
*:first-child+html #elgg_topbar_container_left a.pagelinks {
}
*:first-child+html ul.topbardropdownmenu li.drop a.menuitemtools {
padding-bottom:6px;
}
ul.topbardropdownmenu ul li a {
background-color: #999999;/* menu off state color */
font-weight: bold;
padding-left:6px;
padding-top:4px;
padding-bottom:0;
height:22px;
border-bottom: 1px solid white;
}
ul.topbardropdownmenu ul a.hover {
background-color: #333333;
}
ul.topbardropdownmenu ul a {
opacity: 0.9;
filter: alpha(opacity=90);
}
/* ***************************************
SYSTEM MESSSAGES
*************************************** */
.messages {
background:#ccffcc;
color:#000000;
padding:3px 10px 3px 10px;
z-index: 8000;
margin:0;
position:fixed;
top:30px;
width:969px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border:4px solid #00CC00;
cursor: pointer;
}
.messages_error {
border:4px solid #D3322A;
background:#F7DAD8;
color:#000000;
padding:3px 10px 3px 10px;
z-index: 8000;
margin:0;
position:fixed;
top:30px;
width:969px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
cursor: pointer;
}
.closeMessages {
float:right;
margin-top:17px;
}
.closeMessages a {
color:#666666;
cursor: pointer;
text-decoration: none;
font-size: 80%;
}
.closeMessages a:hover {
color:black;
}
/* ***************************************
COLLAPSABLE BOXES
*************************************** */
.collapsable_box {
margin: 0 0 20px 0;
height:auto;
}
/* IE6 fix */
* html .collapsable_box {
height:10px;
}
.collapsable_box_header {
color: #4690d6;
padding: 5px 10px 5px 10px;
margin:0;
border-left: 1px solid white;
border-right: 1px solid #cccccc;
border-bottom: 1px solid #cccccc;
-moz-border-radius-topleft:8px;
-moz-border-radius-topright:8px;
-webkit-border-top-right-radius:8px;
-webkit-border-top-left-radius:8px;
background:#dedede;
}
.collapsable_box_header h1 {
color: #0054a7;
font-size:1.25em;
line-height: 1.2em;
}
.collapsable_box_content {
padding: 10px 0 10px 0;
margin:0;
height:auto;
background:#dedede;
-moz-border-radius-bottomleft:8px;
-moz-border-radius-bottomright:8px;
-webkit-border-bottom-right-radius:8px;
-webkit-border-bottom-left-radius:8px;
border-left: 1px solid white;
border-right: 1px solid #cccccc;
border-bottom: 1px solid #cccccc;
}
.collapsable_box_content .contentWrapper {
margin-bottom:5px;
}
.collapsable_box_editpanel {
display: none;
background: #a8a8a8;
padding:10px 10px 5px 10px;
border-left: 1px solid white;
border-bottom: 1px solid white;
}
.collapsable_box_editpanel p {
margin:0 0 5px 0;
}
.collapsable_box_header a.toggle_box_contents {
color: #4690d6;
cursor:pointer;
font-family: Arial, Helvetica, sans-serif;
font-size:20px;
font-weight: bold;
text-decoration:none;
float:right;
margin: 0;
margin-top: -7px;
}
.collapsable_box_header a.toggle_box_edit_panel {
color: #4690d6;
cursor:pointer;
font-size:9px;
text-transform: uppercase;
text-decoration:none;
font-weight: normal;
float:right;
margin: 3px 10px 0 0;
}
.collapsable_box_editpanel label {
font-weight: normal;
font-size: 100%;
}
/* used for collapsing a content box */
.display_none {
display:none;
}
/* used on spotlight box - to cancel default box margin */
.no_space_after {
margin: 0 0 0 0;
}
/* ***************************************
GENERAL FORM ELEMENTS
*************************************** */
label {
font-weight: bold;
color:#333333;
font-size: 120%;
}
input {
font: 120% Arial, Helvetica, sans-serif;
padding: 5px;
border: 1px solid #cccccc;
color:#666666;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
}
input[type="checkbox"] {
padding: 1px;
border-style: none;
}
textarea {
font: 120% Arial, Helvetica, sans-serif;
border: solid 1px #cccccc;
padding: 5px;
color:#666666;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
}
textarea:focus, input[type="text"]:focus {
border: solid 1px #4690d6;
background-color: #e4ecf5;
color:#333333;
}
.submit_button {
font: 12px/100% Arial, Helvetica, sans-serif;
font-weight: bold;
color: #ffffff;
background:#4690d6;
border: 1px solid #4690d6;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
width: auto;
height: 25px;
padding: 2px 6px 2px 6px;
margin:10px 0 10px 0;
cursor: pointer;
}
.submit_button:hover, input[type="submit"]:hover {
background: #0054a7;
border-color: #0054a7;
}
input[type="submit"] {
font: 12px/100% Arial, Helvetica, sans-serif;
font-weight: bold;
color: #ffffff;
background:#4690d6;
border: 1px solid #4690d6;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
width: auto;
height: 25px;
padding: 2px 6px 2px 6px;
margin:10px 0 10px 0;
cursor: pointer;
}
.cancel_button {
font: 12px/100% Arial, Helvetica, sans-serif;
font-weight: bold;
color: #999999;
background:#dddddd;
border: 1px solid #999999;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
width: auto;
height: 25px;
padding: 2px 6px 2px 6px;
margin:10px 0 10px 10px;
cursor: pointer;
}
.cancel_button:hover {
background: #cccccc;
}
.input-password,
.input-text,
.input-tags,
.input-url,
.input-textarea {
width:98%;
}
.input-textarea {
height: 200px;
}
/* ***************************************
LOGIN / REGISTER
*************************************** */
#login-box {
margin:0 0 10px 0;
padding:0 0 10px 0;
background: #dedede;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
width:240px;
text-align:left;
}
#login-box form {
margin:0 10px 0 10px;
padding:0 10px 4px 10px;
background: white;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
width:200px;
}
#login-box h2 {
color:#0054A7;
font-size:1.35em;
line-height:1.2em;
margin:0 0 0 8px;
padding:5px 5px 0 5px;
}
#login-box .login-textarea {
width:178px;
}
#login-box label,
#register-box label {
font-size: 1.2em;
color:gray;
}
#login-box p.loginbox {
margin:0;
}
#login-box input[type="text"],
#login-box input[type="password"],
#register-box input[type="text"],
#register-box input[type="password"] {
margin:0 0 10px 0;
}
#register-box input[type="text"],
#register-box input[type="password"] {
width:380px;
}
#login-box h2,
#login-box-openid h2,
#register-box h2,
#add-box h2,
#forgotten_box h2 {
color:#0054A7;
font-size:1.35em;
line-height:1.2em;
margin:0pt 0pt 5px;
}
#register-box {
text-align:left;
width:400px;
padding:10px;
background: #dedede;
margin:0;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
}
#persistent_login label {
font-size:1.0em;
font-weight: normal;
}
/* login and openID boxes when not running custom_index mod */
#two_column_left_sidebar #login-box {
width:auto;
background: none;
}
#two_column_left_sidebar #login-box form {
width:auto;
margin:10px 10px 0 10px;
padding:5px 0 5px 10px;
}
#two_column_left_sidebar #login-box h2 {
margin:0 0 0 5px;
padding:5px 5px 0 5px;
}
#two_column_left_sidebar #login-box .login-textarea {
width:158px;
}
/* login and openID boxes when not running custom_index mod */
#two_column_right_sidebar #login-box {
width:auto;
background: none;
}
#two_column_right_sidebar #login-box form {
width:auto;
margin:10px 10px 0 10px;
padding:5px 0 5px 10px;
}
#two_column_right_sidebar #login-box h2 {
margin:0 0 0 5px;
padding:5px 5px 0 5px;
}
#two_column_right_sidebar #login-box .login-textarea {
width:158px;
}
/* ***************************************
PROFILE
*************************************** */
#profile_info {
margin:0 0 20px 0;
padding:20px;
border-bottom:1px solid #cccccc;
border-right:1px solid #cccccc;
background: #e9e9e9;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
}
#profile_info_column_left {
float:left;
padding: 0;
margin:0 20px 0 0;
}
#profile_info_column_middle {
float:left;
width:365px;
padding: 0;
}
#profile_info_column_right {
width:578px;
margin:0 0 0 0;
background:#dedede;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
padding:4px;
}
#dashboard_info {
margin:0px 0px 0 0px;
padding:20px;
border-bottom:1px solid #cccccc;
border-right:1px solid #cccccc;
background: #bbdaf7;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
}
#profile_menu_wrapper {
margin:10px 0 10px 0;
width:200px;
}
#profile_menu_wrapper p {
border-bottom:1px solid #cccccc;
}
#profile_menu_wrapper p:first-child {
border-top:1px solid #cccccc;
}
#profile_menu_wrapper a {
display:block;
padding:0 0 0 3px;
}
#profile_menu_wrapper a:hover {
color:#ffffff;
background:#4690d6;
text-decoration:none;
}
p.user_menu_friends, p.user_menu_profile,
p.user_menu_removefriend,
p.user_menu_friends_of {
margin:0;
}
#profile_menu_wrapper .user_menu_admin {
border-top:none;
}
#profile_info_column_middle p {
margin:7px 0 7px 0;
padding:2px 4px 2px 4px;
}
/* profile owner name */
#profile_info_column_middle h2 {
padding:0 0 14px 0;
margin:0;
}
#profile_info_column_middle .profile_status {
background:#bbdaf7;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
padding:2px 4px 2px 4px;
line-height:1.2em;
}
#profile_info_column_middle .profile_status span {
display:block;
font-size:90%;
color:#666666;
}
#profile_info_column_middle a.status_update {
float:right;
}
#profile_info_column_middle .odd {
background:#dedede;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
}
#profile_info_column_middle .even {
background:#dedede;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
}
#profile_info_column_right p {
margin:0 0 7px 0;
}
#profile_info_column_right .profile_aboutme_title {
margin:0;
padding:0;
line-height:1em;
}
/* edit profile button */
.profile_info_edit_buttons {
float:right;
margin:0 !important;
padding:0 !important;
}
.profile_info_edit_buttons a {
font: 12px/100% Arial, Helvetica, sans-serif;
font-weight: bold;
color: #ffffff;
background:#4690d6;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
width: auto;
padding: 2px 6px 2px 6px;
margin:0;
cursor: pointer;
}
.profile_info_edit_buttons a:hover {
background: #0054a7;
text-decoration: none;
color:white;
}
/* ***************************************
RIVER
*************************************** */
#river,
.river_item_list {
border-top:1px solid #dddddd;
overflow:hidden;
}
.river_item p {
margin:0;
padding:0 0 0 21px;
line-height:1.1em;
min-height:17px;
}
.river_item {
border-bottom:1px solid #dddddd;
padding:2px 0 2px 0;
}
.river_item_time {
font-size:90%;
color:#666666;
}
.river_item .river_item_useravatar {
float:left;
margin:0 5px 0 0;
}
/* IE6 fix */
* html .river_item p {
padding:3px 0 3px 20px;
}
/* IE7 */
*:first-child+html .river_item p {
min-height:17px;
}
.river_user_update {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_profile.gif) no-repeat left -1px;
}
.river_object_user_profileupdate {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_profile.gif) no-repeat left -1px;
}
.river_object_user_profileiconupdate {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_profile.gif) no-repeat left -1px;
}
.river_object_annotate {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px;
}
.river_object_bookmarks_create {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_bookmarks.gif) no-repeat left -1px;
}
.river_object_bookmarks_comment {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px;
}
.river_object_status_create {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_status.gif) no-repeat left -1px;
}
.river_object_file_create {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_files.gif) no-repeat left -1px;
}
.river_object_file_update {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_files.gif) no-repeat left -1px;
}
.river_object_file_comment {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px;
}
.river_object_widget_create {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_plugin.gif) no-repeat left -1px;
}
.river_object_forums_create {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_forum.gif) no-repeat left -1px;
}
.river_object_forums_update {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_forum.gif) no-repeat left -1px;
}
.river_object_widget_update {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_plugin.gif) no-repeat left -1px;
}
.river_object_blog_create {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_blog.gif) no-repeat left -1px;
}
.river_object_blog_update {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_blog.gif) no-repeat left -1px;
}
.river_object_blog_comment {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px;
}
.river_object_forumtopic_create {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_forum.gif) no-repeat left -1px;
}
.river_user_friend {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_friends.gif) no-repeat left -1px;
}
.river_object_relationship_friend_create {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_friends.gif) no-repeat left -1px;
}
.river_object_relationship_member_create {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_forum.gif) no-repeat left -1px;
}
.river_object_thewire_create {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_thewire.gif) no-repeat left -1px;
}
.river_group_create {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_forum.gif) no-repeat left -1px;
}
.river_group_join {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_forum.gif) no-repeat left -1px;
}
.river_object_groupforumtopic_annotate {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px;
}
.river_object_groupforumtopic_create {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_forum.gif) no-repeat left -1px;
}
.river_object_sitemessage_create {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_blog.gif) no-repeat left -1px;
}
.river_user_messageboard {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px;
}
.river_object_page_create {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_pages.gif) no-repeat left -1px;
}
.river_object_page_update {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_pages.gif) no-repeat left -1px;
}
.river_object_page_top_create {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_pages.gif) no-repeat left -1px;
}
.river_object_page_top_update {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_pages.gif) no-repeat left -1px;
}
.river_object_page_top_comment {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px;
}
.river_object_page_comment {
background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px;
}
/* ***************************************
ENTITY LISTINGS
*************************************** */
.search_listing {
display: block;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
background:white;
margin:0 10px 5px 10px;
padding:5px;
}
.search_listing_icon {
float:left;
}
.search_listing_icon img {
width: 40px;
}
.search_listing_icon .avatar_menu_button img {
width: 15px;
}
.search_listing_info {
margin-left: 50px;
min-height: 40px;
}
/* IE 6 fix */
* html .search_listing_info {
height:40px;
}
.search_listing_info p {
margin:0 0 3px 0;
line-height:1.2em;
}
.search_listing_info p.owner_timestamp {
margin:0;
padding:0;
color:#666666;
font-size: 90%;
}
table.entity_gallery {
border-spacing: 10px;
margin:0 0 0 0;
}
.entity_gallery td {
padding: 5px;
}
.entity_gallery_item {
background: white;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
width:170px;
}
.entity_gallery_item:hover {
background: black;
color:white;
}
.entity_gallery_item .search_listing {
background: none;
text-align: center;
}
.entity_gallery_item .search_listing_header {
text-align: center;
}
.entity_gallery_item .search_listing_icon {
position: relative;
text-align: center;
}
.entity_gallery_item .search_listing_info {
margin: 5px;
}
.entity_gallery_item .search_listing_info p {
margin: 5px;
margin-bottom: 10px;
}
.entity_gallery_item .search_listing {
background: none;
text-align: center;
}
.entity_gallery_item .search_listing_icon {
position: absolute;
margin-bottom: 20px;
}
.entity_gallery_item .search_listing_info {
margin: 5px;
}
.entity_gallery_item .search_listing_info p {
margin: 5px;
margin-bottom: 10px;
}
/* ***************************************
FRIENDS
*************************************** */
/* friends widget */
#widget_friends_list {
display:table;
width:275px;
margin:0 10px 0 10px;
padding:8px 0 4px 8px;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
background:white;
}
.widget_friends_singlefriend {
float:left;
margin:0 5px 5px 0;
}
/* ***************************************
ADMIN AREA - PLUGIN SETTINGS
*************************************** */
.plugin_details {
margin:0 10px 5px 10px;
padding:0 7px 4px 10px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
}
.admin_plugin_reorder {
float:right;
width:200px;
text-align: right;
}
.admin_plugin_reorder a {
padding-left:10px;
font-size:80%;
color:#999999;
}
.plugin_details a.pluginsettings_link {
cursor:pointer;
font-size:80%;
}
.active {
border:1px solid #999999;
background:white;
}
.not-active {
border:1px solid #999999;
background:#dedede;
}
.plugin_details p {
margin:0;
padding:0;
}
.plugin_details a.manifest_details {
cursor:pointer;
font-size:80%;
}
.manifest_file {
background:#dedede;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
padding:5px 10px 5px 10px;
margin:4px 0 4px 0;
display:none;
}
.admin_plugin_enable_disable {
width:150px;
margin:10px 0 0 0;
float:right;
text-align: right;
}
.contentIntro .enableallplugins,
.contentIntro .disableallplugins {
float:right;
}
.contentIntro .enableallplugins {
margin-left:10px;
}
.contentIntro .enableallplugins,
.not-active .admin_plugin_enable_disable a {
font: 12px/100% Arial, Helvetica, sans-serif;
font-weight: bold;
color: #ffffff;
background:#4690d6;
border: 1px solid #4690d6;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
width: auto;
padding: 4px;
cursor: pointer;
}
.contentIntro .enableallplugins:hover,
.not-active .admin_plugin_enable_disable a:hover {
background: #0054a7;
border: 1px solid #0054a7;
text-decoration: none;
}
.contentIntro .disableallplugins,
.active .admin_plugin_enable_disable a {
font: 12px/100% Arial, Helvetica, sans-serif;
font-weight: bold;
color: #ffffff;
background:#999999;
border: 1px solid #999999;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
width: auto;
padding: 4px;
cursor: pointer;
}
.contentIntro .disableallplugins:hover,
.active .admin_plugin_enable_disable a:hover {
background: #333333;
border: 1px solid #333333;
text-decoration: none;
}
.pluginsettings {
margin:15px 0 5px 0;
background:#bbdaf7;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
padding:10px;
display:none;
}
.pluginsettings h3 {
padding:0 0 5px 0;
margin:0 0 5px 0;
border-bottom:1px solid #999999;
}
#updateclient_settings h3 {
padding:0;
margin:0;
border:none;
}
.input-access {
margin:5px 0 0 0;
}
/* ***************************************
GENERIC COMMENTS
*************************************** */
.generic_comment_owner {
font-size: 90%;
color:#666666;
}
.generic_comment {
background:white;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
padding:10px;
margin:0 10px 10px 10px;
}
.generic_comment_icon {
float:left;
}
.generic_comment_details {
margin-left: 60px;
}
.generic_comment_details p {
margin: 0 0 5px 0;
}
.generic_comment_owner {
color:#666666;
margin: 0px;
font-size:90%;
border-top: 1px solid #aaaaaa;
}
/* IE6 */
* html #generic_comment_tbl { width:676px !important;}
/* ***************************************
PAGE-OWNER BLOCK
*************************************** */
#owner_block {
padding:10px;
}
#owner_block_icon {
float:left;
margin:0 10px 0 0;
}
#owner_block_rss_feed,
#owner_block_odd_feed {
padding:5px 0 0 0;
}
#owner_block_rss_feed a {
font-size: 90%;
color:#999999;
padding:0 0 4px 20px;
background: url(<?php echo $vars['url']; ?>_graphics/icon_rss.gif) no-repeat left top;
}
#owner_block_odd_feed a {
font-size: 90%;
color:#999999;
padding:0 0 4px 20px;
background: url(<?php echo $vars['url']; ?>_graphics/icon_odd.gif) no-repeat left top;
}
#owner_block_rss_feed a:hover,
#owner_block_odd_feed a:hover {
color: #0054a7;
}
#owner_block_desc {
padding:4px 0 4px 0;
margin:0 0 0 0;
line-height: 1.2em;
border-bottom:1px solid #cccccc;
color:#666666;
}
#owner_block_content {
margin:0 0 4px 0;
padding:3px 0 0 0;
min-height:35px;
font-weight: bold;
}
#owner_block_content a {
line-height: 1em;
}
.ownerblockline {
padding:0;
margin:0;
border-bottom:1px solid #cccccc;
height:1px;
}
#owner_block_submenu {
margin:20px 0 20px 0;
padding: 0;
width:100%;
}
#owner_block_submenu ul {
list-style: none;
padding: 0;
margin: 0;
}
#owner_block_submenu ul li.selected a {
background: #4690d6;
color:white;
}
#owner_block_submenu ul li.selected a:hover {
background: #4690d6;
color:white;
}
#owner_block_submenu ul li a {
text-decoration: none;
display: block;
margin: 2px 0 0 0;
color:#4690d6;
padding:4px 6px 4px 10px;
font-weight: bold;
line-height: 1.1em;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
}
#owner_block_submenu ul li a:hover {
color:white;
background: #0054a7;
}
/* IE 6 + 7 menu arrow position fix */
* html #owner_block_submenu ul li.selected a {
background-position: left 10px;
}
*:first-child+html #owner_block_submenu ul li.selected a {
background-position: left 8px;
}
#owner_block_submenu .submenu_group {
border-bottom: 1px solid #cccccc;
margin:10px 0 0 0;
padding-bottom: 10px;
}
#owner_block_submenu .submenu_group .submenu_group_filter ul li a,
#owner_block_submenu .submenu_group .submenu_group_filetypes ul li a {
color:#666666;
}
#owner_block_submenu .submenu_group .submenu_group_filter ul li.selected a,
#owner_block_submenu .submenu_group .submenu_group_filetypes ul li.selected a {
background:#999999;
color:white;
}
#owner_block_submenu .submenu_group .submenu_group_filter ul li a:hover,
#owner_block_submenu .submenu_group .submenu_group_filetypes ul li a:hover {
color:white;
background: #999999;
}
/* ***************************************
PAGINATION
*************************************** */
.pagination {
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
background:white;
margin:5px 10px 5px 10px;
padding:5px;
}
.pagination .pagination_number {
display:block;
float:left;
background:#ffffff;
border:1px solid #4690d6;
text-align: center;
color:#4690d6;
font-size: 12px;
font-weight: normal;
margin:0 6px 0 0;
padding:0px 4px;
cursor: pointer;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
}
.pagination .pagination_number:hover {
background:#4690d6;
color:white;
text-decoration: none;
}
.pagination .pagination_more {
display:block;
float:left;
background:#ffffff;
border:1px solid #ffffff;
text-align: center;
color:#4690d6;
font-size: 12px;
font-weight: normal;
margin:0 6px 0 0;
padding:0px 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
}
.pagination .pagination_previous,
.pagination .pagination_next {
display:block;
float:left;
border:1px solid #4690d6;
color:#4690d6;
text-align: center;
font-size: 12px;
font-weight: normal;
margin:0 6px 0 0;
padding:0px 4px;
cursor: pointer;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
}
.pagination .pagination_previous:hover,
.pagination .pagination_next:hover {
background:#4690d6;
color:white;
text-decoration: none;
}
.pagination .pagination_currentpage {
display:block;
float:left;
background:#4690d6;
border:1px solid #4690d6;
text-align: center;
color:white;
font-size: 12px;
font-weight: bold;
margin:0 6px 0 0;
padding:0px 4px;
cursor: pointer;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
}
/* ***************************************
FRIENDS COLLECTIONS ACCORDIAN
*************************************** */
ul#friends_collections_accordian {
margin: 0 0 0 0;
padding: 0;
}
#friends_collections_accordian li {
margin: 0 0 0 0;
padding: 0;
list-style-type: none;
color: #666666;
}
#friends_collections_accordian li h2 {
background:#4690d6;
color: white;
padding:4px 2px 4px 6px;
margin:10px 0 10px 0;
font-size:1.2em;
cursor:pointer;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
}
#friends_collections_accordian li h2:hover {
background:#333333;
color:white;
}
#friends_collections_accordian .friends_picker {
background:white;
padding:0;
display:none;
}
#friends_collections_accordian .friends_collections_controls {
font-size:70%;
float:right;
}
#friends_collections_accordian .friends_collections_controls a {
color:#999999;
font-weight:normal;
}
/* ***************************************
FRIENDS PICKER SLIDER
*************************************** */
.friendsPicker_container h3 {
font-size:4em !important;
text-align: left;
margin:0 0 10px 0 !important;
color:#999999 !important;
background: none !important;
padding:0 !important;
}
.friendsPicker .friendsPicker_container .panel ul {
text-align: left;
margin: 0;
padding:0;
}
.friendsPicker_wrapper {
margin: 0;
padding:0;
position: relative;
width: 100%;
}
.friendsPicker {
position: relative;
overflow: hidden;
margin: 0;
padding:0;
width: 678px;
height: auto;
background: #dedede;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
}
.friendspicker_savebuttons {
background: white;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
margin:0 10px 10px 10px;
}
.friendsPicker .friendsPicker_container { /* long container used to house end-to-end panels. Width is calculated in JS */
position: relative;
left: 0;
top: 0;
width: 100%;
list-style-type: none;
}
.friendsPicker .friendsPicker_container .panel {
float:left;
height: 100%;
position: relative;
width: 678px;
margin: 0;
padding:0;
}
.friendsPicker .friendsPicker_container .panel .wrapper {
margin: 0;
padding:4px 10px 10px 10px;
min-height: 230px;
}
.friendsPickerNavigation {
margin: 0 0 10px 0;
padding:0;
}
.friendsPickerNavigation ul {
list-style: none;
padding-left: 0;
}
.friendsPickerNavigation ul li {
float: left;
margin:0;
background:white;
}
.friendsPickerNavigation a {
font-weight: bold;
text-align: center;
background: white;
color: #999999;
text-decoration: none;
display: block;
padding: 0;
width:20px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
}
.tabHasContent {
background: white; color:#333333 !important;
}
.friendsPickerNavigation li a:hover {
background: #333333;
color:white !important;
}
.friendsPickerNavigation li a.current {
background: #4690D6;
color:white !important;
}
.friendsPickerNavigationAll {
margin:0px 0 0 20px;
float:left;
}
.friendsPickerNavigationAll a {
font-weight: bold;
text-align: left;
font-size:0.8em;
background: white;
color: #999999;
text-decoration: none;
display: block;
padding: 0 4px 0 4px;
width:auto;
}
.friendsPickerNavigationAll a:hover {
background: #4690D6;
color:white;
}
.friendsPickerNavigationL, .friendsPickerNavigationR {
position: absolute;
top: 46px;
text-indent: -9000em;
}
.friendsPickerNavigationL a, .friendsPickerNavigationR a {
display: block;
height: 43px;
width: 43px;
}
.friendsPickerNavigationL {
right: 48px;
z-index:1;
}
.friendsPickerNavigationR {
right: 0;
z-index:1;
}
.friendsPickerNavigationL {
background: url("<?php echo $vars['url']; ?>_graphics/friends_picker_arrows.gif") no-repeat left top;
}
.friendsPickerNavigationR {
background: url("<?php echo $vars['url']; ?>_graphics/friends_picker_arrows.gif") no-repeat -60px top;
}
.friendsPickerNavigationL:hover {
background: url("<?php echo $vars['url']; ?>_graphics/friends_picker_arrows.gif") no-repeat left -44px;
}
.friendsPickerNavigationR:hover {
background: url("<?php echo $vars['url']; ?>_graphics/friends_picker_arrows.gif") no-repeat -60px -44px;
}
.friends_collections_controls a.delete_collection {
display:block;
cursor: pointer;
width:14px;
height:14px;
margin:2px 3px 0 0;
background: url("<?php echo $vars['url']; ?>_graphics/icon_customise_remove.png") no-repeat 0 0;
}
.friends_collections_controls a.delete_collection:hover {
background-position: 0 -16px;
}
.friendspicker_savebuttons .submit_button,
.friendspicker_savebuttons .cancel_button {
margin:5px 20px 5px 5px;
}
#collectionMembersTable {
background: #dedede;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
margin:10px 0 0 0;
padding:10px 10px 0 10px;
}
/* ***************************************
WIDGET PICKER (PROFILE & DASHBOARD)
*************************************** */
/* 'edit page' button */
a.toggle_customise_edit_panel {
float:right;
clear:right;
color: #4690d6;
background: white;
border:1px solid #cccccc;
padding: 5px 10px 5px 10px;
margin:0 0 20px 0;
width:280px;
text-align: left;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
}
a.toggle_customise_edit_panel:hover {
color: #ffffff;
background: #0054a7;
border:1px solid #0054a7;
text-decoration:none;
}
#customise_editpanel {
display:none;
margin: 0 0 20px 0;
padding:10px;
background: #dedede;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
}
/* Top area - instructions */
.customise_editpanel_instructions {
width:690px;
padding:0 0 10px 0;
}
.customise_editpanel_instructions h2 {
padding:0 0 10px 0;
}
.customise_editpanel_instructions p {
margin:0 0 5px 0;
line-height: 1.4em;
}
/* RHS (widget gallery area) */
#customise_editpanel_rhs {
float:right;
width:230px;
background:white;
}
#customise_editpanel #customise_editpanel_rhs h2 {
color:#333333;
font-size: 1.4em;
margin:0;
padding:6px;
}
#widget_picker_gallery {
border-top:1px solid #cccccc;
background:white;
width:210px;
height:340px;
padding:10px;
overflow:scroll;
overflow-x:hidden;
}
/* main page widget area */
#customise_page_view {
width:656px;
padding:10px;
margin:0 0 10px 0;
background:white;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
}
#customise_page_view h2 {
border-top:1px solid #cccccc;
border-right:1px solid #cccccc;
border-left:1px solid #cccccc;
margin:0;
padding:5px;
width:200px;
color: #0054a7;
background: #dedede;
font-size:1.25em;
line-height: 1.2em;
}
#profile_box_widgets {
width:422px;
margin:0 10px 10px 0;
padding:5px 5px 0px 5px;
min-height: 50px;
border:1px solid #cccccc;
background: #dedede;
}
#customise_page_view h2.profile_box {
width:422px;
color: #999999;
}
#profile_box_widgets p {
color:#999999;
}
#leftcolumn_widgets {
width:200px;
margin:0 10px 0 0;
padding:5px 5px 40px 5px;
min-height: 190px;
border:1px solid #cccccc;
}
#middlecolumn_widgets {
width:200px;
margin:0 10px 0 0;
padding:5px 5px 40px 5px;
min-height: 190px;
border:1px solid #cccccc;
}
#rightcolumn_widgets {
width:200px;
margin:0;
padding:5px 5px 40px 5px;
min-height: 190px;
border:1px solid #cccccc;
}
#rightcolumn_widgets.long {
min-height: 288px;
}
/* IE6 fix */
* html #leftcolumn_widgets {
height: 190px;
}
* html #middlecolumn_widgets {
height: 190px;
}
* html #rightcolumn_widgets {
height: 190px;
}
* html #rightcolumn_widgets.long {
height: 338px;
}
#customise_editpanel table.draggable_widget {
width:200px;
background: #cccccc;
margin: 10px 0 0 0;
vertical-align:text-top;
border:1px solid #cccccc;
}
#widget_picker_gallery table.draggable_widget {
width:200px;
background: #cccccc;
margin: 10px 0 0 0;
}
/* take care of long widget names */
#customise_editpanel table.draggable_widget h3 {
word-wrap:break-word;/* safari, webkit, ie */
width:140px;
line-height: 1.1em;
overflow: hidden;/* ff */
padding:4px;
}
#widget_picker_gallery table.draggable_widget h3 {
word-wrap:break-word;
width:145px;
line-height: 1.1em;
overflow: hidden;
padding:4px;
}
#customise_editpanel img.more_info {
background: url(<?php echo $vars['url']; ?>_graphics/icon_customise_info.gif) no-repeat top left;
cursor:pointer;
}
#customise_editpanel img.drag_handle {
background: url(<?php echo $vars['url']; ?>_graphics/icon_customise_drag.gif) no-repeat top left;
cursor:move;
}
#customise_editpanel img {
margin-top:4px;
}
#widget_moreinfo {
position:absolute;
border:1px solid #333333;
background:#e4ecf5;
color:#333333;
padding:5px;
display:none;
width: 200px;
line-height: 1.2em;
}
.widget_more_wrapper {
background-color: white;
margin:0 10px 5px 10px;
padding:5px;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
}
/* droppable area hover class */
.droppable-hover {
background:#bbdaf7;
}
/* target drop area class */
.placeholder {
border:2px dashed #AAA;
width:196px !important;
margin: 10px 0 10px 0;
}
/* class of widget while dragging */
.ui-sortable-helper {
background: #4690d6;
color:white;
padding: 4px;
margin: 10px 0 0 0;
width:200px;
}
/* IE6 fix */
* html .placeholder {
margin: 0;
}
/* IE7 */
*:first-child+html .placeholder {
margin: 0;
}
/* IE6 fix */
* html .ui-sortable-helper h3 {
padding: 4px;
}
* html .ui-sortable-helper img.drag_handle, * html .ui-sortable-helper img.remove_me, * html .ui-sortable-helper img.more_info {
padding-top: 4px;
}
/* IE7 */
*:first-child+html .ui-sortable-helper h3 {
padding: 4px;
}
*:first-child+html .ui-sortable-helper img.drag_handle, *:first-child+html .ui-sortable-helper img.remove_me, *:first-child+html .ui-sortable-helper img.more_info {
padding-top: 4px;
}
/* ***************************************
BREADCRUMBS
*************************************** */
#pages_breadcrumbs {
font-size: 80%;
color:#bababa;
padding:0;
margin:2px 0 0 10px;
}
#pages_breadcrumbs a {
color:#999999;
text-decoration: none;
}
#pages_breadcrumbs a:hover {
color: #0054a7;
text-decoration: underline;
}
/* ***************************************
MISC.
*************************************** */
/* general page titles in main content area */
#content_area_user_title h2 {
margin:0 0 0 8px;
padding:5px;
color:#0054A7;
font-size:1.35em;
line-height:1.2em;
}
/* reusable generic collapsible box */
.collapsible_box {
background:#dedede;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
padding:5px 10px 5px 10px;
margin:4px 0 4px 0;
display:none;
}
a.collapsibleboxlink {
cursor:pointer;
}
/* tag icon */
.object_tag_string {
background: url(<?php echo $vars['url']; ?>_graphics/icon_tag.gif) no-repeat left 2px;
padding:0 0 0 14px;
margin:0;
}
/* profile picture upload n crop page */
#profile_picture_form {
height:145px;
}
#current_user_avatar {
float:left;
width:160px;
height:130px;
border-right:1px solid #cccccc;
margin:0 20px 0 0;
}
#profile_picture_croppingtool {
border-top: 1px solid #cccccc;
margin:20px 0 0 0;
padding:10px 0 0 0;
}
#profile_picture_croppingtool #user_avatar {
float: left;
margin-right: 20px;
}
#profile_picture_croppingtool #applycropping {
}
#profile_picture_croppingtool #user_avatar_preview {
float: left;
position: relative;
overflow: hidden;
width: 100px;
height: 100px;
}
/* ***************************************
SETTINGS & ADMIN
*************************************** */
.admin_statistics,
.admin_users_online,
.usersettings_statistics,
.admin_adduser_link,
#add-box,
#search-box,
#logbrowser_search_area {
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
background:white;
margin:0 10px 10px 10px;
padding:10px;
}
.usersettings_statistics h3,
.admin_statistics h3,
.admin_users_online h3,
.user_settings h3,
.notification_methods h3 {
background:#e4e4e4;
color:#333333;
font-size:1.1em;
line-height:1em;
margin:0 0 10px 0;
padding:5px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
}
h3.settings {
background:#e4e4e4;
color:#333333;
font-size:1.1em;
line-height:1em;
margin:10px 0 4px 0;
padding:5px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
}
.admin_users_online .profile_status {
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
background:#bbdaf7;
line-height:1.2em;
padding:2px 4px;
}
.admin_users_online .profile_status span {
font-size:90%;
color:#666666;
}
.admin_users_online p.owner_timestamp {
padding-left:3px;
}
.admin_debug label,
.admin_usage label {
color:#333333;
font-size:100%;
font-weight:normal;
}
.admin_usage {
border-bottom:1px solid #cccccc;
padding:0 0 20px 0;
}
.usersettings_statistics .odd,
.admin_statistics .odd {
}
.usersettings_statistics .even,
.admin_statistics .even {
}
.usersettings_statistics td,
.admin_statistics td {
padding:2px 4px 2px 4px;
border-bottom:1px solid #cccccc;
}
.usersettings_statistics td.column_one,
.admin_statistics td.column_one {
width:200px;
}
.usersettings_statistics table,
.admin_statistics table {
width:100%;
}
.usersettings_statistics table,
.admin_statistics table {
border-top:1px solid #cccccc;
}
.usersettings_statistics table tr:hover,
.admin_statistics table tr:hover {
background: #E4E4E4;
}
.admin_users_online .search_listing {
margin:0 0 5px 0;
padding:5px;
border:2px solid #cccccc;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
}
/* force tinyMCE editor initial width for safari */
.mceLayout {
width:683px;
}
p.longtext_editarea {
margin:0 !important;
}
.toggle_editor_container {
margin:0 0 15px 0;
}
/* add/remove longtext tinyMCE editor */
a.toggle_editor {
display:block;
float:right;
text-align:right;
color:#666666;
font-size:1em;
font-weight:normal;
}
div.ajax_loader {
background: white url(<?php echo $vars['url']; ?>_graphics/ajax_loader.gif) no-repeat center 30px;
width:auto;
height:100px;
margin:0 10px 0 10px;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
}
/* reusable elgg horizontal tabbed navigation
(used on friends collections, external pages, & riverdashboard mods)
*/
#elgg_horizontal_tabbed_nav {
margin:0 0 5px 0;
padding: 0;
border-bottom: 2px solid #cccccc;
display:table;
width:100%;
}
#elgg_horizontal_tabbed_nav ul {
list-style: none;
padding: 0;
margin: 0;
}
#elgg_horizontal_tabbed_nav li {
float: left;
border: 2px solid #cccccc;
border-bottom-width: 0;
background: #eeeeee;
margin: 0 0 0 10px;
-moz-border-radius-topleft:5px;
-moz-border-radius-topright:5px;
-webkit-border-top-left-radius:5px;
-webkit-border-top-right-radius:5px;
}
#elgg_horizontal_tabbed_nav a {
text-decoration: none;
display: block;
padding:3px 10px 0 10px;
color: #999999;
text-align: center;
height:21px;
}
/* IE6 fix */
* html #elgg_horizontal_tabbed_nav a { display: inline; }
#elgg_horizontal_tabbed_nav a:hover {
color: #4690d6;
background: #dedede;
}
#elgg_horizontal_tabbed_nav .selected {
border-color: #cccccc;
background: white;
}
#elgg_horizontal_tabbed_nav .selected a {
position: relative;
top: 2px;
background: white;
color: #4690d6;
}
/* IE6 fix */
* html #elgg_horizontal_tabbed_nav .selected a { top: 3px; }
/* ***************************************
Auto Suggest Boxes
*************************************** */
.ac_results {
padding: 0px;
border: 1px solid black;
background-color: white;
overflow: hidden;
z-index: 99999;
}
.ac_results ul {
width: 100%;
list-style-position: outside;
list-style: none;
padding: 0;
margin: 0;
}
.ac_results li {
margin: 0px;
padding: 2px 5px;
cursor: default;
display: block;
/*
if width will be 100% horizontal scrollbar will apear
when scroll mode will be used
*/
/*width: 100%;*/
font: menu;
font-size: 12px;
/*
it is very important, if line-height not setted or setted
in relative units scroll will be broken in firefox
*/
line-height: 16px;
overflow: hidden;
}
.ac_loading {
background: white url(<?php echo $vars['url']; ?>_graphics/indicator.gif) right center no-repeat;
}
.ac_odd {
background-color: #eee;
}
.ac_over {
background-color: #0A246A;
color: white;
}
.autocomplete {
width:300px;
}
.ac_results strong {
font-weight: bold;
}
.user_picker .user_picker_entry {
clear: both;
padding: 1em;
}
.livesearch_icon {
float: left;
padding-right: 1em;
}
.draggable {
cursor: move;
}
| gpl-2.0 |
DrBenton/talk-talk | app/core-plugins/hooks/classes/TalkTalk/CorePlugin/Hooks/Plugin/PackingBehaviour/HooksPacker.php | 7423 | <?php
namespace TalkTalk\CorePlugin\Hooks\Plugin\PackingBehaviour;
use TalkTalk\Core\Plugin\Plugin;
use TalkTalk\Core\Plugin\PackingBehaviour\BasePacker;
class HooksPacker extends BasePacker
{
const HOOKS_FILE_PATH = '%plugin-path%/plugin-hooks.php';
const DEFAULT_HOOK_PRIORITY = 0;
const PLUGIN_COMPONENTS_URL = '%plugin-url%/assets/js/modules/components';
protected $myConfigKey = '@hooks';
public function getPackerInitCode()
{
return <<<'PACKER_INIT_CODE'
namespace {
/* Plugins hooks system initialization */
$app->vars['hooks.registry.implementations'] = array();
$app->defineFunction(
'hooks.load_plugin_hooks',
function ($pluginId, $hooksFilePath, $pluginComponentsUrl) use ($app) {
if (isset($app->vars['hooks.registry.implementations'][$pluginId])) {
// This Plugin hooks implementations have already be loaded
return;
}
if (!isset($app->vars['packs.included_files.closures'][$hooksFilePath])) {
throw new \DomainException(
sprintf('Hooks file "%s" not included in packed PHP code!', $hooksFilePath)
);
}
$hooks = array();
call_user_func_array(
$app->vars['packs.included_files.closures'][$hooksFilePath],
array($app, &$hooks, $pluginComponentsUrl)
);
$app->vars['hooks.registry.implementations'][$pluginId] = &$hooks;
}
);
}
PACKER_INIT_CODE;
}
/**
* @inheritdoc
*/
public function getPhpCodeToPack(Plugin $plugin)
{
if (empty($plugin->config[$this->myConfigKey])) {
return null;
}
$hooksFilePath = $this->replace(
self::HOOKS_FILE_PATH,
array(
'%plugin-path%' => $plugin->path,
)
);
if (!is_file($hooksFilePath)) {
throw new \DomainException(
sprintf('Plugin "%s" defines hooks but does not have a "%s" hooks implementation file!', $plugin->id, $hooksFilePath)
);
}
$myConfigPart = $plugin->config[$this->myConfigKey];
// Let's load the Plugin hooks implementation code!
$pluginHooksImplementations = $this->getPluginHooksImplementations($plugin, $hooksFilePath);
if (!is_array($pluginHooksImplementations)) {
print_r($pluginHooksImplementations);
throw new \DomainException(
sprintf('Plugin "%s" hooks implementations file is malformed!', $plugin->id)
);
}
$code = '';
foreach ($myConfigPart as $hookData) {
// Let's normalize this hook data
$normalizedPluginHookData = $this->getNormalizedHookData($plugin, $hookData);
$hookName = $normalizedPluginHookData['name'];
if (!isset($pluginHooksImplementations[$hookName])) {
throw new \DomainException(
sprintf('Plugin "%s" registers a "%s" hook, but this hook definition can not be found in the %d Plugin hooks implementations!', $plugin->id, $hookName, count($pluginHooksImplementations))
);
}
if (!is_callable($pluginHooksImplementations[$hookName])) {
throw new \DomainException(
sprintf('Plugin "%s" registers a "%s" hook, but this hook definition is not callable!', $plugin->id, $hookName)
);
}
// All right, this hooks seems to have an implementation. Let's add some
// code to link this Plugin hook to its implementation
$code .= $this->getHookPhpCode($plugin, $normalizedPluginHookData, $hooksFilePath);
}
// We add the Plugin hooks implementation code to the app
$code .= $this->getPluginHooksImplementationsCode($hooksFilePath);
return $code;
}
/**
* @param Plugin $plugin
* @param array $hookData
* @param string $hooksFilePath
* @return string
*/
protected function getHookPhpCode(Plugin $plugin, array $hookData, $hooksFilePath)
{
$pluginComponentsUrl = $this->getPluginComponentsUrl($plugin);
$pluginPhpCode = <<<'PLUGIN_PHP_CODE'
namespace {
// Hook "%hook-name%" initialization (from Plugin "%plugin-id%"):
$app->vars['hooks.registry']['%hook-name%'][] = array(
'implementation' => function ($hookArgs) use ($app) {
$app->exec(
'hooks.load_plugin_hooks',
'%plugin-id%', '%hooks-file-path%', '%plugin-components-url%'
);
return call_user_func_array(
$app->vars['hooks.registry.implementations']['%plugin-id%']['%hook-name%'],
$hookArgs
);
},
'priority' => %hook-priority%
);
}
PLUGIN_PHP_CODE;
// Job's done!
return $this->replace(
$pluginPhpCode,
array(
'%hooks-file-path%' => $hooksFilePath,
'%hook-name%' => $hookData['name'],
'%hook-priority%' => $hookData['priority'],
'%plugin-components-url%' => $pluginComponentsUrl,
'%plugin-id%' => $plugin->id,
)
);
}
/**
* @param Plugin $plugin
* @param string $hooksFilePath
* @return array
*/
protected function getPluginHooksImplementations(Plugin $plugin, $hooksFilePath)
{
// This Plugin has a "plugin-hooks.php" file.
// --> let's load it!
$pluginHooksImplementations = array();
$pluginComponentsUrl = $this->getPluginComponentsUrl($plugin);
call_user_func_array(
function ($app, array &$hooks, $myComponentsUrl) use ($hooksFilePath) {
include_once $hooksFilePath;
},
array($this->app, &$pluginHooksImplementations, $pluginComponentsUrl)
);
return $pluginHooksImplementations;
}
/**
* @param string $hooksFilePath
* @return string
*/
protected function getPluginHooksImplementationsCode($hooksFilePath)
{
$hooksImplementationsInclusionCode = $this->getPackingManager()
->getAppInclusionsCode($hooksFilePath, array('&$hooks', '$myComponentsUrl'));
return $hooksImplementationsInclusionCode;
}
protected function getPluginComponentsUrl(Plugin $plugin)
{
return preg_replace(
'~^' . $this->app->vars['app.base_url'] . '/~',
'',
$this->app->get('utils.string')
->handlePluginRelatedString($plugin, self::PLUGIN_COMPONENTS_URL)
);
}
protected function getNormalizedHookData(Plugin $plugin, $hookData)
{
$hookData = $this->app->get('utils.array')->getArray($hookData, 'name');
if (!isset($hookData['priority'])) {
if (
0 === strpos($hookData['name'], 'html.') &&
isset($plugin->data['@general']['htmlHooksPriority'])
) {
$hookData['priority'] = $plugin->data['@general']['htmlHooksPriority'];
} else {
$hookData['priority'] = self::DEFAULT_HOOK_PRIORITY;
}
}
$hookData['priority'] = (int) $hookData['priority'];
return $hookData;
}
}
| gpl-2.0 |
royboy789/angular-react-wordpress-theme | assets/js/angular_app.js | 3419 | "use strict";
var reang;
var $ = jQuery;
reang = angular.module('reang', ['ngResource', 'ui.router'])
.filter('to_trusted', ['$sce', function($sce) {
return function(text) {
return $sce.trustAsHtml(text);
};
}])
.config(function($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise('/');
$stateProvider
.state('list', {
url: '/',
template: '<reactposts data="posts" id="test"></reactposts>',
controller: 'reang_controller'
})
.state('single', {
url: '/post/:id',
template: function( $scope ){
return '<reactposts data="posts" id="test"></reactposts>'
},
controller: function( $scope, $stateParams, Posts ) {
$scope.post_id = $stateParams.id;
$scope.getPosts = function(){
Posts.get({ID: $stateParams.id}, function(res){
$scope.posts = res;
});
}
$scope.getPosts();
}
});
//$locationProvider.html5Mode(true);
})
.run(function($rootScope, $location){
$rootScope.$on("$routeChangeStart", function (event, next, current) {
console.log( next, current );
});
$rootScope.$on("$stateChangeSuccess", function(evt, to, toP, from, fromP) { console.log('Success to:', to.url ); });
$rootScope.$on("$stateChangeError", function(evt, to, toP, from, fromP, error) { console.log('Error:', to.url, error ); });
$rootScope.$on("$stateNotFound", function(evt, unfoundState, fromState, fromParams) { console.log('Not Found:', unfoundState ); });
})
.factory('Posts', function($resource) {
return $resource(ajaxInfo.json_url + 'posts/:ID?_wp_json_nonce='+ajaxInfo.nonce, {
ID: '@ID'
},{
'update': { method:'PUT' }
});
})
.controller( 'reang_controller', ['$rootScope', '$scope', 'Posts', function($rootScope, $scope, Posts){
$scope.getPosts = function(){
Posts.query({}, function(res){
$scope.posts = res;
});
}
$scope.getPosts();
$('body').on('click', '.edit_post', function(e) {
var post_id = $(this).data('id');
console.log(post_id);
Posts.get({ID:post_id}, function(res){
$scope.editPost = res;
})
})
$scope.savePost = function() {
console.log('saving..', $scope.editPost);
$scope.editPost.content_raw = $scope.editPost.content;
Posts.update($scope.editPost, function(res){
$scope.getPosts();
$('#editPost').modal('hide');
})
}
}])
.directive('reactposts', function($rootScope) {
return {
restrict: 'E',
scope: { data: '=', id: '@' },
link: function($scope,elm,attrs) {
$scope.$watch('data', function(n,o){
if( n && n.length ) {
$rootScope.react_app = React.render(
React.createElement(APP, {data:$scope.data}),
elm[0]
)
}
if( n && n.ID ) {
$rootScope.react_app = React.render(
React.createElement(APP, {data:$scope.data}),
elm[0]
)
}
});
}
}
})
.controller( 'editPostCtrl', ['$rootScope', '$scope', 'Posts', function($rootScope, $scope, Posts){
console.log('editing..');
$('body').on('click', '.edit_post', function(e) {
var post_id = $(this).data('id');
console.log(post_id);
Posts.get({ID:post_id}, function(res){
$scope.editPost = res;
})
})
$scope.savePost = function() {
console.log('saving..', $scope.editPost);
$scope.editPost.content_raw = $scope.editPost.content;
Posts.update($scope.editPost, function(res){
Posts.query({}, function(res){
$rootScope.react_app.data = res;
$('#editPost').modal('hide');
console.log( $rootScope.react_app.data );
})
})
}
}]); | gpl-2.0 |
sanjayankur31/pyjigdo | pyJigdo/userinterface.py | 7067 | #
# Copyright 2007-2009 Fedora Unity Project (http://fedoraunity.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; version 2, 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 Library 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.
"""
User Interface
"""
import pyJigdo.util
from pyJigdo.translate import _, N_
class SelectImages:
""" A class to work with the user to select what images
they would like to download based on the Jigdo data
we have already been able to acquire. """
def __init__(self, log, settings, base, jigdo_definition):
""" Interactively work with the user to select what images to download
if there were not runtime options defining what to download. """
self.log = log
self.settings = settings
self.base = base
self.jigdo_definition = jigdo_definition
def run(self):
""" Run the selection and user interaction, returning if we selected
any images or not. """
choosing_images = True
num_images = len(self.jigdo_definition.images)
image_maxwidth = len(str(num_images))
if self.settings.image_numbers or self.settings.image_filenames or self.settings.image_all:
if not self.select_images():
self.log.status(_("Selection is invalid, please try again."))
else:
choosing_images = False
if num_images == 1:
self.log.status(_("Only one image defined, downloading."))
self.select_image(1)
choosing_images = False
while choosing_images:
self.log.status(_("Please select one or more of the available Images:"))
for image in self.jigdo_definition.images:
self.log.status(_("%*s: %s" % (image_maxwidth+1, "#" + str(image), self.jigdo_definition.images[image].filename)))
try:
image_choice = raw_input("What image(s) would you like to download? [1-%s] " % num_images )
except KeyboardInterrupt:
self.base.abort()
break
if image_choice == "":
self.log.status(_("Choose the number(s) of the image file(s), seperated by commas or spaces, or specify a range (1-5)"))
continue
try:
ret = image_choice.index('all')
choosing_images = False
self.settings.image_all = True
self.select_images()
continue
except ValueError, e:
pass
# convert "1,2 3-5, 8" to [1,2,3,4,5,8]
expanded_image_choices = pyJigdo.util.image_numstr_to_list(image_choice)
for choice in expanded_image_choices:
try:
choice = int(choice)
if choice > num_images: raise ValueError
except ValueError, e:
self.log.status(_("Invalid selection: %s" % choice))
continue
self.select_image(choice)
active_images = ", ".join(self.selected_images())
if not active_images: active_images = "None!"
self.log.status(_("Currently going to download image(s): %s" % active_images))
try:
continue_selecting = raw_input("Would you like to select another image for download? [y/N] ")
except KeyboardInterrupt:
self.base.abort()
break
if continue_selecting.lower() not in ["y", "yes"]:
choosing_images = False
if len(self.selected_images()) > 0:
return True
else:
return False
def select_image(self, image_unique_id):
""" Flip the switch to set an image to download.
Return True if the action was successful. """
image_unique_id = int(image_unique_id)
self.log.debug(_("Selecting Image %d") % image_unique_id)
success = False
# Find the image with unique_id
if self.jigdo_definition.images.has_key(image_unique_id):
self.jigdo_definition.images[image_unique_id].select()
success = True
else:
self.log.warning(_("Could not select image %s") % image_unique_id)
return success
def select_images(self):
""" Select images based on selections by the user.
Return True if actions were successful. """
self.log.debug(_("Selecting Images..."))
success = False
if self.settings.image_all or len(self.jigdo_definition.images) == 1:
for image in self.jigdo_definition.images:
# Select all Images
self.select_image(image)
success = True
elif self.settings.image_numbers or self.settings.image_filenames:
# Here we allow using both selection by number and filenames.
# This offers the most flexibility.
# Select images by number:
if self.settings.image_numbers:
for image_numstr in self.settings.image_numbers:
for image in pyJigdo.util.image_numstr_to_list(image_numstr):
if self.select_image(image):
success = True
# Select images by whole filename or glob pattern:
if self.settings.image_filenames:
import re, fnmatch
for image_filestr in self.settings.image_filenames: # -f "*i386*,*ppc*" -f "file"
for image_file in image_filestr.replace(',',' ').split(): # [*i386*,*ppc*], [file]
regex = re.compile(fnmatch.translate(image_file))
for (jignum, jigimg) in self.jigdo_definition.images.iteritems():
if regex.match(jigimg.filename):
self.log.debug(_("%s MATCHED: %d: %s") % (image_file, jignum, jigimg.filename))
if self.select_image(jignum):
success = True
return success
def selected_images(self, fullObjects=False):
""" Return a list of selected images. """
images = []
for image in self.jigdo_definition.images:
if self.jigdo_definition.images[image].selected:
if fullObjects:
images.append(self.jigdo_definition.images[image])
else:
images.append(str(image))
return images
| gpl-2.0 |
Tallefer/bombusng-md | src/XMLParser.cpp | 5707 | //#include "stdafx.h"
#include "XMLParser.h"
#include "XMLEventListener.h"
std::string dbgbuf;
XMLParser::XMLParser(XMLEventListener *eventListener){
this->eventListener=eventListener;
state=PLAIN_TEXT;
}
XMLParser::~XMLParser(){}
void XMLParser::parse( const char * buf, int size ) {
while (size>0) {
size--;
char c=*buf++;
switch (state) {
case PLAIN_TEXT:
{
//parsing plain text
if (c=='<') {
state=TAGNAME;
if (sbuf.length()) eventListener->plainTextEncountered( sbuf );
sbuf.clear();
tagname.clear();
attr.clear();
continue;
}
sbuf+=c; continue;
}
case ATRNAME:
{
if (c=='?') continue;
if (c==' ') continue;
if (c=='=') continue;
if (c=='\'') { state=ATRVALQS; atrname=sbuf; sbuf.clear(); continue; }
if (c=='\"') { state=ATRVALQD; atrname=sbuf; sbuf.clear(); continue; }
if (c!='>' && c!='/') {
sbuf+=c;
continue;
} else {
state=TAGNAME;
sbuf.clear();
}
}
case TAGNAME:
{
if (c=='?') continue;
if (c=='/') {
state=ENDTAGNAME;
sbuf.clear();
if (tagname.length()) {
eventListener->tagStart(tagname, attr);
sbuf=tagname;
}
continue;
}
if (c==' ') { state=ATRNAME; continue; }
if (c=='>') {
state=PLAIN_TEXT;
eventListener->tagStart(tagname, attr);
continue;
}
tagname+=c;
if (c=='[') {
if (tagname == "![CDATA[")
state=CDATA;
continue;
}
continue;
}
case CDATA:
{
sbuf+=c;
if (c=='>') {
int e3=sbuf.length()-3;
if (e3 < 0) continue;
if (sbuf[e3] != ']') continue;
if (sbuf[e3+1] != ']') continue;
//if (sbuf[e3] != '>') continue;
sbuf.resize(e3);
state=PLAIN_TEXT;
continue;
}
continue;
}
case ENDTAGNAME:
{
if (c==' ') continue;
if (c=='>') {
state=PLAIN_TEXT;
eventListener->tagEnd(sbuf);
sbuf.clear();
continue;
}
sbuf+=c;
continue;
}
case ATRVALQS:
{
if (c=='\'') { state=ATRNAME; attr[atrname]=sbuf; sbuf.clear(); continue; }
sbuf+=c;
continue;
}
case ATRVALQD:
{
if (c=='\"') { state=ATRNAME; attr[atrname]=sbuf; sbuf.clear(); continue; }
sbuf+=c;
continue;
}
}
}
}
void XMLParser::parseStream() {
int prebuffered = inStream->read(inbuf, XML_PREBUF_SZ);
parse(inbuf, prebuffered);
}
std::string XMLStringPrep(const std::string & data){
std::string result;
for (std::string::const_iterator i=data.begin(); i!=data.end(); i++) {
unsigned char ch=(unsigned char)*i;
switch (ch) {
case '&': result+="&" ; break;
case '"': result+=""" ; break;
case '<': result+="<" ; break;
case '>': result+=">" ; break;
case '\'': result+="'" ; break;
case 0x09: result+=(char)0x09; break;
// not nessesary
case 0x0d: /*result+=" "*/ ; break;
case 0x0a: result+=" " ; break;
default: if (ch>0x1f) result+=ch;
}
}
return result;
}
std::string XMLStringExpand(const std::string & data){
std::string result;
std::string escapedChar;
bool inEsc=false;
for (std::string::const_iterator i=data.begin(); i!=data.end(); i++) {
char ch=*i;
switch (ch) {
case '&':
if (inEsc) throw std::exception("Malformed XML escape sequence");
inEsc=true;
escapedChar.clear();
break;
case ';':
if (inEsc) {
ch=0;
inEsc=false;
if (escapedChar=="amp") ch='&';
if (escapedChar=="quot") ch='"';
if (escapedChar=="lt") ch='<';
if (escapedChar=="gt") ch='>';
if (escapedChar=="apos") ch='\'';
if (escapedChar[0]=='#') {
escapedChar[0]=' ';
ch=atoi(escapedChar.c_str());
}
if (ch==0) throw std::exception("Malformed XML escape sequence");
}
default: if (inEsc) escapedChar+=ch; else result+=ch;
}
}
if (inEsc) throw std::exception("Malformed XML escape sequence");
return result;
} | gpl-2.0 |
deftsoft/Joomla | administrator/components/com_calendar/views/tag/view.html.php | 1509 | <?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla view library
jimport('joomla.application.component.view');
/**
* Event View
*/
class CalendarViewTag extends JView
{
/**
* display method of Event view
* @return void
*/
public function display($tpl = null)
{
// get the Data and assign it
$this->form = $this->get('Form');
$this->item = $this->get('Item');
// Check for errors.
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode('<br />', $errors));
return false;
}
// Set the toolbar
$this->addToolBar();
// Display the template
parent::display($tpl);
}
/**
* Setting the toolbar
*/
protected function addToolBar()
{
JRequest::setVar('hidemainmenu', true);
$isNew = ($this->item->id == 0);
JToolBarHelper::title($isNew ? JText::_('COM_CALENDAR_TAG_TITLE_NEW') : JText::_('COM_CALENDAR_TAG_TITLE_EDIT'));
JToolBarHelper::apply('tag.apply','JTOOLBAR_APPLY');
JToolBarHelper::save('tag.save','JTOOLBAR_SAVE');
JToolBarHelper::cancel('tag.cancel', $isNew ? 'JTOOLBAR_CANCEL' : 'JTOOLBAR_CLOSE');
}
} | gpl-2.0 |
olilarkin/faust | compiler/propagate/propagate.hh | 1835 | /************************************************************************
************************************************************************
FAUST compiler
Copyright (C) 2003-2018 GRAME, Centre National de Creation Musicale
---------------------------------------------------------------------
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., 675 Mass Ave, Cambridge, MA 02139, USA.
************************************************************************
************************************************************************/
#ifndef _PROPAGATE_
#define _PROPAGATE_
#include <vector>
#include "boxes.hh"
#include "signals.hh"
////////////////////////////////////////////////////////////////////////
/**
* boxPropagateSig : box listOfSignal-> listOfSignal'
*
* Propagate a list of signals into a block-diagram. Fo example to
* compute the list of outputs of a block-diagram with n inputs, do :
* Tree lsig = boxPropagateSig(box, makeSigInputList(n));
*/
///////////////////////////////////////////////////////////////////////
using namespace std;
typedef vector<Tree> siglist;
siglist makeSigInputList(int n);
Tree boxPropagateSig(Tree path, Tree box, const siglist& lsig);
#endif
| gpl-2.0 |
FloWerberger/blog-template | wp-includes/post-template.php | 43495 | <?php
/**
* WordPress Post Template Functions.
*
* Gets content for the current post in the loop.
*
* @package WordPress
* @subpackage Template
*/
/**
* Display the ID of the current item in the WordPress Loop.
*
* @since 0.71
*/
function the_ID() {
echo get_the_ID();
}
/**
* Retrieve the ID of the current item in the WordPress Loop.
*
* @since 2.1.0
* @uses $post
*
* @return int
*/
function get_the_ID() {
return get_post()->ID;
}
/**
* Display or retrieve the current post title with optional content.
*
* @since 0.71
*
* @param string $before Optional. Content to prepend to the title.
* @param string $after Optional. Content to append to the title.
* @param bool $echo Optional, default to true.Whether to display or return.
* @return null|string Null on no title. String if $echo parameter is false.
*/
function the_title($before = '', $after = '', $echo = true) {
$title = get_the_title();
if ( strlen($title) == 0 )
return;
$title = $before . $title . $after;
if ( $echo )
echo $title;
else
return $title;
}
/**
* Sanitize the current title when retrieving or displaying.
*
* Works like {@link the_title()}, except the parameters can be in a string or
* an array. See the function for what can be override in the $args parameter.
*
* The title before it is displayed will have the tags stripped and {@link
* esc_attr()} before it is passed to the user or displayed. The default
* as with {@link the_title()}, is to display the title.
*
* @since 2.3.0
*
* @param string|array $args Optional. Override the defaults.
* @return string|null Null on failure or display. String when echo is false.
*/
function the_title_attribute( $args = '' ) {
$defaults = array('before' => '', 'after' => '', 'echo' => true, 'post' => get_post() );
$r = wp_parse_args($args, $defaults);
extract( $r, EXTR_SKIP );
$title = get_the_title( $post );
if ( strlen($title) == 0 )
return;
$title = $before . $title . $after;
$title = esc_attr(strip_tags($title));
if ( $echo )
echo $title;
else
return $title;
}
/**
* Retrieve post title.
*
* If the post is protected and the visitor is not an admin, then "Protected"
* will be displayed before the post title. If the post is private, then
* "Private" will be located before the post title.
*
* @since 0.71
*
* @param int|object $post Optional. Post ID or object.
* @return string
*/
function get_the_title( $post = 0 ) {
$post = get_post( $post );
$title = isset( $post->post_title ) ? $post->post_title : '';
$id = isset( $post->ID ) ? $post->ID : 0;
if ( ! is_admin() ) {
if ( ! empty( $post->post_password ) ) {
$protected_title_format = apply_filters( 'protected_title_format', __( 'Protected: %s' ) );
$title = sprintf( $protected_title_format, $title );
} else if ( isset( $post->post_status ) && 'private' == $post->post_status ) {
$private_title_format = apply_filters( 'private_title_format', __( 'Private: %s' ) );
$title = sprintf( $private_title_format, $title );
}
}
return apply_filters( 'the_title', $title, $id );
}
/**
* Display the Post Global Unique Identifier (guid).
*
* The guid will appear to be a link, but should not be used as an link to the
* post. The reason you should not use it as a link, is because of moving the
* blog across domains.
*
* Url is escaped to make it xml safe
*
* @since 1.5.0
*
* @param int $id Optional. Post ID.
*/
function the_guid( $id = 0 ) {
echo esc_url( get_the_guid( $id ) );
}
/**
* Retrieve the Post Global Unique Identifier (guid).
*
* The guid will appear to be a link, but should not be used as an link to the
* post. The reason you should not use it as a link, is because of moving the
* blog across domains.
*
* @since 1.5.0
*
* @param int $id Optional. Post ID.
* @return string
*/
function get_the_guid( $id = 0 ) {
$post = get_post($id);
return apply_filters('get_the_guid', $post->guid);
}
/**
* Display the post content.
*
* @since 0.71
*
* @param string $more_link_text Optional. Content for when there is more text.
* @param bool $strip_teaser Optional. Strip teaser content before the more text. Default is false.
*/
function the_content( $more_link_text = null, $strip_teaser = false) {
$content = get_the_content( $more_link_text, $strip_teaser );
$content = apply_filters( 'the_content', $content );
$content = str_replace( ']]>', ']]>', $content );
echo $content;
}
/**
* Retrieve the post content.
*
* @since 0.71
*
* @param string $more_link_text Optional. Content for when there is more text.
* @param bool $stripteaser Optional. Strip teaser content before the more text. Default is false.
* @return string
*/
function get_the_content( $more_link_text = null, $strip_teaser = false ) {
global $page, $more, $preview, $pages, $multipage;
$post = get_post();
if ( null === $more_link_text )
$more_link_text = __( '(more…)' );
$output = '';
$has_teaser = false;
// If post password required and it doesn't match the cookie.
if ( post_password_required( $post ) )
return get_the_password_form( $post );
if ( $page > count( $pages ) ) // if the requested page doesn't exist
$page = count( $pages ); // give them the highest numbered page that DOES exist
$content = $pages[$page - 1];
if ( preg_match( '/<!--more(.*?)?-->/', $content, $matches ) ) {
$content = explode( $matches[0], $content, 2 );
if ( ! empty( $matches[1] ) && ! empty( $more_link_text ) )
$more_link_text = strip_tags( wp_kses_no_null( trim( $matches[1] ) ) );
$has_teaser = true;
} else {
$content = array( $content );
}
if ( false !== strpos( $post->post_content, '<!--noteaser-->' ) && ( ! $multipage || $page == 1 ) )
$strip_teaser = true;
$teaser = $content[0];
if ( $more && $strip_teaser && $has_teaser )
$teaser = '';
$output .= $teaser;
if ( count( $content ) > 1 ) {
if ( $more ) {
$output .= '<span id="more-' . $post->ID . '"></span>' . $content[1];
} else {
if ( ! empty( $more_link_text ) )
$output .= apply_filters( 'the_content_more_link', ' <a href="' . get_permalink() . "#more-{$post->ID}\" class=\"more-link\">$more_link_text</a>", $more_link_text );
$output = force_balance_tags( $output );
}
}
if ( $preview ) // preview fix for javascript bug with foreign languages
$output = preg_replace_callback( '/\%u([0-9A-F]{4})/', '_convert_urlencoded_to_entities', $output );
return $output;
}
/**
* Preview fix for javascript bug with foreign languages
*
* @since 3.1.0
* @access private
* @param array $match Match array from preg_replace_callback
* @return string
*/
function _convert_urlencoded_to_entities( $match ) {
return '&#' . base_convert( $match[1], 16, 10 ) . ';';
}
/**
* Display the post excerpt.
*
* @since 0.71
* @uses apply_filters() Calls 'the_excerpt' hook on post excerpt.
*/
function the_excerpt() {
echo apply_filters('the_excerpt', get_the_excerpt());
}
/**
* Retrieve the post excerpt.
*
* @since 0.71
*
* @param mixed $deprecated Not used.
* @return string
*/
function get_the_excerpt( $deprecated = '' ) {
if ( !empty( $deprecated ) )
_deprecated_argument( __FUNCTION__, '2.3' );
$post = get_post();
if ( post_password_required() ) {
return __( 'There is no excerpt because this is a protected post.' );
}
return apply_filters( 'get_the_excerpt', $post->post_excerpt );
}
/**
* Whether post has excerpt.
*
* @since 2.3.0
*
* @param int $id Optional. Post ID.
* @return bool
*/
function has_excerpt( $id = 0 ) {
$post = get_post( $id );
return ( !empty( $post->post_excerpt ) );
}
/**
* Display the classes for the post div.
*
* @since 2.7.0
*
* @param string|array $class One or more classes to add to the class list.
* @param int $post_id An optional post ID.
*/
function post_class( $class = '', $post_id = null ) {
// Separates classes with a single space, collates classes for post DIV
echo 'class="' . join( ' ', get_post_class( $class, $post_id ) ) . '"';
}
/**
* Retrieve the classes for the post div as an array.
*
* The class names are add are many. If the post is a sticky, then the 'sticky'
* class name. The class 'hentry' is always added to each post. For each
* category, the class will be added with 'category-' with category slug is
* added. The tags are the same way as the categories with 'tag-' before the tag
* slug. All classes are passed through the filter, 'post_class' with the list
* of classes, followed by $class parameter value, with the post ID as the last
* parameter.
*
* @since 2.7.0
*
* @param string|array $class One or more classes to add to the class list.
* @param int $post_id An optional post ID.
* @return array Array of classes.
*/
function get_post_class( $class = '', $post_id = null ) {
$post = get_post($post_id);
$classes = array();
if ( empty($post) )
return $classes;
$classes[] = 'post-' . $post->ID;
if ( ! is_admin() )
$classes[] = $post->post_type;
$classes[] = 'type-' . $post->post_type;
$classes[] = 'status-' . $post->post_status;
// Post Format
if ( post_type_supports( $post->post_type, 'post-formats' ) ) {
$post_format = get_post_format( $post->ID );
if ( $post_format && !is_wp_error($post_format) )
$classes[] = 'format-' . sanitize_html_class( $post_format );
else
$classes[] = 'format-standard';
}
// post requires password
if ( post_password_required($post->ID) )
$classes[] = 'post-password-required';
// sticky for Sticky Posts
if ( is_sticky($post->ID) && is_home() && !is_paged() )
$classes[] = 'sticky';
// hentry for hAtom compliance
$classes[] = 'hentry';
// Categories
if ( is_object_in_taxonomy( $post->post_type, 'category' ) ) {
foreach ( (array) get_the_category($post->ID) as $cat ) {
if ( empty($cat->slug ) )
continue;
$classes[] = 'category-' . sanitize_html_class($cat->slug, $cat->term_id);
}
}
// Tags
if ( is_object_in_taxonomy( $post->post_type, 'post_tag' ) ) {
foreach ( (array) get_the_tags($post->ID) as $tag ) {
if ( empty($tag->slug ) )
continue;
$classes[] = 'tag-' . sanitize_html_class($tag->slug, $tag->term_id);
}
}
if ( !empty($class) ) {
if ( !is_array( $class ) )
$class = preg_split('#\s+#', $class);
$classes = array_merge($classes, $class);
}
$classes = array_map('esc_attr', $classes);
return apply_filters('post_class', $classes, $class, $post->ID);
}
/**
* Display the classes for the body element.
*
* @since 2.8.0
*
* @param string|array $class One or more classes to add to the class list.
*/
function body_class( $class = '' ) {
// Separates classes with a single space, collates classes for body element
echo 'class="' . join( ' ', get_body_class( $class ) ) . '"';
}
/**
* Retrieve the classes for the body element as an array.
*
* @since 2.8.0
*
* @param string|array $class One or more classes to add to the class list.
* @return array Array of classes.
*/
function get_body_class( $class = '' ) {
global $wp_query, $wpdb;
$classes = array();
if ( is_rtl() )
$classes[] = 'rtl';
if ( is_front_page() )
$classes[] = 'home';
if ( is_home() )
$classes[] = 'blog';
if ( is_archive() )
$classes[] = 'archive';
if ( is_date() )
$classes[] = 'date';
if ( is_search() ) {
$classes[] = 'search';
$classes[] = $wp_query->posts ? 'search-results' : 'search-no-results';
}
if ( is_paged() )
$classes[] = 'paged';
if ( is_attachment() )
$classes[] = 'attachment';
if ( is_404() )
$classes[] = 'error404';
if ( is_single() ) {
$post_id = $wp_query->get_queried_object_id();
$post = $wp_query->get_queried_object();
$classes[] = 'single';
if ( isset( $post->post_type ) ) {
$classes[] = 'single-' . sanitize_html_class($post->post_type, $post_id);
$classes[] = 'postid-' . $post_id;
// Post Format
if ( post_type_supports( $post->post_type, 'post-formats' ) ) {
$post_format = get_post_format( $post->ID );
if ( $post_format && !is_wp_error($post_format) )
$classes[] = 'single-format-' . sanitize_html_class( $post_format );
else
$classes[] = 'single-format-standard';
}
}
if ( is_attachment() ) {
$mime_type = get_post_mime_type($post_id);
$mime_prefix = array( 'application/', 'image/', 'text/', 'audio/', 'video/', 'music/' );
$classes[] = 'attachmentid-' . $post_id;
$classes[] = 'attachment-' . str_replace( $mime_prefix, '', $mime_type );
}
} elseif ( is_archive() ) {
if ( is_post_type_archive() ) {
$classes[] = 'post-type-archive';
$classes[] = 'post-type-archive-' . sanitize_html_class( get_query_var( 'post_type' ) );
} else if ( is_author() ) {
$author = $wp_query->get_queried_object();
$classes[] = 'author';
if ( isset( $author->user_nicename ) ) {
$classes[] = 'author-' . sanitize_html_class( $author->user_nicename, $author->ID );
$classes[] = 'author-' . $author->ID;
}
} elseif ( is_category() ) {
$cat = $wp_query->get_queried_object();
$classes[] = 'category';
if ( isset( $cat->term_id ) ) {
$classes[] = 'category-' . sanitize_html_class( $cat->slug, $cat->term_id );
$classes[] = 'category-' . $cat->term_id;
}
} elseif ( is_tag() ) {
$tags = $wp_query->get_queried_object();
$classes[] = 'tag';
if ( isset( $tags->term_id ) ) {
$classes[] = 'tag-' . sanitize_html_class( $tags->slug, $tags->term_id );
$classes[] = 'tag-' . $tags->term_id;
}
} elseif ( is_tax() ) {
$term = $wp_query->get_queried_object();
if ( isset( $term->term_id ) ) {
$classes[] = 'tax-' . sanitize_html_class( $term->taxonomy );
$classes[] = 'term-' . sanitize_html_class( $term->slug, $term->term_id );
$classes[] = 'term-' . $term->term_id;
}
}
} elseif ( is_page() ) {
$classes[] = 'page';
$page_id = $wp_query->get_queried_object_id();
$post = get_post($page_id);
$classes[] = 'page-id-' . $page_id;
if ( $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' AND post_status = 'publish' LIMIT 1", $page_id) ) )
$classes[] = 'page-parent';
if ( $post->post_parent ) {
$classes[] = 'page-child';
$classes[] = 'parent-pageid-' . $post->post_parent;
}
if ( is_page_template() ) {
$classes[] = 'page-template';
$classes[] = 'page-template-' . sanitize_html_class( str_replace( '.', '-', get_page_template_slug( $page_id ) ) );
} else {
$classes[] = 'page-template-default';
}
}
if ( is_user_logged_in() )
$classes[] = 'logged-in';
if ( is_admin_bar_showing() ) {
$classes[] = 'admin-bar';
$classes[] = 'no-customize-support';
}
if ( get_theme_mod( 'background_color' ) || get_background_image() )
$classes[] = 'custom-background';
$page = $wp_query->get( 'page' );
if ( !$page || $page < 2)
$page = $wp_query->get( 'paged' );
if ( $page && $page > 1 ) {
$classes[] = 'paged-' . $page;
if ( is_single() )
$classes[] = 'single-paged-' . $page;
elseif ( is_page() )
$classes[] = 'page-paged-' . $page;
elseif ( is_category() )
$classes[] = 'category-paged-' . $page;
elseif ( is_tag() )
$classes[] = 'tag-paged-' . $page;
elseif ( is_date() )
$classes[] = 'date-paged-' . $page;
elseif ( is_author() )
$classes[] = 'author-paged-' . $page;
elseif ( is_search() )
$classes[] = 'search-paged-' . $page;
elseif ( is_post_type_archive() )
$classes[] = 'post-type-paged-' . $page;
}
if ( ! empty( $class ) ) {
if ( !is_array( $class ) )
$class = preg_split( '#\s+#', $class );
$classes = array_merge( $classes, $class );
} else {
// Ensure that we always coerce class to being an array.
$class = array();
}
$classes = array_map( 'esc_attr', $classes );
return apply_filters( 'body_class', $classes, $class );
}
/**
* Whether post requires password and correct password has been provided.
*
* @since 2.7.0
*
* @param int|WP_Post $post An optional post. Global $post used if not provided.
* @return bool false if a password is not required or the correct password cookie is present, true otherwise.
*/
function post_password_required( $post = null ) {
$post = get_post($post);
if ( empty( $post->post_password ) )
return false;
if ( ! isset( $_COOKIE['wp-postpass_' . COOKIEHASH] ) )
return true;
require_once ABSPATH . 'wp-includes/class-phpass.php';
$hasher = new PasswordHash( 8, true );
$hash = wp_unslash( $_COOKIE[ 'wp-postpass_' . COOKIEHASH ] );
if ( 0 !== strpos( $hash, '$P$B' ) )
return true;
return ! $hasher->CheckPassword( $post->post_password, $hash );
}
/**
* Page Template Functions for usage in Themes
*
* @package WordPress
* @subpackage Template
*/
/**
* The formatted output of a list of pages.
*
* Displays page links for paginated posts (i.e. includes the <!--nextpage-->.
* Quicktag one or more times). This tag must be within The Loop.
*
* The defaults for overwriting are:
* 'before' - Default is '<p> Pages:' (string). The html or text to prepend to
* each bookmarks.
* 'after' - Default is '</p>' (string). The html or text to append to each
* bookmarks.
* 'link_before' - Default is '' (string). The html or text to prepend to each
* Pages link inside the <a> tag. Also prepended to the current item, which
* is not linked.
* 'link_after' - Default is '' (string). The html or text to append to each
* Pages link inside the <a> tag. Also appended to the current item, which
* is not linked.
* 'next_or_number' - Default is 'number' (string). Indicates whether page
* numbers should be used. Valid values are number and next.
* 'separator' - Default is ' ' (string). Text used between pagination links.
* 'nextpagelink' - Default is 'Next Page' (string). Text for link to next page.
* of the bookmark.
* 'previouspagelink' - Default is 'Previous Page' (string). Text for link to
* previous page, if available.
* 'pagelink' - Default is '%' (String).Format string for page numbers. The % in
* the parameter string will be replaced with the page number, so Page %
* generates "Page 1", "Page 2", etc. Defaults to %, just the page number.
* 'echo' - Default is 1 (integer). When not 0, this triggers the HTML to be
* echoed and then returned.
*
* @since 1.2.0
*
* @param string|array $args Optional. Overwrite the defaults.
* @return string Formatted output in HTML.
*/
function wp_link_pages( $args = '' ) {
$defaults = array(
'before' => '<p>' . __( 'Pages:' ),
'after' => '</p>',
'link_before' => '',
'link_after' => '',
'next_or_number' => 'number',
'separator' => ' ',
'nextpagelink' => __( 'Next page' ),
'previouspagelink' => __( 'Previous page' ),
'pagelink' => '%',
'echo' => 1
);
$r = wp_parse_args( $args, $defaults );
$r = apply_filters( 'wp_link_pages_args', $r );
extract( $r, EXTR_SKIP );
global $page, $numpages, $multipage, $more;
$output = '';
if ( $multipage ) {
if ( 'number' == $next_or_number ) {
$output .= $before;
for ( $i = 1; $i <= $numpages; $i++ ) {
$link = $link_before . str_replace( '%', $i, $pagelink ) . $link_after;
if ( $i != $page || ! $more && 1 == $page )
$link = _wp_link_page( $i ) . $link . '</a>';
$link = apply_filters( 'wp_link_pages_link', $link, $i );
$output .= $separator . $link;
}
$output .= $after;
} elseif ( $more ) {
$output .= $before;
$i = $page - 1;
if ( $i ) {
$link = _wp_link_page( $i ) . $link_before . $previouspagelink . $link_after . '</a>';
$link = apply_filters( 'wp_link_pages_link', $link, $i );
$output .= $separator . $link;
}
$i = $page + 1;
if ( $i <= $numpages ) {
$link = _wp_link_page( $i ) . $link_before . $nextpagelink . $link_after . '</a>';
$link = apply_filters( 'wp_link_pages_link', $link, $i );
$output .= $separator . $link;
}
$output .= $after;
}
}
$output = apply_filters( 'wp_link_pages', $output, $args );
if ( $echo )
echo $output;
return $output;
}
/**
* Helper function for wp_link_pages().
*
* @since 3.1.0
* @access private
*
* @param int $i Page number.
* @return string Link.
*/
function _wp_link_page( $i ) {
global $wp_rewrite;
$post = get_post();
if ( 1 == $i ) {
$url = get_permalink();
} else {
if ( '' == get_option('permalink_structure') || in_array($post->post_status, array('draft', 'pending')) )
$url = add_query_arg( 'page', $i, get_permalink() );
elseif ( 'page' == get_option('show_on_front') && get_option('page_on_front') == $post->ID )
$url = trailingslashit(get_permalink()) . user_trailingslashit("$wp_rewrite->pagination_base/" . $i, 'single_paged');
else
$url = trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged');
}
return '<a href="' . esc_url( $url ) . '">';
}
//
// Post-meta: Custom per-post fields.
//
/**
* Retrieve post custom meta data field.
*
* @since 1.5.0
*
* @param string $key Meta data key name.
* @return bool|string|array Array of values or single value, if only one element exists. False will be returned if key does not exist.
*/
function post_custom( $key = '' ) {
$custom = get_post_custom();
if ( !isset( $custom[$key] ) )
return false;
elseif ( 1 == count($custom[$key]) )
return $custom[$key][0];
else
return $custom[$key];
}
/**
* Display list of post custom fields.
*
* @internal This will probably change at some point...
* @since 1.2.0
* @uses apply_filters() Calls 'the_meta_key' on list item HTML content, with key and value as separate parameters.
*/
function the_meta() {
if ( $keys = get_post_custom_keys() ) {
echo "<ul class='post-meta'>\n";
foreach ( (array) $keys as $key ) {
$keyt = trim($key);
if ( is_protected_meta( $keyt, 'post' ) )
continue;
$values = array_map('trim', get_post_custom_values($key));
$value = implode($values,', ');
echo apply_filters('the_meta_key', "<li><span class='post-meta-key'>$key:</span> $value</li>\n", $key, $value);
}
echo "</ul>\n";
}
}
//
// Pages
//
/**
* Retrieve or display list of pages as a dropdown (select list).
*
* @since 2.1.0
*
* @param array|string $args Optional. Override default arguments.
* @return string HTML content, if not displaying.
*/
function wp_dropdown_pages($args = '') {
$defaults = array(
'depth' => 0, 'child_of' => 0,
'selected' => 0, 'echo' => 1,
'name' => 'page_id', 'id' => '',
'show_option_none' => '', 'show_option_no_change' => '',
'option_none_value' => ''
);
$r = wp_parse_args( $args, $defaults );
extract( $r, EXTR_SKIP );
$pages = get_pages($r);
$output = '';
// Back-compat with old system where both id and name were based on $name argument
if ( empty($id) )
$id = $name;
if ( ! empty($pages) ) {
$output = "<select name='" . esc_attr( $name ) . "' id='" . esc_attr( $id ) . "'>\n";
if ( $show_option_no_change )
$output .= "\t<option value=\"-1\">$show_option_no_change</option>";
if ( $show_option_none )
$output .= "\t<option value=\"" . esc_attr($option_none_value) . "\">$show_option_none</option>\n";
$output .= walk_page_dropdown_tree($pages, $depth, $r);
$output .= "</select>\n";
}
$output = apply_filters('wp_dropdown_pages', $output);
if ( $echo )
echo $output;
return $output;
}
/**
* Retrieve or display list of pages in list (li) format.
*
* @since 1.5.0
*
* @param array|string $args Optional. Override default arguments.
* @return string HTML content, if not displaying.
*/
function wp_list_pages($args = '') {
$defaults = array(
'depth' => 0, 'show_date' => '',
'date_format' => get_option('date_format'),
'child_of' => 0, 'exclude' => '',
'title_li' => __('Pages'), 'echo' => 1,
'authors' => '', 'sort_column' => 'menu_order, post_title',
'link_before' => '', 'link_after' => '', 'walker' => '',
);
$r = wp_parse_args( $args, $defaults );
extract( $r, EXTR_SKIP );
$output = '';
$current_page = 0;
// sanitize, mostly to keep spaces out
$r['exclude'] = preg_replace('/[^0-9,]/', '', $r['exclude']);
// Allow plugins to filter an array of excluded pages (but don't put a nullstring into the array)
$exclude_array = ( $r['exclude'] ) ? explode(',', $r['exclude']) : array();
$r['exclude'] = implode( ',', apply_filters('wp_list_pages_excludes', $exclude_array) );
// Query pages.
$r['hierarchical'] = 0;
$pages = get_pages($r);
if ( !empty($pages) ) {
if ( $r['title_li'] )
$output .= '<li class="pagenav">' . $r['title_li'] . '<ul>';
global $wp_query;
if ( is_page() || is_attachment() || $wp_query->is_posts_page )
$current_page = $wp_query->get_queried_object_id();
$output .= walk_page_tree($pages, $r['depth'], $current_page, $r);
if ( $r['title_li'] )
$output .= '</ul></li>';
}
$output = apply_filters('wp_list_pages', $output, $r);
if ( $r['echo'] )
echo $output;
else
return $output;
}
/**
* Display or retrieve list of pages with optional home link.
*
* The arguments are listed below and part of the arguments are for {@link
* wp_list_pages()} function. Check that function for more info on those
* arguments.
*
* <ul>
* <li><strong>sort_column</strong> - How to sort the list of pages. Defaults
* to page title. Use column for posts table.</li>
* <li><strong>menu_class</strong> - Class to use for the div ID which contains
* the page list. Defaults to 'menu'.</li>
* <li><strong>echo</strong> - Whether to echo list or return it. Defaults to
* echo.</li>
* <li><strong>link_before</strong> - Text before show_home argument text.</li>
* <li><strong>link_after</strong> - Text after show_home argument text.</li>
* <li><strong>show_home</strong> - If you set this argument, then it will
* display the link to the home page. The show_home argument really just needs
* to be set to the value of the text of the link.</li>
* </ul>
*
* @since 2.7.0
*
* @param array|string $args
* @return string html menu
*/
function wp_page_menu( $args = array() ) {
$defaults = array('sort_column' => 'menu_order, post_title', 'menu_class' => 'menu', 'echo' => true, 'link_before' => '', 'link_after' => '');
$args = wp_parse_args( $args, $defaults );
$args = apply_filters( 'wp_page_menu_args', $args );
$menu = '';
$list_args = $args;
// Show Home in the menu
if ( ! empty($args['show_home']) ) {
if ( true === $args['show_home'] || '1' === $args['show_home'] || 1 === $args['show_home'] )
$text = __('Home');
else
$text = $args['show_home'];
$class = '';
if ( is_front_page() && !is_paged() )
$class = 'class="current_page_item"';
$menu .= '<li ' . $class . '><a href="' . home_url( '/' ) . '" title="' . esc_attr($text) . '">' . $args['link_before'] . $text . $args['link_after'] . '</a></li>';
// If the front page is a page, add it to the exclude list
if (get_option('show_on_front') == 'page') {
if ( !empty( $list_args['exclude'] ) ) {
$list_args['exclude'] .= ',';
} else {
$list_args['exclude'] = '';
}
$list_args['exclude'] .= get_option('page_on_front');
}
}
$list_args['echo'] = false;
$list_args['title_li'] = '';
$menu .= str_replace( array( "\r", "\n", "\t" ), '', wp_list_pages($list_args) );
if ( $menu )
$menu = '<ul>' . $menu . '</ul>';
$menu = '<div class="' . esc_attr($args['menu_class']) . '">' . $menu . "</div>\n";
$menu = apply_filters( 'wp_page_menu', $menu, $args );
if ( $args['echo'] )
echo $menu;
else
return $menu;
}
//
// Page helpers
//
/**
* Retrieve HTML list content for page list.
*
* @uses Walker_Page to create HTML list content.
* @since 2.1.0
* @see Walker_Page::walk() for parameters and return description.
*/
function walk_page_tree($pages, $depth, $current_page, $r) {
if ( empty($r['walker']) )
$walker = new Walker_Page;
else
$walker = $r['walker'];
$args = array($pages, $depth, $r, $current_page);
return call_user_func_array(array($walker, 'walk'), $args);
}
/**
* Retrieve HTML dropdown (select) content for page list.
*
* @uses Walker_PageDropdown to create HTML dropdown content.
* @since 2.1.0
* @see Walker_PageDropdown::walk() for parameters and return description.
*/
function walk_page_dropdown_tree() {
$args = func_get_args();
if ( empty($args[2]['walker']) ) // the user's options are the third parameter
$walker = new Walker_PageDropdown;
else
$walker = $args[2]['walker'];
return call_user_func_array(array($walker, 'walk'), $args);
}
/**
* Create HTML list of pages.
*
* @package WordPress
* @since 2.1.0
* @uses Walker
*/
class Walker_Page extends Walker {
/**
* @see Walker::$tree_type
* @since 2.1.0
* @var string
*/
var $tree_type = 'page';
/**
* @see Walker::$db_fields
* @since 2.1.0
* @todo Decouple this.
* @var array
*/
var $db_fields = array ('parent' => 'post_parent', 'id' => 'ID');
/**
* @see Walker::start_lvl()
* @since 2.1.0
*
* @param string $output Passed by reference. Used to append additional content.
* @param int $depth Depth of page. Used for padding.
* @param array $args
*/
function start_lvl( &$output, $depth = 0, $args = array() ) {
$indent = str_repeat("\t", $depth);
$output .= "\n$indent<ul class='children'>\n";
}
/**
* @see Walker::end_lvl()
* @since 2.1.0
*
* @param string $output Passed by reference. Used to append additional content.
* @param int $depth Depth of page. Used for padding.
* @param array $args
*/
function end_lvl( &$output, $depth = 0, $args = array() ) {
$indent = str_repeat("\t", $depth);
$output .= "$indent</ul>\n";
}
/**
* @see Walker::start_el()
* @since 2.1.0
*
* @param string $output Passed by reference. Used to append additional content.
* @param object $page Page data object.
* @param int $depth Depth of page. Used for padding.
* @param int $current_page Page ID.
* @param array $args
*/
function start_el( &$output, $page, $depth = 0, $args = array(), $current_page = 0 ) {
if ( $depth )
$indent = str_repeat("\t", $depth);
else
$indent = '';
extract($args, EXTR_SKIP);
$css_class = array('page_item', 'page-item-'.$page->ID);
if ( !empty($current_page) ) {
$_current_page = get_post( $current_page );
if ( in_array( $page->ID, $_current_page->ancestors ) )
$css_class[] = 'current_page_ancestor';
if ( $page->ID == $current_page )
$css_class[] = 'current_page_item';
elseif ( $_current_page && $page->ID == $_current_page->post_parent )
$css_class[] = 'current_page_parent';
} elseif ( $page->ID == get_option('page_for_posts') ) {
$css_class[] = 'current_page_parent';
}
$css_class = implode( ' ', apply_filters( 'page_css_class', $css_class, $page, $depth, $args, $current_page ) );
if ( '' === $page->post_title )
$page->post_title = sprintf( __( '#%d (no title)' ), $page->ID );
$output .= $indent . '<li class="' . $css_class . '"><a href="' . get_permalink($page->ID) . '">' . $link_before . apply_filters( 'the_title', $page->post_title, $page->ID ) . $link_after . '</a>';
if ( !empty($show_date) ) {
if ( 'modified' == $show_date )
$time = $page->post_modified;
else
$time = $page->post_date;
$output .= " " . mysql2date($date_format, $time);
}
}
/**
* @see Walker::end_el()
* @since 2.1.0
*
* @param string $output Passed by reference. Used to append additional content.
* @param object $page Page data object. Not used.
* @param int $depth Depth of page. Not Used.
* @param array $args
*/
function end_el( &$output, $page, $depth = 0, $args = array() ) {
$output .= "</li>\n";
}
}
/**
* Create HTML dropdown list of pages.
*
* @package WordPress
* @since 2.1.0
* @uses Walker
*/
class Walker_PageDropdown extends Walker {
/**
* @see Walker::$tree_type
* @since 2.1.0
* @var string
*/
var $tree_type = 'page';
/**
* @see Walker::$db_fields
* @since 2.1.0
* @todo Decouple this
* @var array
*/
var $db_fields = array ('parent' => 'post_parent', 'id' => 'ID');
/**
* @see Walker::start_el()
* @since 2.1.0
*
* @param string $output Passed by reference. Used to append additional content.
* @param object $page Page data object.
* @param int $depth Depth of page in reference to parent pages. Used for padding.
* @param array $args Uses 'selected' argument for selected page to set selected HTML attribute for option element.
* @param int $id
*/
function start_el( &$output, $page, $depth = 0, $args = array(), $id = 0 ) {
$pad = str_repeat(' ', $depth * 3);
$output .= "\t<option class=\"level-$depth\" value=\"$page->ID\"";
if ( $page->ID == $args['selected'] )
$output .= ' selected="selected"';
$output .= '>';
$title = apply_filters( 'list_pages', $page->post_title, $page );
$output .= $pad . esc_html( $title );
$output .= "</option>\n";
}
}
//
// Attachments
//
/**
* Display an attachment page link using an image or icon.
*
* @since 2.0.0
*
* @param int $id Optional. Post ID.
* @param bool $fullsize Optional, default is false. Whether to use full size.
* @param bool $deprecated Deprecated. Not used.
* @param bool $permalink Optional, default is false. Whether to include permalink.
*/
function the_attachment_link( $id = 0, $fullsize = false, $deprecated = false, $permalink = false ) {
if ( !empty( $deprecated ) )
_deprecated_argument( __FUNCTION__, '2.5' );
if ( $fullsize )
echo wp_get_attachment_link($id, 'full', $permalink);
else
echo wp_get_attachment_link($id, 'thumbnail', $permalink);
}
/**
* Retrieve an attachment page link using an image or icon, if possible.
*
* @since 2.5.0
* @uses apply_filters() Calls 'wp_get_attachment_link' filter on HTML content with same parameters as function.
*
* @param int $id Optional. Post ID.
* @param string $size Optional, default is 'thumbnail'. Size of image, either array or string.
* @param bool $permalink Optional, default is false. Whether to add permalink to image.
* @param bool $icon Optional, default is false. Whether to include icon.
* @param string|bool $text Optional, default is false. If string, then will be link text.
* @return string HTML content.
*/
function wp_get_attachment_link( $id = 0, $size = 'thumbnail', $permalink = false, $icon = false, $text = false ) {
$id = intval( $id );
$_post = get_post( $id );
if ( empty( $_post ) || ( 'attachment' != $_post->post_type ) || ! $url = wp_get_attachment_url( $_post->ID ) )
return __( 'Missing Attachment' );
if ( $permalink )
$url = get_attachment_link( $_post->ID );
$post_title = esc_attr( $_post->post_title );
if ( $text )
$link_text = $text;
elseif ( $size && 'none' != $size )
$link_text = wp_get_attachment_image( $id, $size, $icon );
else
$link_text = '';
if ( trim( $link_text ) == '' )
$link_text = $_post->post_title;
return apply_filters( 'wp_get_attachment_link', "<a href='$url' title='$post_title'>$link_text</a>", $id, $size, $permalink, $icon, $text );
}
/**
* Wrap attachment in <<p>> element before content.
*
* @since 2.0.0
* @uses apply_filters() Calls 'prepend_attachment' hook on HTML content.
*
* @param string $content
* @return string
*/
function prepend_attachment($content) {
$post = get_post();
if ( empty($post->post_type) || $post->post_type != 'attachment' )
return $content;
$p = '<p class="attachment">';
// show the medium sized image representation of the attachment if available, and link to the raw file
$p .= wp_get_attachment_link(0, 'medium', false);
$p .= '</p>';
$p = apply_filters('prepend_attachment', $p);
return "$p\n$content";
}
//
// Misc
//
/**
* Retrieve protected post password form content.
*
* @since 1.0.0
* @uses apply_filters() Calls 'the_password_form' filter on output.
* @param int|WP_Post $post Optional. A post id or post object. Defaults to the current post when in The Loop, undefined otherwise.
* @return string HTML content for password form for password protected post.
*/
function get_the_password_form( $post = 0 ) {
$post = get_post( $post );
$label = 'pwbox-' . ( empty($post->ID) ? rand() : $post->ID );
$output = '<form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" class="post-password-form" method="post">
<p>' . __( 'This post is password protected. To view it please enter your password below:' ) . '</p>
<p><label for="' . $label . '">' . __( 'Password:' ) . ' <input name="post_password" id="' . $label . '" type="password" size="20" /></label> <input type="submit" name="Submit" value="' . esc_attr__( 'Submit' ) . '" /></p>
</form>
';
return apply_filters( 'the_password_form', $output );
}
/**
* Whether currently in a page template.
*
* This template tag allows you to determine if you are in a page template.
* You can optionally provide a template name and then the check will be
* specific to that template.
*
* @since 2.5.0
* @uses $wp_query
*
* @param string $template The specific template name if specific matching is required.
* @return bool True on success, false on failure.
*/
function is_page_template( $template = '' ) {
if ( ! is_page() )
return false;
$page_template = get_page_template_slug( get_queried_object_id() );
if ( empty( $template ) )
return (bool) $page_template;
if ( $template == $page_template )
return true;
if ( 'default' == $template && ! $page_template )
return true;
return false;
}
/**
* Get the specific template name for a page.
*
* @since 3.4.0
*
* @param int $post_id Optional. The page ID to check. Defaults to the current post, when used in the loop.
* @return string|bool Page template filename. Returns an empty string when the default page template
* is in use. Returns false if the post is not a page.
*/
function get_page_template_slug( $post_id = null ) {
$post = get_post( $post_id );
if ( ! $post || 'page' != $post->post_type )
return false;
$template = get_post_meta( $post->ID, '_wp_page_template', true );
if ( ! $template || 'default' == $template )
return '';
return $template;
}
/**
* Retrieve formatted date timestamp of a revision (linked to that revisions's page).
*
* @package WordPress
* @subpackage Post_Revisions
* @since 2.6.0
*
* @uses date_i18n()
*
* @param int|object $revision Revision ID or revision object.
* @param bool $link Optional, default is true. Link to revisions's page?
* @return string i18n formatted datetimestamp or localized 'Current Revision'.
*/
function wp_post_revision_title( $revision, $link = true ) {
if ( !$revision = get_post( $revision ) )
return $revision;
if ( !in_array( $revision->post_type, array( 'post', 'page', 'revision' ) ) )
return false;
/* translators: revision date format, see http://php.net/date */
$datef = _x( 'j F, Y @ G:i', 'revision date format');
/* translators: 1: date */
$autosavef = _x( '%1$s [Autosave]', 'post revision title extra' );
/* translators: 1: date */
$currentf = _x( '%1$s [Current Revision]', 'post revision title extra' );
$date = date_i18n( $datef, strtotime( $revision->post_modified ) );
if ( $link && current_user_can( 'edit_post', $revision->ID ) && $link = get_edit_post_link( $revision->ID ) )
$date = "<a href='$link'>$date</a>";
if ( !wp_is_post_revision( $revision ) )
$date = sprintf( $currentf, $date );
elseif ( wp_is_post_autosave( $revision ) )
$date = sprintf( $autosavef, $date );
return $date;
}
/**
* Retrieve formatted date timestamp of a revision (linked to that revisions's page).
*
* @package WordPress
* @subpackage Post_Revisions
* @since 3.6.0
*
* @uses date_i18n()
*
* @param int|object $revision Revision ID or revision object.
* @param bool $link Optional, default is true. Link to revisions's page?
* @return string gravatar, user, i18n formatted datetimestamp or localized 'Current Revision'.
*/
function wp_post_revision_title_expanded( $revision, $link = true ) {
if ( !$revision = get_post( $revision ) )
return $revision;
if ( !in_array( $revision->post_type, array( 'post', 'page', 'revision' ) ) )
return false;
$author = get_the_author_meta( 'display_name', $revision->post_author );
/* translators: revision date format, see http://php.net/date */
$datef = _x( 'j F, Y @ G:i:s', 'revision date format');
$gravatar = get_avatar( $revision->post_author, 24 );
$date = date_i18n( $datef, strtotime( $revision->post_modified ) );
if ( $link && current_user_can( 'edit_post', $revision->ID ) && $link = get_edit_post_link( $revision->ID ) )
$date = "<a href='$link'>$date</a>";
$revision_date_author = sprintf(
/* translators: post revision title: 1: author avatar, 2: author name, 3: time ago, 4: date */
_x( '%1$s %2$s, %3$s ago (%4$s)', 'post revision title' ),
$gravatar,
$author,
human_time_diff( strtotime( $revision->post_modified ), current_time( 'timestamp' ) ),
$date
);
$autosavef = __( '%1$s [Autosave]' );
$currentf = __( '%1$s [Current Revision]' );
if ( !wp_is_post_revision( $revision ) )
$revision_date_author = sprintf( $currentf, $revision_date_author );
elseif ( wp_is_post_autosave( $revision ) )
$revision_date_author = sprintf( $autosavef, $revision_date_author );
return $revision_date_author;
}
/**
* Display list of a post's revisions.
*
* Can output either a UL with edit links or a TABLE with diff interface, and
* restore action links.
*
* @package WordPress
* @subpackage Post_Revisions
* @since 2.6.0
*
* @uses wp_get_post_revisions()
* @uses wp_post_revision_title_expanded()
* @uses get_edit_post_link()
* @uses get_the_author_meta()
*
* @param int|object $post_id Post ID or post object.
* @param string $type 'all' (default), 'revision' or 'autosave'
* @return null
*/
function wp_list_post_revisions( $post_id = 0, $type = 'all' ) {
if ( ! $post = get_post( $post_id ) )
return;
// $args array with (parent, format, right, left, type) deprecated since 3.6
if ( is_array( $type ) ) {
$type = ! empty( $type['type'] ) ? $type['type'] : $type;
_deprecated_argument( __FUNCTION__, '3.6' );
}
if ( ! $revisions = wp_get_post_revisions( $post->ID ) )
return;
$rows = '';
foreach ( $revisions as $revision ) {
if ( ! current_user_can( 'read_post', $revision->ID ) )
continue;
$is_autosave = wp_is_post_autosave( $revision );
if ( ( 'revision' === $type && $is_autosave ) || ( 'autosave' === $type && ! $is_autosave ) )
continue;
$rows .= "\t<li>" . wp_post_revision_title_expanded( $revision ) . "</li>\n";
}
echo "<div class='hide-if-js'><p>" . __( 'JavaScript must be enabled to use this feature.' ) . "</p></div>\n";
echo "<ul class='post-revisions hide-if-no-js'>\n";
echo $rows;
// if the post was previously restored from a revision
// show the restore event details
if ( $restored_from_meta = get_post_meta( $post->ID, '_post_restored_from', true ) ) {
$author = get_user_by( 'id', $restored_from_meta[ 'restored_by_user' ] );
/* translators: revision date format, see http://php.net/date */
$datef = _x( 'j F, Y @ G:i:s', 'revision date format');
$date = date_i18n( $datef, strtotime( $restored_from_meta[ 'restored_time' ] ) );
$time_diff = human_time_diff( $restored_from_meta[ 'restored_time' ] ) ;
?>
<hr />
<div id="revisions-meta-restored">
<?php
printf(
/* translators: restored revision details: 1: gravatar image, 2: author name, 3: time ago, 4: date */
__( 'Previously restored by %1$s %2$s, %3$s ago (%4$s)' ),
get_avatar( $author->ID, 24 ),
$author->display_name,
$time_diff,
$date
);
?>
</div>
<?php
echo "</ul>";
}
}
| gpl-2.0 |
namitgarg/multi | sites/www.rai.com/themes/brownphilip/templates/page.tpl.php | 7135 | <?php
/**
* @file
* Zen theme's implementation to display a single Drupal page.
*
* Available variables:
*
* General utility variables:
* - $base_path: The base URL path of the Drupal installation. At the very
* least, this will always default to /.
* - $directory: The directory the template is located in, e.g. modules/system
* or themes/bartik.
* - $is_front: TRUE if the current page is the front page.
* - $logged_in: TRUE if the user is registered and signed in.
* - $is_admin: TRUE if the user has permission to access administration pages.
*
* Site identity:
* - $front_page: The URL of the front page. Use this instead of $base_path,
* when linking to the front page. This includes the language domain or
* prefix.
* - $logo: The path to the logo image, as defined in theme configuration.
* - $site_name: The name of the site, empty when display has been disabled
* in theme settings.
* - $site_slogan: The slogan of the site, empty when display has been disabled
* in theme settings.
*
* Navigation:
* - $main_menu (array): An array containing the Main menu links for the
* site, if they have been configured.
* - $secondary_menu (array): An array containing the Secondary menu links for
* the site, if they have been configured.
* - $secondary_menu_heading: The title of the menu used by the secondary links.
* - $breadcrumb: The breadcrumb trail for the current page.
*
* Page content (in order of occurrence in the default page.tpl.php):
* - $title_prefix (array): An array containing additional output populated by
* modules, intended to be displayed in front of the main title tag that
* appears in the template.
* - $title: The page title, for use in the actual HTML content.
* - $title_suffix (array): An array containing additional output populated by
* modules, intended to be displayed after the main title tag that appears in
* the template.
* - $messages: HTML for status and error messages. Should be displayed
* prominently.
* - $tabs (array): Tabs linking to any sub-pages beneath the current page
* (e.g., the view and edit tabs when displaying a node).
* - $action_links (array): Actions local to the page, such as 'Add menu' on the
* menu administration interface.
* - $feed_icons: A string of all feed icons for the current page.
* - $node: The node object, if there is an automatically-loaded node
* associated with the page, and the node ID is the second argument
* in the page's path (e.g. node/12345 and node/12345/revisions, but not
* comment/reply/12345).
*
* Regions:
* - $page['header']: Items for the header region.
* - $page['navigation']: Items for the navigation region, below the main menu (if any).
* - $page['help']: Dynamic help text, mostly for admin pages.
* - $page['highlighted']: Items for the highlighted content region.
* - $page['content']: The main content of the current page.
* - $page['sidebar_first']: Items for the first sidebar.
* - $page['sidebar_second']: Items for the second sidebar.
* - $page['footer']: Items for the footer region.
* - $page['bottom']: Items to appear at the bottom of the page below the footer.
*
* @see template_preprocess()
* @see template_preprocess_page()
* @see zen_preprocess_page()
* @see template_process()
*/
?>
<div id="page">
<header id="header" role="banner">
<?php if ($logo): ?>
<a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home" id="logo"><img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" /></a>
<?php endif; ?>
<?php if ($site_name || $site_slogan): ?>
<hgroup id="name-and-slogan">
<?php if ($site_name): ?>
<h1 id="site-name">
<a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><span><?php print $site_name; ?></span></a>
</h1>
<?php endif; ?>
<?php if ($site_slogan): ?>
<h2 id="site-slogan"><?php print $site_slogan; ?></h2>
<?php endif; ?>
</hgroup><!-- /#name-and-slogan -->
<?php endif; ?>
<?php if ($secondary_menu): ?>
<nav id="secondary-menu" role="navigation">
<?php print theme('links__system_secondary_menu', array(
'links' => $secondary_menu,
'attributes' => array(
'class' => array('links', 'inline', 'clearfix'),
),
'heading' => array(
'text' => $secondary_menu_heading,
'level' => 'h2',
'class' => array('element-invisible'),
),
)); ?>
</nav>
<?php endif; ?>
<?php print render($page['header']); ?>
</header>
<div id="navigation">
<?php if ($main_menu): ?>
<nav id="main-menu" role="navigation">
<?php
// This code snippet is hard to modify. We recommend turning off the
// "Main menu" on your sub-theme's settings form, deleting this PHP
// code block, and, instead, using the "Menu block" module.
// @see http://drupal.org/project/menu_block
print theme('links__system_main_menu', array(
'links' => $main_menu,
'attributes' => array(
'class' => array('links', 'inline', 'clearfix'),
),
'heading' => array(
'text' => t('Main menu'),
'level' => 'h2',
'class' => array('element-invisible'),
),
)); ?>
</nav>
<?php endif; ?>
<?php print render($page['navigation']); ?>
</div><!-- /#navigation -->
<?php print render($page['content_top']); ?>
<div id="main">
<div id="content" class="column" role="main">
<?php print render($page['highlighted']); ?>
<?php print $breadcrumb; ?>
<a id="main-content"></a>
<?php print render($title_prefix); ?>
<?php if ($title): ?>
<h1 class="title" id="page-title"><?php print $title; ?></h1>
<?php print $site_h2 ?>
<?php endif; ?>
<?php print render($title_suffix); ?>
<?php print $messages; ?>
<?php print render($tabs); ?>
<?php print render($page['help']); ?>
<?php if ($action_links): ?>
<ul class="action-links"><?php print render($action_links); ?></ul>
<?php endif; ?>
<?php print render($page['content']); ?>
<?php print $feed_icons; ?>
</div><!-- /#content -->
<?php
// Render the sidebars to see if there's anything in them.
$sidebar_first = render($page['sidebar_first']);
$sidebar_second = render($page['sidebar_second']);
?>
<?php if ($sidebar_first || $sidebar_second): ?>
<aside class="sidebars">
<?php print $sidebar_first; ?>
<?php print $sidebar_second; ?>
</aside><!-- /.sidebars -->
<?php endif; ?>
</div><!-- /#main -->
<?php print render($page['content_bottom']); ?>
<?php print render($page['footer']); ?>
<?php
global $user;
if (!$user->uid): ?>
<div id="client-login"><a href="/user">login</a>
</div>
<?php
endif;
?>
</div><!-- /#page -->
<?php print render($page['bottom']); ?>
| gpl-2.0 |
netroby/hotspot9 | src/share/vm/services/diagnosticFramework.cpp | 17921 | /*
* Copyright (c) 2011, 2015, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "precompiled.hpp"
#include "memory/oopFactory.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/javaCalls.hpp"
#include "runtime/mutexLocker.hpp"
#include "services/diagnosticArgument.hpp"
#include "services/diagnosticFramework.hpp"
#include "services/management.hpp"
CmdLine::CmdLine(const char* line, size_t len, bool no_command_name) {
assert(line != NULL, "Command line string should not be NULL");
const char* line_end;
const char* cmd_end;
_cmd = line;
line_end = &line[len];
// Skip whitespace in the beginning of the line.
while (_cmd < line_end && isspace((int) _cmd[0])) {
_cmd++;
}
cmd_end = _cmd;
if (no_command_name) {
_cmd = NULL;
_cmd_len = 0;
} else {
// Look for end of the command name
while (cmd_end < line_end && !isspace((int) cmd_end[0])) {
cmd_end++;
}
_cmd_len = cmd_end - _cmd;
}
_args = cmd_end;
_args_len = line_end - _args;
}
bool DCmdArgIter::next(TRAPS) {
if (_len == 0) return false;
// skipping delimiters
while (_cursor < _len - 1 && _buffer[_cursor] == _delim) {
_cursor++;
}
// handling end of command line
if (_cursor == _len - 1 && _buffer[_cursor] == _delim) {
_key_addr = &_buffer[_cursor];
_key_len = 0;
_value_addr = &_buffer[_cursor];
_value_len = 0;
return false;
}
// extracting first item, argument or option name
_key_addr = &_buffer[_cursor];
bool arg_had_quotes = false;
while (_cursor <= _len - 1 && _buffer[_cursor] != '=' && _buffer[_cursor] != _delim) {
// argument can be surrounded by single or double quotes
if (_buffer[_cursor] == '\"' || _buffer[_cursor] == '\'') {
_key_addr++;
char quote = _buffer[_cursor];
arg_had_quotes = true;
while (_cursor < _len - 1) {
_cursor++;
if (_buffer[_cursor] == quote && _buffer[_cursor - 1] != '\\') {
break;
}
}
if (_buffer[_cursor] != quote) {
THROW_MSG_(vmSymbols::java_lang_IllegalArgumentException(),
"Format error in diagnostic command arguments", false);
}
break;
}
_cursor++;
}
_key_len = &_buffer[_cursor] - _key_addr;
if (arg_had_quotes) {
// if the argument was quoted, we need to step past the last quote here
_cursor++;
}
// check if the argument has the <key>=<value> format
if (_cursor <= _len -1 && _buffer[_cursor] == '=') {
_cursor++;
_value_addr = &_buffer[_cursor];
bool value_had_quotes = false;
// extract the value
while (_cursor <= _len - 1 && _buffer[_cursor] != _delim) {
// value can be surrounded by simple or double quotes
if (_buffer[_cursor] == '\"' || _buffer[_cursor] == '\'') {
_value_addr++;
char quote = _buffer[_cursor];
value_had_quotes = true;
while (_cursor < _len - 1) {
_cursor++;
if (_buffer[_cursor] == quote && _buffer[_cursor - 1] != '\\') {
break;
}
}
if (_buffer[_cursor] != quote) {
THROW_MSG_(vmSymbols::java_lang_IllegalArgumentException(),
"Format error in diagnostic command arguments", false);
}
break;
}
_cursor++;
}
_value_len = &_buffer[_cursor] - _value_addr;
if (value_had_quotes) {
// if the value was quoted, we need to step past the last quote here
_cursor++;
}
} else {
_value_addr = NULL;
_value_len = 0;
}
return _key_len != 0;
}
bool DCmdInfo::by_name(void* cmd_name, DCmdInfo* info) {
if (info == NULL) return false;
return strcmp((const char*)cmd_name, info->name()) == 0;
}
void DCmdParser::add_dcmd_option(GenDCmdArgument* arg) {
assert(arg != NULL, "Sanity");
if (_options == NULL) {
_options = arg;
} else {
GenDCmdArgument* o = _options;
while (o->next() != NULL) {
o = o->next();
}
o->set_next(arg);
}
arg->set_next(NULL);
Thread* THREAD = Thread::current();
arg->init_value(THREAD);
if (HAS_PENDING_EXCEPTION) {
fatal("Initialization must be successful");
}
}
void DCmdParser::add_dcmd_argument(GenDCmdArgument* arg) {
assert(arg != NULL, "Sanity");
if (_arguments_list == NULL) {
_arguments_list = arg;
} else {
GenDCmdArgument* a = _arguments_list;
while (a->next() != NULL) {
a = a->next();
}
a->set_next(arg);
}
arg->set_next(NULL);
Thread* THREAD = Thread::current();
arg->init_value(THREAD);
if (HAS_PENDING_EXCEPTION) {
fatal("Initialization must be successful");
}
}
void DCmdParser::parse(CmdLine* line, char delim, TRAPS) {
GenDCmdArgument* next_argument = _arguments_list;
DCmdArgIter iter(line->args_addr(), line->args_len(), delim);
bool cont = iter.next(CHECK);
while (cont) {
GenDCmdArgument* arg = lookup_dcmd_option(iter.key_addr(),
iter.key_length());
if (arg != NULL) {
arg->read_value(iter.value_addr(), iter.value_length(), CHECK);
} else {
if (next_argument != NULL) {
arg = next_argument;
arg->read_value(iter.key_addr(), iter.key_length(), CHECK);
next_argument = next_argument->next();
} else {
const size_t buflen = 120;
const size_t argbuflen = 30;
char buf[buflen];
char argbuf[argbuflen];
size_t len = MIN2<size_t>(iter.key_length(), argbuflen - 1);
strncpy(argbuf, iter.key_addr(), len);
argbuf[len] = '\0';
jio_snprintf(buf, buflen - 1, "Unknown argument '%s' in diagnostic command.", argbuf);
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), buf);
}
}
cont = iter.next(CHECK);
}
check(CHECK);
}
GenDCmdArgument* DCmdParser::lookup_dcmd_option(const char* name, size_t len) {
GenDCmdArgument* arg = _options;
while (arg != NULL) {
if (strlen(arg->name()) == len &&
strncmp(name, arg->name(), len) == 0) {
return arg;
}
arg = arg->next();
}
return NULL;
}
void DCmdParser::check(TRAPS) {
const size_t buflen = 256;
char buf[buflen];
GenDCmdArgument* arg = _arguments_list;
while (arg != NULL) {
if (arg->is_mandatory() && !arg->has_value()) {
jio_snprintf(buf, buflen - 1, "The argument '%s' is mandatory.", arg->name());
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), buf);
}
arg = arg->next();
}
arg = _options;
while (arg != NULL) {
if (arg->is_mandatory() && !arg->has_value()) {
jio_snprintf(buf, buflen - 1, "The option '%s' is mandatory.", arg->name());
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), buf);
}
arg = arg->next();
}
}
void DCmdParser::print_help(outputStream* out, const char* cmd_name) {
out->print("Syntax : %s %s", cmd_name, _options == NULL ? "" : "[options]");
GenDCmdArgument* arg = _arguments_list;
while (arg != NULL) {
if (arg->is_mandatory()) {
out->print(" <%s>", arg->name());
} else {
out->print(" [<%s>]", arg->name());
}
arg = arg->next();
}
out->cr();
if (_arguments_list != NULL) {
out->print_cr("\nArguments:");
arg = _arguments_list;
while (arg != NULL) {
out->print("\t%s : %s %s (%s, ", arg->name(),
arg->is_mandatory() ? "" : "[optional]",
arg->description(), arg->type());
if (arg->has_default()) {
out->print("%s", arg->default_string());
} else {
out->print("no default value");
}
out->print_cr(")");
arg = arg->next();
}
}
if (_options != NULL) {
out->print_cr("\nOptions: (options must be specified using the <key> or <key>=<value> syntax)");
arg = _options;
while (arg != NULL) {
out->print("\t%s : %s %s (%s, ", arg->name(),
arg->is_mandatory() ? "" : "[optional]",
arg->description(), arg->type());
if (arg->has_default()) {
out->print("%s", arg->default_string());
} else {
out->print("no default value");
}
out->print_cr(")");
arg = arg->next();
}
}
}
void DCmdParser::reset(TRAPS) {
GenDCmdArgument* arg = _arguments_list;
while (arg != NULL) {
arg->reset(CHECK);
arg = arg->next();
}
arg = _options;
while (arg != NULL) {
arg->reset(CHECK);
arg = arg->next();
}
}
void DCmdParser::cleanup() {
GenDCmdArgument* arg = _arguments_list;
while (arg != NULL) {
arg->cleanup();
arg = arg->next();
}
arg = _options;
while (arg != NULL) {
arg->cleanup();
arg = arg->next();
}
}
int DCmdParser::num_arguments() {
GenDCmdArgument* arg = _arguments_list;
int count = 0;
while (arg != NULL) {
count++;
arg = arg->next();
}
arg = _options;
while (arg != NULL) {
count++;
arg = arg->next();
}
return count;
}
GrowableArray<const char *>* DCmdParser::argument_name_array() {
int count = num_arguments();
GrowableArray<const char *>* array = new GrowableArray<const char *>(count);
GenDCmdArgument* arg = _arguments_list;
while (arg != NULL) {
array->append(arg->name());
arg = arg->next();
}
arg = _options;
while (arg != NULL) {
array->append(arg->name());
arg = arg->next();
}
return array;
}
GrowableArray<DCmdArgumentInfo*>* DCmdParser::argument_info_array() {
int count = num_arguments();
GrowableArray<DCmdArgumentInfo*>* array = new GrowableArray<DCmdArgumentInfo *>(count);
int idx = 0;
GenDCmdArgument* arg = _arguments_list;
while (arg != NULL) {
array->append(new DCmdArgumentInfo(arg->name(), arg->description(),
arg->type(), arg->default_string(), arg->is_mandatory(),
false, arg->allow_multiple(), idx));
idx++;
arg = arg->next();
}
arg = _options;
while (arg != NULL) {
array->append(new DCmdArgumentInfo(arg->name(), arg->description(),
arg->type(), arg->default_string(), arg->is_mandatory(),
true, arg->allow_multiple()));
arg = arg->next();
}
return array;
}
DCmdFactory* DCmdFactory::_DCmdFactoryList = NULL;
bool DCmdFactory::_has_pending_jmx_notification = false;
void DCmd::parse_and_execute(DCmdSource source, outputStream* out,
const char* cmdline, char delim, TRAPS) {
if (cmdline == NULL) return; // Nothing to do!
DCmdIter iter(cmdline, '\n');
int count = 0;
while (iter.has_next()) {
if(source == DCmd_Source_MBean && count > 0) {
// When diagnostic commands are invoked via JMX, each command line
// must contains one and only one command because of the Permission
// checks performed by the DiagnosticCommandMBean
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
"Invalid syntax");
}
CmdLine line = iter.next();
if (line.is_stop()) {
break;
}
if (line.is_executable()) {
DCmd* command = DCmdFactory::create_local_DCmd(source, line, out, CHECK);
assert(command != NULL, "command error must be handled before this line");
DCmdMark mark(command);
command->parse(&line, delim, CHECK);
command->execute(source, CHECK);
}
count++;
}
}
void DCmdWithParser::parse(CmdLine* line, char delim, TRAPS) {
_dcmdparser.parse(line, delim, CHECK);
}
void DCmdWithParser::print_help(const char* name) {
_dcmdparser.print_help(output(), name);
}
void DCmdWithParser::reset(TRAPS) {
_dcmdparser.reset(CHECK);
}
void DCmdWithParser::cleanup() {
_dcmdparser.cleanup();
}
GrowableArray<const char*>* DCmdWithParser::argument_name_array() {
return _dcmdparser.argument_name_array();
}
GrowableArray<DCmdArgumentInfo*>* DCmdWithParser::argument_info_array() {
return _dcmdparser.argument_info_array();
}
void DCmdFactory::push_jmx_notification_request() {
MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag);
_has_pending_jmx_notification = true;
Service_lock->notify_all();
}
void DCmdFactory::send_notification(TRAPS) {
DCmdFactory::send_notification_internal(THREAD);
// Clearing pending exception to avoid premature termination of
// the service thread
if (HAS_PENDING_EXCEPTION) {
CLEAR_PENDING_EXCEPTION;
}
}
void DCmdFactory::send_notification_internal(TRAPS) {
ResourceMark rm(THREAD);
HandleMark hm(THREAD);
bool notif = false;
{
MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag);
notif = _has_pending_jmx_notification;
_has_pending_jmx_notification = false;
}
if (notif) {
Klass* k = Management::sun_management_ManagementFactoryHelper_klass(CHECK);
instanceKlassHandle mgmt_factory_helper_klass(THREAD, k);
JavaValue result(T_OBJECT);
JavaCalls::call_static(&result,
mgmt_factory_helper_klass,
vmSymbols::getDiagnosticCommandMBean_name(),
vmSymbols::getDiagnosticCommandMBean_signature(),
CHECK);
instanceOop m = (instanceOop) result.get_jobject();
instanceHandle dcmd_mbean_h(THREAD, m);
Klass* k2 = Management::sun_management_DiagnosticCommandImpl_klass(CHECK);
instanceKlassHandle dcmd_mbean_klass(THREAD, k2);
if (!dcmd_mbean_h->is_a(k2)) {
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
"ManagementFactory.getDiagnosticCommandMBean didn't return a DiagnosticCommandMBean instance");
}
JavaValue result2(T_VOID);
JavaCallArguments args2(dcmd_mbean_h);
JavaCalls::call_virtual(&result2,
dcmd_mbean_klass,
vmSymbols::createDiagnosticFrameworkNotification_name(),
vmSymbols::void_method_signature(),
&args2,
CHECK);
}
}
Mutex* DCmdFactory::_dcmdFactory_lock = new Mutex(Mutex::leaf, "DCmdFactory", true, Monitor::_safepoint_check_never);
bool DCmdFactory::_send_jmx_notification = false;
DCmdFactory* DCmdFactory::factory(DCmdSource source, const char* name, size_t len) {
MutexLockerEx ml(_dcmdFactory_lock, Mutex::_no_safepoint_check_flag);
DCmdFactory* factory = _DCmdFactoryList;
while (factory != NULL) {
if (strlen(factory->name()) == len &&
strncmp(name, factory->name(), len) == 0) {
if(factory->export_flags() & source) {
return factory;
} else {
return NULL;
}
}
factory = factory->_next;
}
return NULL;
}
int DCmdFactory::register_DCmdFactory(DCmdFactory* factory) {
MutexLockerEx ml(_dcmdFactory_lock, Mutex::_no_safepoint_check_flag);
factory->_next = _DCmdFactoryList;
_DCmdFactoryList = factory;
if (_send_jmx_notification && !factory->_hidden
&& (factory->_export_flags & DCmd_Source_MBean)) {
DCmdFactory::push_jmx_notification_request();
}
return 0; // Actually, there's no checks for duplicates
}
DCmd* DCmdFactory::create_global_DCmd(DCmdSource source, CmdLine &line,
outputStream* out, TRAPS) {
DCmdFactory* f = factory(source, line.cmd_addr(), line.cmd_len());
if (f != NULL) {
if (f->is_enabled()) {
THROW_MSG_NULL(vmSymbols::java_lang_IllegalArgumentException(),
f->disabled_message());
}
return f->create_Cheap_instance(out);
}
THROW_MSG_NULL(vmSymbols::java_lang_IllegalArgumentException(),
"Unknown diagnostic command");
}
DCmd* DCmdFactory::create_local_DCmd(DCmdSource source, CmdLine &line,
outputStream* out, TRAPS) {
DCmdFactory* f = factory(source, line.cmd_addr(), line.cmd_len());
if (f != NULL) {
if (!f->is_enabled()) {
THROW_MSG_NULL(vmSymbols::java_lang_IllegalArgumentException(),
f->disabled_message());
}
return f->create_resource_instance(out);
}
THROW_MSG_NULL(vmSymbols::java_lang_IllegalArgumentException(),
"Unknown diagnostic command");
}
GrowableArray<const char*>* DCmdFactory::DCmd_list(DCmdSource source) {
MutexLockerEx ml(_dcmdFactory_lock, Mutex::_no_safepoint_check_flag);
GrowableArray<const char*>* array = new GrowableArray<const char*>();
DCmdFactory* factory = _DCmdFactoryList;
while (factory != NULL) {
if (!factory->is_hidden() && (factory->export_flags() & source)) {
array->append(factory->name());
}
factory = factory->next();
}
return array;
}
GrowableArray<DCmdInfo*>* DCmdFactory::DCmdInfo_list(DCmdSource source ) {
MutexLockerEx ml(_dcmdFactory_lock, Mutex::_no_safepoint_check_flag);
GrowableArray<DCmdInfo*>* array = new GrowableArray<DCmdInfo*>();
DCmdFactory* factory = _DCmdFactoryList;
while (factory != NULL) {
if (!factory->is_hidden() && (factory->export_flags() & source)) {
array->append(new DCmdInfo(factory->name(),
factory->description(), factory->impact(),
factory->permission(), factory->num_arguments(),
factory->is_enabled()));
}
factory = factory->next();
}
return array;
}
| gpl-2.0 |
glye/ezpublish-kernel | eZ/Publish/Core/Persistence/Legacy/Content/UrlWildcard/Gateway/ExceptionConversion.php | 3234 | <?php
/**
* File containing the Section Gateway class
*
* @copyright Copyright (C) 1999-2014 eZ Systems AS. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
* @version //autogentag//
*/
namespace eZ\Publish\Core\Persistence\Legacy\Content\UrlWildcard\Gateway;
use eZ\Publish\Core\Persistence\Legacy\Content\UrlWildcard\Gateway;
use eZ\Publish\SPI\Persistence\Content\UrlWildcard;
use Doctrine\DBAL\DBALException;
use PDOException;
/**
* UrlAlias Handler
*/
class ExceptionConversion extends Gateway
{
/**
* The wrapped gateway
*
* @var \eZ\Publish\Core\Persistence\Legacy\Content\UrlWildcard\Gateway
*/
protected $innerGateway;
/**
* Creates a new exception conversion gateway around $innerGateway
*
* @param \eZ\Publish\Core\Persistence\Legacy\Content\UrlWildcard\Gateway $innerGateway
*/
public function __construct( Gateway $innerGateway )
{
$this->innerGateway = $innerGateway;
}
/**
* Inserts the given UrlWildcard
*
* @param \eZ\Publish\SPI\Persistence\Content\UrlWildcard $urlWildcard
*
* @return mixed
*/
public function insertUrlWildcard( UrlWildcard $urlWildcard )
{
try
{
return $this->innerGateway->insertUrlWildcard( $urlWildcard );
}
catch ( DBALException $e )
{
throw new \RuntimeException( 'Database error', 0, $e );
}
catch ( PDOException $e )
{
throw new \RuntimeException( 'Database error', 0, $e );
}
}
/**
* Deletes the UrlWildcard with given $id
*
* @param mixed $id
*
* @return void
*/
public function deleteUrlWildcard( $id )
{
try
{
return $this->innerGateway->deleteUrlWildcard( $id );
}
catch ( DBALException $e )
{
throw new \RuntimeException( 'Database error', 0, $e );
}
catch ( PDOException $e )
{
throw new \RuntimeException( 'Database error', 0, $e );
}
}
/**
* @param mixed $parentId
*
* @return array
*/
public function loadUrlWildcardData( $parentId )
{
try
{
return $this->innerGateway->loadUrlWildcardData( $parentId );
}
catch ( DBALException $e )
{
throw new \RuntimeException( 'Database error', 0, $e );
}
catch ( PDOException $e )
{
throw new \RuntimeException( 'Database error', 0, $e );
}
}
/**
* Loads an array with data about UrlWildcards (paged)
*
* @param mixed $offset
* @param mixed $limit
*
* @return array
*/
public function loadUrlWildcardsData( $offset = 0, $limit = -1 )
{
try
{
return $this->innerGateway->loadUrlWildcardsData( $offset, $limit );
}
catch ( DBALException $e )
{
throw new \RuntimeException( 'Database error', 0, $e );
}
catch ( PDOException $e )
{
throw new \RuntimeException( 'Database error', 0, $e );
}
}
}
| gpl-2.0 |
donatellosantoro/freESBee | freesbeeWeb/src/it/unibas/icar/freesbee/ws/client/accordoservizio/cxf/SOAPFault.java | 773 |
package it.unibas.icar.freesbee.ws.client.accordoservizio.cxf;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for SOAPFault complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="SOAPFault">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SOAPFault")
public class SOAPFault {
}
| gpl-2.0 |
jakesyl/Advance_Package_Tool | apt-private/acqprogress.cc | 9978 | // -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
/* ######################################################################
Acquire Progress - Command line progress meter
##################################################################### */
/*}}}*/
// Include files /*{{{*/
#include<config.h>
#include <apt-pkg/acquire.h>
#include <apt-pkg/acquire-item.h>
#include <apt-pkg/acquire-worker.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/strutl.h>
#include <apt-pkg/error.h>
#include <apt-private/acqprogress.h>
#include <string.h>
#include <stdio.h>
#include <signal.h>
#include <iostream>
#include <sstream>
#include <unistd.h>
#include <apti18n.h>
/*}}}*/
// AcqTextStatus::AcqTextStatus - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
AcqTextStatus::AcqTextStatus(std::ostream &out, unsigned int &ScreenWidth,unsigned int const Quiet) :
pkgAcquireStatus(), out(out), ScreenWidth(ScreenWidth), LastLineLength(0), ID(0), Quiet(Quiet)
{
// testcases use it to disable pulses without disabling other user messages
if (Quiet == 0 && _config->FindB("quiet::NoUpdate", false) == true)
this->Quiet = 1;
}
/*}}}*/
// AcqTextStatus::Start - Downloading has started /*{{{*/
// ---------------------------------------------------------------------
/* */
void AcqTextStatus::Start()
{
pkgAcquireStatus::Start();
LastLineLength = 0;
ID = 1;
}
/*}}}*/
void AcqTextStatus::AssignItemID(pkgAcquire::ItemDesc &Itm) /*{{{*/
{
/* In theory calling it from Fetch() would be enough, but to be
safe we call it from IMSHit and Fail as well.
Also, an Item can pass through multiple stages, so ensure
that it keeps the same number */
if (Itm.Owner->ID == 0)
Itm.Owner->ID = ID++;
}
/*}}}*/
// AcqTextStatus::IMSHit - Called when an item got a HIT response /*{{{*/
// ---------------------------------------------------------------------
/* */
void AcqTextStatus::IMSHit(pkgAcquire::ItemDesc &Itm)
{
if (Quiet > 1)
return;
AssignItemID(Itm);
clearLastLine();
// TRANSLATOR: Very short word to be displayed before unchanged files in 'apt-get update'
ioprintf(out, _("Hit:%lu %s"), Itm.Owner->ID, Itm.Description.c_str());
out << std::endl;
Update = true;
}
/*}}}*/
// AcqTextStatus::Fetch - An item has started to download /*{{{*/
// ---------------------------------------------------------------------
/* This prints out the short description and the expected size */
void AcqTextStatus::Fetch(pkgAcquire::ItemDesc &Itm)
{
Update = true;
if (Itm.Owner->Complete == true)
return;
AssignItemID(Itm);
if (Quiet > 1)
return;
clearLastLine();
// TRANSLATOR: Very short word to be displayed for files processed in 'apt-get update'
// Potentially replaced later by "Hit:", "Ign:" or "Err:" if something (bad) happens
ioprintf(out, _("Get:%lu %s"), Itm.Owner->ID, Itm.Description.c_str());
if (Itm.Owner->FileSize != 0)
out << " [" << SizeToStr(Itm.Owner->FileSize) << "B]";
out << std::endl;
}
/*}}}*/
// AcqTextStatus::Done - Completed a download /*{{{*/
// ---------------------------------------------------------------------
/* We don't display anything... */
void AcqTextStatus::Done(pkgAcquire::ItemDesc &Itm)
{
Update = true;
AssignItemID(Itm);
}
/*}}}*/
// AcqTextStatus::Fail - Called when an item fails to download /*{{{*/
// ---------------------------------------------------------------------
/* We print out the error text */
void AcqTextStatus::Fail(pkgAcquire::ItemDesc &Itm)
{
if (Quiet > 1)
return;
AssignItemID(Itm);
clearLastLine();
if (Itm.Owner->Status == pkgAcquire::Item::StatDone || Itm.Owner->Status == pkgAcquire::Item::StatIdle)
{
// TRANSLATOR: Very short word to be displayed for files in 'apt-get update'
// which failed to download, but the error is ignored (compare "Err:")
ioprintf(out, _("Ign:%lu %s"), Itm.Owner->ID, Itm.Description.c_str());
if (Itm.Owner->ErrorText.empty() == false &&
_config->FindB("Acquire::Progress::Ignore::ShowErrorText", false) == true)
out << std::endl << " " << Itm.Owner->ErrorText;
out << std::endl;
}
else
{
// TRANSLATOR: Very short word to be displayed for files in 'apt-get update'
// which failed to download and the error is critical (compare "Ign:")
ioprintf(out, _("Err:%lu %s"), Itm.Owner->ID, Itm.Description.c_str());
out << std::endl << " " << Itm.Owner->ErrorText << std::endl;
}
Update = true;
}
/*}}}*/
// AcqTextStatus::Stop - Finished downloading /*{{{*/
// ---------------------------------------------------------------------
/* This prints out the bytes downloaded and the overall average line
speed */
void AcqTextStatus::Stop()
{
pkgAcquireStatus::Stop();
if (Quiet > 1)
return;
clearLastLine();
if (_config->FindB("quiet::NoStatistic", false) == true)
return;
if (FetchedBytes != 0 && _error->PendingError() == false)
ioprintf(out,_("Fetched %sB in %s (%sB/s)\n"),
SizeToStr(FetchedBytes).c_str(),
TimeToStr(ElapsedTime).c_str(),
SizeToStr(CurrentCPS).c_str());
}
/*}}}*/
// AcqTextStatus::Pulse - Regular event pulse /*{{{*/
// ---------------------------------------------------------------------
/* This draws the current progress. Each line has an overall percent
meter and a per active item status meter along with an overall
bandwidth and ETA indicator. */
bool AcqTextStatus::Pulse(pkgAcquire *Owner)
{
pkgAcquireStatus::Pulse(Owner);
if (Quiet > 0)
return true;
enum {Long = 0,Medium,Short} Mode = Medium;
std::string Line;
{
std::stringstream S;
for (pkgAcquire::Worker *I = Owner->WorkersBegin(); I != 0;
I = Owner->WorkerStep(I))
{
// There is no item running
if (I->CurrentItem == 0)
{
if (I->Status.empty() == false)
S << " [" << I->Status << "]";
continue;
}
// Add in the short description
S << " [";
if (I->CurrentItem->Owner->ID != 0)
S << I->CurrentItem->Owner->ID << " ";
S << I->CurrentItem->ShortDesc;
// Show the short mode string
if (I->CurrentItem->Owner->ActiveSubprocess.empty() == false)
S << " " << I->CurrentItem->Owner->ActiveSubprocess;
// Add the current progress
if (Mode == Long)
S << " " << I->CurrentSize;
else
{
if (Mode == Medium || I->TotalSize == 0)
S << " " << SizeToStr(I->CurrentSize) << "B";
}
// Add the total size and percent
if (I->TotalSize > 0 && I->CurrentItem->Owner->Complete == false)
{
if (Mode == Short)
ioprintf(S, " %.0f%%", (I->CurrentSize*100.0)/I->TotalSize);
else
ioprintf(S, "/%sB %.0f%%", SizeToStr(I->TotalSize).c_str(),
(I->CurrentSize*100.0)/I->TotalSize);
}
S << "]";
}
// Show at least something
Line = S.str();
S.clear();
if (Line.empty() == true)
Line = _(" [Working]");
}
// Put in the percent done
{
std::stringstream S;
ioprintf(S, "%.0f%%", Percent);
S << Line;
Line = S.str();
S.clear();
}
/* Put in the ETA and cps meter, block off signals to prevent strangeness
during resizing */
sigset_t Sigs,OldSigs;
sigemptyset(&Sigs);
sigaddset(&Sigs,SIGWINCH);
sigprocmask(SIG_BLOCK,&Sigs,&OldSigs);
if (CurrentCPS != 0)
{
unsigned long long ETA = (TotalBytes - CurrentBytes)/CurrentCPS;
std::string Tmp = " " + SizeToStr(CurrentCPS) + "B/s " + TimeToStr(ETA);
size_t alignment = Line.length() + Tmp.length();
if (alignment < ScreenWidth)
{
alignment = ScreenWidth - alignment;
for (size_t i = 0; i < alignment; ++i)
Line.append(" ");
Line.append(Tmp);
}
}
if (Line.length() > ScreenWidth)
Line.erase(ScreenWidth);
sigprocmask(SIG_SETMASK,&OldSigs,0);
// Draw the current status
if (_config->FindB("Apt::Color", false) == true)
out << _config->Find("APT::Color::Yellow");
if (LastLineLength > Line.length())
clearLastLine();
else
out << '\r';
out << Line << std::flush;
if (_config->FindB("Apt::Color", false) == true)
out << _config->Find("APT::Color::Neutral") << std::flush;
LastLineLength = Line.length();
Update = false;
return true;
}
/*}}}*/
// AcqTextStatus::MediaChange - Media need to be swapped /*{{{*/
// ---------------------------------------------------------------------
/* Prompt for a media swap */
bool AcqTextStatus::MediaChange(std::string Media, std::string Drive)
{
// If we do not output on a terminal and one of the options to avoid user
// interaction is given, we assume that no user is present who could react
// on your media change request
if (isatty(STDOUT_FILENO) != 1 && Quiet >= 2 &&
(_config->FindB("APT::Get::Assume-Yes",false) == true ||
_config->FindB("APT::Get::Force-Yes",false) == true ||
_config->FindB("APT::Get::Trivial-Only",false) == true))
return false;
clearLastLine();
ioprintf(out,_("Media change: please insert the disc labeled\n"
" '%s'\n"
"in the drive '%s' and press [Enter]\n"),
Media.c_str(),Drive.c_str());
char C = 0;
bool bStatus = true;
while (C != '\n' && C != '\r')
{
int len = read(STDIN_FILENO,&C,1);
if(C == 'c' || len <= 0)
bStatus = false;
}
if(bStatus)
Update = true;
return bStatus;
}
/*}}}*/
void AcqTextStatus::clearLastLine() { /*{{{*/
if (Quiet > 0 || LastLineLength == 0)
return;
// do not try to clear more than the (now smaller) screen
if (LastLineLength > ScreenWidth)
LastLineLength = ScreenWidth;
out << '\r';
for (size_t i = 0; i < LastLineLength; ++i)
out << ' ';
out << '\r' << std::flush;
}
/*}}}*/
| gpl-2.0 |
JMaNGOS/JMaNGOS | Commons/src/main/java/org/jmangos/commons/entities/skills/language/LanguageOrcish.java | 1293 | /*******************************************************************************
* Copyright (C) 2013 JMaNGOS <http://jmangos.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/>.
******************************************************************************/
/**
*
*/
package org.jmangos.commons.entities.skills.language;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import org.jmangos.commons.entities.CharacterSkill;
/**
* @author MinimaJack
*
*/
@Entity
@DiscriminatorValue(value = "109")
public class LanguageOrcish extends CharacterSkill {
/**
*
*/
private static final long serialVersionUID = -3701345579947072305L;
}
| gpl-2.0 |
Shahabambesik/merbot | plugins/send.lua | 315 | do
local function run(msg, matches)
if matches[1] == "getplug" then
local file = matches[2]
if is_sudo(msg.from.peer_id) then
local receiver = get_receiver(msg)
send_document(receiver, "./plugins/"..file..".lua", ok_cb, false)
end
end
end
return {
patterns = {
"^(getplug) (.*)$"
},
run = run
}
end
| gpl-2.0 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.