repo_name
stringlengths
4
116
path
stringlengths
4
379
size
stringlengths
1
7
content
stringlengths
3
1.05M
license
stringclasses
15 values
iammyr/Benchmark
src/main/java/org/owasp/benchmark/testcode/BenchmarkTest16729.java
1874
/** * OWASP Benchmark Project v1.1 * * This file is part of the Open Web Application Security Project (OWASP) * Benchmark Project. For details, please see * <a href="https://www.owasp.org/index.php/Benchmark">https://www.owasp.org/index.php/Benchmark</a>. * * The Benchmark 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. * * The Benchmark 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 * * @author Nick Sanidas <a href="https://www.aspectsecurity.com">Aspect Security</a> * @created 2015 */ package org.owasp.benchmark.testcode; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet("/BenchmarkTest16729") public class BenchmarkTest16729 extends HttpServlet { private static final long serialVersionUID = 1L; @Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); } @Override public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String param = request.getParameter("foo"); String bar = doSomething(param); new java.io.File(bar, "/Test.txt"); } // end doPost private static String doSomething(String param) throws ServletException, IOException { StringBuilder sbxyz91082 = new StringBuilder(param); String bar = sbxyz91082.append("_SafeStuff").toString(); return bar; } }
gpl-2.0
sd44/TaobaoCppQtSDK
TaoApiCpp/response/IncrementCustomerStopResponse.cpp
436
#include <TaoApiCpp/response/IncrementCustomerStopResponse.h> bool IncrementCustomerStopResponse::getIsSuccess() const { return isSuccess; } void IncrementCustomerStopResponse::setIsSuccess (bool isSuccess) { this->isSuccess = isSuccess; } void IncrementCustomerStopResponse::parseNormalResponse() { parseError(); if (responseParser->hasName("is_success")) { isSuccess = responseParser->getBoolByName("is_success"); } }
gpl-2.0
nico202/spikestream
library/src/xml/XMLParameterParser.cpp
3606
//SpikeStream includes #include "XMLParameterParser.h" #include "SpikeStreamXMLException.h" using namespace spikestream; //Qt includes #include <QDebug> /*! Constructor */ XMLParameterParser::XMLParameterParser(){ } /*! Destructor */ XMLParameterParser::~XMLParameterParser(){ } /*----------------------------------------------------------*/ /*----- PUBLIC METHODS -----*/ /*----------------------------------------------------------*/ /*! Parses the XML string and returns a map of parameters */ QHash<QString, double> XMLParameterParser::getParameterMap(const QString& xmlString){ //Clear parameter map parameterMap.clear(); //Return empty map if paramter string is empty if(xmlString == "") return parameterMap; //Parse the XML QXmlSimpleReader xmlReader; QXmlInputSource xmlInput; xmlReader.setContentHandler(this); xmlReader.setErrorHandler(this); xmlInput.setData(xmlString); xmlReader.parse(xmlInput); return parameterMap; } /*----------------------------------------------------------*/ /*----- PROTECTED METHODS -----*/ /*----------------------------------------------------------*/ /*! Called when parser encounters characters. */ bool XMLParameterParser::characters(const QString& chars){ if(loadingParameter){ if(currentElement == "name"){ currentParamName = chars; } else if(currentElement == "value"){ bool ok; currentParamValue = chars.toDouble(&ok); if(!ok) throw SpikeStreamXMLException("Error converting parameter value to double: " + chars); } else{ throw SpikeStreamXMLException("Unrecognized element: " + currentElement); } } else throw SpikeStreamXMLException("Unexpected characters encountered: '" + chars + "'"); return true; } /*! Called when the parser encounters the end of an element. */ bool XMLParameterParser::endElement( const QString&, const QString&, const QString& elemName){ if(loadingParameter && elemName == "parameter"){ //Check that parameter name has been set if(currentParamName == "") throw SpikeStreamXMLException("Parameter is missing description"); //Store parameter in map parameterMap[currentParamName] = currentParamValue; //Have finished loading the parameter loadingParameter = false; } return true; } /*! Called when the parser generates an error. */ bool XMLParameterParser::error (const QXmlParseException& parseEx){ throw SpikeStreamXMLException(parseEx.message()); return true; } /*! Returns a default error string. */ QString XMLParameterParser::errorString (){ return QString("Default error string"); } /*! Called when the parser generates a fatal error. */ bool XMLParameterParser::fatalError (const QXmlParseException& parseEx){ throw SpikeStreamXMLException(parseEx.message()); return true; } /*! Called when parser reaches the start of the document. */ bool XMLParameterParser::startDocument(){ loadingParameter = false; return true; } /*! Called when parser reaches the start of an element. */ bool XMLParameterParser::startElement(const QString&, const QString&, const QString& qName, const QXmlAttributes&){ currentElement = qName; if(currentElement == "parameter"){ //Reset information associated with a parameter currentParamName = ""; currentParamValue = 0.0; loadingParameter = true; } return true; } /*! Called when the parser generates a warning. */ bool XMLParameterParser::warning ( const QXmlParseException& ex){ qWarning()<<ex.message(); return true; }
gpl-2.0
AliZafar120/NetworkStimulatorSPl3
examples/epidemic-test.cc
3003
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation; * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ns3/core-module.h" #include "ns3/simulator-module.h" #include "ns3/node-module.h" #include "ns3/helper-module.h" #include "ns3/epidemic-module.h" #include "ns3/rapidnet-module.h" #include "ns3/values-module.h" #include "ns3/rapidnet-script-utils.h" #define eLinkAdd(src, next, cost) \ tuple (Epidemic::ELINKADD, \ attr ("eLinkAdd_attr1", Ipv4Value, src), \ attr ("eLinkAdd_attr2", Ipv4Value, next), \ attr ("eLinkAdd_attr3", Int32Value, cost)) #define insertlink(from, to, cost) \ app(from)->Inject (eLinkAdd (addr (from), addr (to), cost)); \ app(to)->Inject (eLinkAdd (addr (to), addr (from), cost)); using namespace std; using namespace ns3; using namespace ns3::rapidnet; using namespace ns3::rapidnet::epidemic; ApplicationContainer apps; // dynamic topology void UpdateLink1() { insertlink(1, 2, 1); insertlink(1, 3, 1); insertlink(4, 5, 1); } void UpdateLink2() { insertlink(3, 5, 1); } void UpdateLink3() { insertlink(4, 6, 1); } void InjectMessage1 () { app(1)->Inject (tuple (Epidemic::EMESSAGEINJECTORIGINAL, attr ("eMessageInjectOriginal_attr1", Ipv4Value, Ipv4Address ("192.168.0.1")), attr ("eMessageInjectOriginal_attr2", Ipv4Value, Ipv4Address ("192.168.0.6")))); } void InjectMessage2 () { app(2)->Inject (tuple (Epidemic::EMESSAGEINJECTORIGINAL, attr ("eMessageInjectOriginal_attr1", Ipv4Value, Ipv4Address ("192.168.0.2")), attr ("eMessageInjectOriginal_attr2", Ipv4Value, Ipv4Address ("192.168.0.6")))); } void PrintTables () { PrintRelation(apps, Epidemic::TMESSAGE, std::clog); PrintRelation(apps, Epidemic::TSUMMARYVEC, std::clog); } int main (int argc, char *argv[]) { srand((unsigned)time(0)); // seed should be set in main function LogComponentEnable("Epidemic", LOG_LEVEL_INFO); LogComponentEnable("RapidNetApplicationBase", LOG_LEVEL_INFO); double TOTAL_TIME = 15.0; apps = InitRapidNetApps (6, Create<EpidemicHelper> (), "192.168.0.0"); apps.Start (Seconds (0.0)); apps.Stop (Seconds (TOTAL_TIME)); schedule (0.0, UpdateLink1); schedule (1.0, InjectMessage1); schedule (1.1, InjectMessage2); schedule (5.0, UpdateLink2); schedule (10.0, UpdateLink3); schedule (TOTAL_TIME, PrintTables); Simulator::Run (); Simulator::Destroy (); return 0; }
gpl-2.0
lmorg/murex
shell/autocomplete/flags_test.go
22436
package autocomplete_test import ( "context" "fmt" "sort" "strings" "testing" _ "github.com/lmorg/murex/builtins" "github.com/lmorg/murex/config/defaults" "github.com/lmorg/murex/lang" "github.com/lmorg/murex/lang/ref" "github.com/lmorg/murex/shell/autocomplete" "github.com/lmorg/murex/test/count" "github.com/lmorg/murex/utils/json" "github.com/lmorg/murex/utils/parser" "github.com/lmorg/murex/utils/readline" ) type testAutocompleteFlagsT struct { CmdLine string ExpItems []string ExpDefs map[string]string } func initAutocompleteFlagsTest(exe string, acJson string) { lang.InitEnv() defaults.Defaults(lang.ShellProcess.Config, false) //debug.Enabled = true err := lang.ShellProcess.Config.Set("shell", "autocomplete-soft-timeout", 3000, nil) if err != nil { panic(err.Error()) } err = lang.ShellProcess.Config.Set("shell", "autocomplete-hard-timeout", 10000, nil) if err != nil { panic(err.Error()) } var flags []autocomplete.Flags err = json.UnmarshalMurex([]byte(acJson), &flags) if err != nil { panic(err.Error()) } for i := range flags { // So we don't have nil values in JSON if len(flags[i].Flags) == 0 { flags[i].Flags = make([]string, 0) } sort.Strings(flags[i].Flags) } autocomplete.ExesFlags[exe] = flags autocomplete.ExesFlagsFileRef[exe] = &ref.File{Source: &ref.Source{Module: "test/test"}} } func testAutocompleteFlags(t *testing.T, tests []testAutocompleteFlagsT) { t.Helper() count.Tests(t, len(tests)) for i, test := range tests { var err error errCallback := func(e error) { err = e } pt, _ := parser.Parse([]rune(test.CmdLine), 0) dtc := readline.DelayedTabContext{} dtc.Context, _ = context.WithCancel(context.Background()) act := autocomplete.AutoCompleteT{ Definitions: make(map[string]string), ErrCallback: errCallback, DelayedTabContext: dtc, ParsedTokens: pt, } autocomplete.MatchFlags(&act) //fmt.Println(jsonOutput(pt.Parameters)) if err != nil { t.Errorf("Error in test %d: %s", i, err.Error()) continue } sort.Strings(test.ExpItems) sort.Strings(act.Items) expectedItems := jsonOutput(test.ExpItems) actualItems := jsonOutput(act.Items) expectedDefs := jsonOutput(test.ExpDefs) actualDefs := jsonOutput(act.Definitions) if len(test.ExpItems) != len(act.Items) || len(test.ExpDefs) != len(act.Definitions) { t.Errorf("Item count != expected item count") t.Logf(" Test number: %d", i) t.Logf(" Command line: %s", test.CmdLine) t.Logf(" Expected n Items: %d", len(test.ExpItems)) t.Logf(" Actual n Items: %d", len(act.Items)) t.Logf(" Expected n Defs: %d", len(test.ExpDefs)) t.Logf(" Actual n Defs: %d", len(act.Definitions)) t.Logf(" exp json items: %s", expectedItems) t.Logf(" act json items: %s", actualItems) t.Logf(" exp json defs: %s", expectedDefs) t.Logf(" act json defs: %s", actualDefs) goto nextTest } for item := range test.ExpItems { if test.ExpItems[item] != act.Items[item] { t.Errorf("test.ExpItems[item] != act.Items[item]") t.Logf(" Test number: %d", i) t.Logf(" Command line: %s", test.CmdLine) t.Logf(" Item index: %d", item) t.Logf(" Expected Item: %s", test.ExpItems[item]) t.Logf(" Actual Item: %s", act.Items[item]) t.Logf(" exp json items: %s", expectedItems) t.Logf(" act json items: %s", actualItems) t.Logf(" exp json defs: %s", expectedDefs) t.Logf(" act json defs: %s", actualDefs) goto nextTest } } for k := range test.ExpDefs { if test.ExpDefs[k] != act.Definitions[k] { t.Errorf("test.ExpDefs[k] != act.Definitions[k]") t.Logf(" Test number: %d", i) t.Logf(" Command line: %s", test.CmdLine) t.Logf(" Definition key: %s", k) t.Logf(" Expected def: %s", test.ExpDefs[k]) t.Logf(" Actual def: %s", act.Definitions[k]) t.Logf(" exp json items: %s", expectedItems) t.Logf(" act json items: %s", actualItems) t.Logf(" exp json defs: %s", expectedDefs) t.Logf(" act json defs: %s", actualDefs) goto nextTest } } nextTest: } } func jsonOutput(v interface{}) string { b, err := json.Marshal(v, false) if err != nil && !strings.Contains(err.Error(), "o data returned") { panic(err.Error()) } return string(b) } func TestAutocompleteDocgen(t *testing.T) { json := ` [ { "AllowMultiple": true, "Optional": true, "FlagsDesc": { "-panic": "panic", "-readonly": "ro", "-verbose": "v", "-version": "ver", "-warning": "warn" } }, { "FlagsDesc": { "-config": "conf" }, "FlagValues": { "-config": [{ "IncFiles": true }] } } ]` initAutocompleteFlagsTest(t.Name(), json) tests := []testAutocompleteFlagsT{ { CmdLine: fmt.Sprintf(`%s -`, t.Name()), ExpItems: []string{ `panic`, "readonly", "verbose", "version", "warning", "config", }, ExpDefs: map[string]string{ "config": "conf", "panic": "panic", "readonly": "ro", "verbose": "v", "version": "ver", "warning": "warn", }, }, { CmdLine: fmt.Sprintf(`%s -p`, t.Name()), ExpItems: []string{ `anic`, }, ExpDefs: map[string]string{ `anic`: `panic`, }, }, { CmdLine: fmt.Sprintf(`%s -panic -w`, t.Name()), ExpItems: []string{ `arning`, }, ExpDefs: map[string]string{ `arning`: `warn`, }, }, { CmdLine: fmt.Sprintf(`%s -panic -c`, t.Name()), ExpItems: []string{ `onfig`, }, ExpDefs: map[string]string{ `onfig`: `conf`, }, }, { CmdLine: fmt.Sprintf(`%s -panic -config R`, t.Name()), ExpItems: []string{ `EADME.md`, }, ExpDefs: map[string]string{}, }, } testAutocompleteFlags(t, tests) } func TestAutocompleteDocgenBug(t *testing.T) { json := ` [ { "AllowMultiple": true, "Optional": true, "FlagsDesc": { "-panic": "panic", "-readonly": "ro", "-verbose": "v", "-version": "ver", "-warning": "warn", "-config": "conf" }, "FlagValues": { "-config": [{ "IncFiles": true }] } } ]` initAutocompleteFlagsTest(t.Name(), json) tests := []testAutocompleteFlagsT{ { CmdLine: fmt.Sprintf(`%s -`, t.Name()), ExpItems: []string{ `panic`, "readonly", "verbose", "version", "warning", "config", }, ExpDefs: map[string]string{ "config": "conf", "panic": "panic", "readonly": "ro", "verbose": "v", "version": "ver", "warning": "warn", }, }, { CmdLine: fmt.Sprintf(`%s -p`, t.Name()), ExpItems: []string{ `anic`, }, ExpDefs: map[string]string{ `anic`: `panic`, }, }, { CmdLine: fmt.Sprintf(`%s -panic -w`, t.Name()), ExpItems: []string{ `arning`, }, ExpDefs: map[string]string{ `arning`: `warn`, }, }, { CmdLine: fmt.Sprintf(`%s -panic -c`, t.Name()), ExpItems: []string{ `onfig`, }, ExpDefs: map[string]string{ `onfig`: `conf`, }, }, { CmdLine: fmt.Sprintf(`%s -panic -config R`, t.Name()), ExpItems: []string{ `EADME.md`, }, ExpDefs: map[string]string{}, }, } testAutocompleteFlags(t, tests) } func TestAutocompleteDynamic(t *testing.T) { json := ` [ { "AllowMultiple": true, "Dynamic": ({ a: [Monday..Friday] }) } ]` initAutocompleteFlagsTest(t.Name(), json) tests := []testAutocompleteFlagsT{ { CmdLine: fmt.Sprintf(`%s `, t.Name()), ExpItems: []string{ `Monday`, `Tuesday`, `Wednesday`, `Thursday`, `Friday`, }, ExpDefs: map[string]string{}, }, { CmdLine: fmt.Sprintf(`%s T`, t.Name()), ExpItems: []string{ `uesday`, `hursday`, }, ExpDefs: map[string]string{}, }, { CmdLine: fmt.Sprintf(`%s Tuesday `, t.Name()), ExpItems: []string{ `Monday`, `Tuesday`, `Wednesday`, `Thursday`, `Friday`, }, ExpDefs: map[string]string{}, }, { CmdLine: fmt.Sprintf(`%s Tuesday T`, t.Name()), ExpItems: []string{ `uesday`, `hursday`, }, ExpDefs: map[string]string{}, }, } testAutocompleteFlags(t, tests) } func TestAutocompleteDynamicDesc(t *testing.T) { json := ` [ { "AllowMultiple": true, "DynamicDesc": ({ map { a: [Monday..Friday] } { a: [1..5] } }) } ]` initAutocompleteFlagsTest(t.Name(), json) tests := []testAutocompleteFlagsT{ { CmdLine: t.Name(), ExpItems: []string{ `Monday`, `Tuesday`, `Wednesday`, `Thursday`, `Friday`, }, ExpDefs: map[string]string{ `Monday`: `1`, `Tuesday`: `2`, `Wednesday`: `3`, `Thursday`: `4`, `Friday`: `5`, }, }, { CmdLine: fmt.Sprintf(`%s T`, t.Name()), ExpItems: []string{ `uesday`, `hursday`, }, ExpDefs: map[string]string{ `uesday`: `2`, `hursday`: `4`, }, }, { CmdLine: fmt.Sprintf(`%s Tuesday `, t.Name()), ExpItems: []string{ `Monday`, `Tuesday`, `Wednesday`, `Thursday`, `Friday`, }, ExpDefs: map[string]string{ `Monday`: `1`, `Tuesday`: `2`, `Wednesday`: `3`, `Thursday`: `4`, `Friday`: `5`, }, }, { CmdLine: fmt.Sprintf(`%s Tuesday T`, t.Name()), ExpItems: []string{ `uesday`, `hursday`, }, ExpDefs: map[string]string{ `uesday`: `2`, `hursday`: `4`, }, }, } testAutocompleteFlags(t, tests) } ///// func TestAutocompleteDynamicArrayChain(t *testing.T) { json := ` [ { "Dynamic": ({ a: [Monday..Friday] }) }, { "Dynamic": ({ a: [Jan..Mar] }) } ]` initAutocompleteFlagsTest(t.Name(), json) tests := []testAutocompleteFlagsT{ { CmdLine: t.Name(), ExpItems: []string{ `Monday`, `Tuesday`, `Wednesday`, `Thursday`, `Friday`, }, ExpDefs: map[string]string{}, }, { CmdLine: fmt.Sprintf(`%s T`, t.Name()), ExpItems: []string{ `uesday`, `hursday`, }, ExpDefs: map[string]string{}, }, { CmdLine: fmt.Sprintf(`%s Tuesday `, t.Name()), ExpItems: []string{ `Jan`, `Feb`, `Mar`, }, ExpDefs: map[string]string{}, }, } testAutocompleteFlags(t, tests) } func TestAutocompleteDynamicArrayChainOptional(t *testing.T) { json := ` [ { "Optional": true, "Dynamic": ({ a: [Monday..Friday] }) }, { "Dynamic": ({ a: [Jan..Mar] }) } ]` initAutocompleteFlagsTest(t.Name(), json) tests := []testAutocompleteFlagsT{ { CmdLine: t.Name(), ExpItems: []string{ `Monday`, `Tuesday`, `Wednesday`, `Thursday`, `Friday`, `Jan`, `Feb`, `Mar`, }, ExpDefs: map[string]string{}, }, { CmdLine: fmt.Sprintf(`%s T`, t.Name()), ExpItems: []string{ `uesday`, `hursday`, }, ExpDefs: map[string]string{}, }, { CmdLine: fmt.Sprintf(`%s Tuesday `, t.Name()), ExpItems: []string{ `Jan`, `Feb`, `Mar`, }, ExpDefs: map[string]string{}, }, { CmdLine: fmt.Sprintf(`%s F`, t.Name()), ExpItems: []string{ `riday`, `eb`, }, ExpDefs: map[string]string{}, }, { CmdLine: fmt.Sprintf(`%s J`, t.Name()), ExpItems: []string{ `an`, }, ExpDefs: map[string]string{}, }, } testAutocompleteFlags(t, tests) } func TestAutocompleteDynamicArrayChainOptionalMultiple(t *testing.T) { json := ` [ { "Optional": true, "AllowMultiple": true, "Dynamic": ({ a: [Monday..Friday] }) }, { "Dynamic": ({ a: [Jan..Mar] }) } ]` initAutocompleteFlagsTest(t.Name(), json) tests := []testAutocompleteFlagsT{ { CmdLine: t.Name(), ExpItems: []string{ `Monday`, `Tuesday`, `Wednesday`, `Thursday`, `Friday`, `Jan`, `Feb`, `Mar`, }, ExpDefs: map[string]string{}, }, { CmdLine: fmt.Sprintf(`%s T`, t.Name()), ExpItems: []string{ `uesday`, `hursday`, }, ExpDefs: map[string]string{}, }, { CmdLine: fmt.Sprintf(`%s Tuesday `, t.Name()), ExpItems: []string{ `Monday`, `Tuesday`, `Wednesday`, `Thursday`, `Friday`, `Jan`, `Feb`, `Mar`, }, ExpDefs: map[string]string{}, }, { CmdLine: fmt.Sprintf(`%s F`, t.Name()), ExpItems: []string{ `riday`, `eb`, }, ExpDefs: map[string]string{}, }, { CmdLine: fmt.Sprintf(`%s J`, t.Name()), ExpItems: []string{ `an`, }, ExpDefs: map[string]string{}, }, } testAutocompleteFlags(t, tests) } ///// func TestAutocompleteDynamicDescArrayChain(t *testing.T) { json := ` [ { "DynamicDesc": ({ map { a: [Monday..Friday] } { a: [Monday..Friday] } }) }, { "DynamicDesc": ({ map { a: [Jan..Mar] } { a: [Jan..Mar] } }) } ]` initAutocompleteFlagsTest(t.Name(), json) tests := []testAutocompleteFlagsT{ { CmdLine: t.Name(), ExpItems: []string{ `Monday`, `Tuesday`, `Wednesday`, `Thursday`, `Friday`, }, ExpDefs: map[string]string{ `Monday`: `Monday`, `Tuesday`: `Tuesday`, `Wednesday`: `Wednesday`, `Thursday`: `Thursday`, `Friday`: `Friday`, }, }, { CmdLine: fmt.Sprintf(`%s T`, t.Name()), ExpItems: []string{ `uesday`, `hursday`, }, ExpDefs: map[string]string{ `uesday`: `Tuesday`, `hursday`: `Thursday`, }, }, { CmdLine: fmt.Sprintf(`%s Tuesday `, t.Name()), ExpItems: []string{ `Jan`, `Feb`, `Mar`, }, ExpDefs: map[string]string{ `Jan`: `Jan`, `Feb`: `Feb`, `Mar`: `Mar`, }, }, } testAutocompleteFlags(t, tests) } func TestAutocompleteDynamicDescArrayChainOptional(t *testing.T) { json := ` [ { "Optional": true, "DynamicDesc": ({ map { a: [Monday..Friday] } { a: [Monday..Friday] } }) }, { "DynamicDesc": ({ map { a: [Jan..Mar] } { a: [Jan..Mar] } }) } ]` initAutocompleteFlagsTest(t.Name(), json) tests := []testAutocompleteFlagsT{ { CmdLine: t.Name(), ExpItems: []string{ `Monday`, `Tuesday`, `Wednesday`, `Thursday`, `Friday`, `Jan`, `Feb`, `Mar`, }, ExpDefs: map[string]string{ `Monday`: `Monday`, `Tuesday`: `Tuesday`, `Wednesday`: `Wednesday`, `Thursday`: `Thursday`, `Friday`: `Friday`, `Jan`: `Jan`, `Feb`: `Feb`, `Mar`: `Mar`, }, }, { CmdLine: fmt.Sprintf(`%s T`, t.Name()), ExpItems: []string{ `uesday`, `hursday`, }, ExpDefs: map[string]string{ `uesday`: `Tuesday`, `hursday`: `Thursday`, }, }, { CmdLine: fmt.Sprintf(`%s Tuesday `, t.Name()), ExpItems: []string{ `Jan`, `Feb`, `Mar`, }, ExpDefs: map[string]string{ `Jan`: `Jan`, `Feb`: `Feb`, `Mar`: `Mar`, }, }, { CmdLine: fmt.Sprintf(`%s F`, t.Name()), ExpItems: []string{ `riday`, `eb`, }, ExpDefs: map[string]string{ `riday`: `Friday`, `eb`: `Feb`, }, }, { CmdLine: fmt.Sprintf(`%s J`, t.Name()), ExpItems: []string{ `an`, }, ExpDefs: map[string]string{ `an`: `Jan`, }, }, } testAutocompleteFlags(t, tests) } func TestAutocompleteDynamicDescArrayChainOptionalMultiple(t *testing.T) { json := ` [ { "Optional": true, "AllowMultiple": true, "DynamicDesc": ({ map { a: [Monday..Friday] } { a: [Monday..Friday] } }) }, { "DynamicDesc": ({ map { a: [Jan..Mar] } { a: [Jan..Mar] } }) } ]` initAutocompleteFlagsTest(t.Name(), json) tests := []testAutocompleteFlagsT{ { CmdLine: t.Name(), ExpItems: []string{ `Monday`, `Tuesday`, `Wednesday`, `Thursday`, `Friday`, `Jan`, `Feb`, `Mar`, }, ExpDefs: map[string]string{ `Monday`: `Monday`, `Tuesday`: `Tuesday`, `Wednesday`: `Wednesday`, `Thursday`: `Thursday`, `Friday`: `Friday`, `Jan`: `Jan`, `Feb`: `Feb`, `Mar`: `Mar`, }, }, { CmdLine: fmt.Sprintf(`%s T`, t.Name()), ExpItems: []string{ `uesday`, `hursday`, }, ExpDefs: map[string]string{ `uesday`: `Tuesday`, `hursday`: `Thursday`, }, }, { CmdLine: fmt.Sprintf(`%s Tuesday `, t.Name()), ExpItems: []string{ `Monday`, `Tuesday`, `Wednesday`, `Thursday`, `Friday`, `Jan`, `Feb`, `Mar`, }, ExpDefs: map[string]string{ `Monday`: `Monday`, `Tuesday`: `Tuesday`, `Wednesday`: `Wednesday`, `Thursday`: `Thursday`, `Friday`: `Friday`, `Jan`: `Jan`, `Feb`: `Feb`, `Mar`: `Mar`, }, }, { CmdLine: fmt.Sprintf(`%s F`, t.Name()), ExpItems: []string{ `riday`, `eb`, }, ExpDefs: map[string]string{ `riday`: `Friday`, `eb`: `Feb`, }, }, { CmdLine: fmt.Sprintf(`%s J`, t.Name()), ExpItems: []string{ `an`, }, ExpDefs: map[string]string{ `an`: `Jan`, }, }, } testAutocompleteFlags(t, tests) } ///// func TestAutocompleteNested(t *testing.T) { json := ` [ { "Flags": [ "Sunday", "Monday", "Happy Days" ], "FlagValues": { "Sunday": [{ "Dynamic": ({ a: [1..3] }) }], "Monday": [{ "Flags": [ "a", "b", "c" ] }] } } ]` initAutocompleteFlagsTest(t.Name(), json) tests := []testAutocompleteFlagsT{ { CmdLine: t.Name(), ExpItems: []string{ `Sunday`, `Monday`, `Happy Days`, }, ExpDefs: map[string]string{}, }, { CmdLine: fmt.Sprintf(`%s S`, t.Name()), ExpItems: []string{ `unday`, }, ExpDefs: map[string]string{}, }, { CmdLine: fmt.Sprintf(`%s Sunday `, t.Name()), ExpItems: []string{ `1`, `2`, `3`, }, ExpDefs: map[string]string{}, }, { CmdLine: fmt.Sprintf(`%s Monday `, t.Name()), ExpItems: []string{ `a`, `b`, `c`, }, ExpDefs: map[string]string{}, }, } testAutocompleteFlags(t, tests) } ///// func TestAutocompleteComplexNestedDynamic(t *testing.T) { json := ` [ { "Optional": true, "Dynamic": ({ out: optional }) }, { "Dynamic": ({ a: [Sunday..Friday] }), "FlagValues": { "Sunday": [{ "Dynamic": ({ a: [1..3] }) }], "Monday": [{ "Flags": [ "a", "b", "c" ] }] } }, { "Dynamic": ({ a: [Jan..Mar] }) } ]` initAutocompleteFlagsTest(t.Name(), json) tests := []testAutocompleteFlagsT{ { CmdLine: t.Name(), ExpItems: []string{ `optional`, `Sunday`, `Monday`, `Tuesday`, `Wednesday`, `Thursday`, `Friday`, }, ExpDefs: map[string]string{}, }, { CmdLine: fmt.Sprintf(`%s T`, t.Name()), ExpItems: []string{ `uesday`, `hursday`, }, ExpDefs: map[string]string{}, }, { CmdLine: fmt.Sprintf(`%s Tuesday `, t.Name()), ExpItems: []string{ `Jan`, `Feb`, `Mar`, }, ExpDefs: map[string]string{}, }, { CmdLine: fmt.Sprintf(`%s Sunday `, t.Name()), ExpItems: []string{ `1`, `2`, `3`, }, ExpDefs: map[string]string{}, }, { CmdLine: fmt.Sprintf(`%s Monday `, t.Name()), ExpItems: []string{ `a`, `b`, `c`, }, ExpDefs: map[string]string{}, }, { CmdLine: fmt.Sprintf(`%s z`, t.Name()), ExpItems: []string{}, ExpDefs: map[string]string{}, }, { CmdLine: fmt.Sprintf(`%s z `, t.Name()), ExpItems: []string{}, ExpDefs: map[string]string{}, }, { CmdLine: fmt.Sprintf(`%s Sunday z`, t.Name()), ExpItems: []string{}, ExpDefs: map[string]string{}, }, { CmdLine: fmt.Sprintf(`%s Sunday z `, t.Name()), ExpItems: []string{}, ExpDefs: map[string]string{}, }, } testAutocompleteFlags(t, tests) } func TestAutocompleteComplexNestedDynamicDesc(t *testing.T) { json := ` [ { "Optional": true, "DynamicDesc": ({ map { out "Optional" } { out "optional" } }) }, { "DynamicDesc": ({ map { a: [Sunday..Friday] } { a: [sunday..friday] } }), "FlagValues": { "Sunday": [{ "DynamicDesc": ({ map { a: [1..3] } { a: [1..3] } }) }], "Monday": [{ "DynamicDesc": ({ map { a: [a..c] } { a: [a..c] } }) }] } }, { "DynamicDesc": ({ map { a: [Jan..Mar] } { a: [jan..mar] } }) } ]` initAutocompleteFlagsTest(t.Name(), json) tests := []testAutocompleteFlagsT{ { CmdLine: t.Name(), ExpItems: []string{ `Optional`, `Sunday`, `Monday`, `Tuesday`, `Wednesday`, `Thursday`, `Friday`, }, ExpDefs: map[string]string{ `Optional`: `optional`, `Sunday`: `sunday`, `Monday`: `monday`, `Tuesday`: `tuesday`, `Wednesday`: `wednesday`, `Thursday`: `thursday`, `Friday`: `friday`, }, }, { CmdLine: fmt.Sprintf(`%s T`, t.Name()), ExpItems: []string{ `uesday`, `hursday`, }, ExpDefs: map[string]string{ `uesday`: `tuesday`, `hursday`: `thursday`, }, }, { CmdLine: fmt.Sprintf(`%s Tuesday `, t.Name()), ExpItems: []string{ `Jan`, `Feb`, `Mar`, }, ExpDefs: map[string]string{ `Jan`: `jan`, `Feb`: `feb`, `Mar`: `mar`, }, }, { CmdLine: fmt.Sprintf(`%s Sunday `, t.Name()), ExpItems: []string{ `1`, `2`, `3`, }, ExpDefs: map[string]string{ `1`: `1`, `2`: `2`, `3`: `3`, }, }, { CmdLine: fmt.Sprintf(`%s Monday `, t.Name()), ExpItems: []string{ `a`, `b`, `c`, }, ExpDefs: map[string]string{ `a`: `a`, `b`: `b`, `c`: `c`, }, }, { CmdLine: fmt.Sprintf(`%s z `, t.Name()), ExpItems: []string{}, ExpDefs: map[string]string{}, }, { CmdLine: fmt.Sprintf(`%s z`, t.Name()), ExpItems: []string{}, ExpDefs: map[string]string{}, }, { CmdLine: fmt.Sprintf(`%s z `, t.Name()), ExpItems: []string{}, ExpDefs: map[string]string{}, }, { CmdLine: fmt.Sprintf(`%s Sunday z`, t.Name()), ExpItems: []string{}, ExpDefs: map[string]string{}, }, { CmdLine: fmt.Sprintf(`%s Sunday z `, t.Name()), ExpItems: []string{}, ExpDefs: map[string]string{}, }, } testAutocompleteFlags(t, tests) }
gpl-2.0
xplico/CapAnalysis
www/app/Model/Note.php
1666
<?php /* CapAnalysis Copyright 2012 Gianluca Costa (http://www.capanalysis.net) All rights reserved. */ App::uses('AppModel', 'Model'); /** * Note Model * * @property User $User * @property Item $Item */ class Note extends AppModel { /** * Display field * * @var string */ public $displayField = 'body'; /** * Validation rules * * @var array */ public $validate = array( 'body' => array( 'alphanumeric' => array( 'rule' => array('alphanumeric'), //'message' => 'Your custom message here', //'allowEmpty' => false, //'required' => false, //'last' => false, // Stop validation after this rule //'on' => 'create', // Limit validation to 'create' or 'update' operations ), 'url' => array( 'rule' => array('url'), //'message' => 'Your custom message here', //'allowEmpty' => false, //'required' => false, //'last' => false, // Stop validation after this rule //'on' => 'create', // Limit validation to 'create' or 'update' operations ), ), ); //The Associations below have been created with all possible keys, those that are not needed can be removed /** * belongsTo associations * * @var array */ public $belongsTo = array( 'User' => array( 'className' => 'User', 'foreignKey' => 'user_id', 'conditions' => '', 'fields' => '', 'order' => '' ), 'Dataset' => array( 'className' => 'Dataset', 'foreignKey' => 'dataset_id', 'conditions' => '', 'fields' => '', 'order' => '' ), 'Capfile' => array( 'className' => 'Capfile', 'foreignKey' => 'capfile_id', 'conditions' => '', 'fields' => '', 'order' => '' ) ); }
gpl-2.0
msimic/MediaPoint
MediaPoint_Common/Subtitles/SubtitleFormats/UnknownSubtitle11.cs
10518
using System; using System.Collections.Generic; using System.Text; using System.Text.RegularExpressions; namespace MediaPoint.Subtitles.Logic.SubtitleFormats { /// <summary> /// MicroDvd with time codes...? /// </summary> public class UnknownSubtitle11 : SubtitleFormat { static Regex _regexMicroDvdLine = new Regex(@"^\{-?\d+:\d+:\d+}\{-?\d+:\d+:\d+}.*$", RegexOptions.Compiled); public override string Extension { get { return ".sub"; } } public override string Name { get { return "Unknown 11"; } } public override bool HasLineNumber { get { return false; } } public override bool IsTimeBased { get { return true; } } public override bool IsMine(List<string> lines, string fileName) { var trimmedLines = new List<string>(); int errors = 0; foreach (string line in lines) { if (line.Trim().Length > 0 && line.Contains("{")) { string s = RemoveIllegalSpacesAndFixEmptyCodes(line); if (_regexMicroDvdLine.IsMatch(s)) trimmedLines.Add(s); else errors++; } else { errors++; } } return trimmedLines.Count > errors; } private string RemoveIllegalSpacesAndFixEmptyCodes(string line) { int index = line.IndexOf("}"); if (index >= 0 && index < line.Length) { index = line.IndexOf("}", index + 1); if (index >= 0 && index + 1 < line.Length) { if (line.IndexOf("{}") >= 0 && line.IndexOf("{}") < index) { line = line.Insert(line.IndexOf("{}") + 1, "0"); // set empty time codes to zero index++; } while (line.IndexOf(" ") >= 0 && line.IndexOf(" ") < index) { line = line.Remove(line.IndexOf(" "), 1); index--; } } } return line; } private string MakeTimeCode(TimeCode tc) { return string.Format("{0}:{1:00}:{2:00}", tc.Hours, tc.Minutes, tc.Seconds); } public override string ToText(Subtitle subtitle, string title) { var sb = new StringBuilder(); foreach (Paragraph p in subtitle.Paragraphs) { sb.Append("{"); sb.Append(MakeTimeCode(p.StartTime)); sb.Append("}{"); sb.Append(MakeTimeCode(p.EndTime)); sb.Append("}"); //{y:b} is italics for single line //{Y:b} is italics for both lines string[] parts = p.Text.Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries); int count = 0; bool italicOn = false; bool boldOn = false; bool underlineOn = false; StringBuilder lineSb = new StringBuilder(); foreach (string line in parts) { if (count > 0) lineSb.Append("|"); if (line.StartsWith("<i>") || italicOn) { italicOn = true; boldOn = false; underlineOn = false; lineSb.Append("{y:i}"); // italic single line } else if (line.StartsWith("<b>") || boldOn) { italicOn = false; boldOn = true; underlineOn = false; lineSb.Append("{y:b}"); // bold single line } else if (line.StartsWith("<u>") || underlineOn) { italicOn = false; boldOn = true; underlineOn = false; lineSb.Append("{y:u}"); // underline single line } if (line.Contains("</i>")) italicOn = false; if (line.Contains("</b>")) boldOn = false; if (line.Contains("</u>")) underlineOn = false; lineSb.Append(Utilities.RemoveHtmlTags(line)); count++; } string text = lineSb.ToString(); int noOfLines = Utilities.CountTagInText(text, "|") + 1; if (noOfLines > 1 && Utilities.CountTagInText(text, "{y:i}") == noOfLines) text = "{Y:i}" + text.Replace("{y:i}", string.Empty); else if (noOfLines > 1 && Utilities.CountTagInText(text, "{y:b}") == noOfLines) text = "{Y:b}" + text.Replace("{y:b}", string.Empty); else if (noOfLines > 1 && Utilities.CountTagInText(text, "{y:u}") == noOfLines) text = "{Y:u}" + text.Replace("{y:u}", string.Empty); sb.AppendLine(Utilities.RemoveHtmlTags(text)); } return sb.ToString().Trim(); } private TimeCode DecodeTimeCode(string timeCode) { string[] arr = timeCode.Split(":".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); return new TimeCode(int.Parse(arr[0]), int.Parse(arr[1]), int.Parse(arr[2]), 0); } public override void LoadSubtitle(Subtitle subtitle, List<string> lines, string fileName) { _errorCount = 0; foreach (string line in lines) { string s = RemoveIllegalSpacesAndFixEmptyCodes(line); if (_regexMicroDvdLine.IsMatch(s)) { try { int textIndex = GetTextStartIndex(s); if (textIndex < s.Length) { string text = s.Substring(textIndex); string temp = s.Substring(0, textIndex - 1); string[] frames = temp.Replace("}{", ";").Replace("{", string.Empty).Replace("}", string.Empty).Split(';'); TimeCode startTime = DecodeTimeCode(frames[0]); TimeCode endTime = DecodeTimeCode(frames[1]); string post = string.Empty; string[] parts = text.Split("|".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); int count = 0; StringBuilder lineSb = new StringBuilder(); foreach (string s2 in parts) { if (count > 0) lineSb.AppendLine(); s = s2.Trim(); if (s.StartsWith("{Y:i}")) { s = "<i>" + s.Replace("{Y:i}", string.Empty); post += "</i>"; } else if (s.StartsWith("{Y:b}")) { s = "<b>" + s.Replace("{Y:b}", string.Empty); post += "</b>"; } else if (s.StartsWith("{Y:u}")) { s = "<u>" + s.Replace("{Y:u}", string.Empty); post += "</u>"; } else if (s.StartsWith("{y:i}")) { s = "<i>" + s.Replace("{y:i}", string.Empty) + "</i>"; } else if (s.StartsWith("{y:b}")) { s = "<b>" + s.Replace("{y:b}", string.Empty) + "</b>"; } else if (s.StartsWith("{y:u}")) { s = "<u>" + s.Replace("{y:u}", string.Empty) + "</u>"; } s = s.Replace("{Y:i}", string.Empty).Replace("{y:i}", string.Empty); s = s.Replace("{Y:b}", string.Empty).Replace("{y:b}", string.Empty); s = s.Replace("{Y:u}", string.Empty).Replace("{y:u}", string.Empty); lineSb.Append(s); count++; } text = lineSb.ToString() + post; subtitle.Paragraphs.Add(new Paragraph(startTime, endTime, text)); } } catch { _errorCount++; } } else { _errorCount++; } } int i = 0; foreach (Paragraph p in subtitle.Paragraphs) { Paragraph previous = subtitle.GetParagraphOrDefault(i - 1); if (p.StartFrame == 0 && previous != null) { p.StartFrame = previous.EndFrame + 1; } if (p.EndFrame == 0) { p.EndFrame = p.StartFrame; } i++; } subtitle.Renumber(1); } private static int GetTextStartIndex(string line) { int i = 0; int tagCount = 0; while (i < line.Length && tagCount < 4) { if (line[i] == '{' || line[i] == '}') tagCount++; i++; } return i; } } }
gpl-2.0
Parchive/par2cmdline
src/descriptionpacket.cpp
11458
// This file is part of par2cmdline (a PAR 2.0 compatible file verification and // repair tool). See http://parchive.sourceforge.net for details of PAR 2.0. // // Copyright (c) 2003 Peter Brian Clements // Copyright (c) 2019 Michael D. Nahas // // par2cmdline 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. // // par2cmdline 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 "libpar2internal.h" #ifdef _MSC_VER #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #define new DEBUG_NEW #endif #endif // Construct the packet and store the filename and size. bool DescriptionPacket::Create(string filename, u64 filesize) { // Allocate some extra bytes for the packet in memory so that strlen() can // be used on the filename. The extra bytes do not get written to disk. FILEDESCRIPTIONPACKET *packet = (FILEDESCRIPTIONPACKET *)AllocatePacket(sizeof(*packet) + (~3 & (3 + (u32)filename.size())), 4); // Store everything that is currently known in the packet. packet->header.magic = packet_magic; packet->header.length = packetlength; //packet->header.hash; // Not known yet //packet->header.setid; // Not known yet packet->header.type = filedescriptionpacket_type; //packet->fileid; // Not known yet //packet->hashfull; // Not known yet //packet->hash16k; // Not known yet packet->length = filesize; memcpy(packet->name, filename.c_str(), filename.size()); return true; } void DescriptionPacket::Hash16k(const MD5Hash &hash) { ((FILEDESCRIPTIONPACKET *)packetdata)->hash16k = hash; } void DescriptionPacket::HashFull(const MD5Hash &hash) { ((FILEDESCRIPTIONPACKET *)packetdata)->hashfull = hash; } void DescriptionPacket::ComputeFileId(void) { FILEDESCRIPTIONPACKET *packet = ((FILEDESCRIPTIONPACKET *)packetdata); // Compute the fileid from the hash, length, and name fields in the packet. MD5Context context; context.Update(&packet->hash16k, sizeof(FILEDESCRIPTIONPACKET)-offsetof(FILEDESCRIPTIONPACKET,hash16k) +strlen((const char*)packet->name)); context.Final(packet->fileid); } // Load a description packet from a specified file bool DescriptionPacket::Load(DiskFile *diskfile, u64 offset, PACKET_HEADER &header) { // Is the packet big enough if (header.length <= sizeof(FILEDESCRIPTIONPACKET)) { return false; } // Is the packet too large (what is the longest permissible filename) if (header.length - sizeof(FILEDESCRIPTIONPACKET) > 100000) { return false; } // Allocate the packet (with a little extra so we will have NULLs after the filename) FILEDESCRIPTIONPACKET *packet = (FILEDESCRIPTIONPACKET *)AllocatePacket((size_t)header.length, 4); packet->header = header; // Read the rest of the packet from disk if (!diskfile->Read(offset + sizeof(PACKET_HEADER), &packet->fileid, (size_t)packet->header.length - sizeof(PACKET_HEADER))) return false; // Are the file and 16k hashes consistent if (packet->length <= 16384 && packet->hash16k != packet->hashfull) { return false; } return true; } // Returns the URL-style encoding of a character: // "%HH" where H is a hex-digit. string DescriptionPacket::UrlEncodeChar(char c) { string result("%"); char high_bits = ((c >> 4) & 0xf); if (high_bits < 10) result += '0' + high_bits; else result += 'A' + (high_bits - 10); char low_bits = (c & 0xf); if (low_bits < 10) result += '0' + low_bits; else result += 'A' + (low_bits - 10); return result; } // Converts the filename from that on disk to the version // in the Par file. Par uses HTML-style slashes ('/' or // UNIX-style slashes) to denote directories. This // function also prints a warning if a character may be // illegal on another machine. // // NOTE: I decided to warn users, not change the files. // If a user is just backing up files on their own system // and not sending them to users on another operating // system, we don't want to change the filenames. string DescriptionPacket::TranslateFilenameFromLocalToPar2(std::ostream &sout, std::ostream &serr, const NoiseLevel noiselevel, string local_filename) { string par2_encoded_filename; string::iterator p = local_filename.begin(); while (p != local_filename.end()) { unsigned char ch = *p; bool ok = true; if (ch < 32) { ok = false; } else { switch (ch) { case '"': case '*': case ':': case '<': case '>': case '?': case '|': ok = false; } } if (!ok) { if (noiselevel >= nlNormal) { serr << "WARNING: A filename contains the character \'" << ch << "\' which some systems do not allow in filenames." << endl; } } #ifdef _WIN32 // replace Windows-slash with HTML-slash if (ch == '\\') { ch = '/'; } #else if (ch == '\\') { if (noiselevel >= nlNormal) { serr << "WARNING: Found Windows-style slash '\\' in filename. Windows systems may have trouble with it." << endl; } } #endif par2_encoded_filename += ch; ++p; } // Par files should never contain an absolute path. On Windows, // These start "C:\...", etc. An attacker could put an absolute // path into a Par file and overwrite system files. if (par2_encoded_filename.size() > 1 && par2_encoded_filename.at(1) == ':') { if (noiselevel >= nlNormal) { serr << "WARNING: The second character in the filename \"" << par2_encoded_filename << "\" is a colon (':')." << endl; serr << " This may be interpreted by Windows systems as an absolute path." << endl; serr << " This file may be ignored by Par clients because absolute paths" << endl; serr << " are a way for an attacker to overwrite system files." << endl; } } if (par2_encoded_filename.at(0) == '/') { if (noiselevel >= nlNormal) { serr << "WARNING: The first character in the filename \"" << par2_encoded_filename << "\" is an HTML-slash ('/')." << endl; serr << " This may be interpreted by UNIX systems as an absolute path." << endl; serr << " This file may be ignored by Par clients because absolute paths" << endl; serr << " are a way for an attacker to overwrite system files." << endl; } } if (par2_encoded_filename.find("../") != string::npos) { if (noiselevel >= nlQuiet) { serr << "WARNING: The filename \"" << par2_encoded_filename << "\" contains \"..\"." << endl; serr << " This is a parent directory. This file may be ignored" << endl; serr << " by Par clients because parent directories are a way" << endl; serr << " for an attacker to overwrite system files." << endl; } } if (par2_encoded_filename.length() > 255) { if (noiselevel >= nlNormal) { serr << "WARNING: A filename is over 255 characters. That may be too long" << endl; serr << " for Windows systems to handle." << endl; } } return par2_encoded_filename; } // Take a filename that matches the PAR2 standard ('/' slashes, etc.) // and convert it to a legal filename on the local system. // While at it, try to fix things: illegal characters, attempts // to write an absolute path, directories named "..", etc. // // This implementation changes any illegal char into the URL-style // encoding of %HH where H is a hex-digit. // // NOTE: Windows limits path names to 255 characters. I'm not // sure that anything can be done here for that. string DescriptionPacket::TranslateFilenameFromPar2ToLocal(std::ostream &sout, std::ostream &serr, const NoiseLevel noiselevel, string par2_encoded_filename) { string local_filename; string::iterator p = par2_encoded_filename.begin(); while (p != par2_encoded_filename.end()) { unsigned char ch = *p; bool ok = true; #ifdef _WIN32 if (ch < 32) { ok = false; } else { switch (ch) { case '"': case '*': case ':': case '<': case '>': case '?': case '|': ok = false; } } #elif __APPLE__ // (Assuming OSX/MacOS and not IOS!) // Does not allow ':' if (ch < 32 || ch == ':') { ok = false; } #else // other UNIXes allow anything. if (ch < 32) { ok = false; } #endif // replace unix / to windows \ or windows \ to unix / #ifdef _WIN32 if (ch == '/') { ch = '\\'; } #else if (ch == '\\') { if (noiselevel >= nlQuiet) { // This is a legal Par2 character, but assume someone screwed up. serr << "INFO: Found Windows-style slash in filename. Changing to UNIX-style slash." << endl; ch = '/'; } } #endif if (ok) { local_filename += ch; } else { if (noiselevel >= nlQuiet) { serr << "INFO: Found illegal character '" << ch << "' in filename. Changed it to \"" << UrlEncodeChar(ch) << "\"" << endl; // convert problem characters to hex local_filename += UrlEncodeChar(ch); } } ++p; } #ifdef _WIN32 // Par files should never contain an absolute path. On Windows, // These start "C:\...", etc. An attacker could put an absolute // path into a Par file and overwrite system files. For Windows // systems, we've already changed ':' to "%3A", so any absolute // path should have become relative. // Replace any references to ".." which could also be used by // an attacker. while (true) { size_t index = local_filename.find("..\\"); if (index == string::npos) break; if (noiselevel >= nlQuiet) { serr << "INFO: Found attempt to write parent directory. Changing \"..\" to \"" << UrlEncodeChar('.') << UrlEncodeChar('.') << "\"" << endl; } local_filename.replace(index, 2, UrlEncodeChar('.')+UrlEncodeChar('.')); } #else // On UNIX systems, we don't want to allow filename to start with a slash, // because someone could be sneakily trying to overwrite a system file. if (local_filename.at(0) == '/') { if (noiselevel >= nlQuiet) { serr << "INFO: Found attempt to write absolute path. Changing '/' at start of filename to \"" << UrlEncodeChar('/') << "\"" << endl; } local_filename.replace(0, 1, UrlEncodeChar('/')); } // replace any references to ".." which could also be sneaking while (true) { size_t index = local_filename.find("../"); if (index == string::npos) break; if (noiselevel >= nlQuiet) { serr << "INFO: Found attempt to write parent directory. Changing \"..\" to \"" << UrlEncodeChar('.') << UrlEncodeChar('.') << "\"" << endl; } local_filename.replace(index, 2, UrlEncodeChar('.')+UrlEncodeChar('.')); } #endif return local_filename; }
gpl-2.0
hsfoxman/wiki
languages/messages/MessagesAm.php
181885
<?php /** Amharic (አማርኛ) * * See MessagesQqq.php for message documentation incl. usage of parameters * To improve a translation please visit http://translatewiki.net * * @ingroup Language * @file * * @author Codex Sinaiticus * @author Elfalem * @author Hinstein * @author Reedy * @author Romaine * @author Solomon * @author Teferra */ $namespaceNames = array( NS_MEDIA => 'ፋይል', NS_SPECIAL => 'ልዩ', NS_TALK => 'ውይይት', NS_USER => 'አባል', NS_USER_TALK => 'አባል_ውይይት', NS_PROJECT_TALK => '$1_ውይይት', NS_FILE => 'ስዕል', NS_FILE_TALK => 'ስዕል_ውይይት', NS_MEDIAWIKI => 'መልዕክት', NS_MEDIAWIKI_TALK => 'መልዕክት_ውይይት', NS_TEMPLATE => 'መለጠፊያ', NS_TEMPLATE_TALK => 'መለጠፊያ_ውይይት', NS_HELP => 'እርዳታ', NS_HELP_TALK => 'እርዳታ_ውይይት', NS_CATEGORY => 'መደብ', NS_CATEGORY_TALK => 'መደብ_ውይይት', ); $namespaceAliases = array( 'መልጠፊያ' => NS_TEMPLATE, 'መልጠፊያ_ውይይት' => NS_TEMPLATE_TALK, ); $specialPageAliases = array( 'Longpages' => array( 'ረጃጅም_ገጾች' ), 'Newpages' => array( 'አዳዲስ_ገጾች' ), 'Shortpages' => array( 'አጫጭር_ገጾች' ), ); $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' => 'በቀዳሚነት ውጪያዊ አራሚን ተጠቀም', 'tog-externaldiff' => 'በቀዳሚነት የውጭ ልዩነት-ማሳያን ተጠቀም', 'tog-showjumplinks' => 'የ"ዝለል" አቅላይ መያያዣዎችን አስችል', 'tog-uselivepreview' => 'ቀጥታ ቅድመ-ዕይታን ይጠቀሙ (JavaScript) (የሙከራ)', 'tog-forceeditsummary' => 'ማጠቃለያው ባዶ ከሆነ ማስታወሻ ይስጠኝ', 'tog-watchlisthideown' => 'የራስዎ ለውጦች ከሚከታተሉት ገጾች ይደበቁ', 'tog-watchlisthidebots' => 'የቦት (መሣርያ) ለውጦች ከሚከታተሉት ገጾች ይደበቁ', 'tog-watchlisthideminor' => 'ጥቃቅን ለውጦች ከሚከታተሉት ገጾች ይደበቁ', 'tog-watchlisthideliu' => 'ያባላት ለውጦች ከምከታተል ገጾች ዝርዝር ይደበቁ', 'tog-watchlisthideanons' => 'የቁ. አድራሻ ለውጦች ከምከታተል ገጾች ዝርዝር ይደበቁ', 'tog-ccmeonemails' => 'ወደ ሌላ ተጠቃሚ የምልከው ኢሜል ቅጂ ለኔም ይላክ', 'tog-diffonly' => 'ከለውጦቹ ስር የገጽ ይዞታ አታሳይ', 'tog-showhiddencats' => 'የተደበቁ መደቦች ይታዩ', 'tog-norollbackdiff' => 'ROLLBACK ከማድረግ በኋላ ልዩነቱ ማሳየት ይቅር', 'underline-always' => 'ሁሌም ይህን', 'underline-never' => 'ሁሌም አይሁን', 'underline-default' => 'የቃኝ ቀዳሚ ባህሪዎች', # Font style option in Special:Preferences 'editfont-default' => 'የቃኝ ቀዳሚ ባህሪዎች', # 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 ንዑስ-መደቦች አሉ}} (በጠቅላላም ከነስውር መደቦች $2 አሉ)}}፦', 'category-subcat-count-limited' => 'በዚሁ መደብ ውስጥ {{PLURAL:$1|የሚከተለው ንዑስ መደብ አለ| የሚከተሉት $1 ንዑስ መደቦች አሉ}}፦', 'category-article-count' => '{{PLURAL:$2|ይኸው መደብ የሚከተለውን መጣጥፍ ብቻ አለው።|በዚሁ መደብ ውስጥ (ከ$2 በጠቅላላ) {{PLURAL:$1|የሚከተለው መጣጥፍ አለ።|የሚከተሉት $1 መጣጥፎች አሉ።}}}}', 'category-article-count-limited' => 'በዚሁ መደብ ውስጥ {{PLURAL:$1|የሚከተለው መጣጥፍ አለ|የሚከተሉት $1 መጣጥፎች አሉ}}።', 'category-file-count' => '{{PLURAL:$2|ይኸው መደብ የሚከተለውን ፋይል ብቻ አለው።|በዚሁ መደብ ውስጥ (ከ$2 በጠቅላላ) {{PLURAL:$1|የሚከተለው ፋይል አለ።|የሚከተሉት $1 ፋይሎች አሉ።}}}}', 'category-file-count-limited' => 'በዚሁ መደብ ውስጥ {{PLURAL:$1|የሚከተለው ፋይል አለ|የሚከተሉት $1 ፋይሎች አሉ}}።', 'listingcontinuesabbrev' => '(ተቀጥሏል)', 'index-category' => ' ማውጫው ላይ የተመዘገብ ገጾች', 'broken-file-category' => 'የማይኖሩ ፋይሎች ያሉባቸው ገጾች', 'about' => 'ስለ', 'article' => 'መጣጥፍ', 'newwindow' => '(ባዲስ መስኮት ውስጥ ይከፈታል።)', 'cancel' => 'ሰርዝ', 'moredotdotdot' => 'ተጨማሪ...', 'mypage' => 'የኔ ገጽ', 'mytalk' => 'የኔ ውይይት', 'anontalk' => 'ውይይት ለዚሁ ቁ. አድራሻ', 'navigation' => 'መቃኘት', 'and' => '&#32;እና', # 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-view-create' => 'አዲስ ፍጠር', 'vector-view-edit' => 'አርም', 'vector-view-history' => 'ታሪኩን አሳይ', 'vector-view-view' => 'ለማንበብ', 'vector-view-viewsource' => 'ጥሬ ኮድ ለመመልከት', 'actions' => 'ድርጊቶች', 'namespaces' => 'ክፍለ-ዊኪዎች', 'errorpagetitle' => 'ስህተት', 'returnto' => '(ወደ $1 ለመመለስ)', 'tagline' => 'ከ{{SITENAME}}', 'help' => 'እርዳታ ገጽ', 'search' => 'ፈልግ', 'searchbutton' => 'ፈልግ', 'go' => 'ሂድ', 'searcharticle' => 'ሂድ', 'history' => 'የገጽ ታሪክ', 'history_short' => 'ታሪክ', 'updatedmarker' => 'ከመጨረሻው ጉብኝቴ በኋላ የተሻሻለ', 'printableversion' => 'ለህትመት የተዘጋጀ', 'permalink' => 'ቋሚ መያያዣ', 'print' => 'ይታተም', 'view' => 'ለመመልከት', 'edit' => 'አርም', 'create' => 'ለመፍጠር', 'editthispage' => 'ይህን ገጽ አርም', 'create-this-page' => 'ይህን ገጽ ለመፍጠር', 'delete' => 'ይጥፋ', 'deletethispage' => 'ይህን ገጽ ሰርዝ', 'undelete_short' => '{{PLURAL:$1|አንድ ዕትም|$1 ዕትሞች}} ለመመልስ', 'viewdeleted_short' => '{{PLURAL:$1|የጠፋውን ዕትም|$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' => 'ይህ ገጽ መጨረሻ የተቀየረው እ.ኣ.አ በ$2፣ $1 ዓ.ም. ነበር።', 'viewcount' => 'ይህ ገጽ {{PLURAL:$1|አንዴ|$1 ጊዜ}} ታይቷል።', 'protectedpage' => 'የተቆለፈ ገጽ', 'jumpto' => 'ዘልለው ለመሔድ፦', 'jumptonavigation' => 'የማውጫ ቁልፎች', 'jumptosearch' => 'ፍለጋ', 'view-pool-error' => 'ይቅቅርታ፣ በአሁኑ ወቅት ብዙ ተጠቃሚዎች ገፁን ለማየት እየሞከሩ ስለሆነ ሰርቨሩ ላይ መጨናነቅ ተፈጥሯል ስለዚህ እባክዎን ትንሽ ቆይተው በድጋሚ ይዎክሩ። $1', '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' => 'ስለ {{SITENAME}}', 'aboutpage' => 'Project:ስለ', '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' => 'የጠየቁት አድራጎት ለ$1 {{PLURAL:$2|ማዕረግ ላላቸው|ማዕረጎች ላሏቸው}} አባላት ብቻ ይፈቀዳል።', 'versionrequired' => 'የMediaWiki ዝርያ $1 ያስፈልጋል።', 'versionrequiredtext' => 'ይህንን ገጽ ለመጠቀም የMediaWiki ዝርያ $1 ያስፈልጋል። [[Special:Version|የዝርያውን ገጽ]] ይዩ።', 'ok' => 'እሺ', 'retrievedfrom' => 'ከ «$1» የተወሰደ', 'youhavenewmessages' => '$1 አሉዎት ($2)።', 'newmessageslink' => 'አዲስ መልእክቶች', 'newmessagesdifflink' => 'የመጨረሻ ለውጥ', 'youhavenewmessagesfromusers' => 'ከ{{PLURAL:$3|ሌላ አባል|$3 አባላት}} $1 {{PLURAL:$1|አለዎት|አሉልዎ}}። ($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' => '{{PLURAL:$1|የጠፋ ዕትም|$1 የጠፉት ዕትሞች}}', 'feedlinks' => 'ማጉረስ (feed)፦', 'feed-invalid' => 'የማይገባ የማጉረስ አይነት።', 'feed-unavailable' => 'ማጉረስ በ{{SITENAME}} የለም።', 'site-rss-feed' => '$1 የድህረ ገፁ አጫጭር ምገባዎች', 'site-atom-feed' => '$1 አቶም Feed', 'page-rss-feed' => '"$1" R.S.S. Feed', 'page-atom-feed' => '"$1" አቶም Feed', 'red-link-title' => '$1 (ገጹ ገና አልተጻፈም)', # Short words for each namespace, by default used in the namespace tab in monobook 'nstab-main' => 'ገጽ', 'nstab-user' => 'የአባል ገጽ', 'nstab-media' => 'ፋይል', 'nstab-special' => 'ልዩ ገጾች', 'nstab-project' => 'የፕሮጀክት ገጽ', 'nstab-image' => 'ፋይል', 'nstab-mediawiki' => 'መልዕክት', 'nstab-template' => 'መለጠፊያ', 'nstab-help' => 'የመመሪያ ገጽ', 'nstab-category' => 'ምድብ', # Main script and global functions 'nosuchaction' => 'የማይሆን ተግባር', 'nosuchactiontext' => 'በURL የተወሰነው ተግባር በዚህ ዊኪ አይታወቀም።', 'nosuchspecialpage' => 'እንዲህ የተባለ ልዩ ገጽ የለም', 'nospecialpagetext' => '<strong>ለማይኖር ልዩ ገጽ ጠይቀዋል።</strong> የሚኖሩ ልዩ ገጾች ዝርዝር በ[[Special:SpecialPages|{{int:specialpages}}]] ሊገኝ ይችላል።', # General errors 'error' => 'ስኅተት', 'databaseerror' => 'የመረጃ-ቤት ስህተት', 'dberrortext' => 'የመረጃ-ቤት ጥያቄ ስዋሰው ስህተት ሆኗል። ይህ ምናልባት በሶፍትዌሩ ወስጥ ያለ ተውሳክ ሊጠቆም ይችላል። መጨረሻ የተሞከረው መረጃ-ቤት ጥያቄ <blockquote><tt>$1</tt></blockquote> ከተግባሩ «<tt>$2</tt>» ውስጥ ነበረ። MySQL ስህተት «<tt>$3: $4</tt>» መለሰ።', 'dberrortextcl' => 'የመረጃ-ቤት ጥያቄ ስዋሰው ስህተት ሆኗል። መጨረሻ የተሞከረው መረጃ-ቤት ጥያቄ <blockquote><tt>$1</tt></blockquote> ከተግባሩ «<tt>$2</tt>» ውስጥ ነበረ። MySQL ስህተት «<tt>$3: $4</tt>» መለሰ።', 'laggedslavemode' => 'ማስጠንቀቂያ፦ ምናልባት የቅርብ ለውጦች በገጹ ላይ አይታዩም።', 'readonly' => 'መረጃ-ቤት ተቆልፏል', 'enterlockreason' => 'የመቆለፉን ምክንያትና የሚያልቅበትን ሰዓት (በግምት) ይጻፉ።', 'readonlytext' => 'መረጃ-ቤቱ አሁን ከመቀየር ተቆልፏል። ይህ ለተራ አጠባበቅ ብቻ መሆኑ አይቀርም። ከዚያ በኋላ እንደ ወትሮ ሁኔታ ይኖራል። የቆለፉት መጋቢ ይህንን መግለጫ አቀረቡ፦ $1', 'missingarticle-rev' => '(እትም#: $1)', 'missingarticle-diff' => '(ልዩነት# : $1 እና $2)', 'readonly_lag' => 'ተከታይ ሰርቨሮች ለቀዳሚው እስከሚደርሱ ድረስ መረጃ-ቤቱ በቀጥታ ተቆልፏል።', 'internalerror' => 'የውስጥ ስህተት', 'internalerror_info' => 'የውስጥ ስህተት፦ $1', 'fileappenderror' => '«$1» ወደ «$2» መጨምር አልተቻለም።', 'filecopyerror' => 'ፋይሉን «$1» ወደ «$2» መቅዳት አልተቻለም።', 'filerenameerror' => 'የፋይሉን ስም ከ«$1» ወደ «$2» መቀየር አተቻለም።', 'filedeleteerror' => 'ፋይሉን «$1» ለማጥፋት አልተቻለም።', 'directorycreateerror' => 'ዶሴ «$1» መፍጠር አልተቻለም።', 'filenotfound' => '«$1» የሚባል ፋይል አልተገኘም።', 'fileexistserror' => 'ወደ ፋይሉ «$1» መጻፍ አይቻልም፦ ፋይሉ ይኖራል', 'unexpected' => 'ያልተጠበቀ ዕሴት፦ «$1»=«$2»።', 'formerror' => 'ስኅተት፦ ማመልከቻ ለማቅረብ አልተቻለም', 'badarticleerror' => 'ይህ ተግባር በዚሁ ገጽ ላይ ሊደረግ አይቻልም።', 'cannotdelete' => 'የተወሰነው ገጽ ወይም ፋይል ለማጥፋት አልተቻለም። (ምናልባት በሌላ ሰው እጅ ገና ጠፍቷል።)', 'cannotdelete-title' => 'ገጹን «$1» ለማጥፋት አልተቻለም።', 'delete-hook-aborted' => 'መጥፋቱ በሜንጦ ተቋረጠ። ምንም ምክንያት አልሰጠም።', 'badtitle' => 'መጥፎ አርዕስት', 'badtitletext' => 'የፈለጉት አርዕስት ልክ አልነበረም። ምናልባት ለአርዕስት የማይሆን የፊደል ምልክት አለበት።', 'perfcached' => 'ማስታወቂያ፡ ይህ መረጃ በየጊዜ የሚታደስ ስለሆነ ዘመናዊ ሳይሆን የቆየ ሊሆን ይችላል። A maximum of {{PLURAL:$1|one result is|$1 results are}} available in the cache.', 'perfcachedts' => 'የሚቀጥለው መረጃ ተቆጥቧል፣ መጨረሻ የታደሠው $1 እ.ኤ.አ. ነው።', 'querypage-no-updates' => 'ይህ ገጽ አሁን የታደሠ አይደለም። ወደፊትም መታደሱ ቀርቷል። በቅርብ ግዜ አይታደስም።', 'wrong_wfQuery_params' => 'ለwfQuery() ትክክለኛ ያልሆነ ግቤት<br /> ተግባር፦ $1<br /> ጥያቄ፦ $2', 'viewsource' => 'ምንጩን ተመልከት', 'viewsource-title' => 'ጥሬ ኮዱን ለ$1 ለማየት', 'actionthrottled' => 'ተግባሩ ተቋረጠ', 'actionthrottledtext' => 'የስፓም መብዛት ለመቃወም፣ በአጭር ጊዜ ውስጥ ይህን ተግባር ብዙ ጊዜ ከመፈጽም ተክለክለዋል። አሁንም ከመጠኑ በላይ በልጠዋል። እባክዎ ከጥቂት ደቂቃ በኋላ እንደገና ይሞክሩ።', 'protectedpagetext' => 'ይኸው ገጽ እንዳይታረም ተጠብቋል።', 'viewsourcetext' => 'የዚህን ገጽ ምንጭ ማየትና መቅዳት ይችላሉ።', 'protectedinterface' => 'ይህ ገጽ ለስልቱ ገጽታ ጽሑፍን ያቀርባል፣፡ ስለዚህ እንዳይበላሽ ተጠብቋል።', 'editinginterface' => "'''ማስጠንቀቂያ፦''' ይህ ገጽ ለድረገጹ መልክ ጽሕፈት ይሰጣል። በዊኪ ሁሉ ላይ መላውን የድረገጽ መልክ በቀላል ለማስተርጎም [//translatewiki.net/wiki/Main_Page?setlang=am translatewiki.net] ይጎብኙ።", 'sqlhidden' => '(የመደበኛ-የመጠይቅ-ቋንቋ (SQL) ጥያቄ ተደበቀ)', 'cascadeprotected' => "'''ማስጠንቀቂያ፦''' ይህ አርእስት ሊፈጠር ወይም ሊቀየር አይቻልም። ምክንያቱም ወደ {{PLURAL:$1|ተከታተለው አርዕስት|ተከታተሉት አርእስቶች}} ተጨምሯል። $2", 'namespaceprotected' => "በ'''$1''' ክፍለ-ዊኪ ያሉትን ገጾች ለማዘጋጀት ፈቃድ የለዎም።", 'ns-specialprotected' => 'ልዩ ገጾችን ማረም አይፈቀድም።', 'titleprotected' => "ይህ አርዕስት እንዳይፈጠር በ[[User:$1|$1]] ተጠብቋል። የተሰጠው ምክንያት ''$2'' ነው።", 'exception-nologin' => 'ገና አልገቡም', 'exception-nologin-text' => 'ለዚሁ ገጽ ወይም አድራጎት፣ ወደ ዊኪው በአባልነት ስም አስቀድሞ መግባት ግዴታ ነው።', # Virus scanner 'virus-unknownscanner' => 'ያልታወቀ antivirus:', # Login and logout pages 'logouttext' => "'''አሁን ወጥተዋል።''' አሁንም በቁጥር መታወቂያዎ ማዘጋጀት ይቻላል። ወይም ደግሞ እንደገና በብዕር ስምዎ መግባት ይችላሉ። በጥቂት ሴኮንድ ውስጥ ወደሚከተለው ገጽ በቀጥታ ይመለሳል፦", 'welcomecreation' => '== ሰላምታ፣ $1! == የብዕር ስምዎ ተፈጥሯል። ምርጫዎችዎን ለማስተካከል ይችላሉ።', 'yourname' => 'Username / የብዕር ስም:', 'yourpassword' => 'Password / መግቢያ ቃል', 'yourpasswordagain' => 'መግቢያ ቃልዎን ዳግመኛ ይስጡ', 'remembermypassword' => 'ለሚቀጥለው ጊዜ በዚ ኮምፒውተር ላይ በአባልነት ስሜ መግባቴን ( ቢባዛ ለ $1 {{PLURAL:$1|ቀን|ቀናት}}) አስታውስ።', 'yourdomainname' => 'የእርስዎ ከባቢ (domain)፦', 'password-change-forbidden' => 'በዚሁ ዊኪ መግቢያ ቃልን መቀይር አልተፈቀደም።', 'externaldberror' => 'ወይም አፍአዊ የማረጋገጫ መረጃ-ቤት ስኅተት ነበረ፣ ወይም አፍአዊ አባልነትዎን ማሳደስ አልተፈቀዱም።', 'login' => 'ለመግባት', 'nav-login-createaccount' => 'መግቢያ', 'loginprompt' => '(You must have cookies enabled to log in to {{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) ይጠቀማል። በርስዎ ኮምፒውተር ግን የቃኚ-ማስታወሻ እንዳይሠራ ተደርጓል። እባክዎ እንዲሠራ ያድርጉና በአዲስ ብዕር ስምና መግቢያ ቃልዎ ይግቡ።።', 'nocookieslogin' => 'በ{{SITENAME}} ተጠቃሚዎች ለመግባት የቃኚ-ማስታወሻ (cookie) ይጠቀማል። በርስዎ ኮምፒውተር ግን የቃኚ-ማስታወሻ እንዳይሠራ ተደርጓል። እባክዎ እንዲሠራ ያድርጉና እንደገና ይሞክሩ።', 'noname' => 'የተወሰነው ብዕር ስም ትክክለኛ አይደለም።', 'loginsuccesstitle' => 'መግባትዎ ተከናወነ!', 'loginsuccess' => 'እንደ «$1» ሆነው አሁን {{SITENAME}}ን ገብተዋል።', 'nosuchuser' => '«$1» የሚል ብዕር ስም አልተገኘም። አጻጻፉን ይመልከቱ ወይም አዲስ ብዕር ስም ያውጡ።', 'nosuchusershort' => '«$1» የሚል ብዕር ስም አልተገኘም። አጻጻፉን ይመልከቱ።', 'nouserspecified' => 'አንድ ብዕር ስም መጠቆም ያስፈልጋል።', 'login-userblocked' => 'ተጠቃሚው አሁን የታገደ ነው። መግባት አልተፈቀደም።', 'wrongpassword' => 'የተሰጠው መግቢያ ቃል ልክ አልነበረም። ዳግመኛ ይሞክሩ።', 'wrongpasswordempty' => 'ምንም መግቢያ ቃል አልተሰጠም። ዳግመኛ ይሞክሩ።', 'passwordtooshort' => 'የመረጡት መግቢያ ቃል ልክ አይሆንም። ቢያንስ $1 ፊደላትና ከብዕር ስምዎ የተለየ መሆን አለበት።', 'password-name-match' => 'መግቢያ ቃልዎ እና የአባል ስምዎ መለያየት አስፈላጊ ነው።', 'password-login-forbidden' => 'ይህ አባል ስምና መግቢያ ቃል መጥቀም የተከለከለ ነው።', 'mailmypassword' => 'አዲስ የይለፍቃል በኢሜሌ ይላክልኝ።', 'passwordremindertitle' => 'አዲስ ግዜያዊ መግቢያ ቃል (PASSWORD) ለ{{SITENAME}}', 'passwordremindertext' => 'አንድ ሰው (ከቁጥር አድራሻ #$1 ሆኖ እርስዎ ይሆናሉ) አዲስ መግቢያ ቃል ለ{{SITENAME}} ጠይቋል ($4). ለ«$2» ይሆነው መግቢያ ቃል አሁን «$3» ነው። አሁን በዚህ መግቢያ ቃል ገብተው ወደ አዲስ መግቢያ ቃል መቀየር ይሻሎታል። ይህ ጥያቄ የእርስዎ ካልሆነ፣ ወይም መግቢያ ቃልዎን ያስታወሱ እንደ ሆነ፣ ይህንን መልእክት ቸል ማለት ይችላሉ። የቆየው መግቢያ ቃል ከዚህ በኋላ ተግባራዊ ሆኖ ይቀጥላል።', 'noemail' => 'ለብዕር ስም «$1» የተመዘገበ ኢ-ሜል የለም።', 'noemailcreate' => 'ትክክለኛ ኢ-ሜል ማቅረብ ያስፈልጋል።', 'passwordsent' => 'አዲስ መግቢያ ቃል ለ«$1» ወደ ተመዘገበው ኢ-ሜል ተልኳል። እባክዎ ከተቀበሉት በኋላ ዳግመኛ ይግቡ።', 'blocked-mailpassword' => 'የርስዎ ቁጥር አድራሻ ከማዘጋጀት ታግዷልና፣ እንግዲህ ተንኮል ለመከልከል የመግቢያ ቃል ማግኘት ዘዴ ለመጠቀም አይፈቀደም።', 'eauthentsent' => 'የማረጋገጫ ኢ-ሜል ወዳቀረቡት አድራሻ ተልኳል። ያው አድራሻ በውነት የርስዎ እንደሆነ ለማረጋገጥ፣ እባክዎ በዚያ ደብዳቤ ውስጥ የተጻፈውን መያያዣ ይጫኑ። ከዚያ ቀጥሎ ኢ-ሜል ከሌሎች ተጠቃሚዎች መቀበል ይችላሉ።', 'throttled-mailpassword' => 'የመግቢያ ቃል ማስታወሻ ገና አሁን ባለፉት $1 ሰዓቶች ተልኳል። ተንኮልን ለመከልከል፣ በየ$1 ሰዓቶቹ አንድ የመግቢያ ቃል ማስታወሻ ብቻ ይላካል።', 'mailerror' => 'ኢ-ሜልን የመላክ ስኅተት፦ $1', 'acct_creation_throttle_hit' => 'ይቅርታ! $1 ብዕር ስሞች ከዚህ በፊት ፈጥረዋል። ከዚያ በላይ ለመፍጠር አይችሉም።', 'emailauthenticated' => 'የርስዎ ኢ-ሜል አድራሻ በ$1 ተረጋገጠ።', 'emailnotauthenticated' => 'ያቀረቡት አድራሻ ገና አልተረጋገጠምና ከሌሎች ተጠቃሚዎች ኢሜል መቀበል አይችሉም።', 'noemailprefs' => '(በ{{SITENAME}} በኩል ኢሜል ለመቀበል፣ የራስዎን አድራሻ አስቀድመው ማቅረብ ያስፈልጋል።)', 'emailconfirmlink' => 'አድራሻዎን ለማረጋገጥ', 'invalidemailaddress' => 'ያው ኢ-ሜል አድራሻ ትክክለኛ አይመስልምና ልንቀበለው አይቻልም። እባክዎ ትክክለኛ አድራሻ ያስግቡ ወይም አለዚያ ጥያቄው ባዶ ይሁን።', 'cannotchangeemail' => 'በዚሁ ዊኪ ላይ፣ የተሠጠውን ኢ-ሜል አድራሻ ለመቀይር አይቻልም።', 'emaildisabled' => 'በዚሁ ድረገጽ ኢ-ሜል መላክ አልተቻለም።', 'accountcreated' => 'ብዕር ስም ተፈጠረ', 'accountcreatedtext' => 'ለ$1 ብዕር ስም ተፈጥሯል።', 'createaccount-title' => 'ለ{{SITENAME}} የብዕር ስም መፍጠር', 'createaccount-text' => 'አንድ ሰው ለኢሜል አድራሻዎ {{SITENAME}} ($4) «$2» የተባለውን ብዕር ስም በመግቢያ ቃል «$3» ፈጥሯል። አሁን ገብተው የመግቢያ ቃልዎን መቀየር ይቫልዎታል። ይህ ብዕር ስም በስህተት ከተፈጠረ፣ ይህን መልእክት ቸል ማለት ይችላሉ።', 'login-throttled' => 'በዚሁ አባል ስም በጥቂት ግዜ ውስጥ ከመጠን በላይ ሙከራዎች አድርገዋል። እባክዎ እንደገና ሳይሞክሩ ለጥቂት ደቂቃ ይቆዩ።', 'login-abort-generic' => 'መግባትዎ አልተከናወነም፤ ተሠርዟል።', 'loginlanguagelabel' => 'ቋምቋ፦ $1', # Email sending 'user-mail-no-addy' => 'እሚደርስበት ኢ-ሜል አድራሻ ሳይታወቅ መላክ አይቻልም።', # Change password dialog 'resetpass' => 'የአባል መግቢያ ቃል ለመቀየር', 'resetpass_announce' => 'በኢ-ሜል በተላከ ጊዜያዊ ኮድ ገብተዋል። መግባትዎን ለመጨርስ፣ አዲስ መግቢያ ቃል እዚህ መምረጥ አለብዎ።', 'resetpass_header' => 'መግቢያ ቃል ለመቀየር', 'oldpassword' => 'የአሁኑ መግቢያ ቃልዎ', 'newpassword' => 'አዲስ መግቢያ ቃል', 'retypenew' => 'አዲስ መግቢያ ቃል ዳግመኛ', 'resetpass_submit' => 'መግቢያ ቃል ለመቀየርና ለመግባት', 'resetpass_success' => 'የመግቢያ ቃልዎ መቀየሩ ተከናወነ! አሁን መግባት ይደረግልዎታል......', 'resetpass_forbidden' => 'በ{{SITENAME}} የመግቢያ ቃል መቀየር አይቻልም።', 'resetpass-no-info' => 'ይህንን ገጽ በቀጥታ ለማግኘት አስቀድሞ መግባት ያስፈልጋል።', 'resetpass-submit-loggedin' => 'ቃልዎ ይቀየር', 'resetpass-submit-cancel' => 'ይቅር', 'resetpass-wrong-oldpass' => 'ጊዜያዊው ወይም ያሁኑኑ መግቢያ ቃል አይስማማም። ምናልባት መግቢያ ቃልዎን መቀይሩ ተከናወነ፣ ወይም አዲስ ጊዜያዊ መግቢያ ቃልን ጠየቁ።', 'resetpass-temp-password' => 'ኅላፊ (ጊዜያዊ) መግቢያ ቃል፦', # Special:PasswordReset 'passwordreset' => 'መግቢያ ቃል መቀይር', 'passwordreset-legend' => 'መግቢያ ቃልዎን ለመቀይር', 'passwordreset-disabled' => 'በዚሁ ዊኪ መግቢያ ቃል መቀይር አልተቻለም', 'passwordreset-username' => 'የብዕር ስም:', 'passwordreset-email' => 'የኢ-ሜል አድራሻ:', 'passwordreset-emailelement' => 'የአባል ስም፦ $1 ጊዜያዊ መግቢያ ቃል፦ $2', 'passwordreset-emailsent' => 'የማስታወሻ ኢ-ሜል ተልኳል።', 'passwordreset-emailsent-capture' => 'የማስታወሻ ኢ-ሜል ተልኳል፤ ከዚህም ታች ይታያል።', 'passwordreset-emailerror-capture' => 'የማስታወሻ ኢ-ሜል ተልኳል፤ ከዚህም ታች ይታያል፤ ነገር ግን ወደ ተጠቃሚው ለመላክ ስንል አልተከናወነም፡', # 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' => 'የንዑስ-ክፍል አርዕስት ለመፍጠር', 'nowiki_sample' => 'በዚህ ውስጥ የሚከተት ሁሉ የዊኪ-ሥርአተ ቋንቋን ቸል ይላል', 'nowiki_tip' => 'የዊኪ-ሥርአተ ቋንቋን ቸል ለማድረግ', 'image_tip' => 'የስዕል መያያዣ ለመፍጠር', 'media_tip' => 'የድምጽ ፋይል መያያዣ ለመፍጠር', 'sig_tip' => 'ፊርማዎ ከነሰዓቱ (4x ~)', 'hr_tip' => "አድማሳዊ መስመር (በ'----') ለመፍጠር", # Edit pages 'summary' => 'ማጠቃለያ:', 'subject' => 'ጥቅል ርዕስ:', 'minoredit' => 'ይህ ለውጥ ጥቃቅን ነው።', 'watchthis' => 'ይህንን ገጽ ለመከታተል', 'savearticle' => 'ገጹን አስቀምጥ', 'preview' => 'ሙከራ / preview', 'showpreview' => 'ቅድመ እይታ', 'showlivepreview' => 'የቀጥታ ቅድመ-ዕይታ', 'showdiff' => 'ማነጻጸሪያ', 'anoneditwarning' => "'''ማስጠንቀቂያ:''' እርስዎ አሁን በአባል ስምዎ ያልገቡ ነዎት። ይህን ገፅ ማዘጋጀት፣ ማረምና ማስተካከል ይችላሉ፤ ነገር ግን ያደረጉት ለውጥ በአባልነት ስምዎ ሳይሆን በድህረ ገፅ የመለያ ቁጥር አድራሻዎ (IP address) በገፁ የለውጥ ታሪክ ላይ ይመዘገባሉ።", 'anonpreviewwarning' => 'እርስዎ ገና ያልገቡ ነዎት። ይህን ገፅ በማቅረብ የመለያ ቁጥር አድራሻዎ (IP address) በገፁ የለውጥ ታሪክ ላይ ይመዘገባል።', 'missingsummary' => "'''ማስታወሻ፦''' ማጠቃለያ ገና አላቀረቡም። እንደገና «ገጹን ለማቅረብ» ቢጫኑ፣ ያለ ማጠቃለያ ይላካል።", 'missingcommenttext' => 'እባክዎ አስተያየት ከዚህ በታች ያስግቡ።', 'missingcommentheader' => "'''ማስታወሻ፦''' ለዚሁ አስተያየት ምንም አርእስት አላቀረቡም። 'ለማቅረብ' እንደገና ቢጫኑ ለውጥዎ ያለ አርዕስት ይሆናል።", 'summary-preview' => 'የማጠቃለያ ቅድመ እይታ:', 'subject-preview' => 'የአርእስት ቅድመ-ዕይታ', 'blockedtitle' => 'አባል ተከለክሏል', 'blockedtext' => "'''የርስዎ ብዕር ስም ወይም ቁጥር አድራሻ ከማዘጋጀት ተከለክሏል።''' በእርስዎ ላይ ማገጃ የጣለው መጋቢ $1 ነበረ። ምክንያቱም፦ ''$2'' * ማገጃ የጀመረበት ግዜ፦ $8 * ማገጃ የሚያልቅበት ግዜ፦ $6 * የታገደው ተጠቃሚ፦ $7 $1ን ወይም ማንም ሌላ [[{{MediaWiki:Grouppage-sysop}}|መጋቢ]] ስለ ማገጃ ለመጠይቅ ይችላሉ። ነገር ግን በ[[Special:Preferences|ምርጫዎችዎ]] ትክክለኛ ኢሜል ካልኖረ ከጥቅሙም ካልተከለከሉ በቀር ለሰው ኢሜል ለመላክ አይችሉም። የአሁኑኑ ቁጥር አድራሻዎ $3 ህኖ የማገጃው ቁጥር #$5 ነው። ምንም ጥያቄ ካለዎ ይህን ቁጥር ይጨምሩ።", 'autoblockedtext' => "የእርስዎ ቁጥር አድራሻ በቀጥታ ታግዷል። በ$1 የተገደ ተጠቃሚ ስለ ተጠቀመ ነው። የተሰጠው ምክንያት እንዲህ ነው፦ :''$2'' * ማገጃ የጀመረበት፦ $8 * ማገጃ ያለቀበት፦ $6 ስለ ማገጃው ለመወያየት፣ $1 ወይም ማንምን ሌላ [[{{MediaWiki:Grouppage-sysop}}|መጋቢ]] መጠይቅ ይችላሉ። በ[[Special:Preferences|ምርጫዎችዎ]] ትክክለኛ ኢ-ሜል አድራሻ ካልሰጡ፣ ወይም ከጥቅሙ ከታገዱ፣ ወደ ሌላ ሰው ኢ-ሜል መላክ እንዳልተቻለዎ ያስታውሱ። የማገጃዎ ቁጥር # $5 ነው። እባክዎ በማንኛውም ጥያቄ ይህን ቁጥር ይሰጡ።", 'blockednoreason' => 'ምንም ምክንያት አልተሰጠም', 'whitelistedittext' => 'ገጾችን ለማዘጋጀት $1 አስቀድሞ ያስፈልግዎታል።', 'confirmedittext' => 'ገጽ ማዘጋጀት ሳይችሉ፣ አስቀድመው የኢ-ሜል አድራሻዎን ማረጋገጥ አለብዎት። እባክዎ፣ በ[[Special:Preferences|ምርጫዎችዎ]] በኩል ኢ-ሜል አድራሻዎን ያረጋግጡ።', 'nosuchsectiontitle' => 'የማይኖር ክፍል', 'nosuchsectiontext' => 'የማይኖር ክፍል ለማዘጋጀት ሞክረዋል።', 'loginreqtitle' => 'መግባት ያስፈልጋል።', 'loginreqlink' => 'መግባት', 'loginreqpagetext' => 'ሌሎች ገጾች ለመመልከት $1 ያስፈልግዎታል።', 'accmailtitle' => 'የመግቢያ ቃል ተላከ።', 'accmailtext' => 'የመግቢያ ቃል ለ«$1» ወደ $2 ተልኳል።', 'newarticle' => '(አዲስ)', 'newarticletext' => 'እርስዎ የተከተሉት መያያዣ እስካሁን ወደማይኖር ገጽ የሚወስድ ነው። ገጹን አሁን ለመፍጠር፣ ከታች በሚገኘው ሳጥን ውስጥ መተየብ ይጀምሩ። ለተጨማሪ መረጃ፣ [[{{MediaWiki:Helppage}}|የእርዳታ ገጽን]] ይመልከቱ። ወደዚህ በስሕተት ከሆነ የመጡት፣ የቃኝውን «Back» ቁልፍ ይጫኑ።', 'anontalkpagetext' => "----''ይኸው ገጽ ገና ያልገባ ወይም ብዕር ስም የሌለው ተጠቃሚ ውይይት ገጽ ነው። መታወቂያው በ[[ቁጥር አድራሻ]] እንዲሆን ያስፈልጋል። አንዳንዴ ግን አንድ የቁጥር አድራሻ በሁለት ወይም በብዙ ተጠቃሚዎች የጋራ ሊሆን ይችላል። ስለዚህ ለርስዎ የማይገባ ውይይት እንዳይደርስልዎ፣ [[Special:UserLogin|«መግቢያ»]] በመጫን የብዕር ስም ለማውጣት ይችላሉ።''", 'noarticletext' => 'በአሁኑ ወቅት በዚህ ገጽ ላይ ጽሑፍ የለም፤ ነገር ግን በሌሎች ገጾች ላይ [[Special:Search/{{PAGENAME}}|ይህን አርዕስት መፈለግ]]፣ <span class="plainlinks">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} ከርዕሱ ጋር የተዛመዱ መዝገቦችን መፈልግ]፣ ወይም [{{fullurl:{{FULLPAGENAME}}|action=edit}} አዲስ ገፅ ሊያዘጋጁ] ይችላሉ</span>።', 'noarticletext-nopermission' => 'በአሁኑ ወቅት በዚህ ገጽ ላይ ጽሑፍ የለም፤ በሌሎች ገጾች ላይ [[Special:Search/{{PAGENAME}}|ይህን አርዕስት መፈለግ]]፣ <span class="plainlinks">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} ከርዕሱ ጋር የተዛመዱ መዝገቦችን መፈልግ]፣ ይችላሉ። ነገር ግን ይህን ገጽ ለመፍጠር ፈቃድ የለዎም።።', 'userpage-userdoesnotexist' => 'የብዕር ስም «<nowiki>$1</nowiki>» አልተመዘገበም። እባክዎ ይህን ገጽ ለመፍጠር/ ለማስተካከል የፈለጉ እንደ ሆነ ያረጋግጡ።', 'userpage-userdoesnotexist-view' => 'የአባል ስም «$1» ገና አልተመዘገበም።', 'blocked-notice-logextract' => 'ይህ ተጠቃሚ $1 አሁን የታገደ ነው። ከዚህ ታች የማገጃ መዝገብ መጨረሻ ድርጊት ይታያል።', 'usercssyoucanpreview' => "'''ምክር፦''' ሳይቆጠብ አዲስ CSSዎን ለመሞከር 'ቅድመ እይታ' የሚለውን ይጫኑ።", 'userjsyoucanpreview' => "'''ምክር፦''' ሳይቆጠብ አዲስ JSዎን ለመሞከር 'ቅድመ እይታ' የሚለውን ይጫኑ።", 'usercsspreview' => "'''ማስታወሻ፦ CSS-ዎን ለሙከራ ብቻ እያዩ ነው፤ ገና አልተቆጠበም!'''", 'userjspreview' => "'''ማስታወሻ፦ JavaScriptዎን ለሙከራ ብቻ እያዩ ነው፤ ገና አልተቆጠበም!'''", 'sitecsspreview' => "'''ማስታወሻ፦ CSSዎን ለሙከራ ብቻ እያዩ ነው፤ ገና አልተቆጠበም!'''", 'sitejspreview' => "'''ማስታወሻ፦ JavaScriptዎን ለሙከራ ብቻ እያዩ ነው፤ ገና አልተቆጠበም!'''", 'userinvalidcssjstitle' => "'''ማስጠንቀቂያ፦''' «$1» የሚባል መልክ የለም። ልዩ .css እና .js ገጾች በትንንሽ እንግሊዝኛ ፊደል መጀመር እንዳለባቸው ያስታውሱ። ለምሳሌ፦ {{ns:user}}:Foo/vector.css ልክ ነው እንጂ {{ns:user}}:Foo/Vector.css አይደለም።", 'updated' => '(የታደሰ)', 'note' => "'''ማሳሰቢያ፦'''", 'previewnote' => "ማስታወቂያ፦ '''ይህ ለሙከራው ብቻ ነው የሚታየው -- ምንም ለውጦች ገና አልተላኩም!'''", 'previewconflict' => 'ለማስቀምጥ የመረጡ እንደ ሆነ እንደሚታይ፣ ይህ ቅድመ-ዕይታ በላይኛ ጽሕፈት ማዘጋጀት ክፍል ያለውን ጽሕፈት ያንጸባርቃል።', 'session_fail_preview' => "'''ይቅርታ! ገጹን ለማቅረብ ስንሂድ፣ አንድ ትንሽ ችግር በመረቡ መረጃ ውስጥ ድንገት ገብቶበታል። እባክዎ፣ እንደገና ገጹን ለማቅረብ አንዴ ይሞክሩ። ከዚያ ገና ካልሠራ፣ ምናልባት ከአባል ስምዎ መውጣትና እንደገና መግባት ይሞክሩ።'''", 'editing' => '«$1» ማዘጋጀት / ማስተካከል', 'creating' => '$1ን መፍጠር', 'editingsection' => '«$1» (ክፍል) ማዘጋጀት / ማስተካከል', 'editingcomment' => '$1 ማዘጋጀት (ውይይት መጨመር)', 'editconflict' => 'ተቃራኒ ለውጥ፦ $1', 'explainconflict' => "ይህን ገጽ ለማዘጋጀት ከጀመሩ በኋላ የሌላ ሰው ለውጥ ገብቷል። ላይኛው ጽሕፈት የአሁኑ እትም ያሳያል፤ የርስዎም እትም ከዚያ በታች ይገኛል። ለውጦችዎን በአሁኑ ጽሕፈት ውስጥ ማዋሐድ ይኖርብዎታል። ገጹንም ባቀረቡበት ግዜ በላይኛው ክፍል ያለው ጽሕፈት '''ብቻ''' ይቀርባል።", 'yourtext' => 'የእርስዎ እትም', 'storedversion' => 'የተቆጠበው እትም', 'editingold' => "'''ማስጠንቀቂያ፦ ይህ እትም የአሁኑ አይደለም፣ ከዚህ ሁናቴ ታድሷል። ይህንን እንዳቀረቡ ከዚህ እትም በኋላ የተቀየረው ለውጥ ሁሉ ያልፋል።'''", 'yourdiff' => 'ልዩነቶች', 'copyrightwarning' => 'ልብ በሉ ለ {{SITENAME}} ያደረጉት ሁሉም ተሳትፎዎች በ $2 ስር የተለቀቁ እና እሱንም ታሳቢ ያደረጉ መሆናችውን ያገናዝቡ (ለተጨማሪ መረጃ $1 ይመልከቱ) ምናልባት ስገቡትን የፅሁፍ አስተዋጽኦ በሌሎች ተጠቃሚዎች እንዲታረም፣ እንዲለወጥ ወይም እንዲባዛና እንዲሰራጭ ካልወደዱ እባክዎን ወደዚህ አይላኩት። <br /> በተጨማሪም የሚያስገቡት ፅሁፍ በራስዎ የተፃፈ፣ ከሌሎች ነፃ እና የህዝብ ድህረ ገፆች የተገለበጡ ወይም ቀድቶ ማባዛትን ከፈቀዱ እና ነፃ ከሆኑ ምንጮች የተገለበጡ መሆናቸውን ቃል ይግቡልን። "ካለ ባሌቤቱ ፍቃድ ምንም አይነት ነገር አያስገቡ!"', 'copyrightwarning2' => "ወደ {{SITENAME}} የሚላከው አስተዋጽኦ ሁሉ በሌሎች ተጠቃሚዎች ሊታረም፣ ሊለወጥ፣ ወይም ሊጠፋ እንደሚቻል ያስታውሱ። ጽሕፈትዎ እንዲታረም ካልወደዱ፣ ወደዚህ አይልኩት።<br /> ደግሞ ይህ የራስዎ ጽሕፈት ወይም ከነጻ ምንጭ የተቀዳ ጽሕፈት መሁኑን ያረጋግጣሉ። (ለዝርዝር $1 ይዩ)። '''አለፈቃድ፡ መብቱ የተጠበቀውን ሥራ አይልኩት!'''", 'longpageerror' => "'''ስህተት፦ ያቀረቡት ጽሕፈት $1 kb ነው፤ ይህም ከተፈቀደው ወሰን $2 kb በላይ ነው። ሊቆጠብ አይችልም።'''", 'readonlywarning' => ":'''ማስታወቂያ፦''' {{SITENAME}} አሁን ለአጭር ግዜ ተቆልፎ ገጹን ለማቅረብ አይቻልም። ጥቂት ደቂቃ ቆይተው እባክዎ እንደገና ይሞክሩት! :(The database has been temporarily locked for maintenance, so you cannot save your edits at this time. You may wish to cut-&-paste the text into another file, and try again in a moment or two.)", 'protectedpagewarning' => "'''ማስጠንቀቂያ፦ ይህ ገጽ ከመጋቢ በስተቀር በማንም እንዳይለወጥ ተቆልፏል።'''", 'semiprotectedpagewarning' => "'''ማስታወቂያ፦''' ይኸው ገጽ ከቋሚ አዛጋጆች በተቀር በማንም እንዳይለወጥ ተቆልፏል።", 'cascadeprotectedwarning' => "'''ማስጠንቀቂያ፦''' ይህ ገጽ በመጋቢ ብቻ እንዲታረም ተቆልፏል። ምክንያቱም {{PLURAL:$1|በሚከተለው በውስጡ የሚያቆልፍ ገጽ|በሚከተሉ በውስጡ ይሚያቆልፉ ገጾች}} ውስጥ ይገኛል።", 'titleprotectedwarning' => "'''ማስጠንቀቂያ፦ ይህ ገጽ አንዳንድ ተጠቃሚ ብቻ ሊፈጠር እንዲችል ተቆልፏል።'''", 'templatesused' => '{{PLURAL:$1|ምሳሌዎች|ምሳሌዎች}} used on this page:', 'templatesusedpreview' => 'ለዚህ ገፅ የሚሆኑ {{PLURAL:$1|ምሳሌ|ምሳሌዎች}} :', 'templatesusedsection' => 'በዚሁ ክፍል የተጠቀሙት መለጠፊያዎች፦', 'template-protected' => '(የተቆለፈ)', 'template-semiprotected' => '(በከፊል የተቆለፈ)', 'hiddencategories' => 'ይህ ገጽ በ{{PLURAL:$1|1 የተደበቀ መደብ|$1 የተደበቁ መድቦች}} ውስጥ ይገኛል።', 'nocreatetitle' => 'የገጽ መፍጠር ተወሰነ', 'nocreatetext' => '{{SITENAME}} አዳዲስ ገጾችን ለመፍጠር ያሚያስችል ሁኔታ ከለክሏል። ተመልሰው የቆየውን ገጽ ማዘጋጀት ይችላሉ፤ አለዚያ [[Special:UserLogin|በብዕር ስም መግባት]] ይችላሉ።', 'nocreate-loggedin' => 'አዲስ ገጽ በ{{SITENAME}} ለመፍጠር ፈቃድ የለዎም።', 'permissionserrors' => 'የፈቃድ ስሕተቶች', 'permissionserrorstext' => 'ያ አድራጎት አይቻልም - {{PLURAL:$1|ምክንያቱም|ምክንያቶቹም}}፦', 'permissionserrorstext-withaction' => '$2 አልተፈቀዱም፤ {{PLURAL:$1|ምክንያቱም|ምክንያቱም}}:', 'recreate-moveddeleted-warn' => ":<strong>'''ማስጠንቀቂያ፦ ይኸው አርእስት ከዚህ በፊት የጠፋ ገጽ ነው!'''</strong> *እባክዎ፥ ገጹ እንደገና እንዲፈጠር የሚገባ መሆኑን ያረጋግጡ። *የገጹ መጥፋት ዝርዝር ከዚህ ታች ይታያል።", 'moveddeleted-notice' => 'ይኸው ገጽ ከዚህ በፊት የጠፋ ነው። የገጹ መጥፋት ዝርዝር ከዚህ ታች ይታያል።', 'log-fulllog' => 'ሙሉ መዝገቡን ለማየት', 'edit-hook-aborted' => 'ለውጡ በሜንጦ ተቋረጠ። ምንም ምክንያት አልሰጠም።', 'edit-gone-missing' => 'ገጹን ማሳደስ አልተቻለም። እንደ ጠፋ ይመስላል።', 'edit-conflict' => 'ተቃራኒ ለውጥ።', 'edit-no-change' => 'በጽሕፈቱ አንዳችም አልተለወጠምና ለውጥዎ ቸል ተብሏል።', 'edit-already-exists' => 'አዲስ ገጽ ለመፍጠር አልተቻለም፤ ገና ይኖራልና።', 'defaultmessagetext' => 'የቆየው ጽሕፈት', # "Undo" feature 'undo-success' => "ያ ለውጥ በቀጥታ ሊገለበጥ ይቻላል። እባክዎ ከታች ያለውን ማነጻጸርያ ተመልክተው ይህ እንደሚፈልጉ ያረጋግጡና ለውጡ እንዲገለበጥ '''ገጹን ለማቅረብ''' ይጫኑ።", 'undo-failure' => 'ከዚሁ ለውጥ በኋላ ቅራኔ ለውጦች ስለ ገቡ ሊገለበጥ አይቻልም።', 'undo-norev' => 'ለውጡ አይኖርም ወይም ጠፍቷልና ሊገለበጥ አልተቻለም።', 'undo-summary' => 'አንድ ለውጥ $1 ከ[[Special:Contributions/$2|$2]] ([[User talk:$2|ውይይት]]) ገለበጠ', # Account creation failure 'cantcreateaccounttitle' => 'ብዕር ስም ለመፍጠር አይቻልም', 'cantcreateaccount-text' => "ከዚሁ የቁጥር አድራሻ ('''$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' => "ከ2 እትሞች መካከል ልዩነቶቹን ለመናበብ፦ በ2 ክብ ነገሮች ውስጥ ምልክት አድርገው «የተመረጡትን እትሞች ለማነፃፀር» የሚለውን ተጭነው የዛኔ በቀጥታ ይሄዳሉ።<br /> መግለጫ፦ (ከአሁን) - ከአሁኑ እትም ያለው ልዩነት፤ (ካለፈው) - ቀጥሎ ከቀደመው እትም ያለው ልዩነት፤<br /> «'''ጥ'''» ማለት ጥቃቅን ለውጥ ነው።", 'history-fieldset-title' => 'የቀደሙት ዕትሞች ፍለጋ', 'histfirst' => 'ቀድመኞች', 'histlast' => 'ኋለኞች', 'historysize' => '($1 byte)', '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-delundel' => 'ይታይ/ይደበቅ', 'rev-showdeleted' => 'አሳይ', 'revdelete-nooldid-title' => 'የማይሆን ግብ እትም', 'revdelete-nooldid-text' => 'ይህ ተግባር የሚፈጸምበት ግብ (አላማ) እትም አልወሰኑም።', 'revdelete-nologtype-title' => 'ምንም የመዝገብ አይነት አልተሠጠም።', 'revdelete-no-file' => 'የተወሰነው ፋይል አይኖርም።', 'revdelete-show-file-submit' => 'አዎን', 'revdelete-selected' => "'''ከ [[:$1]] {{PLURAL:$2|የተመረጡ ዝርያዎች|የተመረጡ ዝርያዎች}}:'''", 'logdelete-selected' => "'''{{PLURAL:$1|የተመረጠ መዝገብ ድርጊት|የተመረጡ መዝገብ ድርጊቶች}}፦'''", 'revdelete-hide-text' => 'የእትሙ ጽሕፈት ይደበቅ', 'revdelete-hide-image' => 'የፋይሉ ይዞታ ይደበቅ', 'revdelete-hide-name' => 'ድርጊትና ግቡ ይደበቅ', 'revdelete-hide-comment' => 'ማጠቃለያ ይደበቅ', 'revdelete-hide-user' => 'የአዘጋጁ ብዕር ስም ወይም ቁ. አድርሻ ይደበቅ', 'revdelete-radio-same' => '(እንደ በፊቱ ይቆይ)', 'revdelete-radio-set' => 'አዎ', 'revdelete-radio-unset' => 'አይ', 'revdelete-suppress' => 'መረጃ ከመጋቢዎችና ከሌሎች ይደበቅ።', 'revdelete-log' => 'ምክንያቱ፦', 'revdelete-submit' => 'በተመረጠው ዕትም ይደረግ', 'revdel-restore' => 'እይታን ለማስተካከል', 'revdel-restore-deleted' => 'የጠፉት ለውጦች', 'revdel-restore-visible' => 'ሊታይ የሚችሉ ለውጦች', 'pagehist' => 'የገጽ ታሪክ', 'deletedhist' => 'የጠፉት ዕትሞች ታሪክ', 'revdelete-otherreason' => 'ሌላ/ተጨማሪ ምክንያት፦', 'revdelete-reasonotherlist' => 'ሌላ ምክንያት', 'revdelete-edit-reasonlist' => "'ተራ የማጥፋት ምክንያቶች' ለማስተካከል", 'revdelete-offender' => 'የለውጡ አቅራቢ፦', # Suppression log 'suppressionlog' => 'የመከልከል መዝገብ', # History merging 'mergehistory' => 'የገጽ ታሪኮች ለመዋሐድ', 'mergehistory-box' => 'የሁለት ገጾች እትሞች ለማዋሐድ፦', 'mergehistory-from' => 'መነሻው ገጽ፦', 'mergehistory-into' => 'መድረሻው ገጽ፦', 'mergehistory-list' => 'መዋሐድ የሚችሉ እትሞች ታሪክ', 'mergehistory-go' => 'መዋሐድ የሚችሉ እትሞች ይታዩ', 'mergehistory-submit' => 'እትሞቹን ለማዋሐድ', 'mergehistory-empty' => 'ምንም ዕትም ማዋሐድ አይቻልም።', 'mergehistory-success' => 'ከ[[:$1]] $3 {{PLURAL:$3|እትም|እትሞች}} ወደ [[:$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' => 'የተመረጡትን እትሞች ለማነፃፀር', 'editundo' => 'ለውጡ ይገለበጥ', 'diff-multi' => '(ከነዚህ 2 እትሞች መካከል {{PLURAL:$1|አንድ ለውጥ ነበር|$1 ለውጦች ነበሩ}}።)', # Search results 'searchresults' => 'የፍለጋ ውጤቶች', 'searchresults-title' => 'ለ"$1" የፍለጋ ውጤቶች', 'searchresulttext' => 'በተጨማሪ ስለ ፍለጋዎች ለመረዳት፣ [[{{MediaWiki:Helppage}}]] ያንብቡ።', 'searchsubtitle' => 'እየፈለግህ/ሽ ያለሀው/ሽው \'\'\'[[:$1]]\'\'\' ([[Special:Prefixindex/$1|all pages starting with "$1"]]{{int:pipe-separator}}[[Special:WhatLinksHere/$1|all ከሱጋር የተያያዙ በሙላ "$1"]])', 'searchsubtitleinvalid' => "ለ'''$1''' ፈለጉ", 'toomanymatches' => 'ከመጠን በላይ ያሉ ስምምነቶች ተመለሱ፤ እባክዎ ሌላ ጥያቄ ይሞክሩ።', 'titlematches' => 'የሚስማሙ አርዕስቶች', 'notitlematches' => 'የሚስማሙ አርዕስቶች የሉም', 'textmatches' => 'ጽሕፈት የሚስማማባቸው ገጾች', 'notextmatches' => 'ጽሕፈት የሚስማማባቸው ገጾች የሉም', 'prevn' => 'ፊተኛ {{PLURAL:$1|$1}}', 'nextn' => 'ቀጥሎ {{PLURAL:$1|$1}}', 'prevn-title' => 'ፊተኛ $1 {{PLURAL:$1|ውጤት|ውጤቶች}}', 'nextn-title' => '{{PLURAL:$1|የሚቀጥለው|የሚቀጥሉ}} $1 {{PLURAL:$1|ውጤት|ውጤቶች}}', 'shown-title' => '$1 {{PLURAL:$1|ውጤት|ውጤቶች}} በየገጹ {{PLURAL:$1|ይታይ|ይታዩ}}', 'viewprevnext' => 'በቁጥር ለማየት፡ ($1 {{int:pipe-separator}} $2) ($3).', 'searchmenu-legend' => 'የፍለጋ ምርጫዎች', 'searchmenu-exists' => "'''\"[[:\$1]]\" የሚባል መጣጥፍ በዚሁ ዊኪ ላይ አለ።'''", 'searchmenu-new' => "'''\"[[:\$1]]\" የሚባል መጣጥፍ ይፈጠር?'''", 'searchhelp-url' => 'Help:ይዞታ', '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 ({{PLURAL:$2|1 ቃል|$2 ቃላት}})', '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' => 'የተዛመደ', 'searcheverything-enable' => 'በክፍለ-ዊኪዎች ሁሉ ለመፈለግ', 'searchrelated' => 'የተዛመደ', 'searchall' => 'ሁሉ', 'showingresults' => 'ከ ቁ.#<b>$2</b> ጀምሮ እስከ <b>$1</b> ውጤቶች ድረስ ከዚህ በታች ይታያሉ።', 'showingresultsnum' => "ከ#'''$2''' ጀምሮ {{PLURAL:$3|'''1''' ውጤት|'''$3''' ውጤቶች}} ከዚህ ታች ማየት ይቻላል።", 'nonefound' => "\"ማስገንዘቢያ\" የተወሰኑ ፍለጋዎች ብቻ በዋናው ስምምነት መሰረት ተፈልገው ይገኛሉ:: ከምትፈልገው ነገር በፊት ''all:''ን በማስገባት ፍለጋህን ደግመህ ሞክር ይህም ሁሉንም የፍለጋ ቦታዎች እንድታዳርስ ይረዳሃል።", 'search-nonefound' => 'ለጥያቄው ምንም የሚስማማ ውጤት አልተገኘም።', 'powersearch' => 'ፍለጋ', 'powersearch-legend' => 'ተጨማሪ ፍለጋ', 'powersearch-ns' => 'በነዚሁ ክፍለ-ዊኪዎች ይፈልግ:', 'powersearch-redir' => 'መምሪያ መንገዶቹም ይዘርዝሩ', 'powersearch-field' => 'ለዚሁ ጽሕፈት ይፈልግ፦', 'powersearch-toggleall' => ' ሁሉም', 'powersearch-togglenone' => ' ምንም', 'search-external' => 'አፍአዊ ፍለጋ', 'searchdisabled' => '{{SITENAME}} ፍለጋ አሁን እንዳይሠራ ተደርጓል። ለጊዜው ግን በGoogle ላይ መፈልግ ይችላሉ። የ{{SITENAME}} ይዞታ ማውጫ በዚያ እንዳልታደሰ ማቻሉ ያስታውሱ።', # Quickbar 'qbsettings-none' => ' ምንም', 'qbsettings-fixedleft' => 'በግራ የተለጠፈ', 'qbsettings-fixedright' => 'በቀኝ የተለጠፈ', 'qbsettings-floatingleft' => 'በግራ ተንሳፋፊ', 'qbsettings-floatingright' => 'በቀኝ ተንሳፋፊ', # Preferences page 'preferences' => 'ምርጫዎች፤', 'mypreferences' => 'ምርጫዎች፤', 'prefs-edits' => 'የለውጦች ቁጥር:', 'prefsnologin' => 'ገና አልገቡም', 'prefsnologintext' => 'ምርጫዎችዎን ለማስተካከል አስቀድሞ <span class="plainlinks">[{{fullurl:{{#Special:UserLogin}}|returnto=$1}} መግባት]</span> ያስፈልግዎታል።', 'changepassword' => 'መግቢያ ቃልዎን ለመቀየር', 'prefs-skin' => 'የድህረ-ገጽ መልክ', 'skin-preview' => 'ቅድመ-ዕይታ', 'datedefault' => 'ግድ የለኝም', 'prefs-datetime' => 'ዘመንና ሰዓት', 'prefs-user-pages' => 'የአባል ገጾች', 'prefs-personal' => 'ያባል ዶሴ', 'prefs-rc' => 'የቅርቡ ለውጦች ዝርዝር', 'prefs-watchlist' => 'የሚከታተሉ ገጾች', 'prefs-watchlist-days' => 'በሚከታተሉት ገጾች ዝርዝር ስንት ቀን ይታይ፤', 'prefs-watchlist-days-max' => 'Maximum $1 {{PLURAL:$1|day|days}}', 'prefs-watchlist-edits' => 'በተደረጁት ዝርዝር ስንት ለውጥ ይታይ፤', 'prefs-watchlist-edits-max' => '(ከ1,000 ለውጥ በላይ አይሆንም)', 'prefs-misc' => 'ልዩ ልዩ ምርጫዎች', 'prefs-resetpass' => 'መግቢያ ቃል ለመቀየር', 'prefs-changeemail' => 'ኢ-ሜል አድራሻዎን ለመቀይር', 'prefs-email' => 'የኢ-ሜል ምርጫዎች', 'prefs-rendering' => ' አቀራረብ', 'saveprefs' => 'ይቆጠብ', 'resetprefs' => 'እንደ በፊቱ ይታደስ', 'prefs-editing' => 'የማዘጋጀት ምርጫዎች', 'prefs-edit-boxsize' => 'ይህ የማዘጋጀት ሳጥን ስፋት ለመወሰን ነው።', 'rows' => 'በማዘጋጀቱ ሰንጠረዥ ስንት ተርታዎች?', 'columns' => 'ስንት ዓምዶችስ?', 'searchresultshead' => 'ፍለጋ', 'resultsperpage' => 'ስንት ውጤቶች በየገጹ?', 'recentchangesdays' => 'በቅርቡ ለውጦች ዝርዝር ስንት ቀን ይታይ?', 'recentchangesdays-max' => '(እስከ $1 {{PLURAL:$1|ቀን|ቀን}} ድረስ)', 'recentchangescount' => 'በዝርዝርዎ ላይ ስንት ለውጥ ይታይ? (እስከ 500)', 'savedprefs' => 'ምርጫዎችህ ተቆጥበዋል።', 'timezonelegend' => 'የሰዓት ክልል', 'localtime' => 'የክልሉ ሰዓት (Local time)', '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' => 'ልዩ ጃቫ ስክሪፕት', 'prefs-emailconfirm-label' => 'የኢ-ሜል ማረጋገጫ', 'prefs-textboxsize' => 'የማዘጋጀት መስኮት መጠን', 'youremail' => 'ኢ-ሜል *', 'username' => 'የብዕር ስም:', 'uid' => 'የገባበት ቁ.: #', 'prefs-memberingroups' => 'ተጠቃሚው {{PLURAL:$1|ያለበት ስብስባ|ያለባቸው ስብስባዎች}}፦', 'prefs-registration' => 'የተመዘገበበት ሰዓት፦', 'yourrealname' => 'ዕውነተኛ ስም፦', 'yourlanguage' => 'ቋንቋ', 'yourvariant' => 'የቋንቋው ቀበሌኛ፦', 'yournick' => 'ቁልምጫ ስም (ለፊርማ)', 'badsig' => 'ትክክለኛ ያልሆነ ጥሬ ፊርማ፤ HTML ተመልከት።', 'badsiglength' => 'ያ ቁልምጫ ስም ከመጠን በላይ ይረዝማል፤ ከ$1 ፊደል በታች መሆን አለበት።', 'yourgender' => 'ሥርዓተ ጾታ', 'gender-unknown' => ' አታምር', 'gender-male' => 'ወንድ', 'gender-female' => ' ሴት', 'email' => 'ኢ-ሜል', 'prefs-help-realname' => 'ዕውነተኛ ስምዎን መግለጽ አስፈላጊነት አይደለም። ለመግለጽ ከመረጡ ለሥራዎ ደራሲነቱን ለማስታወቅ ይጠቅማል።', 'prefs-help-email' => 'ኢሜል አድራሻን ማቅረብዎ አስፈላጊ አይደለም። ቢያቅርቡት ሌሎች አባላት አድራሻውን ሳያውቁ በፕሮግራሙ አማካኝነት ሊገናኙዎት ተቻለ።', 'prefs-help-email-required' => 'የኢ-ሜል አድራሻ ያስፈልጋል።', 'prefs-info' => ' መሰረታዊ መረጃ', 'prefs-signature' => 'ፊርማ', 'prefs-dateformat' => ' የቀን ቅርፀት', 'prefs-advancedediting' => 'የተደረጁ ምርጫዎች', 'prefs-advancedrc' => 'የተደረጁ ምርጫዎች', 'prefs-advancedrendering' => 'የተደረጁ ምርጫዎች', 'prefs-advancedsearchoptions' => 'የተደረጁ ምርጫዎች', 'prefs-advancedwatchlist' => 'የተደረጁ ምርጫዎች', 'prefs-displayrc' => 'የማሳያ አማራጮች', 'prefs-diffs' => 'ልዩነቶች', # User preference: email validation using jQuery 'email-address-validity-valid' => 'ኢ-ሜል አድራሻ ትክክለኛ ይመስላል።', 'email-address-validity-invalid' => 'ትክክለኛ ኢ-ሜል ማቅረብ ያስፈልጋል።', # User rights 'userrights' => 'የአባል መብቶች ለማስተዳደር', 'userrights-lookup-user' => 'የ1 አባል ማዕረግ ለማስተዳደር', 'userrights-user-editname' => 'ለዚሁ ብዕር ስም፦', 'editusergroup' => 'የአባሉ ማዕረግ ለማስተካከል', 'editinguser' => "ይህ ማመልከቻ ለብዕር ስም '''[[User:$1|$1]]''' ([[User talk:$1|{{int:talkpagelinktext}}]]{{int:pipe-separator}}[[Special:Contributions/$1|{{int:contribslink}}]]) መብቶቹን ለመቀየር ነው።", 'userrights-editusergroup' => 'የአባሉ ማዕረግ ለማስተካከል', 'saveusergroups' => 'ለውጦቹ ይቆጠቡ', 'userrights-groupsmember' => 'አሁን ያሉባቸው ማዕረጎች፦', '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' => 'BOTS', 'group-sysop' => 'መጋቢ', 'group-bureaucrat' => 'አስተዳዳሪዎች', 'group-all' => '(ሁሉ)', 'group-user-member' => '{{GENDER:$1|ተጠቃሚ}}', 'group-autoconfirmed-member' => 'የተረጋገጠ ተጠቃሚ', 'group-bot-member' => 'BOT', 'group-sysop-member' => 'መጋቢ', 'group-bureaucrat-member' => 'አስተዳዳሪ', 'grouppage-user' => '{{ns:project}}:ተጠቃሚዎች', 'grouppage-autoconfirmed' => '{{ns:project}}:የተረጋገጡ ተጠቃሚዎች', 'grouppage-bot' => '{{ns:project}}:BOTS', 'grouppage-sysop' => '{{ns:project}}:መጋቢዎች', 'grouppage-bureaucrat' => '{{ns:project}}:አስተዳዳሪዎች', # Rights 'right-read' => 'ገጾችን ለማንበብ', 'right-edit' => 'ገጾችን ለማዘጋጀት', 'right-createpage' => 'ገጾች ለመፍጠር (ውይይት ገጾች ያልሆኑትን)', 'right-createtalk' => 'የውይይት ገጽ ለመፍጠር', 'right-createaccount' => 'አዳዲስ አባልነቶችን ለመፍጠር', 'right-minoredit' => 'ለውጦችን ጥቃቅን ሆኖ ለማመልከት', 'right-move' => 'ገጾችን ለማዛወር', 'right-move-subpages' => 'ገጾችን ከነንዑስ ገጾቻቸው ለማዛወር', 'right-movefile' => 'ፋይሎችን ለማዛወር', 'right-upload' => 'ፋይሎችን ለመላክ', 'right-autoconfirmed' => 'በከፊል የተቆለፉት ገጾች ለማረም', 'right-delete' => 'ገጾችን ለማጥፋት', 'right-bigdelete' => 'ትልቅ የእትም ታሪክ ያላቸውን ገጾች ለማጥፋት', 'right-deleterevision' => 'በገጾች የተወሰኑትን እትሞች ለማጥፋትና ለመመልስ', 'right-browsearchive' => 'የጠፉትን ገጾች ለመፈለግ', 'right-undelete' => 'የጠፋውን ገጽ ለመመልስ', 'right-suppressrevision' => 'ከመጋቢዎቹ የተደበቁትን እትሞች አይቶ ለመመልስ', 'right-suppressionlog' => 'የግል መዝገቦች ለማየት', 'right-block' => 'ተጠቃሚዎችን ከማዘጋጀት ለማገድ', 'right-blockemail' => 'ተጠቃሚ ኢ-ሜል ከመላክ ለመከልከል', 'right-protect' => 'የመቆለፍ ደረጃ ለመቀይርና የተቆለፉትን ገጾች ለማረም', 'right-rollback' => 'አንድ ገጽ መጨረሻ የለወጠውን ተጠቃሚ ለውጦች በፍጥነት rollback ለማድረግ', 'right-markbotedits' => 'rollback ሲደረግ እንደ bot ለማመልከት', 'right-import' => 'ከሌላ ዊኪ ገጾችን ለማስገባት', 'right-patrol' => 'የሰው ለውጦች የተሣለፉ ሆነው ለማመልከት', 'right-autopatrol' => 'የራሱ ለውጦች በቀጥታ የተሣለፉ ሆነው መመልከት', 'right-mergehistory' => 'የገጾች እትሞችን ታሪክ ለመዋሐድ', 'right-userrights' => 'ያባላት ሁሉ መብቶች ለማስተካከል', 'right-sendemail' => 'ወደ ሌላ አባል ኢ-ሜል ለመላክ', # User rights log 'rightslog' => 'የአባል መብቶች መዝገብ', 'rightslogtext' => 'ይህ መዝገብ የአባል መብቶች ሲለወጡ ይዘረዝራል።', 'rightslogentry' => 'የ$1 ማዕረግ ከ$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-movefile' => 'ይህን ፋይል ለማዛወር', 'action-upload' => 'ይህንን ፋይል ለመላክ', 'action-delete' => 'ይህን ገጽ ለማጥፋት', 'action-deleterevision' => 'ይህን እትም ለማጥፋት', 'action-deletedhistory' => 'ለዚሁ ገጽ የጠፉትን ዕትሞች ታሪክ ለማየት', 'action-browsearchive' => 'የጠፉትን ገጾች ለመፈለግ', 'action-undelete' => 'ይህንን ገጽ ለመመልስ', 'action-suppressrevision' => 'ይህን የተደበቅ ዕትም አይተው ለመመልስ', 'action-suppressionlog' => 'ይህንን የግል መዝገብ ለማየት', 'action-block' => 'ይህንን ተጠቃሚ ከማዘጋጀት ለማገድ', 'action-protect' => 'ለዚሁ ገጽ የመቆለፍ ደረጃ ለመቀይር', 'action-import' => 'ይህን ገጽ ከሌላ ዊኪ ለማስገባት', 'action-patrol' => 'የሰው ለውጦች የተሣለፉ ሆነው ለማመልከት', 'action-autopatrol' => 'የራስዎ ለውጥ የተሣለፈ ሆኖ መመልከት', 'action-mergehistory' => 'የዚሁን ገጽ ዕትሞች ታሪክ ለማዋሐድ', 'action-userrights' => 'ያባላት ሁሉ መብቶች ለማስተካከል', 'action-sendemail' => 'ኢ-ሜል መላክ', # Recent changes 'nchanges' => '$1 {{PLURAL:$1|ለውጥ|ለውጦች}}', 'recentchanges' => 'በቅርብ ጊዜ የተለወጡ', 'recentchanges-legend' => 'የቅርብ ለውጥ አማራጮች፦', 'recentchanges-summary' => 'በዚሁ ገጽ ላይ በቅርብ ጊዜ የወጡ አዳዲስ ለውጦች ለመከታተል ይችላሉ።', 'recentchanges-feed-description' => 'በዚህ ዊኪ ላይ በቅርብ ግዜ የተለወጠውን በዚሁ feed መከታተል ይችላሉ', 'recentchanges-label-newpage' => 'ይኸው ለውጥ አዲስ ገጽ ፈጠረ።', 'recentchanges-label-minor' => 'ይህ ለውጥ ጥቃቅን ነው።', 'recentchanges-label-bot' => 'ይኸው ለውጥ በሎሌ ተደረገ።', 'rcnote' => "ከ$5 $4 እ.ኤ.አ. {{PLURAL:$2|ባለፈው 1 ቀን|ባለፉት '''$2''' ቀኖች}} {{PLURAL:$1|የተደረገው '''1''' ለውጥ እታች ይገኛል|የተደረጉት '''$1''' መጨረሻ ለውጦች እታች ይገኛሉ}}።", 'rcnotefrom' => "ከ'''$2''' ጀምሮ የተቀየሩት ገጾች (እስከ '''$1''' ድረስ) ክዚህ በታች ይታያሉ።", 'rclistfrom' => '(ከ $1 ጀምሮ አዲስ ለውጦቹን ለማየት)', 'rcshowhideminor' => 'ጥቃቅን ለውጦች $1', 'rcshowhidebots' => 'bots $1', 'rcshowhideliu' => 'ያባላት ለውጦች $1', 'rcshowhideanons' => 'የቁ. አድራሻ ለውጦች $1', 'rcshowhidepatr' => 'የተቆጣጠሩ ለውጦች $1', 'rcshowhidemine' => 'የኔ $1', 'rclinks' => 'ባለፉት $2 ቀን ውስጥ የወጡት መጨረሻ $1 ለውጦች ይታዩ።<br />($3)', 'diff' => 'ለውጡ', 'hist' => 'ታሪክ', 'hide' => 'ይደበቁ', 'show' => 'ይታዩ', 'minoreditletter' => 'ጥ', 'newpageletter' => 'አ', 'boteditletter' => 'B', 'number_of_watching_users_pageview' => '[$1 የሚከታተሉ {{PLURAL:$1|ተጠቃሚ|ተጠቃሚዎች}}]', 'rc_categories_any' => 'ማንኛውም', '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' => "ከዚሁ ገጽ የተያየዙት ሌሎች ጽሑፎች ቅርብ ለውጦች ከታች ይዘረዝራሉ። በሚከታተሉት ገጾች መካከል ያሉት ሁሉ በ'''ጉልህ ፊደላት''' ይታያሉ።", 'recentchangeslinked-page' => 'አርዕስት፡', 'recentchangeslinked-to' => '(ወዲህ በተያያዙት መጣጥፎች ላይ)', # Upload 'upload' => 'ፋይል / ሥዕል ለመላክ', 'uploadbtn' => 'ፋይሉ ይላክ', 'reuploaddesc' => 'ለመሰረዝና ወደ መላኪያ ማመልከቻ ለመመለስ', 'uploadnologin' => 'ገና አልገቡም', 'uploadnologintext' => 'ፋይል ለመላክ አስቀድሞ [[Special:UserLogin|መግባት]] ያስፈልግዎታል።', 'uploaderror' => 'የመላክ ስሕተት', 'uploadtext' => "በዚህ ማመልከቻ ላይ ፋይል ለመላክ ይችላሉ። ቀድሞ የተላኩት ስዕሎች [[Special:FileList|በፋይል / ሥዕሎች ዝርዝር]] ናቸው፤ ከዚህ በላይ የሚጨመረው ፋይል ሁሉ [[Special:Log/upload|በፋይሎች መዝገብ]] ይዘረዝራሉ። ስዕልዎ በጽሑፍ እንዲታይ '''<nowiki>[[</nowiki>{{ns:file}}<nowiki>:Filename.jpg]]</nowiki>''' ወይም '''<nowiki>[[</nowiki>{{ns:file}}<nowiki>:Filename.png|thumb|ሌላ ጽሑፍ]]</nowiki>''' በሚመስል መልክ ይጠቅሙ።", '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-badmime' => 'የMIME አይነት «$1» ፋይሎች ሊላኩ አይፈቀዱም።', 'filetype-bad-ie-mime' => 'ይህን ፋይል መላክ አይቻልም፤ Internet Explorer እንደ $1 ይመስለው ነበርና ይህ የማይፈቅድ አደገኛ የፋይል አይነት ነው።', 'filetype-unwanted-type' => "'''\".\$1\"''' ያልተፈለገ ፋይል አይነት ነው። የተመረጡት ፋይል አይነቶች \$2 ናቸው።", 'filetype-banned-type' => "'''«.$1»''' ያልተፈቀደ ፋይል አይነት ነው። የተፈቀዱት ፋይል አይነቶች $2 ናቸው።", 'filetype-missing' => 'ፋይሉ ምንም ቅጥያ (ለምሳሌ «.jpg») የለውም።', 'empty-file' => 'የላኩት ፋይል ባዶ ነበር።', 'file-too-large' => 'ያቀረቡት ፋይል ከተፈቀደው መጠን በላይ ነው።', 'filename-tooshort' => 'የፋይሉ ስም ከተፈቀደው አጭር ነው።', 'filetype-banned' => 'ይህ አይነት ፋይል አልተፈቀደም።', 'verification-error' => 'ይሄው ፋይል የፋይልን ማረጋገጫ አላለፈም።', 'illegal-filename' => 'የፋይሉ ስም የተፈቀደ አይደለም።', 'overwrite' => 'እንድን ፋይል ደምስሶ መጻፍ አልተፈቀደም።', 'unknown-error' => 'ያልታወቀ ስኅተት ደረሰ።', 'tmp-create-error' => 'ጊዜያዊ ፋይልን መፍጠር አልተቻለም።', 'tmp-write-error' => 'ጊዜያዊ ፋይልን በመጻፍ ስኅተት ደረሰ።', 'large-file' => 'የፋይል መጠን ከ$1 በላይ እንዳይሆን ይመከራል፤ የዚህ ፋይል መጠን $2 ነው።', 'largefileserver' => 'ይህ ፋይል ሰርቨሩ ከሚችለው መጠን በላይ ነው።', 'emptyfile' => 'የላኩት ፋይል ባዶ እንደ ሆነ ይመስላል። ይህ ምናልባት በፋይሉ ስም አንድ ግድፋት ስላለ ይሆናል። እባክዎ ይህን ፋይል በውኑ መላክ እንደ ፈለጉ ያረጋግጡ።', 'fileexists' => 'ይህ ስም ያለው ፋይል አሁን ይኖራል፤ እባክዎ እሱም ለመቀየር እንደፈለጉ እርግጥኛ ካልሆኑ <strong>[[:$1]]</strong> ይመለከቱ። [[$1|thumb]]', 'filepageexists' => 'የዚሁ ፋኡል መግለጫ ገጽ ከዚህ በፊት በ<strong>[[:$1]]</strong> ተፈጥሯል፤ ነገር ግን ይህ ስም ያለበት ፋይል አሁን አይኖርም። ስለዚህ ያቀረቡት ማጠቃለያ በመግለጫው ገጽ አይታይም። መግለጫዎ በዚያ እንዲታይ በእጅ ማስገባት ይኖርብዎታል።', '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' => 'ፋይል መላክ አይቻልም', 'uploaddisabledtext' => 'ፋይል መላክ በዚህ ዊኪ አይቻልም።', 'uploadvirus' => 'ፋይሉ ቫይረስ አለበት! ዝርዝር፦ $1', 'upload-source' => 'መነሻ ፋይል', 'sourcefilename' => 'የቆየው የፋይሉ ስም፦', 'destfilename' => 'የፋይሉ አዲስ ስም፦', 'upload-maxfilesize' => 'የፋይል ግዙፍነት ውሳኔ፦ $1', 'upload-description' => 'የፋይሉ መግለጫ', 'upload-options' => 'የመላክ ምርጫዎች', 'watchthisupload' => 'ይህንን ገጽ ለመከታተል', 'filewasdeleted' => 'በዚሁ ስም ያለው ፋይል ከዚህ በፊት ተልኮ እንደገና ጠፍቷል። ዳግመኛ ሳይልኩት $1 ማመልከት ያሻላል።', 'filename-bad-prefix' => "የሚልኩት ፋይል ስም በ'''«$1»''' ይጀመራል፤ ይህ ብዙ ጊዜ በቁጥራዊ ካሜራ የተወሰነ ገላጭ ያልሆነ ስም ይሆናል። እባክዎ ለፋይልዎ ገላጭ የሆነ ስም ይምረጡ።", 'upload-success-subj' => 'መላኩ ተከናወነ', 'upload-failure-subj' => 'የመላክ ችግር', 'upload-failure-msg' => 'ከ [$2] ለመላክ ስትል አንድ ችግር ደረሰ፤ $1', 'upload-warning-subj' => 'የመላክ ማስጠንቀቂያ ምልክት', 'upload-proto-error' => 'ትክክለኛ ያልሆነ ወግ (protocol)', 'upload-proto-error-text' => 'የሩቅ መላክ እንዲቻል URL በ<code>http://</code> ወይም በ<code>ftp://</code> መጀመር አለበት።', 'upload-file-error' => 'የውስጥ ስህተት', 'upload-misc-error' => 'ያልታወቀ የመላክ ስህተት', 'upload-misc-error-text' => 'በተላከበት ጊዜ ያልታወቀ ስህተት ተነሣ። እባክዎ URL ትክክለኛና የሚገኝ መሆኑን አረጋግጠው እንደገና ይሞክሩ። ችግሩ ቢቀጠል፣ መጋቢን ይጠይቁ።', 'upload-unknown-size' => 'ያልታወቀ መጠን', # File backend 'backend-fail-notexists' => '$1 የሚለው ፋይል አይኖርም።', 'backend-fail-delete' => 'ፋይሉን «$1» ለማጥፋት አልተቻለም።', 'backend-fail-alreadyexists' => '«$1» የሚባል ፋይል አሁን ይኖራል።', '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» ለመጻፍ አልተቻለም።', # img_auth script messages 'img-auth-nofile' => '«$1» የሚባል ፋይል አይኖርም።', # 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 ሊገኝ አልቻለም። እባክዎ URL ልክ መሆኑንና አሁን መኖሩን ያረጋግጡ።', 'upload-curl-error28' => 'የመላክ ጊዜ አልቋል', 'upload-curl-error28-text' => ' ድረ-ገጹ እንዲገኝ ከመጠን በላይ ረጅም ሰዓት ፈጀ። እባክዎ ድረ-ገጹ መኖሩን ያረጋግጡና እንደገና ሳይሞክሩ ትንሽ ይቆዩ። ምናልባትም በሌላ ጊዜ ትራፊኩ ይቀነሳል።', 'license' => 'የፈቃድ አይነት፦', 'license-header' => 'የፈቃድ አይነት፦', 'nolicense' => 'ምንም አልተመረጠም', 'license-nopreview' => '(ቅድመ-ዕይታ አይገኝም)', 'upload_source_url' => ' (ትክክለኛ፣ በግልጽ የሚገኝ URL)', 'upload_source_file' => ' (በኮምፒውተርዎ ላይ ያለበት ፋይል)', # Special:ListFiles 'listfiles_search_for' => 'ለMedia ፋይል ስም ፍለጋ፦', 'imgfile' => 'ፋይሉ', 'listfiles' => 'የፋይል / ሥዕሎች ዝርዝር', 'listfiles_thumb' => 'ናሙና', 'listfiles_date' => 'ቀን እ.ኤ.አ', 'listfiles_name' => 'የፋይል ስም', 'listfiles_user' => 'አቅራቢው', 'listfiles_size' => 'መጠን (byte)', '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' => 'ክልሉ (በpixel)', 'filehist-filesize' => 'መጠን', 'filehist-comment' => 'ማጠቃለያ', 'imagelinks' => 'ፋይል መያያዣዎች', 'linkstoimage' => '{{PLURAL:$1|የሚከተለው ገጽ ወደዚሁ ፋይል ተያይዟል|የሚከተሉ $1 ገጾች ወደዚሁ ፋይል ተያይዘዋል}}፦', 'nolinkstoimage' => 'ወዲህ ፋይል የተያያዘ ገጽ የለም።', 'morelinkstoimage' => 'ለዚህ ፋይል [[Special:WhatLinksHere/$1|ተጨማሪ መያያዣዎችን]] ለማየት።', 'duplicatesoffile' => '{{PLURAL:$1|የሚከተለው ፋይል የዚህ ፋይል ቅጂ ነው|የሚከተሉት $1 ፋይሎች የዚሁ ፋይል ቅጂዎች ናቸው}}፦', 'sharedupload' => 'ይህ ፋይል ከጋራ ምንጭ ($1) የተቀሰመ ነው። በማንኛውም ዊኪ ላይ ሊጠቅም ይቻላል።', 'filepage-nofile' => 'እንዲህ የሚባል ፋይል አይኖርም።', 'filepage-nofile-link' => 'እንዲህ የሚባል ፋይል አይኖርም፤ እርስዎ ግን [$1 እሱን መላክ] ይችላሉ።', 'uploadnewversion-linktext' => 'ለዚሁ ፋይል አዲስ ዕትም ለመላክ', 'shared-repo-from' => 'ከ $1', # File reversion 'filerevert' => '$1 ማገልበጥ', 'filerevert-legend' => 'ፋይል ማገልበጥ', 'filerevert-comment' => 'ማጠቃለያ፦', 'filerevert-defaultcomment' => 'በ$2፣ $1 ወደ ነበረው ዕትም መለሰው', 'filerevert-submit' => 'ማገልበጥ', 'filerevert-success' => "'''[[Media:$1|$1]]''' [በ$3፣ $2 ወደ ነበረው $4 እትም] ተመልሷል።", # File deletion 'filedelete' => '$1 ለማጥፋት', 'filedelete-legend' => 'ፋይልን ለማጥፋት', 'filedelete-intro' => "'''[[Media:$1|$1]]''' ሊያጥፉ ነው።", 'filedelete-intro-old' => "በ[$4 $3፣ $2] እ.ኤ.አ. የነበረው የ'''[[Media:$1|$1]]''' እትም ሊያጥፉ ነው።", 'filedelete-comment' => 'ምክንያቱ፦', 'filedelete-submit' => 'ይጥፋ', 'filedelete-success' => "'''$1''' ጠፍቷል።", 'filedelete-success-old' => '<span class="plainlinks">በ$3፣ $2 የነበረው የ\'\'\'[[Media:$1|$1]]\'\'\' ዕትም ጠፍቷል።</span>', 'filedelete-nofile' => "'''$1''' በ{{SITENAME}} የለም።", 'filedelete-otherreason' => 'ሌላ / ተጨማሪ ምክንያት፦', 'filedelete-reason-otherlist' => 'ሌላ ምክንያት', 'filedelete-reason-dropdown' => '*ተራ የማጥፋት ምክንያቶች ** የማብዛት ፈቃድ አለመኖር ** የተዳገመ ፋይል ቅጂ', 'filedelete-edit-reasonlist' => "'ተራ የማጥፋት ምክንያቶች' ለማስተካከል", # MIME search 'mimesearch' => 'የMIME ፍለጋ', 'mimetype' => 'የMIME አይነት፦', 'download' => 'አውርድ', # Unwatched pages 'unwatchedpages' => 'ያልተከታተሉ ገጾች', # List redirects 'listredirects' => 'መምሪያ መንገዶች ሁሉ', # Unused templates 'unusedtemplates' => 'ያልተለጠፉ መለጠፊያዎች', 'unusedtemplatestext' => 'በ{{ns:template}} ክፍለ-ዊኪ ያሉት መለጠፊያዎች በአንዳችም ገጽ ላይ ካልተለጠፉ፣ በዚህ ገጽ ይዘረዝራሉ። መጋቢዎች ሳያጥፉዋቸው ግን ወደነሱ ሌላ መያያዣ አለመኖሩን ያረጋግጡ።', 'unusedtemplateswlh' => 'ሌሎች መያያዣዎች', # Random page 'randompage' => 'ማናቸውንም ለማየት', 'randompage-nopages' => 'በዚህ ክፍለ-ዊኪ ምንም ገጽ የለም።', # Random redirect 'randomredirect' => 'ማናቸውም መምሪያ መንገድ', 'randomredirect-nopages' => 'በዚህ ክፍለ-ዊኪ ምንም መምሪያ መንገድ የለም።', # Statistics 'statistics' => 'የዚሁ ሥራ እቅድ ዝርዝር ቁጥሮች', 'statistics-header-pages' => 'የገጽ ዝርዝር ቁጥሮች', 'statistics-header-edits' => 'የለውጥ ዝርዝር ቁጥሮች', 'statistics-header-users' => 'ያባላት ዝርዝር ቁጥሮች', 'statistics-articles' => 'መያያዣ ያላቸው መጣጥፎች', 'statistics-pages' => 'ገጾች በሙሉ', 'statistics-pages-desc' => 'በዊኪ ላይ ያሉት ገጾች ሁሉ - ከነውይይት፣ መምሪያ መንገድ ወዘተ.', 'statistics-files' => 'የተላኩት ፋይሎች', 'statistics-edits' => '{{SITENAME}} ከተጀመረ አንሥቶ የተደረጉት ለውጦች', 'statistics-users' => 'አባልነት የገቡ [[Special:ListUsers|ተጠቃሚዎች]]', 'statistics-users-active' => 'ተግባራዊ ተጠቃሚዎች', 'statistics-users-active-desc' => 'ባለፈው {{PLURAL:$1|ቀን|$1 ቀን}} ማንኛውንም ድርጊት የሠሩት ተጠቃሚዎች', 'statistics-mostpopular' => 'ከሁሉ የታዩት ገጾች', 'disambiguations' => 'ወደ መንታ መንገድ የሚያያይዝ', 'disambiguationspage' => 'Template:መንታ', 'disambiguations-text' => "የሚከተሉት ጽሑፎች ወደ '''መንታ መንገድ''' እየተያያዙ ነውና ብዙ ጊዜ እንዲህ ሳይሆን ወደሚገባው ርዕስ ቢወስዱ ይሻላል። <br /> መንታ መንገድ ማለት የመንታ መለጠፊያ ([[MediaWiki:Disambiguationspage]]) ሲኖርበት ነው።", 'doubleredirects' => 'ድርብ መምሪያ መንገዶች', 'doubleredirectstext' => 'ይህ ድርብ መምሪያ መንገዶች ይዘርዘራል። ድርብ መምሪያ መንገድ ካለ ወደ መጨረሻ መያያዣ እንዲሄድ ቢስተካከል ይሻላል።', 'double-redirect-fixed-move' => '[[$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|byte|bytes}}', 'ncategories' => '$1 {{PLURAL:$1|መደብ|መደቦች}}', 'nlinks' => '$1 መያያዣዎች', 'nmembers' => '$1 {{PLURAL:$1|መጣጥፍ|መጣጥፎች}}', 'nrevisions' => '$1 ለውጦች', 'nviews' => '$1 {{PLURAL:$1|ዕይታ|ዕይታዎች}}', 'nimagelinks' => 'በ$1 {{PLURAL:$1|ገጽ|ገጾች}} ላይ ይጠቀማል።', 'ntransclusions' => 'በ$1 {{PLURAL:$1|ገጽ|ገጾች}} ይጠቀማል።', 'specialpage-empty' => '(ይህ ገጽ ባዶ ነው።)', 'lonelypages' => 'ያልተያያዙ ፅሑፎች', 'lonelypagestext' => 'የሚቀጥሉት ገጾች በ{{SITENAME}} ውስጥ ከሚገኙ ሌሎች ገጾች ጋር አልተያያዙም።', 'uncategorizedpages' => 'ገና ያልተመደቡ ጽሑፎች', 'uncategorizedcategories' => 'ያልተመደቡ መደቦች (ንዑስ ያልሆኑ)', 'uncategorizedimages' => 'ያልተመደቡ ፋይሎች', 'uncategorizedtemplates' => 'ያልተመደቡ መለጠፊያዎች', 'unusedcategories' => 'ባዶ መደቦች', 'unusedimages' => 'ያልተያያዙ ፋይሎች', 'popularpages' => 'የሚወደዱ ገጾች', 'wantedcategories' => 'ቀይ መያያዣዎች የበዙላቸው መደቦች', 'wantedpages' => 'ቀይ መያያዣዎች የበዙላቸው አርእስቶች', 'wantedfiles' => 'የተፈለጉ ፋይሎች', 'wantedtemplates' => 'የተፈለጉ መለጠፊያዎች', 'mostlinked' => 'መያያዣዎች የበዙላቸው ገጾች', 'mostlinkedcategories' => 'መያያዣዎች የበዙላቸው መደቦች', 'mostlinkedtemplates' => 'መያያዣዎች የበዙላቸው መለጠፊያዎች', 'mostcategories' => 'መደቦች የበዙላቸው መጣጥፎች', 'mostimages' => 'መያያዣዎች የበዙላቸው ስዕሎች', 'mostrevisions' => 'ለውጦች የበዙላቸው መጣጥፎች', 'prefixindex' => 'ሁሉንም ገፆች ከነ ቅድም ቅጥያቸው', 'shortpages' => 'ጽሁፎች ካጭሩ ተደርድረው', 'longpages' => 'ጽሁፎች ከረጅሙ ተደርድረው', 'deadendpages' => 'መያያዣ የሌለባቸው ፅሑፎች', 'deadendpagestext' => 'የሚቀጥሉት ገጾች በ{{SITENAME}} ውስጥ ከሚገኙ ሌሎች ገጾች ጋር አያያይዙም።', 'protectedpages' => 'የተቆለፉ ገጾች', 'protectedpagestext' => 'የሚከተሉት ገጾች ከመዛወር ወይም ከመታረም ተቆልፈዋል።', 'protectedpagesempty' => 'በዚያ ግቤት የሚቆለፍ ገጽ አሁን የለም።', 'protectedtitles' => 'የተቆለፉ አርዕስቶች', 'protectedtitlestext' => 'የሚከተሉት አርዕስቶች ከመፈጠር ተጠብቀዋል።', 'protectedtitlesempty' => 'እንደዚህ አይነት አርእስት አሁን የሚቆለፍ ምንም የለም።', 'listusers' => 'አባላት', 'listusers-editsonly' => 'ለውጦች ያላቸው ተጠቃሚዎች ብቻ ይታዩ', 'usereditcount' => '$1 {{PLURAL:$1|ለውጥ|ለውጦች}}', 'usercreated' => 'በ$1 በ$2 {{GENDER:$3|ተፈጠረ|ተፈጠረች}}።', 'newpages' => 'አዳዲስ መጣጥፎች', 'newpages-username' => 'በአቅራቢው፦', 'ancientpages' => 'የቈዩ ፅሑፎች (በተለወጠበት ሰአት)', 'move' => 'ለማዛወር', 'movethispage' => 'ይህንን ገጽ ለማዛወር', 'unusedimagestext' => 'እነኚህ ፋይሎች ከ{{SITENAME}} አልተያያዙም። ሆኖም ሳያጥፏቸው ከ{{SITENAME}} ውጭ በቀጥታ ተያይዘው የሚገኙ ድረ-ገጾች መኖራቸው እንደሚቻል ይገንዝቡ።', 'unusedcategoriestext' => 'እነዚህ መደብ ገጾች ባዶ ናቸው። ምንም ጽሑፍ ወይም ግንኙነት የለባቸውም።', 'notargettitle' => 'ምንም ግብ የለም', 'notargettext' => 'ይህ ተግባር የሚፈጽምበት ምንም ግብ (አላማ) ገጽ ወይም አባል አልወሰኑም።', 'nopagetitle' => 'ያው ገጽ አይኖርም', 'nopagetext' => 'የወሰኑት መድረሻ አርእስት ሊገኝ አይችልም።', 'pager-newer-n' => '{{PLURAL:$1|ኋለኛ 1|ኋለኛ $1}}', 'pager-older-n' => '{{PLURAL:$1|ፊተኛ 1|ፊተኛ $1}}', # Book sources 'booksources' => 'የመጻሕፍት ቤቶችና ሸጪዎች', 'booksources-search-legend' => 'የመጽሐፍ ቦታ ፍለጋ', 'booksources-isbn' => 'የመጽሐፉ ISBN #:', 'booksources-go' => 'ይሂድ', 'booksources-text' => 'ከዚህ ታች ያሉት ውጭ መያያዦች መጻሕፍት ይሸጣሉ፤ ስለ ተፈለጉት መጻሕፍት ተጨማሪ መረጃ እዚያ እንደሚገኝ ይሆናል።', # Special:Log 'specialloguserlabel' => 'ብዕር ስም፡', 'speciallogtitlelabel' => 'አርዕስት፡', 'log' => 'Logs / መዝገቦች', 'all-logs-page' => 'All logs - መዝገቦች ሁሉ', 'alllogstext' => 'ይኸው መዝገብ ሁሉንም ያጠቅልላል። 1) የፋይሎች መዝገብ 2) የማጥፋት መዝገብ 3) የመቆለፍ መዝገብ 4) የማገድ መዝገብ 5) የመጋቢ አድራጎት መዝገቦች በያይነቱ ናቸው። ከሳጥኑ የተወሰነ መዝገብ አይነት መምረጥ ይችላሉ። ከዚያ ጭምር በብዕር ስም ወይም በገጽ ስም መፈለግ ይቻላል።', 'logempty' => '(በመዝገቡ ምንም የለም...)', 'log-title-wildcard' => 'ከዚህ ፊደል ጀምሮ አርዕስቶችን ለመፈልግ', # Special:AllPages 'allpages' => 'ገጾች ሁሉ በሙሉ', 'alphaindexline' => '$1 እስከ $2 ድረስ', 'nextpage' => 'የሚቀጥለው ገጽ (ከ$1 ጀምሮ)', 'prevpage' => 'ፊተኛው ገጽ (ከ$1 ጀምሮ)', 'allpagesfrom' => 'ገጾች ከዚሁ ፊደል ጀምሮ ይታዩ፦', 'allpagesto' => 'የሚጨርሱ ገፆችን በሙሉ አያየኝ፦ በ:', 'allarticles' => 'የመጣጥፎች ማውጫ በሙሉ፣', 'allinnamespace' => 'ገጾች ሁሉ (ክፍለ-ዊኪ፡$1)', 'allnotinnamespace' => 'ገጾች ሁሉ (በክፍለ-ዊኪ፡$1 ያልሆኑት)', 'allpagesprev' => 'ቀድመኛ', 'allpagesnext' => 'ቀጥሎ', 'allpagessubmit' => 'ይታይ', 'allpagesprefix' => 'በዚሁ ፊደል የጀመሩት ገጾች:', 'allpages-bad-ns' => 'በ{{SITENAME}} «$1» የሚባል ክፍለዊኪ የለም።', # SpecialCachedPage 'cachedspecial-refresh-now' => 'መጨረሻውን ለማየት', # Special:Categories 'categories' => 'ምድቦች', 'categoriespagetext' => 'በዚሁ ሥራ ዕቅድ ውስጥ የሚከተሉ መደቦች ይኖራሉ። [[Special:UnusedCategories|Unused categories]] are not shown here. Also see [[Special:WantedCategories|wanted categories]].', 'special-categories-sort-abc' => 'በፊደል ተራ ይደርደሩ', # Special:DeletedContributions 'deletedcontributions' => 'የአባሉ የጠፉት አስተዋጽኦች', 'deletedcontributions-title' => 'የአባሉ የጠፉት አስተዋጽኦች', 'sp-deletedcontributions-contribs' => 'አስተዋጽኦች', # Special:LinkSearch 'linksearch' => 'የውጭ ማያያዛዎች', 'linksearch-ns' => 'ክፍለ-ዊኪ፦', 'linksearch-ok' => 'ፍለጋ', 'linksearch-line' => '$1 ከ $2 ተያያዘ።', # Special:ListUsers 'listusersfrom' => 'ከዚሁ ፊደል ጀምሮ፦', 'listusers-submit' => 'ይታይ', 'listusers-noresult' => 'ማንም ተጠቃሚ አልተገኘም።', 'listusers-blocked' => '(ታግዷል)', # Special:ActiveUsers 'activeusers' => 'ተግባራዊ አባላት ዝርዝር', 'activeusers-intro' => 'እነዚህ አባላት ባለፈው $1 ቀን ውስጥ ማናቸውንም አይነት ተግባር ፈጸሙ።', 'activeusers-count' => '$1 {{PLURAL:$1|ለውጥ|ለውጦች}} ባለፈው $3 ቀን ውስጥ', 'activeusers-hidebots' => 'ሎሌዎች ይደበቁ', 'activeusers-hidesysops' => 'መጋቢዎች ይደበቁ', 'activeusers-noresult' => 'ማንም ተጠቃሚ አልተገኘም።', # Special:Log/newusers 'newuserlogpage' => 'የአባልነት መዝገብ (user log)', 'newuserlogpagetext' => 'ይህ መዝገብ ወደ አባልነት የገቡትን ብዕር ስሞች ይዘርዝራል።', # Special:ListGroupRights 'listgrouprights' => 'የተጠቃሚ ስብስባ መብቶች', 'listgrouprights-group' => 'ስብስባ', 'listgrouprights-rights' => 'መብቶች', 'listgrouprights-members' => '(የአባላት ዝርዝር)', # Email user 'mailnologin' => 'ምንም መነሻ አድራሻ የለም', 'mailnologintext' => 'ኢ-ሜል ወደ ሌላ አባል ለመላክ [[Special:UserLogin|መግባት]]ና በ[[Special:Preferences|ምርጫዎችዎ]] ትክክለኛ የኢሜል አድራሻዎ መኖር ያስፈልጋል።', 'emailuser' => 'ለዚህ/ች ሰው ኢሜል መላክ', 'emailuser-title-target' => '{{GENDER:$1|ለዚህ|ለዚች}} አባል ኢ-ሜል መላክ', 'emailuser-title-notarget' => 'ወደ አባል ኢ-ሜል ለመላክ', 'emailpage' => 'ወደዚህ/ች አባል ኢ-ሜል ለመላክ', 'emailpagetext' => 'አባሉ በሳቸው «ምርጫዎች» ክፍል ተግባራዊ ኢ-ሜል አድራሻ ያስገቡ እንደሆነ፣ ከታች ያለው ማመልከቻ አንድን ደብዳቤ በቀጥታ ይልካቸዋል። ተቀባዩም መልስ በቀጥታ ሊሰጡዎ እንዲችሉ፣ በእርስዎ «ምርጫዎች» ክፍል ያስገቡት ኢ-ሜል አድራሻ በደብዳቤዎ «From:» መስመር ይታይላቸዋል።', 'defemailsubject' => '{{SITENAME}} Email / ኢ-ሜል', 'usermaildisabledtext' => 'በዚሁ ዊኪ ኢ-ሜል ለአባላት መላክ አይችሉም።', 'noemailtitle' => 'ኢ-ሜል አይቻልም', 'noemailtext' => 'ለዚህ/ች አባል ኢ-ሜል መላክ አይቻልም። ወይም ተገቢ ኢ-ሜል አድራሻ የለንም፣ ወይም ከሰው ምንም ኢ-ሜል መቀበል አልወደደ/ችም።', 'nowikiemailtitle' => 'ምንም ኢ-ሜል አይፈቀድም።', 'nowikiemailtext' => 'ይህ አባል ከሌሎች ተጠቃሚዎች እ-ሜል ለመቀበል አልፈቀደም።', 'emailnotarget' => 'ያ ተቀባይ ስም አይኖርም ወይም ትክክል አይደለም።', 'emailtarget' => 'የተቀባይ አባል ስም ያስግቡ', 'emailusername' => 'የተጠቃሚ ሥም', 'emailusernamesubmit' => 'ለማቅረብ', 'email-legend' => 'ኢ-ሜል ወደ ሌላ የ{{SITENAME}} ተጠቃሚ ለመላክ', 'emailfrom' => 'ከ', 'emailto' => 'ለ', 'emailsubject' => 'ርዕሰ ጉዳይ:', 'emailmessage' => 'መልእክት:', 'emailsend' => 'ይላክ', 'emailccme' => 'አንድ ቅጂ ደግሞ ለራስዎ ኢ-ሜል ይላክ።', 'emailccsubject' => 'ወደ $1 የመልዕክትዎ ቅጂ፦ $2', 'emailsent' => 'ኢ-ሜል ተልኳል።', 'emailsenttext' => 'ኢ-ሜል መልዕክትዎ ተልኳል።', # Watchlist 'watchlist' => 'የምከታተላቸው ገጾች፤', 'mywatchlist' => 'የምከታተላቸው ገጾች፤', 'watchlistfor2' => 'ለ $1 $2', 'nowatchlist' => 'ዝርዝርዎ ባዶ ነው። ምንም ገጽ ገና አልተጨመረም።', 'watchlistanontext' => 'የሚከታተሉት ገጾች ዝርዝርዎን ለመመልከት ወይም ለማስተካከል እባክዎ $1።', 'watchnologin' => 'ገና አልገቡም', 'watchnologintext' => 'የሚከታተሏቸውን ገጾች ዝርዝር ለመቀየር [[Special:UserLogin|መግባት]] ይኖርብዎታል።', 'addedwatchtext' => "ገጹ «$1» [[Special:Watchlist|ለሚከታተሉት ገጾች]] ተጨምሯል። ወደፊት ይህ ገጽ ወይም የውይይቱ ገጽ ሲቀየር፣ በዚያ ዝርዝር ላይ ይታያል። በተጨማሪም [[Special:RecentChanges|«በቅርብ ጊዜ በተለወጡ» ገጾች]] ዝርዝር፣ በቀላሉ እንዲታይ በ'''ጉልህ ፊደላት''' ተጽፎ ይገኛል። በኋላ ጊዜ ገጹን ከሚከታተሉት ገጾች ለማስወግድ የፈለጉ እንደሆነ፣ በጫፉ ዳርቻ «አለመከታተል» የሚለውን ይጫኑ።", 'removedwatchtext' => 'ይህ ገፅ "[[:$1]]" ከ [[Special:Watchlist|your watchlist]] ተወግዷል።', 'watch' => 'ለመከታተል', 'watchthispage' => 'ይህንን ገጽ ለመከታተል', 'unwatch' => 'አለመከታተል', 'unwatchthispage' => 'መከታተል ይቅር', 'notanarticle' => 'መጣጥፍ አይደለም', 'notvisiblerev' => 'ዕትሙ ጠፍቷል', 'watchnochange' => 'ከተካከሉት ገጾች አንዳችም በተወሰነው ጊዜ ውስጥ አልተለወጠም።', 'watchlist-details' => 'አሁን {{PLURAL:$1|$1 ገፅ|$1 ገፆች}} በምትከታተላቸው ገፆች ላይ አሉ (የውይይት ገፅ ሳይጨመር)።', 'wlheader-enotif' => '* የ-ኢሜል ማስታወቂያ እንዲሠራ ተደርጓል።', 'wlheader-showupdated' => "* መጨረሻ ከጎበኟቸው ጀምሮ የተቀየሩት ገጾች በ'''ጉልህ ፊደላት''' ይታያሉ", 'watchmethod-recent' => 'የቅርብ ለውጦችን ለሚከታተሉት ገጾች በመፈለግ', 'watchmethod-list' => 'የሚከታተሉትን ገጾች ለቅርብ ለውጦች በመፈለግ', 'watchlistcontains' => 'አሁን በሙሉ $1 ገጾች እየተከታተሉ ነው።', 'wlnote' => 'ባለፉት <b>$2</b> ሰዓቶች የተደረጉት $1 መጨረሻ ለውጦች እታች ይገኛሉ።', 'wlshowlast' => 'ያለፉት $1 ሰዓት፤ $2 ቀን፤ $3 ይታዩ።', 'watchlist-options' => 'የዝርዝሩ ምርጫዎች', # Displayed when you click the "watch" button and it is in the process of watching 'watching' => 'እየተጨመረ ነው...', 'unwatching' => 'እየተወገደ ነው...', 'enotif_mailer' => 'የ{{SITENAME}} ኢሜል-ማስታወቂያ', 'enotif_reset' => 'ገጾች ሁሉ የተጎበኙ ሆነው ለማመልከት', 'enotif_newpagetext' => 'ይህ አዲስ ገጽ ነው።', 'enotif_impersonal_salutation' => '{{SITENAME}} ተጠቃሚ', 'changed' => 'ተለወጠ', 'created' => 'ተፈጠረ', 'enotif_subject' => 'የ{{SITENAME}} ገጽ $PAGETITLE በ$PAGEEDITOR $CHANGEDORCREATED', 'enotif_lastvisited' => 'መጨረሻ ከጎበኙ ጀምሮ ለውጦችን ሁሉ ለመመልከት $1 ይዩ።', 'enotif_lastdiff' => 'ይህን ለውጥ ለማመልከት $1 ይዩ።', 'enotif_anon_editor' => 'ቁጥር አድራሻ $1', 'enotif_body' => 'ለ$WATCHINGUSERNAME ይድረስ፣ የ{{SITENAME}} ገጽ $PAGETITLE በ$PAGEEDITDATE በ$PAGEEDITOR $CHANGEDORCREATED፤ ለአሁኑኑ እትም $PAGETITLE_URL ይዩ። $NEWPAGE የአዛጋጁ ማጠቃለያ፦ $PAGESUMMARY $PAGEMINOREDIT አዛጋጁን ለማገናኘት፦ በኢ-ሜል፦ $PAGEEDITOR_EMAIL በዊኪ፦ $PAGEEDITOR_WIKI ገጹን ካልጎበኙ በቀር ምንም ሌላ ኢሜል-ማስታወቂያ አይሰጥም። ደግሞ በተከታተሉት ገጾች ዝርዝር ላለው ገጽ ሁሉ የኢሜል-ማስታወቂያውን ሁኔታ ማስተካከል ይችላሉ። ከክብር ጋር፣ የ{{SITENAME}} ኢሜል-ማስታወቂያ መርሃግብር። -- የሚከታተሉት ገጾች ዝርዝር ለመቀየር፣ {{canonicalurl:{{#special:EditWatchlist}}}} ይጎበኙ። በተጨማሪ ለመረዳት፦ {{canonicalurl:{{MediaWiki:Helppage}}}}', # Delete 'deletepage' => 'ገጹ ይጥፋ', 'confirm' => 'ማረጋገጫ', 'excontent' => 'ይዞታ፦ «$1» አለ።', 'excontentauthor' => "ይዞታ '$1' አለ (የጻፈበትም '$2' ብቻ ነበር)", 'exbeforeblank' => 'ባዶ፤ ከተደመሰሰ በፊት ይዞታው «$1» አለ።', 'exblank' => 'ገጹ ባዶ ነበረ።', 'delete-confirm' => '«$1» ለማጥፋት', 'delete-legend' => 'ለማጥፋት', 'historywarning' => 'ማስጠንቀቂያ፦ ለዚሁ ገጽ የዕትም ታሪክ ደግሞ ሊጠፋ ነው! :', 'confirmdeletetext' => 'ይህን ገጽ ከነ ሙሉ የለውጥ ታሪኩ ሊያጠፉት ነው። እባክዎን ይህን የሚያደርጉት አስበውበት፣ በ[[{{MediaWiki:Policy-url}}|መተዳደሪያ ደንብም]] መሰረት መሆኑን ያረጋግጡ።', 'actioncomplete' => 'ተፈጽሟል', 'actionfailed' => 'ድርጊቱ አልተከናወነም።', 'deletedtext' => '«$1» ጠፍቷል። (የጠፉትን ገጾች ሁሉ ለመመልከት $2 ይዩ።)', 'dellogpage' => 'የማጥፋት መዝገብ', 'dellogpagetext' => 'በቅርቡ የጠፉት ገጾች ከዚህ ታች የዘረዝራሉ።', 'deletionlog' => 'የማጥፋት መዝገብ', 'reverted' => 'ወደ ቀድመኛ ዕትም ገለበጠው።', 'deletecomment' => 'ምክንያት:', 'deleteotherreason' => 'ሌላ /ተጨማሪ ምክንያት', 'deletereasonotherlist' => 'ሌላ ምክንያት', 'deletereason-dropdown' => '*ተራ የማጥፋት ምክንያቶች ** በአቅራቢው ጥያቄ ** ማብዛቱ ያልተፈቀደለት ጽሑፍ ** ተንኮል', 'delete-edit-reasonlist' => "'ተራ የማጥፋት ምክንያቶች' ለማዘጋጀት", # Rollback 'rollback' => 'ለውጦቹ ይገልበጡ', 'rollback_short' => 'ይመለስ', 'rollbacklink' => 'ROLLBACK ይመለስ', 'rollbackfailed' => 'መገልበጡ አልተከናወነም', 'cantrollback' => 'ለውጡን መገልበጥ አይቻልም፦ አቅራቢው ብቻ ስላዘጋጁት ነው።', 'alreadyrolled' => 'የ[[:$1]] መጨረሻ ለውጥ በ[[User:$2|$2]] ([[User talk:$2|ውይይት]]) መገልበት አይቻልም፤ ሌላ ሰው አሁን ገጹን መልሶታል። መጨረሻው ለውጥ በ[[User:$3|$3]] ([[User talk:$3|ውይይት]]) ነበረ።', 'editcomment' => "ማጠቃለያው፦ «''$1''» ነበረ።", 'revertpage' => 'የ$2ን ለውጦች ወደ $1 እትም መለሰ።', 'rollback-success' => 'የ$1 ለውጦች ተገለበጡ፣ ወደ $2 ዕትም ተመልሷል።', # Protect 'protectlogpage' => 'የማቆለፍ መዝገብ', 'protectlogtext' => 'ይህ መዝገብ ገጽ ሲቆለፍ ወይም ሲከፈት ይዘረዝራል። ለአሁኑ የተቆለፈውን ለመመልከት፣ [[Special:ProtectedPages|የቆለፉትን ገጾች]] ደግሞ ያዩ።', 'protectedarticle' => 'ገጹን «[[$1]]» ቆለፈው።', 'modifiedarticleprotection' => 'የመቆለፍ ደረጃ ለ«[[$1]]» ቀየረ።', 'unprotectedarticle' => 'ገጹን «[[$1]]» ፈታ።', 'movedarticleprotection' => 'የመቆለፍ ደረጃ ከ"[[$2]]" ወደ "[[$1]]" ተቀየረ', 'protect-title' => 'ለ«$1» የመቆለፍ ደረጃ ለማስተካከል', 'prot_1movedto2' => '«$1» ወደ «[[$2]]» አዛወረ', 'protect-badnamespace-text' => 'በዚሁ ክፍለ ዊኪ ያሉት ገጾች ሊቆለፉ አይችሉም።', 'protect-legend' => 'የመቆለፍ ማረጋገጫ', 'protectcomment' => 'ምክንያት:', 'protectexpiry' => 'የሚያልቅበት ግዜ፦', 'protect_expiry_invalid' => "የተሰጠው 'የሚያልቅበት ጊዜ' ልክ አይደለም።", 'protect_expiry_old' => "የተሰጠው 'የሚያልቅበት ጊዜ' ባለፈው ግዜ ነበር።", 'protect-text' => "እዚህ ለገጹ «'''$1'''» የመቆለፍ ደረጃ መመልከት ወይም መቀይር ይችላሉ።", 'protect-locked-blocked' => "ማገጃ እያለብዎት የመቆለፍ ደረጃ ለመቀየር አይችሉም። ለገጹ '''$1''' የአሁኑኑ ደረጃ እንዲህ ነው፦", 'protect-locked-dblock' => "መረጃ-ቤቱ እራሱ አሁን ስለሚቆለፍ፣ የገጽ መቆለፍ ደረጃ ሊቀየር አይችልም። ለገጹ '''$1''' የአሁኑኑ ደረጃ እንዲህ ነው፦", 'protect-locked-access' => "እርስዎ ገጽ የመቆለፍ ወይም የመፍታት ፈቃድ የለዎም።<br />አሁኑ የዚሁ ገጽ መቆለፍ ደረጃ እንዲህ ነው፦ '''$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-otherreason' => 'ሌላ/ተጨማሪ ምክንያት፦', 'protect-otherreason-op' => 'ሌላ/ተጨማሪ ምክንያት', 'protect-edit-reasonlist' => "'ተራ የመቆለፍ ምክንያቶች' ለማዘጋጀት", 'protect-expiry-options' => '2 ሰዓቶች:2 hours,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' => 'byte መጠን ያለው ሁሉ', # Restrictions (nouns) 'restriction-edit' => 'እንዲዘጋጅ፦', 'restriction-move' => 'እንዲዛወር፦', # Restriction levels 'restriction-level-sysop' => 'በሙሉ ተቆልፎ', 'restriction-level-autoconfirmed' => 'በከፊል ተቆልፎ', 'restriction-level-all' => 'ማንኛውም ደረጃ', # Undelete 'undelete' => 'የተደለዘ ገጽ ለመመለስ', 'undeletepage' => 'የተደለዘ ገጽ ለመመለስ', 'viewdeletedpage' => 'የተደለዙ ገጾች ለማየት', 'undeletepagetext' => 'እነዚህ ገጾች ተደለዙ፣ እስካሁን ግን በመዝገቡ ውስጥ ይገኛሉና ሊመለሱ ይቻላል። ሆኖም መዝገቡ አንዳንዴ ሊደመስስ ይቻላል።', 'undelete-fieldset-title' => 'የጠፉትን እትሞች ለመመልስ', 'undeleteextrahelp' => "እትሞቹን በሙሉ ለመመልስ፣ ሳጥኖቹ ሁሉ ባዶ ሆነው ይቆዩና 'ይመለስ' የሚለውን ይጫኑ። <br />አንዳንድ እትም ብቻ ለመመልስ፣ የተፈለገውን እትሞች በየሳጥኖቹ አመልክተው 'ይመለስ' ይጫኑ። <br />'ባዶ ይደረግ' ቢጫን፣ ማጠቃልያውና ሳጥኖቹ ሁሉ እንደገና ባዶ ይሆናሉ።", 'undeleterevisions' => 'በመዝገቡ $1 {{PLURAL:$1|ዕትም አለ|ዕትሞች አሉ}}', 'undeletehistory' => 'የተደለዘ ገጽ ሲመለስ፣ የተመለከቱት ዕትሞች ሁሉ ወደ ዕትሞች ታሪክ ደግሞ ይመልሳሉ። ገጹ ከጠፋ በኋላ በዚያው አርዕሥት ሌላ ገጽ ቢኖር፣ የተመለሱት ዕትሞች ወደ ዕትሞች ታሪክ አንድላይ ይጨመራሉ።', 'undeletehistorynoadmin' => 'ይህ ገጽ ጠፍቷል። የመጥፋቱ ምክንያት ከዚህ በታች ይታያል። ደግሞ ከጠፋ በፊት ያዘጋጁት ተጠቃሚዎች ይዘረዘራሉ። የተደለዙት ዕትሞች ጽሕፈት ለመጋቢዎች ብቻ ሊታይ ይችላል።', 'undelete-revision' => 'የ$1 የተደለዘ ዕትም በ$2 በ$3፦', 'undelete-nodiff' => 'ቀድመኛ ዕትም አልተገኘም።', 'undeletebtn' => 'ይመለስ', 'undeletelink' => 'አሳይ/ወደ ነበረበት መልስ', 'undeleteviewlink' => 'ተመልከት', 'undeletereset' => 'ባዶ ይደረግ', 'undeleteinvert' => 'ምርጫውን ለመገልበጥ', 'undeletecomment' => 'ማጠቃልያ፦', 'undeletedrevisions' => '{{PLURAL:$1|1 ዕትም|$1 ዕትሞች}} መለሰ', 'undeletedrevisions-files' => '{{PLURAL:$1|1 ዕትም|$1 ዕትሞች}} እና {{PLURAL:$2|1 ፋይል|$2 ፋይሎች}} መለሰ', 'undeletedfiles' => '{{PLURAL:$1|1 ፋይል|$1 ፋይሎች}} መለሰ', 'cannotundelete' => 'መመለሱ አልተከናወነም፤ ምናልባት ሌላ ሰው ገጹን አስቀድሞ መልሶታል።', 'undeletedpage' => "'''$1 ተመልሷል''' በቅርብ የጠፉና የተመለሱ ገጾች ለማመልከት [[Special:Log/delete|የማጥፋቱን መዝገብ]] ይዩ።", 'undelete-header' => 'በቅርብ ግዜ የተደለዙትን ገጾች ለማመልከት [[Special:Log/delete|የማጥፋቱን መዝገብ]] ይዩ።', 'undelete-search-box' => 'የተደለዙትን ገጾች ለመፈልግ', 'undelete-search-prefix' => 'ከዚሁ ፊደል ጀምሮ፦', 'undelete-search-submit' => 'ይታይ', 'undelete-no-results' => 'በመዝገቡ ምንም ተመሳሳይ ገጽ አልተገኘም።', 'undelete-filename-mismatch' => 'በጊዜ ማህተም $1 ያለው እትም መመልስ አልተቻለም፤ የፋይል ስም አለመስማማት', 'undelete-error-short' => 'ፋይል የመመለስ ስኅተት፦ $1', 'undelete-error-long' => 'ፋይሉ በመመለስ ስኅተቶች ተነሡ፦ $1', 'undelete-show-file-submit' => 'አዎን', # Namespace form on various pages 'namespace' => 'ዓይነት፦', 'invert' => '(ምርጫውን ለመገልበጥ)', 'blanknamespace' => 'መጣጥፎች', # Contributions 'contributions' => 'ያባል አስተዋጽኦች', 'contributions-title' => 'የ$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-logs' => 'መዝገቦች', 'sp-contributions-talk' => 'ውይይት', 'sp-contributions-userrights' => 'የአባል መብቶች ለማስተዳደር', 'sp-contributions-blocked-notice' => 'ይህ ተጠቃሚ $1 አሁን የታገደ ነው። ከዚህ ታች የማገጃ መዝገብ መጨረሻ ድርጊት ይታያል።', 'sp-contributions-blocked-notice-anon' => 'ይህ IP ቁጥር አሁን የታገደ ነው። ከዚህ ታች የማገጃ መዝገብ መጨረሻ ድርጊት ይታያል።', 'sp-contributions-search' => 'የሰውን አስተዋጽኦች ለመፈለግ፦', 'sp-contributions-username' => 'ብዕር ስም ወይም የቁ. አድራሻ፦', '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' => 'ከዚህ ታች ያለው ማመልከቻ በአንድ ቁጥር አድርሻ ወይም ብዕር ስም ላይ ማገጃ (ማዕቀብ) ለመጣል ይጠቀማል። ይህ በ[[{{MediaWiki:Policy-url}}|መርመርያዎቻችን]] መሠረት ተንኮል ወይም ጉዳት ለመከልከል ብቻ እንዲደረግ ይገባል። ከዚህ ታች የተለየ ምክንያት (ለምሣሌ የተጎዳው ገጽ በማጠቆም) ይጻፉ።', 'ipadressorusername' => 'የቁ. አድራሻ ወይም የብዕር ስም፦', 'ipbexpiry' => 'የሚያልቅበት፦', 'ipbreason' => 'ምክንያቱ፦', 'ipbreasonotherlist' => 'ሌላ ምክንያት', 'ipbreason-dropdown' => "*ተራ የማገጃ ምክንያቶች ** የሀሠት መረጃ መጨምር ** ከገጾች ይዞታውን መደምሰስ ** የ'ስፓም' ማያያዣ ማብዛት ** እንቶ ፈንቶ መጨምር ** ዛቻ ማብዛት ** በአድራሻዎች ብዛት መተንኮል ** የማይገባ ብዕር ስም", 'ipbcreateaccount' => 'ብዕር ስም እንዳያውጣ ለመከልከል', 'ipbemailban' => 'ተጠቃሚው ኢ-ሜል ከመላክ ይከለከል', 'ipbenableautoblock' => 'በተጠቃሚው መጨረሻ ቁ.# እና ካሁን ወዲያ በሚጠቀመው አድራሻ ላይ ማገጃ ይጣል።', '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' => 'ሌላ/ተጨማሪ ምክንያት፦', 'ipb-confirm' => 'ማገጃውን ለማረጋገጥ', 'badipaddress' => 'የማይሆን የቁ. አድራሻ', 'blockipsuccesssub' => 'ማገጃ ተከናወነ', 'blockipsuccesstext' => '[[Special:Contributions/$1|$1]] ታግዷል።<br /> ማገጃዎች ለማመልከት [[Special:BlockList|የማገጃ ዝርዝሩን]] ይዩ።', 'ipb-blockingself' => 'እራስዎን ሊያግዱ ነው። ይሄ በእርግጡ ይደረግን?', 'ipb-edit-dropdown' => "'ተራ የማገጃ ምክንያቶች' ለማስተካከል", 'ipb-unblock-addr' => 'ከ$1 መገጃ ለማንሣት', 'ipb-unblock' => 'ከብዕር ስም ወይም ከቁ. አድራሻ ማገጃ ለማንሣት', 'ipb-blocklist' => 'አሁን ያሉትን ማገጃዎች ለመመልከት', 'ipb-blocklist-contribs' => 'የ$1 ለውጦች', 'unblockip' => 'ከተጠቃሚ ማገጃ ለማንሣት', 'unblockiptext' => 'በዚህ ማመልከቻ ከታገደ ተጠቃሚ ማገጃውን ለማንሣት ይቻላል።', 'ipusubmit' => 'ማገጃውን ለማንሣት', 'unblocked' => 'ማገጃ ከ[[User:$1|$1]] ተነሣ', 'unblocked-range' => 'ማገጃ ከ$1 ተነሣ', 'unblocked-id' => 'ማገጃ $1 ተነሣ', 'blocklist' => 'የታገዱት ተጠቃሚዎች', 'ipblocklist' => 'የድህረ ገፅ መለያዎችንና (IP addresses) እና የተጠቃሚዎችን የብዕር ስም አግድ።', 'ipblocklist-legend' => 'አንድ የታገደውን ተጠቃሚ ለመፈለግ፦', 'blocklist-tempblocks' => 'ጊዜያዊ ማገጃዎች ይደበቁ', 'blocklist-timestamp' => 'የተደረገበት ሰዓት', 'blocklist-expiry' => 'የሚያልቅበት ግዜ', 'blocklist-by' => 'ማገጃ የጣለው', 'blocklist-reason' => 'ምክንያት', 'ipblocklist-submit' => 'ይፈለግ', 'ipblocklist-otherblocks' => '{{PLURAL:$1|ሌላ ማገጃ|ሌሎች ማገጃዎች}}', 'infiniteblock' => 'መቸም ይማያልቅ', 'expiringblock' => 'በ$1 $2 እ.ኤ.አ. ያልቃል', 'anononlyblock' => 'ያልገቡት የቁ.# ብቻ', 'noautoblockblock' => 'የቀጥታ ማገጃ እንዳይሠራ ተደረገ', 'createaccountblock' => 'ስም ከማውጣት ተከለከለ', 'emailblock' => 'ኢ-ሜል ታገደ', 'blocklist-nousertalk' => 'የገዛ ውይይት ገጹን ማዘጋጀት አይችልም', 'ipblocklist-empty' => 'የማገጃ ዝርዝር ባዶ ነው።', 'ipblocklist-no-results' => 'የተጠየቀው ተጠቃሚ አሁን የታገደ አይደለም።', 'blocklink' => 'ማገጃ', 'unblocklink' => 'ማገጃ ለማንሣት', 'change-blocklink' => 'እገዳውን ቀይር', 'contribslink' => 'አስተዋጽኦች', 'emaillink' => 'ኢ-ሜል መላክ', 'blocklogpage' => 'የማገጃ መዝገብ', 'blocklogentry' => 'እስከ $2 ድረስ [[$1]] አገዳ $3', 'blocklogtext' => 'ይህ መዝገብ ተጠቃሚዎች መቸም ሲታገዱ ወይም ማገጃ ሲነሣ የሚዘረዝር ነው። ለአሁኑ የታገዱት ሰዎች [[Special:BlockList|በአሁኑ ማገጃዎች ዝርዝር]] ይታያሉ።', 'unblocklogentry' => 'የ$1 ማገጃ አነሣ', 'block-log-flags-anononly' => 'ያልገቡት የቁ. አድራሻዎች ብቻ', 'block-log-flags-nocreate' => 'አዲስ ብዕር ስም ከማውጣት ተከለከለ', 'block-log-flags-noautoblock' => 'የቀጥታ ማገጃ እንዳይሠራ ተደረገ', 'block-log-flags-noemail' => 'ኢ-ሜል ታገደ', 'block-log-flags-nousertalk' => 'የገዛ ውይይት ገጹን ማዘጋጀት አይችልም', 'ipb_expiry_invalid' => 'የሚያልቅበት ግዜ አይሆንም።', 'ipb_already_blocked' => '«$1» ገና ከዚህ በፊት ታግዶ ነው።', 'ipb-needreblock' => '$1 አሁን ገና ታግዷል። ዝርዝሩን ማስተካከል ፈለጉ?', 'blockme' => 'ልታገድ', 'proxyblocker-disabled' => 'ይህ ተግባር እንደማይሠራ ተደርጓል።', 'proxyblocksuccess' => 'ተደርጓል።', 'cant-block-while-blocked' => 'እርስዎ እየታገዱ ሌላ ተጠቃሚ ለማገድ አይችሉም።', # Developer tools 'lockdb' => 'መረጃ-ቤት ለመቆለፍ', 'unlockdb' => 'መረጃ-ቤት ለመፍታት', 'lockconfirm' => 'አዎ፣ መረጃ-ቤቱን ለማቆለፍ በውኑ እፈልጋለሁ።', 'unlockconfirm' => 'አዎ፣ መረጃ-ቤቱን ለመፍታት በውኑ እፈልጋለሁ።', 'lockbtn' => 'መረጃ-ቤቱ ይቆለፍ', 'unlockbtn' => 'መረጃ-ቤቱ ይፈታ', 'locknoconfirm' => 'በማረጋገጫ ሳትኑ ውስጥ ምልክት አላደረጉም።', 'lockdbsuccesssub' => 'የመረጃ-ቤት መቆለፍ ተከናወነ', 'unlockdbsuccesssub' => 'የመረጃ-ቤት መቆለፍ ተጨረሰ', 'lockdbsuccesstext' => 'መረጃ-ቤቱ ተቆልፏል።<br /> ሥራዎን እንደጨረሱ [[Special:UnlockDB|መቆለፉን ለመፍታት]] እንዳይረሱ።', 'unlockdbsuccesstext' => 'መረጃ-ቤቱ ተፈታ።', 'databasenotlocked' => 'መረጃ-ቤቱ የተቆለፈ አይደለም።', # Move page 'move-page' => '«$1»ን ለማዛወር', 'move-page-legend' => 'የሚዛወር ገጽ', 'movepagetext' => "ከታች የሚገኘው ማመልከቻ ተጠቅመው የገጹ ስም መለወጥ ይችላሉ፤ የቀድሞው ገፅ ታሪክ ደግሞ ሙሉ በሙሉ ወደ አዲሱ ይዘዋወራል። የቀድሞው ርዕስ ለአዲሱ ገፅ እንደ መምሪያ ወይም መጠቆሚያ ገፅ በመሆን ያገለግላይ። እርስዎ ከትክክለኛውንና ከዋናው ገፅ ጋር በቀጥታ እንዲገናኝ ማድረግና ማስተካከል ይችላሉ ይህ አንዳይሆን ከመረጡ ደግሞ ወይ [[Special:DoubleRedirects|double]] አልያም [[Special:BrokenRedirects|broken redirects]] መምረጥዎን እርግጠኛ ይሁኑ። ነገር ግን በስርአት መቆራኘታቸውን ማረጋገጥና እርግጠኛ የመሆን አላፊነትና ግዴታ አለብዎት። ልብ ይበሉ፦ አዲስ ለሰጡት ርዕስ ተመሳሳይ ርዕስ ያለው ሌላ ገጽ ቀድሞ ካለ እናም ገፁ ባዶ ካልሆነ መይም ለሌላ ገፅ መምሪያ ካልሆነ አልያም ምንም ታሪክ የሌለው ካልሆነ በስተቀር ገጽን ወደዚያ ለማዛወር '''የማይቻል''' ነው። ይህ ማለት ደግሞ ገፅ ቀድሞ ይጠራበት ወደነበረበት ቦታ መመልስ ይችላሉ ነገር ግን ቀድሞ በነበረ ገፅ ላይ ደርበው መፃፍ ግን አይችሉም '''ማስጠንቀቂያ፦''' በጣም ለተወደደ ወይም ብዙ ጊዜ ለሚነበብ ገጽ እንዲህ ያለ ለውጥ ማድረግ አደገኛና ከፍተኛ ጥንቃቄን የሚጠይቅ ነው። ስለዚህ እባክዎ ለውጥ ከማድረግዎ በፊት ሂደቱን መሚገባ እንደተረዱት እንግጠኛ ይሁኑ።", 'movepagetalktext' => "አብዛኛው ጊዜ፣ ከዚሁ ገጽ ጋራ የሚገናኘው የውይይት ገጽ አንድላይ ይዛወራል፤ '''ነገር ግን፦''' * ገጹን ወደማይመሳስል ክፍለ-ዊኪ (ለምሳሌ Mediawiki:) ቢያዛውሩት፤ * ባዶ ያልሆነ ውይይት ገጽ ቅድሞ ቢገኝ፤ ወይም * እታች ከሚገኘውን ሳጥን ምልክቱን ካጠፉ፤ : :ከነውይይቱ ገጽ አንድላይ አይዛወሩም። የዚያን ጊዜ የውይይቱን ገጽ ለማዛወር ከወደዱ በእጅ ማድረግ ያስፈልግዎታል።", 'movearticle' => 'የቆየ አርእስት፡', 'movenologin' => 'ገና አልገቡም', 'movenologintext' => 'ገጽ ለማዛወር [[Special:UserLogin|በብዕር ስም መግባት]] ይኖርብዎታል።', 'movenotallowed' => 'በዚህ ዊኪ ገጾችን ለማዛወር ፈቃድ የለዎም።', 'movenotallowedfile' => 'ፋይልን ለማዛወር ፈቃድ የለዎም።', 'cant-move-user-page' => 'ከንዑስ ገጾች በቀር፣ የአባል ገጽ ለማዛወር ፈቃድ የለዎም።', 'newtitle' => 'አዲሱ አርእስት', 'move-watch' => 'ይህ ገጽ በተከታተሉት ገጾች ይጨመር', 'movepagebtn' => 'ገጹ ይዛወር', 'pagemovedsub' => 'መዛወሩ ተከናወነ', 'movepage-moved' => "'''«$1» ወደ «$2» ተዛውሯል'''", 'movepage-moved-redirect' => 'መምሪያ መንገድ ተፈጠረ።', 'articleexists' => 'በዚያ አርዕሥት ሌላ ገጽ አሁን አለ። አለበለዚያ የመረጡት ስም ልክ አይደለም - ሌላ አርእስት ይምረጡ።', 'cantmove-titleprotected' => 'አዲሱ አርዕስት ከመፈጠር ስለተጠበቀ፣ ገጽ ወደዚያው ሥፍራ ለማዛወር አይችሉም።', 'talkexists' => "'''ገጹ ወደ አዲሱ አርዕስት ተዛወረ፤ እንጂ በአዲሱ አርዕስት የቆየ ውይይት ገጽ አስቀድሞ ስለ ኖረ የዚህ ውይይት ገጽ ሊዛወር አልተቻለም። እባክዎ፣ በእጅ ያጋጥሙአቸው።'''", 'movedto' => 'የተዛወረ ወደ', 'movetalk' => 'ከተቻለ፣ ከነውይይቱ ገጽ ጋራ ይዛወር', 'move-subpages' => 'ንዑስ ገጾች ደግሞ ይዛወሩ', 'move-talk-subpages' => 'የውይይቱ ገጽ ንዑስ ገጾች ደግሞ ይዛወሩ', 'movepage-page-moved' => 'ገጹ $1 ወደ $2 ተዛውሯል።', 'movepage-page-unmoved' => 'ገጹ $1 ወደ $2 ሊዛወር አልተቻለም።', 'movelogpage' => 'የማዛወር መዝገብ', 'movelogpagetext' => 'ይህ መዝገብ ገጽ ሲዛወር ይመዝገባል። <ይመለስ> ቢጫኑ ኖሮ መዛወሩን ይገለብጣል!', 'movenosubpage' => 'ይህ ገጽ ምንም ንዑስ ገጽ የለውም።', 'movereason' => 'ምክንያት:', 'revertmove' => 'ይመለስ', 'delete_and_move' => 'ማጥፋትና ማዛወር', 'delete_and_move_text' => '==ማጥፋት ያስፈልጋል== መድረሻው ገጽ ሥፍራ «[[:$1]]» የሚለው ገጽ አሁን ይኖራል። ሌላው ገጽ ወደዚያ እንዲዛወር እሱን ለማጥፋት ይወድዳሉ?', 'delete_and_move_confirm' => 'አዎን፣ ገጹ ይጥፋ', 'delete_and_move_reason' => 'ለመዛወሩ ሥፍራ እንዲገኝ ጠፋ', 'selfmove' => 'የመነሻ እና የመድረሻ አርዕስቶች አንድ ናቸው፤ ገጽ ወደ ራሱ ለማዛወር አይቻልም።', 'immobile-source-namespace' => 'በክፍለ-ዊኪ "$1" ያሉት ገጾች ማዛወር አይቻልም።', 'immobile-target-namespace' => 'ገጾችን ወደ በክፍለ-ዊኪ "$1" ማዛወር አይቻልም።', 'immobile-source-page' => 'ይህ ገጽ የማይዛወር አይነት ነው።', 'immobile-target-page' => 'ወደዚያው መድረሻ አርዕስት ማዛወር አይቻልም።', 'imagenocrossnamespace' => 'ፋይልን ወደ ሌላ አይነት ክፍለ-ዊኪ ማዛወር አይቻልም።', 'imageinvalidfilename' => 'የመድረሻ ፋይል ስም ልክ አይደለም።', 'fix-double-redirects' => 'ወደ ቀደመው አርዕስት የሚወስዱ መምሪያ መንገዶች ካሉ በቀጥታ ይታደሱ', 'move-leave-redirect' => 'መምሪያ መንገድ ይኖር።', # Export 'export' => 'ገጾች ወደ ሌላ ዊኪ ለመላክ', 'exportcuronly' => 'ሙሉ ታሪክ ሳይሆን ያሁኑኑን ዕትም ብቻ ይከተት', 'export-submit' => 'ለመላክ', 'export-addcattext' => 'ከዚሁ መደብ ገጾች ይጨመሩ፦', 'export-addcat' => 'ለመጨምር', 'export-addns' => 'ለመጨምር', 'export-download' => 'እንደ ፋይል ለመቆጠብ', 'export-templates' => 'ከነመለጠፊያዎቹ', # Namespace 8 related 'allmessages' => 'የድረገጽ መልክ መልእክቶች', 'allmessagesname' => 'የመልእክት ስም', 'allmessagesdefault' => 'የቆየው ጽሕፈት', 'allmessagescurrent' => 'ያሁኑ ጽሕፈት', 'allmessagestext' => 'በ«MediaWiki» ክፍለ-ዊኪ ያሉት የድረገጽ መልክ መልእክቶች ሙሉ ዝርዝር ይህ ነው። Please visit [//www.mediawiki.org/wiki/Localisation MediaWiki Localisation] and [//translatewiki.net translatewiki.net] if you wish to contribute to the generic MediaWiki localisation.', 'allmessagesnotsupportedDB' => "'''\$wgUseDatabaseMessages''' ስለ ተዘጋ '''{{ns:special}}:Allmessages''' ሊጠቀም አይችልም።", 'allmessages-filter-legend' => 'ማጣሪያ', 'allmessages-filter-all' => 'ሁሉ', 'allmessages-language' => 'ቋንቋ፦', 'allmessages-filter-submit' => 'ሂድ', # Thumbnails 'thumbnail-more' => 'አጎላ', 'filemissing' => 'ፋይሉ አልተገኘም', 'thumbnail_error' => 'ናሙና በመፍጠር ችግር አጋጠመ፦ $1', 'thumbnail_invalid_params' => 'ትክክለኛ ያልሆነ የናሙና ግቤት', # Special:Import 'import' => 'ገጾች ከሌላ ዊኪ ለማስገባት', 'importinterwiki' => 'ከሌላ ዊኪ ማስገባት', 'import-interwiki-source' => 'መነሻ ዊኪ/ገጽ:', 'import-interwiki-history' => 'ለዚህ ገጽ የታሪክ ዕትሞች ሁሉ ለመቅዳት', 'import-interwiki-submit' => 'ለማስገባት', 'import-interwiki-namespace' => 'መድረሻ ክፍለ-ዊኪ:', 'import-upload-filename' => 'የፋይሉ ስም፦', 'import-comment' => 'ማጠቃለያ፦', 'importstart' => 'ገጾችን በማስገባት ላይ ነው...', 'import-revision-count' => '$1 {{PLURAL:$1|ዕትም|ዕትሞች}}', 'importnopages' => 'ለማስገባት ምንም ገጽ የለም።', 'importfailed' => 'ማስገባቱ አልተከናወነም፦ <nowiki>$1</nowiki>', 'importunknownsource' => 'ያልታወቀ የማስገባት መነሻ አይነት', 'importcantopen' => 'የማስገባት ፋይል መክፈት አልተቻለም', 'importnotext' => 'ባዶ ወይም ጽሕፈት የለም', 'importsuccess' => 'ማስገባቱ ጨረሰ!', 'import-noarticle' => 'ለማስገባት ምንም ገጽ የለም!', 'import-nonewrevisions' => 'ዕትሞቹ ሁሉ ከዚህ በፊት ገብተዋል', # Import log 'importlogpage' => 'የገጽ ማስገባት መዝገብ', 'import-logentry-upload-detail' => '$1 {{PLURAL:$1|ዕትም|ዕትሞች}}', 'import-logentry-interwiki-detail' => '$1 {{PLURAL:$1|ዕትም|ዕትሞች}} ከ$2', # Tooltip help for the actions 'tooltip-pt-userpage' => 'መደነኛው ገጽህ/ሽ', 'tooltip-pt-anonuserpage' => 'ለቁ. አድራሻዎ የመኖርያ ገጽ', 'tooltip-pt-mytalk' => 'የመወያያ ገፅህ/ሽ', 'tooltip-pt-anontalk' => 'ለቁ. አድራሻዎ የውይይት ገጽ', '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-delete' => 'ይህንን ገጽ ለማጥፋት', 'tooltip-ca-undelete' => 'በዚህ ገጽ ላይ ሳይጠፋ የተደረጉትን ዕትሞች ለመመልስ', 'tooltip-ca-move' => 'ይህ ገጽ ወደ ሌላ አርእስት ለማዋወር', 'tooltip-ca-watch' => 'ይህንን ገጽ ወደ ተከታተሉት ገጾች ዝርዝር ለመጨምር', 'tooltip-ca-unwatch' => 'ይህንን ገጽ ከተከታተሉት ገጾች ዝርዝር ለማስወግድ', 'tooltip-search' => 'ቃል ወይም አርዕስት በ{{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' => 'በዚሁ ዊኪ ላይ በቅርቡ የተደረጉ ለውጦች', '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' => 'ፋይል ወይም ሥዕልን ወደ {{SITENAME}} ለመላክ', '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' => 'የለወጡትን ዕትም ወደ {{SITENAME}} ለመላክ', 'tooltip-preview' => 'ለውጦችዎ ሳይያቀርቡዋቸው እስቲ ይመለከቷቸው!', 'tooltip-diff' => 'እርስዎ የሚያደርጉት ለውጦች ከአሁኑ ዕትም ጋር ለማነጻጸር', 'tooltip-compareselectedversions' => 'ካመለከቱት ዕትሞች መካከል ያለውን ልዩነት ለማነጻጸር', 'tooltip-watch' => 'ይህንን ገጽ ወደተከታተሉት ገጾች ዝርዝር ለመጨምር', 'tooltip-recreate' => 'ገጹ የጠፋ ሆኖም እንደገና ለመፍጠር', 'tooltip-upload' => 'ለመጀመር ይጫኑ', 'tooltip-rollback' => 'ROLLBACK የመጨረሻውን አዛጋጅ ለውጦች በፍጥነት ይገልበጣል።', 'tooltip-undo' => '"መልስ" ይህን ቅድመ እይታ ወደ ቀድሞው የእርማት ቦታው መልስ። ማጠቃለያው ላይ ምክንያታችንን ለማስገባት ይፈቅድልናል።', # Attribution 'anonymous' => 'የ{{SITENAME}} ቁ. አድራሻ ተጠቃሚ(ዎች)', 'siteuser' => '{{SITENAME}} ተጠቃሚ $1', 'lastmodifiedatby' => 'ይህ ገጽ መጨረሻ የተቀየረው $2፣ $1 በ$3 ነበር።', 'others' => 'ሌሎች', 'siteusers' => '{{SITENAME}} ተጠቃሚ(ዎች) $1', # Spam protection 'spamprotectiontitle' => 'የስፓም መከላከል ማጣሪያ', 'spambot_username' => 'MediaWiki የስፓም ማፅዳት', 'spam_reverting' => 'ወደ $1 የሚወስድ መያያዣ ወደሌለበት መጨረሻ ዕትም መለሰው', # Info page 'pageinfo-firstuser' => 'የገጹ ፈጣሪ', 'pageinfo-firsttime' => 'የተፈጠረበት ቀን', 'pageinfo-lastuser' => 'የመጨረሻው አራሚ', 'pageinfo-lasttime' => 'የመጨረሻው ዕትም ቀን', 'pageinfo-edits' => 'ጠቅላላ የእርማት ቁጥር', # Patrolling 'markaspatrolleddiff' => 'የተሳለፈ ሆኖ ማመልከት', 'markaspatrolledtext' => 'ይህን ገጽ የተመለከተ ሆኖ ለማሳለፍ', 'markedaspatrolled' => 'የተመለከተ ሆኖ ተሳለፈ', 'markedaspatrolledtext' => 'የተመረጠው ዕትም የተመለከተ ሆኖ ተሳለፈ።', 'rcpatroldisabled' => 'የቅርብ ለውጦች ማሳለፊያ አይኖርም', 'rcpatroldisabledtext' => 'የቅርብ ለውጦች ማሳለፊያ ተግባር አሁን አይሠራም።', 'markedaspatrollederror' => 'የተመለከተ ሆኖ ለማሳለፍ አይቻልም', 'markedaspatrollederrortext' => 'የተመለከተ ሆኖ ለማሳለፍ አንድን ዕትም መወሰን አለብዎት።', 'markedaspatrollederror-noautopatrol' => 'የራስዎን ለውጥ የተመለከተ ሆኖ ለማሳለፍ አይችሉም።', # Patrol log 'patrol-log-page' => 'የማሳለፊያ መዝገብ', 'log-show-hide-patrol' => 'ማሳለፊያ መዝገቦች', # Image deletion 'deletedrevision' => 'የቆየው ዕትም $1 አጠፋ', 'filedeleteerror-short' => 'የፋይል ማጥፋት ስኅተት፦ $1', 'filedeleteerror-long' => 'ፋይሉን በማጥፋት ስህተቶች ተነስተዋል፦ $1', 'filedelete-missing' => 'ፋይሉ «$1» ሰለማይኖር ሊጠፋ አይችልም።', 'filedelete-old-unregistered' => 'የተወሰነው ፋይል ዕትም «$1» በመረጃ-ቤቱ የለም።', 'filedelete-current-unregistered' => 'የተወሰነው ፋይል «$1» በመረጃ-ቤቱ የለም።', # Browsing diffs 'previousdiff' => 'የፊተኛው ለውጥ', 'nextdiff' => 'የሚቀጥለው ለውጥ →', # Media information 'imagemaxsize' => 'በፋይል መግለጫ ገጽ ላይ የስዕል መጠን ወሰን ቢበዛ፦', 'thumbsize' => 'የናሙና መጠን፦', 'widthheightpage' => '$1 በ$2፣ $3 ገጾች', 'file-info' => 'የፋይል መጠን፦ $1፣ የMIME አይነት፦ $2', 'file-info-size' => '$1 × $2 ፒክስል፤ መጠን፦ $3፤ የMIME ዓይነት፦ $4', 'file-nohires' => 'ከዚህ በላይ ማጉላት አይቻልም።', 'svg-long-desc' => 'የSVG ፋይል፡ በተግባር $1 × $2 ፒክስል፤ መጠን፦ $3', 'show-big-image' => 'በሙሉ ጒልህነት ለመመልከት', # Special:NewFiles 'newimages' => 'የአዳዲስ ሥዕሎች ማሳያ አዳራሽ', 'imagelisttext' => '$1 የተጨመሩ ሥእሎች ወይም ፋይሎች ከታች ይዘረዝራሉ ($2)።', 'newimages-legend' => 'ማጣሪያ', 'showhidebots' => '(«bots» $1)', 'noimages' => 'ምንም የለም!', 'ilsubmit' => 'ፍለጋ', 'bydate' => 'በተጨመሩበት ወቅት', 'sp-newimages-showfrom' => 'ከ$2፣ $1 እ.ኤ.አ. ጀምሮ አዲስ ይታዩ', # Video information, used by Language::formatTimePeriod() to format lengths in the above messages 'seconds' => '$1 ሴኮንድ', 'minutes' => '$1 ደቂቃ', 'hours' => '$1 ሰዓት', 'days' => '$1 ቀን', 'ago' => 'ከ$1 በፊት', # Bad image list 'bad_image_list' => 'ሥርዓቱ እንዲህ ነው፦ በ* የሚጀምሩ መስመሮች ብቻ ይቆጠራል። በመስመሩ መጀመርያው መያያዣ የመጥፎ ስዕል መያያዣ መሆን አለበት። ከዚያ ቀጥሎ በዚያው በመስመር መያያዣ ቢገኝ ግን ስዕሉ እንደ ተፈቀደበት ገጽ ይቆጠራል።', # Metadata 'metadata' => 'ተጨማሪ መረጃ', 'metadata-help' => 'ይህ ፋይል በውስጡ ተጨማሪ መረጃ ይይዛል። መረጃውም በዲጂታል ካሜራ ወይም በኮምፒውተር ስካነር የተጨመረ ይሆናል። ይህ ከኦሪጂናሉ ቅጅ የተለወጠ ከሆነ፣ ምናልባት የመረጃው ዝርዝር ለውጦቹን የማያንጸባረቅ ይሆናል።', 'metadata-expand' => 'ተጨማሪ መረጃ ይታይ', 'metadata-collapse' => 'ተጨማሪ መረጃ ይደበቅ', 'metadata-fields' => "በዚህ የሚዘረዘሩ EXIF መረጃ አይነቶች በፋይል ገጽ ላይ በቀጥታ ይታያሉ። ሌሎቹ 'ተጨማሪ መረጃ ይታይ' ካልተጫነ በቀር ይደበቃሉ። * make * model * datetimeoriginal * exposuretime * fnumber * isospeedratings * focallength * artist * copyright * imagedescription * gpslatitude * gpslongitude * gpsaltitude", # EXIF tags 'exif-imagewidth' => 'ስፋት', 'exif-imagelength' => 'ቁመት', 'exif-compression' => 'የመጨመቅ ዘዴ', 'exif-photometricinterpretation' => 'የPixel አሠራር', 'exif-orientation' => 'አቀማመጥ', 'exif-samplesperpixel' => 'የክፍለ ነገሮች ቁጥር', 'exif-planarconfiguration' => 'የመረጃ አስተዳደር', 'exif-ycbcrpositioning' => 'የY ና C አቀማመጥ', 'exif-xresolution' => 'አድማሳዊ ማጉላት', 'exif-yresolution' => 'ቁም ማጉላት', 'exif-stripoffsets' => 'የስዕል መረጃ ሥፍራ', 'exif-rowsperstrip' => 'የተርታዎች ቁጥር በየቁራጩ', 'exif-stripbytecounts' => 'byte በየተጨመቀ ቁራጩ', 'exif-jpeginterchangeformatlength' => 'የJPEG መረጃ byte', 'exif-datetime' => 'ፋይሉ የተቀየረበት ቀንና ሰዓት', 'exif-imagedescription' => 'የስዕል አርዕስት', 'exif-make' => 'የካሜራው ሠሪ ድርጅት', 'exif-model' => 'የካሜራው ዝርያ', 'exif-software' => 'የተጠቀመው ሶፍትዌር', 'exif-artist' => 'ደራሲ', 'exif-copyright' => 'ባለ መብቱ', 'exif-exifversion' => 'የExif ዝርያ', 'exif-flashpixversion' => 'የተደገፈ Flashpix ዝርያ', 'exif-componentsconfiguration' => 'የየክፍለ ነገሩ ትርጉም', 'exif-compressedbitsperpixel' => 'የስዕል መጨመቅ ዘዴ', 'exif-pixelydimension' => 'እውነተኛ የስዕል ስፋት', 'exif-pixelxdimension' => 'እውነተኛ የስዕል ቁመት', 'exif-usercomment' => 'የተጠቃሚው ማጠቃለያ', 'exif-relatedsoundfile' => 'የተዛመደ የድምጽ ፋይል', 'exif-datetimeoriginal' => 'መረጃው የተፈጠረበት ቀንና ሰዓት', 'exif-datetimedigitized' => 'ዲጂታል የተደረገበት ቀንና ሰዓት', 'exif-exposuretime' => 'የግልጠት ግዜ', 'exif-exposuretime-format' => '$1 ሴኮንድ ($2)', 'exif-fnumber' => 'የF ቁጥር', 'exif-exposureprogram' => 'የግልጠት ፕሮግራም', 'exif-shutterspeedvalue' => 'የከላይ ፍጥነት', 'exif-aperturevalue' => 'ክፍተት', 'exif-brightnessvalue' => 'ብሩህነት', 'exif-exposurebiasvalue' => 'የግልጠት ዝንባሌ', 'exif-maxaperturevalue' => 'የየብስ ክፍተት ወሰን ቢበዛ', 'exif-subjectdistance' => 'የጉዳዩ ርቀት', 'exif-meteringmode' => 'የመመተር ዘዴ', 'exif-lightsource' => 'የብርሃን ምንጭ', 'exif-flash' => 'ብልጭታ', 'exif-focallength' => 'የምስሪት ትኩረት እርዝማኔ', 'exif-subjectarea' => 'የጉዳዩ ክልል', 'exif-flashenergy' => 'የብልጭታ ኅይል', 'exif-subjectlocation' => 'የጉዳዩ ሥፍራ', 'exif-exposureindex' => 'ግልጠት መለኪያ ቁጥር', 'exif-sensingmethod' => 'የመሰማት ዘዴ', 'exif-filesource' => 'የፋይል ምንጭ', 'exif-scenetype' => 'የትርኢት አይነት', 'exif-customrendered' => 'ልዩ የስዕል አገባብ', 'exif-exposuremode' => 'የግልጠት ዘዴ', 'exif-whitebalance' => 'የነጭ ዝንባሌ', 'exif-digitalzoomratio' => 'ቁጥራዊ ማጉላት ውድር', 'exif-focallengthin35mmfilm' => 'በ35 mm ፊልም የትኩረት እርዝማኔ', 'exif-scenecapturetype' => 'የትርኢት መማረክ አይነት', 'exif-gaincontrol' => 'የትርኢት ማሠልጠን', 'exif-contrast' => 'የድምቀት አነጻጸር', 'exif-sharpness' => 'ስለት', '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' => 'የስዕል እንቅስቃሴ መሰረት', 'exif-gpstrack' => 'የእንቅስቃሴ አቅጣጫ', 'exif-gpsimgdirectionref' => 'የስዕል አቅጣጫ መሠረት', 'exif-gpsimgdirection' => 'የስዕል አቅጣጫ', 'exif-gpsdestlatituderef' => 'የመድረሻ ኬክሮስ መሠረት', 'exif-gpsdestlatitude' => 'የመድረሻ ኬክሮስ', 'exif-gpsdestlongituderef' => 'የመድረሻ ኬንትሮስ መሠረት', 'exif-gpsdestlongitude' => 'የመድረሻ ኬንትሮስ', 'exif-gpsdestdistanceref' => 'የመድረሻ ርቀት መሠረት', 'exif-gpsdestdistance' => 'ርቀት ከመድረሻ', 'exif-gpsprocessingmethod' => 'የGPS አግባብ ዘዴ ስም', 'exif-gpsareainformation' => 'የGPS ክልል ስም', 'exif-gpsdatestamp' => 'የGPS ቀን', 'exif-gpsdifferential' => 'GPS ልዩነት ማስተካከል', 'exif-countrycreated' => 'ፎቶው የተነሣበት ሀገር', 'exif-countrycodecreated' => 'ፎቶው የተነሣበት ሀገር ኮድ', 'exif-provinceorstatecreated' => 'ፎቶው የተነሣበት ክፍላገር', 'exif-citycreated' => 'ፎቶው የተነሣበት ከተማ', 'exif-countrydest' => 'የታየው ሀገር', 'exif-countrycodedest' => 'የሚታየው ሀገር ኮድ', 'exif-provinceorstatedest' => 'የሚታየው ክፍለሀገር', 'exif-citydest' => 'የሚታየው ከተማ', 'exif-objectname' => 'አጭር አርዕስት', 'exif-specialinstructions' => 'ልዩ ማስጠንቀቂያ', 'exif-source' => 'መነሻ', 'exif-languagecode' => 'ቋንቋ', 'exif-cameraownername' => 'ባለ ካሜራ', 'exif-personinimage' => 'የታየው ሰው', # EXIF attributes 'exif-compression-1' => 'ያልተጨመቀ', 'exif-unknowndate' => 'ያልታወቀ ቀን', 'exif-orientation-1' => 'መደበኛ', 'exif-orientation-2' => 'በአድማሱ ላይ ተገለበጠ', 'exif-orientation-3' => '180° የዞረ', 'exif-orientation-4' => 'በዋልታው ላይ ተገለበጠ', 'exif-componentsconfiguration-0' => 'አይኖርም', 'exif-exposureprogram-0' => 'አልተወሰነም', 'exif-exposureprogram-1' => 'በዕጅ', 'exif-exposureprogram-2' => 'መደበኛ ፕሮግራም', 'exif-exposureprogram-3' => 'የክፍተት ቀዳሚነት', 'exif-exposureprogram-4' => 'የከላይ ቀዳሚነት', 'exif-exposureprogram-6' => 'የድርጊት ፕሮግራም (ለፈጣን ከላይ ፍጥነት የዘነበለ)', 'exif-subjectdistance-value' => '$1 ሜትር', 'exif-meteringmode-0' => 'አይታወቅም', 'exif-meteringmode-1' => 'አማካኝ', 'exif-meteringmode-3' => 'ነጥብ', 'exif-meteringmode-6' => 'በከፊል', 'exif-meteringmode-255' => 'ሌላ', 'exif-lightsource-0' => 'አይታወቅም', 'exif-lightsource-1' => 'መዓልት', 'exif-lightsource-3' => 'Tungsten (ቦግ ያለ መብራት)', 'exif-lightsource-4' => 'ብልጭታ', 'exif-lightsource-9' => 'መልካም አየር', 'exif-lightsource-10' => 'ደመናም አየር', 'exif-lightsource-11' => 'ጥላ', 'exif-lightsource-17' => 'መደበኛ ብርሃን A', 'exif-lightsource-18' => 'መደበኛ ብርሃን B', 'exif-lightsource-19' => 'መደበኛ ብርሃን C', 'exif-lightsource-255' => 'ሌላ የብርሃን ምንጭ', # Flash modes 'exif-flash-function-1' => 'የብልጭታ ተግባር የለም', 'exif-focalplaneresolutionunit-2' => 'inches (ኢንች)', 'exif-sensingmethod-1' => 'ያልተወሰነ', 'exif-sensingmethod-2' => 'የ1-ኤሌክትሮ-ገል ቀለም ክልል ሰሚ', 'exif-sensingmethod-3' => 'የ2-ኤሌክትሮ-ገል ቀለም ክልል ሰሚ', 'exif-sensingmethod-4' => 'የ3-ኤሌክትሮ-ገል ቀለም ክልል ሰሚ', 'exif-sensingmethod-5' => 'ቀለም ተከታታይ ክልል ሰሚ', 'exif-sensingmethod-7' => 'ሦስት መስመር ያለው ሰሚ', 'exif-sensingmethod-8' => 'ቀለም ተከታታይ መስመር ሰሚ', '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-contrast-0' => 'መደበኛ', 'exif-contrast-1' => 'ለስላሳ', 'exif-contrast-2' => 'ጽኑዕ', 'exif-saturation-0' => 'መደበኛ', 'exif-sharpness-0' => 'መደበኛ', 'exif-sharpness-1' => 'ለስላሳ', 'exif-sharpness-2' => 'ጽኑዕ', 'exif-subjectdistancerange-0' => 'አይታወቅም', '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' => 'ምዕራብ ኬንትሮስ', 'exif-gpsmeasuremode-2' => '2 አቅጣቻ ያለው መለኪያ', 'exif-gpsmeasuremode-3' => '3 አቅጣቻ ያለው መለኪያ', # Pseudotags used for GPSSpeedRef 'exif-gpsspeed-k' => 'ኪሎሜትር በየሰዓቱ', 'exif-gpsspeed-m' => 'ማይል (mile) በየሰዓቱ', 'exif-gpsspeed-n' => 'Knot (የመርከብ ፍጥነት መለኪያ)', # Pseudotags used for GPSDestDistanceRef 'exif-gpsdestdistance-k' => 'ኪሎሜትር', 'exif-gpsdestdistance-m' => 'ማይል', 'exif-gpsdop-excellent' => 'በጣም ጥሩ', 'exif-gpsdop-good' => 'ጥሩ ($1)', 'exif-objectcycle-a' => 'ጥዋት ብቻ', 'exif-objectcycle-p' => 'ማታ ብቻ', 'exif-objectcycle-b' => 'ጥዋትም ማታም', # Pseudotags used for GPSTrackRef, GPSImgDirectionRef and GPSDestBearingRef 'exif-gpsdirection-t' => 'ዕውነተኛ አቅጣጫ', 'exif-gpsdirection-m' => 'መግነጢሳዊ አቅጣጫ', 'exif-dc-publisher' => 'አሳታሚ', 'exif-dc-rights' => 'መብቶች', 'exif-isospeedratings-overflow' => 'ከ65535 በላይ', 'exif-iimcategory-clj' => 'ወንጀልና ሕግ', 'exif-iimcategory-fin' => 'ምጣኔ ሀብትና ንግድ', 'exif-iimcategory-edu' => 'ትምህርት', 'exif-iimcategory-hth' => 'ጤንነት', '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-urgency-high' => 'ከፍተኛ ($1)', # External editor support 'edit-externally' => 'ይህንን ፋይል በአፍአዊ ሶፍትዌር ለማዘጋጀት', 'edit-externally-help' => '(ለተጨማሪ መረጃ ይህን ገፅ ተመልከቱ [//www.mediawiki.org/wiki/Manual:External_editors setup instructions])', # 'all' in various places, this might be different for inflected languages 'watchlistall2' => 'ሁሉ', 'namespacesall' => 'ሁሉ (all)', 'monthsall' => 'ሁሉ', 'limitall' => 'ሁሉ', # Email address confirmation 'confirmemail' => 'ኢ-ሜልዎን ለማረጋገጥ', 'confirmemail_noemail' => 'በ[[Special:Preferences|ምርጫዎችዎ]] ትክክለኛ ኢሜል አድራሻ አልሰጡም።', 'confirmemail_text' => 'አሁን በ{{SITENAME}} በኩል «ኢ-ሜል» ለመላክም ሆነ ለመቀበል አድራሻዎን ማረጋገጥ ግዴታ ሆኗል። እታች ያለውን በተጫኑ ጊዜ አንድ የማረጋገጫ መልእክት ቀድሞ ወደ ሰጡት ኢሜል አድራሻ በቀጥታ ይላካል። በዚህ መልእክት ልዩ ኮድ ያለበት መያያዣ ይገኝበታል፣ ይህንን መያያዣ ከዚያ ቢጎብኙ ኢ-ሜል አድራሻዎ የዛኔ ይረጋግጣል።', 'confirmemail_pending' => 'ማረጋገጫ ኮድ ከዚህ በፊት ገና ተልኮልዎታል። ብዕር ስምዎን ያወጡ በቅርብ ጊዜ ከሆነ፣ አዲስ ኮድን ከመጠይቅ በፊት ምናልባት የተላከው እስከሚደርስ ድረስ ጥቂት ደቂቃ መቆየት ይሻላል።', 'confirmemail_send' => 'የማረጋገጫ ኮድ ወደኔ ኢ-ሜል ይላክልኝ', 'confirmemail_sent' => 'የማረጋገጫ ኢ-ሜል ቅድም ወደ ሰጡት አድራሻ አሁን ተልኳል!', 'confirmemail_oncreate' => 'ማረጋገጫ ኮድ ወደ ኢ-ሜል አድራሻዎ ተልኳል። ይኸው ኮድ ለመግባት አያስፈልግም፤ ነገር ግን የዊኪው ኢ-ሜል ተግባር እንዲሠራ ለማድረግ ያስፈልጋል።', 'confirmemail_sendfailed' => 'ወደሰጡት ኢሜል አድራሻ መላክ አልተቻለም። እባክዎ፣ ወደ [[Special:Preferences|«ምርጫዎች»]] ተመልሰው የጻፉትን አድራሻ ደንበኛነት ይመለከቱ።', 'confirmemail_invalid' => 'ይህ ኮድ አልተከናወነም። (ምናልባት ጊዜው አልፏል።) እንደገና ይሞክሩ!', 'confirmemail_needlogin' => 'ኢሜል አድራሻዎን ለማረጋገጥ $1 ያስፈልግዎታል።', 'confirmemail_success' => 'እ-ሜል አድራሻዎ ተረጋግጧል። አሁን ገብተው ዊኪውን መጠቀም ይችላሉ።', 'confirmemail_loggedin' => 'የርስዎ ኢ-ሜል አድራሻ ተረጋግጧል። አሁን ኢ-ሜል በ{{SITENAME}} በኩል ለመላክ ወይም ለመቀበል ይችላሉ።', 'confirmemail_error' => 'ማረጋገጫዎን በመቆጠብ አንድ ችግር ተነሣ።', 'confirmemail_subject' => '{{SITENAME}} email address confirmation / እ-ሜል አድራሻ ማረጋገጫ', 'confirmemail_body' => 'ጤና ይስጥልኝ የርስዎ ኢ-ሜል አድራሻ በ$1 ለ{{SITENAME}} ብዕር ስም «$2» ቀርቧል። ይህ እርስዎ እንደ ሆኑ ለማረጋገጥና የ{{SITENAME}} ኢ-ሜል ጥቅም ለማግኘት፣ እባክዎን የሚከተለውን መያያዣ ይጎበኙ። $3 ይህ ምናልባት እርስዎ ካልሆኑ፣ መያያዣውን አይከተሉ። የዚህ መያያዣው ኮድ እስከ $4 ድረስ ይሠራል።', 'confirmemail_invalidated' => 'የኢ-ሜል አድራሻ ማረጋገጫ ተሠረዘ።', 'invalidateemail' => 'የኢ-ሜል ማረጋገጫ መሠረዝ', # Scary transclusion 'scarytranscludetoolong' => '[URL ከመጠን በላይ የረዘመ ነው]', # Delete conflict 'deletedwhileediting' => "'''ማስጠንቀቂያ'''፦ መዘጋጀት ከጀመሩ በኋላ ገጹ ጠፍቷል!", 'confirmrecreate' => "መዘጋጀት ከጀመሩ በኋላ፣ ተጠቃሚው [[User:$1|$1]] ([[User talk:$1|ውይይት]]) ገጹን አጠፍተው ይህን ምክንያት አቀረቡ፦ : ''$2'' እባክዎ ገጹን እንደገና ለመፍጠር በውኑ እንደ ፈለጉ ያረጋግጡ።", 'recreate' => 'እንደገና ይፈጠር', # action=purge 'confirm_purge_button' => 'እሺ', 'confirm-purge-top' => 'የዚሁ ገጽ ካሽ (cache) ይጠረግ?', # Multipage image navigation 'imgmultipageprev' => '← ፊተኛው ገጽ', 'imgmultipagenext' => 'የሚቀጥለው ገጽ →', 'imgmultigo' => 'ሂድ!', 'imgmultigoto' => 'ወደ ገጽ# $1 ለመሄድ', # Table pager 'table_pager_next' => 'ቀጥሎ ገጽ', 'table_pager_prev' => 'ፊተኛው ገጽ', 'table_pager_first' => 'መጀመርያው ግጽ', 'table_pager_last' => 'መጨረሻው ገጽ', 'table_pager_limit' => 'በየገጹ $1 መስመሮች', 'table_pager_limit_submit' => 'ይታዩ', 'table_pager_empty' => 'ምንም ውጤት የለም', # Auto-summaries 'autosumm-blank' => 'ጽሑፉን በሙሉ ደመሰሰ።', 'autosumm-replace' => 'ጽሑፉ በ«$1» ተተካ።', 'autoredircomment' => 'ወደ [[$1]] መምሪያ መንገድ ፈጠረ', 'autosumm-new' => 'አዲስ ገጽ ፈጠረ፦ «$1»', # Live preview 'livepreview-loading' => 'በመጫን ላይ ነው...', 'livepreview-ready' => 'በመጫን ላይ ነው... ዝግጁ!', 'livepreview-failed' => 'የቀጥታ ቅድመ-ዕይታ አልተከናወነም! የተለመደ ቅድመ-ዕይታ ይሞክሩ።', 'livepreview-error' => 'መገናኘት አልተከናወነም፦$1 «$2»። የተለመደ ቅድመ-ዕይታ ይሞክሩ።', # Friendlier slave lag warnings 'lag-warn-normal' => 'ከ$1 ሴኮንድ በፊት ጀምሮ የቀረቡ ለውጦች ምናልባት በዚህ ዝርዝር አይታዩም።', 'lag-warn-high' => 'የመረጃ-ቤት ሰርቨር በጣም ስለሚዘገይ፣ ከ$1 ሴኮንድ በፊት ጀምሮ የቀረቡ ለውጦች ምናልባት በዚህ ዝርዝር አይታዩም።', # Watchlist editor 'watchlistedit-numitems' => 'አሁን በሙሉ {{PLURAL:$1|$1 ገጽ|$1 ገጾች}} እየተከታተሉ ነው።', 'watchlistedit-noitems' => 'ዝርዝርዎ ባዶ ነው።', 'watchlistedit-normal-title' => 'ዝርዝሩን ለማስተካከል', 'watchlistedit-normal-legend' => 'አርእስቶችን ከተካከሉት ገጾች ዝርዝር ለማስወግድ...', 'watchlistedit-normal-explain' => 'ከዚህ ታች፣ የሚከታተሉት ገጾች ሁሉ በሙሉ ተዘርዝረው ይገኛሉ። አንዳንድ ገጽ ከዚህ ዝርዝር ለማስወግድ ያሠቡ እንደሆነ፣ በሳጥኑ ውስጥ ምልክት አድርገው በስተግርጌ በሚገኘው «ማስወግጃ» የሚለውን ተጭነው ከዚህ ዝርዝር ሊያስወግዷቸው ይቻላል። (ይህን በማድረግዎ ከገጹ ጋር የሚገናኘው ውይይት ገጽ ድግሞ ከዝርዝርዎ ይጠፋል።) ከዚህ ዘዴ ሌላ [[Special:EditWatchlist/raw|ጥሬውን ኮድ መቅዳት ወይም ማዘጋጀት]] ይቻላል።', 'watchlistedit-normal-submit' => 'ማስወገጃ', 'watchlistedit-normal-done' => 'ከዝርዝርዎ {{PLURAL:$1|1 አርዕስት ተወግዷል|$1 አርእስቶች ተወግደዋል}}፦', 'watchlistedit-raw-title' => 'የዝርዝሩ ጥሬ ኮድ', 'watchlistedit-raw-legend' => 'የዝርዝሩን ጥሬ ኮድ ለማዘጋጀት...', 'watchlistedit-raw-explain' => 'በተከታተሉት ገጾች ዝርዝር ላይ ያሉት አርእስቶች ሁሉ ከዚህ ታች ይታያሉ። በየመስመሩ አንድ አርእስት እንደሚኖር፣ ይህን ዝርዝር ለማዘጋጀት ይችላሉ። አዘጋጅተውት ከጨረሱ በኋላ በስተግርጌ «ዝርዝሩን ለማሳደስ» የሚለውን ይጫኑ። አለበለዚያ ቢሻልዎት፣ የተለመደውን ዘዴ ([[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' => 'የዝርዝሩ ጥሬ ኮድ', # Core parser functions 'unknown_extension_tag' => 'ያልታወቀ የቅጥያ ምልክት «$1»', # Special:Version 'version' => 'ዝርያ', 'version-extensions' => 'የተሳኩ ቅጥያዎች', 'version-specialpages' => 'ልዩ ገጾች', 'version-parserhooks' => 'የዘርዛሪ ሜንጦዎች', 'version-variables' => 'ተለዋጮች', 'version-other' => 'ሌላ', 'version-hooks' => 'ሜንጦዎች', 'version-extension-functions' => 'የቅጥያ ሥራዎች', 'version-parser-extensiontags' => 'የዝርዛሪ ቅጥያ ምልክቶች', 'version-parser-function-hooks' => 'የዘርዛሪ ተግባር ሜጦዎች', 'version-hook-name' => 'የሜንጦ ስም', 'version-hook-subscribedby' => 'የተጨመረበት', 'version-version' => '(ዝርያ $1)', 'version-license' => 'ፈቃድ', 'version-software' => 'የተሳካ ሶፍትዌር', 'version-software-product' => 'ሶፍትዌር', 'version-software-version' => 'ዝርያ', # Special:FilePath 'filepath' => 'የፋይል መንገድ', 'filepath-page' => 'ፋይሉ፦', 'filepath-submit' => 'መንገድ', 'filepath-summary' => 'ይህ ልዩ ገጽ ለ1 ፋይል ሙሉ መንገድ ይሰጣል።<br /> ስዕል በሙሉ ማጉላት ይታያል፤ ሌላ አይነት ፋይል በሚገባው ፕሮግራም በቀጥታ ይጀመራል።', # Special:FileDuplicateSearch 'fileduplicatesearch' => 'ለቅጂ ፋይሎች መፈልግ', 'fileduplicatesearch-legend' => 'ለቅጂ ለመፈልግ', 'fileduplicatesearch-filename' => 'የፋይል ስም:', 'fileduplicatesearch-submit' => 'ፍለጋ', 'fileduplicatesearch-noresults' => '«$1» የሚባል ፋይል አልተገኘም።', # Special:SpecialPages 'specialpages' => 'ልዩ ገጾች', 'specialpages-group-other' => 'ሌሎች ልዩ ገጾች', 'specialpages-group-login' => 'መግቢያ', 'specialpages-group-changes' => 'የቅርቡ ለውጦችና መዝገቦች', 'specialpages-group-users' => 'አባሎችና መብቶች', 'specialpages-group-highuse' => 'ከፍተኛ ጥቅም ያላቸው ገጾች', 'specialpages-group-pages' => 'የገጾች ዝርዝሮች', 'specialpages-group-pagetools' => 'የገጽ መሣሪያዎች', 'specialpages-group-wiki' => 'የዊኪ መረጃና መሣርያዎች', 'specialpages-group-spam' => 'የ«ስፓም» ማሳርያዎች', # Special:BlankPage 'blankpage' => 'ባዶ ገጽ', # Special:Tags 'tag-filter-submit' => 'ማጣሪያ', 'tags-edit' => 'አርም', 'tags-hitcount' => '$1 {{PLURAL:$1|ለውጥ|ለውጦች}}', # Database error messages 'dberr-header' => 'ይህ ዊኪ ችግር አለው', 'dberr-usegoogle' => 'ለአሁኑ ጊዜ በጉግል መፈልግ ይችላሉ።', # HTML forms 'htmlform-submit' => 'ለማቅረብ', 'htmlform-selectorother-other' => 'ሌላ', # New logging system 'logentry-delete-delete' => '$1 ገጹን $3 አጠፋ', 'newuserlog-byemail' => 'ማለፊያ-ቃል በኤ-መልዕክት ተልኳል', # Feedback 'feedback-cancel' => 'ይቅር', # Search suggestions 'searchsuggest-search' => 'ፈልግ', 'searchsuggest-containing' => 'በመጣጥፎች ይዘት ለመፈልግ...', # API errors 'api-error-badaccess-groups' => 'እርስዎ በዚህ ውኪ ላይ ፋይል እንድሊኩ አልተፈቀደም።', 'api-error-badtoken' => 'የውስጥ ስህተት: መጥፎ ጥቅል።', 'api-error-copyuploaddisabled' => 'በሰነድ አድራሻ መላክ በዚህ አቅራቢ ላይ አልተፈቀደም።', 'api-error-duplicate' => 'በዚህ ድረ ገጽ ላይ የዚህ ዓይነት ይዞታ {{PLURAL:$1| [$2 ያለው ፋይል አለ።] | [$2 ያላቸው ፍይሎች አሉ።]}}', 'api-error-duplicate-popup-title' => 'አንድ አይነት {{PLURAL:$1|ፋይል|ፋይሎች}}', 'api-error-empty-file' => 'የላኩት ፋይል ባዶ ነበር።', 'api-error-fetchfileerror' => 'የውስጥ ስህተት: ፍይሉ ሲመጣ ችግር ተፈጠረ።', 'api-error-file-too-large' => 'የላኩት ፋይል በጣም ትልቅ ነበር።', 'api-error-filename-tooshort' => 'የፋይሉ ስም በጣም ትንሽ ነው።', 'api-error-filetype-banned' => 'የዚህ ዓይነት ፋይል ተከልክሏል።', 'api-error-filetype-banned-type' => '$1 ያልተፈቀደ ፋይል አይነት ነው። የተፈቀዱት ፋይል አይነቶች $2 ናቸው።', 'api-error-filetype-missing' => 'ፋይሉ ቅጥያ ይጎለዋል።', 'api-error-illegal-filename' => 'የፋይሉ ስም የተፈቀደ አይደለም።', 'api-error-invalid-file-key' => 'የውስጥ ስህተት: ፍይሉ የጊዜያዊ ማስቀመጫ ውስጥ አልተገኘም።', 'api-error-missingparam' => 'የውስጥ ስህተት: ጥያቄው ግቤቶች ይጎሉታል።', 'api-error-missingresult' => 'የውስጥ ስህተት: መቅዳቱ እንደተሳካ ማረጋገጥ አልተቻለም።', 'api-error-mustbeloggedin' => 'ፋይል ለመላክ ተዘግቦ መግባት ያስፈልጋል።', 'api-error-noimageinfo' => 'ፋይል መላኩ ተሳክቷል ግን አቅራቢው ምንም ዓይነት መረጃ ስለ ፋይሉ አልሰጠም።', 'api-error-overwrite' => 'እንድን ፋይል ደምስሶ መጻፍ አልተፈቀደም።', 'api-error-stashfailed' => 'የውስጥ ስህተት: አቅራቢው ጊዜያዊ ፍይሉን አላስቀመጠም።', 'api-error-timeout' => 'በሚገባ ጊዜ ውስጥ አቅራቢው መልስ አልሰጠም።', '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' => 'ይህ ፋይል የተበላሸ ወይም ትክክል ያልሆነ ቅጥያ ያለው ሊሆን ይችላል።', );
gpl-2.0
casedot/AllYourBaseTemplate
wp-content/plugins/redirection/modules/wordpress.php
4302
<?php class WordPress_Module extends Red_Module { const MODULE_ID = 1; private $matched = false; public function get_id() { return self::MODULE_ID; } public function can_edit_config() { return false; } public function render_config() { } public function get_config() { return array(); } public function start() { // Setup the various filters and actions that allow Redirection to happen add_action( 'init', array( &$this, 'init' ) ); add_action( 'send_headers', array( &$this, 'send_headers' ) ); add_filter( 'permalink_redirect_skip', array( &$this, 'permalink_redirect_skip' ) ); add_filter( 'wp_redirect', array( &$this, 'wp_redirect' ), 1, 2 ); add_action( 'template_redirect', array( &$this, 'template_redirect' ) ); // Remove WordPress 2.3 redirection remove_action( 'template_redirect', 'wp_old_slug_redirect' ); remove_action( 'edit_form_advanced', 'wp_remember_old_slug' ); } public function init() { $url = $_SERVER['REQUEST_URI']; // Make sure we don't try and redirect something essential if ( !$this->protected_url( $url ) && $this->matched === false ) { do_action( 'redirection_first', $url, $this ); $redirects = Red_Item::get_for_url( $url, 'wp' ); foreach ( (array)$redirects AS $item ) { if ( $item->matches( $url ) ) { $this->matched = $item; break; } } do_action( 'redirection_last', $url, $this ); } } private function protected_url( $url ) { return false; } public function template_redirect() { if ( is_404() ) { $options = red_get_options(); if ( isset( $options['expire_404'] ) && $options['expire_404'] >= 0 ) { RE_404::create( $this->get_url(), $this->get_user_agent(), $this->get_ip(), $this->get_referrer() ); } } } public function status_header( $status ) { // Fix for incorrect headers sent when using FastCGI/IIS if ( substr( php_sapi_name(), 0, 3 ) == 'cgi' ) return str_replace( 'HTTP/1.1', 'Status:', $status ); return $status; } public function send_headers( $obj ) { if ( !empty( $this->matched ) && $this->matched->match->action_code == '410' ) { add_filter( 'status_header', array( &$this, 'set_header_410' ) ); } } public function set_header_410() { return 'HTTP/1.1 410 Gone'; } public function wp_redirect( $url, $status ) { global $wp_version, $is_IIS; if ( $is_IIS ) { header( "Refresh: 0;url=$url" ); return $url; } elseif ( $status == 301 && php_sapi_name() == 'cgi-fcgi' ) { $servers_to_check = array( 'lighttpd', 'nginx' ); foreach ( $servers_to_check as $name ) { if ( stripos( $_SERVER['SERVER_SOFTWARE'], $name ) !== false ) { status_header( $status ); header( "Location: $url" ); exit( 0 ); } } } status_header( $status ); return $url; } public function update( $data ) { return false; } protected function load( $options ) { } protected function flush_module() { } public function permalink_redirect_skip( $skip ) { // only want this if we've matched using redirection if ( $this->matched ) $skip[] = $_SERVER['REQUEST_URI']; return $skip; } public function get_name() { return __( 'WordPress', 'redirection' ); } public function get_description() { return __( 'WordPress-powered redirects. This requires no further configuration, and you can track hits.', 'redirection' ); } private function get_url() { if ( isset( $_SERVER['REQUEST_URI'] ) ) return $_SERVER['REQUEST_URI']; return ''; } private function get_user_agent() { if ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) return $_SERVER['HTTP_USER_AGENT']; return false; } private function get_referrer() { if ( isset( $_SERVER['HTTP_REFERER'] ) ) return $_SERVER['HTTP_REFERER']; return false; } private function get_ip() { if ( isset( $_SERVER['REMOTE_ADDR'] ) ) return $_SERVER['REMOTE_ADDR']; elseif ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) return $_SERVER['HTTP_X_FORWARDED_FOR']; return ''; } }
gpl-2.0
ArtemElchin/struct-dissector
src/main/net/taunova/protocol/rtp/TcpDissectorDemo.java
5083
package net.taunova.protocol.rtp; import com.taunova.util.field.Fields; import java.io.File; import java.io.IOException; import java.nio.ByteBuffer; import net.taunova.protocol.*; import javolution.io.Struct; public class TcpDissectorDemo extends AbstractDissector { public Dissection dissect(DataInput input, Dissection d) { d.addProtocol(new RtcpProtocol()); class ProtocolFields1 extends Struct { Unsigned16 source_port=new Unsigned16(); Unsigned16 destination_port=new Unsigned16(); Unsigned32 sequence_number =new Unsigned32(); Unsigned32 acknowledgment_number=new Unsigned32(); BitField data_offset=new BitField(4); BitField reserved=new BitField(3); BitField ns=new BitField(1); BitField cwr= new BitField(1); BitField ece=new BitField(1); BitField urg=new BitField(1); BitField ack=new BitField(1); BitField psh=new BitField(1); BitField syn=new BitField(1); BitField fin=new BitField(1); Unsigned16 window_size=new Unsigned16(); Unsigned16 checksum=new Unsigned16(); Unsigned16 urgent_poin=new Unsigned16(); //Option========================================== BitField no_operation=new BitField(8); Unsigned32 max_segment_size=new Unsigned32(); Unsigned32 window_scale=new Unsigned32(); Unsigned16 sack_permitted=new Unsigned16(); Signed64 timestamp_1=new Signed64(); Unsigned16 timestamp_2=new Unsigned16(); Signed64 sack_1=new Signed64(); Unsigned16 sack_2=new Unsigned16(); BitField end_of_option_list=new BitField(1); //================================================== } ProtocolFields1 objectProtocolFields=new ProtocolFields1(); byte[] b=input.get(0, 20); ByteBuffer buff= ByteBuffer.wrap(b); objectProtocolFields.setByteBuffer(buff, 0); d.addField(Fields.createInteger(1, objectProtocolFields.source_port.get())); d.addField(Fields.createInteger(2, objectProtocolFields.destination_port.get())); d.addField(Fields.createLong(3, objectProtocolFields.sequence_number.get())); d.addField(Fields.createLong(4, objectProtocolFields.acknowledgment_number.get())); d.addField(Fields.createByte(5, objectProtocolFields.data_offset.byteValue())); d.addField(Fields.createByte(6, objectProtocolFields.reserved.byteValue())); d.addField(Fields.createByte(7, objectProtocolFields.ns.byteValue())); d.addField(Fields.createByte(8, objectProtocolFields.cwr.byteValue())); d.addField(Fields.createByte(9, objectProtocolFields.ece.byteValue())); d.addField(Fields.createByte(10, objectProtocolFields.urg.byteValue())); d.addField(Fields.createByte(11, objectProtocolFields.ack.byteValue())); d.addField(Fields.createByte(12, objectProtocolFields.psh.byteValue())); d.addField(Fields.createByte(13, objectProtocolFields.syn.byteValue())); d.addField(Fields.createByte(14, objectProtocolFields.fin.byteValue())); d.addField(Fields.createInteger(15, objectProtocolFields.window_size.get())); d.addField(Fields.createInteger(16, objectProtocolFields.checksum.get())); d.addField(Fields.createInteger(17, objectProtocolFields.urgent_poin.get())); //Option==================================================================================== d.addField(Fields.createShort(18, objectProtocolFields.no_operation.shortValue())); d.addField(Fields.createLong(19, objectProtocolFields.max_segment_size.get())); d.addField(Fields.createLong(20, objectProtocolFields.window_scale.get())); d.addField(Fields.createInteger(21, objectProtocolFields.sack_permitted.get())); d.addField(Fields.createLong(22, objectProtocolFields.timestamp_1.get())); d.addField(Fields.createInteger(23, objectProtocolFields.timestamp_2.get())); d.addField(Fields.createLong(24, objectProtocolFields.sack_1.get())); d.addField(Fields.createInteger(25, objectProtocolFields.sack_2.get())); d.addField(Fields.createByte(26, objectProtocolFields.end_of_option_list.byteValue())); //=================================================================================== return d; } @Override public boolean isProtocol(DataInput input, Dissection dissection) { throw new UnsupportedOperationException("Not supported yet."); } public static void main(String[] args) throws IOException { System.out.println("Dissecting TCP packet"); Dissection dissection = new BasicDissection(); byte[] buffer = ProtocolDataHelper.getFrameData(new File("example/default_tcp_1.bin")); DataInput packetInput = new ByteArrayDataInput(buffer); TcpDissectorDemo dissectionDemo = new TcpDissectorDemo(); dissectionDemo.dissect(packetInput, dissection); System.out.println("Loaded data: " + packetInput); System.out.println("Decoded data: " + dissection); } }
gpl-2.0
robertoyus/jautomata-core-android
src/rationals/utils/MsgQueue.java
2516
package rationals.utils; import java.io.Serializable; import java.util.Collection; import java.util.Iterator; import java.util.LinkedList; import java.util.NoSuchElementException; /** * @author bailly * @version $Id: MsgQueue.java,v 1.1 2013/03/08 17:53:37 gesteban Exp $ */ public class MsgQueue implements Serializable { /** private list for queueing */ private LinkedList list = new LinkedList(); /** counter of enqueued objects */ private int count = 0; /** lock object */ private transient Object lock = new Object(); ///////////////////////////////////////////////// // CONSTRUCTOR ////////////////////////////////////////////////// //////////////////////////////////////////////: // PUBLIC METHODS /////////////////////////////////////////////// /** * Dequeu first message * * this method is blocking * * @return first message in list or null */ public Object dequeue() { try { synchronized (lock) { return list.removeFirst(); } } catch (NoSuchElementException nsex) { return null; } } /** * Adds all elements of collection in order of * iterator for collection * * @param col a Collection */ public void addAll(Collection coll) { Iterator it = coll.iterator(); while (it.hasNext()) { enqueue((Object) it.next()); } } /** * Enqueue message at end * * @param msg message to enqueue */ public void enqueue(Object msg) { synchronized (lock) { list.addLast(msg); } count++; } /** * Get all messages in the list as an array of messages * * @return an array of Object objects or null */ public Object[] dequeueAll() { Object[] ary = new Object[0]; synchronized (lock) { ary = (Object[]) list.toArray(ary); list.clear(); } return ary; } /** * get number of messages in queue * * @return number of messages */ public int getSize() { synchronized(lock) { return list.size(); } } /** * Get number of messages which have been enqueued * @return total number of messages of queue */ public int getCount() { return count; } /** * removes all messages m queue */ public void flush() { synchronized (lock) { list.clear(); } } /** * ReadObject implementation */ private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, ClassNotFoundException { try { // first, call default serialization mechanism stream.defaultReadObject(); lock = new Object(); } catch (java.io.NotActiveException ex) { } } }
gpl-2.0
Square-dot-HipToBe/FieldService
MyTime/Controls/Primitives/DigitDataSource.cs
1999
using System; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Ink; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using Microsoft.Phone.Controls.Primitives; namespace Controls.Primitives { internal class DigitDataSource : ILoopingSelectorDataSource { public DigitDataSource(int minValue, int maxValue, int step, int defaultValue, string stringFormat) { MinValue = minValue; MaxValue = maxValue; Step = step; SelectedItem = defaultValue; StringFormat = stringFormat; } public int MinValue { get; set; } public int MaxValue { get; set; } public int Step { get; set; } private string ApplyFormat(int digit) { return digit.ToString(StringFormat); } #region ILoopingSelectorDataSource Members public object GetNext(object relativeTo) { return Convert.ToInt32(relativeTo) + Step > MaxValue ? ApplyFormat(MinValue) : ApplyFormat(Convert.ToInt32(relativeTo) + Step); } public object GetPrevious(object relativeTo) { return Convert.ToInt32(relativeTo) - Step < MinValue ? ApplyFormat(MaxValue) : ApplyFormat(Convert.ToInt32(relativeTo) - Step); } public string StringFormat { get; private set; } public int selectedItem; public object SelectedItem { get { return ApplyFormat(selectedItem); } set { int newValue = Convert.ToInt32(value); if (selectedItem != newValue) { int previousSelectedItem = selectedItem; selectedItem = newValue; EventHandler<SelectionChangedEventArgs> handler = SelectionChanged; if (handler != null) handler(this, new SelectionChangedEventArgs(new object[] { ApplyFormat(previousSelectedItem) }, new object[] { ApplyFormat(selectedItem) })); } } } public event EventHandler<SelectionChangedEventArgs> SelectionChanged; #endregion } }
gpl-2.0
felipenaselva/felipe.repository
script.module.urlresolver.xxx/resources/plugins/xnxx.py
1337
''' urlresolver XBMC Addon Copyright (C) 2016 Gujal This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. ''' from urlresolver.plugins.lib import helpers from urlresolver.resolver import UrlResolver, ResolverError class XNXXResolver(UrlResolver): name = 'xnxx' domains = ['xnxx.com'] pattern = '(?://|\.)(xnxx\.com)/video-(.+)' def get_media_url(self, host, media_id): return helpers.get_media_url(self.get_url(host, media_id), patterns=['''setVideo(?:Url)?(?P<label>(?:HLS|High|Low))\(['"](?P<url>[^"']+)''']).replace(' ', '%20') def get_url(self, host, media_id): return self._default_get_url(host, media_id, template='http://www.{host}/video-{media_id}') @classmethod def _is_enabled(cls): return True
gpl-2.0
haidarafif0809/qwooxcqmkozzxce
batal_edit_penjualan_ugd.php
807
<?php session_start(); // memasukan file db.php include 'db.php'; include 'sanitasi.php'; // mengirim data(file) no_faktur, menggunakan metode GET $session_id = session_id(); $no_reg = stringdoang($_GET['no_reg']); // menghapus data pada tabel tbs_pembelian berdasarkan no_faktur $query = $db->query("DELETE FROM tbs_penjualan WHERE no_reg = '$no_reg'"); // logika $query => jika $query benar maka akan menuju ke formpemebelain.php // dan jika salah maka akan menampilkan kalimat failed if ($query == TRUE) { echo '<META HTTP-EQUIV="Refresh" Content="0; URL=lap_penjualan.php?no_reg='.$no_reg.'">'; } else { echo "failed"; } //Untuk Memutuskan Koneksi Ke Database mysqli_close($db); ?>
gpl-2.0
efaby/clinica
libraries/regularlabs/fields/menuitems.php
3148
<?php /** * @package Regular Labs Library * @version 16.5.10919 * * @author Peter van Westen <info@regularlabs.com> * @link http://www.regularlabs.com * @copyright Copyright © 2016 Regular Labs All Rights Reserved * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL */ defined('_JEXEC') or die; require_once dirname(__DIR__) . '/helpers/field.php'; class JFormFieldRL_MenuItems extends RLFormField { public $type = 'MenuItems'; protected function getInput() { $this->params = $this->element->attributes(); $size = (int) $this->get('size'); $multiple = $this->get('multiple', 0); RLFunctions::loadLanguage('com_menus', JPATH_ADMINISTRATOR); $options = $this->getMenuItems(); require_once dirname(__DIR__) . '/helpers/html.php'; return RLHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple); } /** * Get a list of menu links for one or all menus. */ public static function getMenuItems() { $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('a.id AS value, a.title AS text, a.alias, a.level, a.menutype, a.type, a.template_style_id, a.checked_out, a.language') ->from('#__menu AS a') ->join('LEFT', $db->quoteName('#__menu') . ' AS b ON a.lft > b.lft AND a.rgt < b.rgt') ->where('a.published != -2') ->group('a.id, a.title, a.level, a.menutype, a.type, a.template_style_id, a.checked_out, a.lft') ->order('a.lft ASC'); // Get the options. $db->setQuery($query); try { $links = $db->loadObjectList(); } catch (RuntimeException $e) { JError::raiseWarning(500, $e->getMessage()); return false; } // Group the items by menutype. $query->clear() ->select('*') ->from('#__menu_types') ->where('menutype <> ' . $db->quote('')) ->order('title, menutype'); $db->setQuery($query); try { $menuTypes = $db->loadObjectList(); } catch (RuntimeException $e) { JError::raiseWarning(500, $e->getMessage()); return false; } // Create a reverse lookup and aggregate the links. $rlu = array(); foreach ($menuTypes as &$type) { $type->value = 'type.' . $type->menutype; $type->text = $type->title; $type->level = 0; $type->class = 'hidechildren'; $type->labelclass = 'nav-header'; $rlu[$type->menutype] = &$type; $type->links = array(); } // Loop through the list of menu links. foreach ($links as &$link) { if (isset($rlu[$link->menutype])) { if (preg_replace('#[^a-z0-9]#', '', strtolower($link->text)) !== preg_replace('#[^a-z0-9]#', '', $link->alias)) { $link->text .= ' <small>[' . $link->alias . ']</small>'; } if ($link->language && $link->language != '*') { $link->text .= ' <small>(' . $link->language . ')</small>'; } if ($link->type == 'alias') { $link->text .= ' <small>(' . JText::_('COM_MENUS_TYPE_ALIAS') . ')</small>'; $link->disable = 1; } $rlu[$link->menutype]->links[] = &$link; // Cleanup garbage. unset($link->menutype); } } return $menuTypes; } }
gpl-2.0
bmitchenko/spa
spa.common/Modules/Notification.ts
1651
module spa { /** Уведомление. */ export class Notification<TArgs> { private _dispatched = false; private _listeners: { (args?: TArgs): any }[] = []; private _args: TArgs; /** Уведомляет подписчиков о событии. */ public notify(args?: TArgs): void { this._listeners.forEach((listener) => { listener(args); }); } /** Уведомляет подписчиков о событии. Последующие подписчики также будут уведомлены о событии. */ public notifyOnce(args?: TArgs) { if (this._dispatched) { return; } else { this._args = args; this._dispatched = true; this.notify(args); } } /** Освобождает ресурсы уведомления и очищает список подпичсчиков. */ public dispose(): void { this._args = null; this._listeners.length = 0; this._listeners = null; } /** Подписаться на событие. */ public subscribe(handler: (args?: TArgs) => any): void { this._listeners.push(handler); if (this._dispatched) { handler(this._args); } } /** Отписаться от события. */ public unsubscribe(handler: (args?: TArgs) => any): boolean { return this._listeners.remove(handler); } } }
gpl-2.0
pjarosik/golem
src/main/scala/com/github/golem/command/Command.scala
119
package com.github.golem.command trait Command /** * Informative means 'response is ommited'. */ trait Informative
gpl-2.0
tomsrocket/radio-pi
config/generate-google-key.php
2327
<?php require __DIR__ . '../web-frontend/vendor/autoload.php'; require 'config.php'; if (php_sapi_name() != 'cli') { throw new Exception('This application must be run on the command line.'); } /** * Returns an authorized API client. * @return Google_Client the authorized client object */ function getClient() { $client = new Google_Client(); $client->setApplicationName(APPLICATION_NAME); $client->setScopes(SCOPES); $client->setAuthConfigFile(CLIENT_SECRET_PATH); $client->setAccessType('offline'); // Load previously authorized credentials from a file. $credentialsPath = CREDENTIALS_PATH; if (file_exists($credentialsPath)) { $accessToken = file_get_contents($credentialsPath); } else { // Request authorization from the user. $authUrl = $client->createAuthUrl(); printf("Open the following link in your browser:\n%s\n", $authUrl); print 'Enter verification code: '; $authCode = trim(fgets(STDIN)); // Exchange authorization code for an access token. $accessToken = $client->authenticate($authCode); // Store the credentials to disk. if(!file_exists(dirname($credentialsPath))) { mkdir(dirname($credentialsPath), 0700, true); } file_put_contents($credentialsPath, $accessToken); printf("Credentials saved to %s\n", $credentialsPath); } $client->setAccessToken($accessToken); // Refresh the token if it's expired. if ($client->isAccessTokenExpired()) { $client->refreshToken($client->getRefreshToken()); file_put_contents($credentialsPath, $client->getAccessToken()); } return $client; } // Get the API client and construct the service object. $client = getClient(); $service = new Google_Service_Calendar($client); // Print the next 10 events on the user's calendar. $calendarId = 'primary'; $optParams = array( 'maxResults' => 10, 'orderBy' => 'startTime', 'singleEvents' => TRUE, 'timeMin' => date('c'), ); $results = $service->events->listEvents($calendarId, $optParams); if (count($results->getItems()) == 0) { print "No upcoming events found.\n"; } else { print "Upcoming events:\n"; foreach ($results->getItems() as $event) { $start = $event->start->dateTime; if (empty($start)) { $start = $event->start->date; } printf("%s (%s)\n", $event->getSummary(), $start); } }
gpl-2.0
opieproject/opie
i18n/fr/embeddedkonsole.ts
7275
<!DOCTYPE TS><TS> <defaultcodec>iso8859-1</defaultcodec> <context> <name>CommandEditDialog</name> <message> <source>Command Selection</source> <translation>Sélection commande</translation> </message> </context> <context> <name>CommandEditDialogBase</name> <message> <source>Commands</source> <translation>Editer commandes</translation> </message> <message> <source>&lt;B&gt;Commands&lt;/B&gt;:</source> <translation>&lt;B&gt;Commandes de la liste actuelle&lt;/B&gt; : </translation> </message> <message> <source>&lt;B&gt;Suggested Commands&lt;/B&gt;:</source> <translation>&lt;B&gt;Autres commandes suggérées&lt;/B&gt; : </translation> </message> </context> <context> <name>Konsole</name> <message> <source>Terminal</source> <translation>Konsole</translation> </message> <message> <source>New</source> <translation>Nouveau</translation> </message> <message> <source>Enter</source> <translation>Entrer</translation> </message> <message> <source>Space</source> <translation>Espace</translation> </message> <message> <source>Tab</source> <translation>Tabulation</translation> </message> <message> <source>Up</source> <translation>Monter</translation> </message> <message> <source>Down</source> <translation>Descendre</translation> </message> <message> <source>Paste</source> <translation>Coller</translation> </message> <message> <source>Show command list</source> <translation>Afficher liste</translation> </message> <message> <source>Hide command list</source> <translation>Cacher liste</translation> </message> <message> <source>Green on Black</source> <translation>Vert sur noir</translation> </message> <message> <source>Black on White</source> <translation>Noir sur blanc</translation> </message> <message> <source>White on Black</source> <translation>Blanc sur noir</translation> </message> <message> <source>Green on Yellow</source> <translation>Vert sur jaune</translation> </message> <message> <source>Blue on Magenta</source> <translation>Bleu sur magenta</translation> </message> <message> <source>Magenta on Blue</source> <translation>Magenta sur bleu</translation> </message> <message> <source>Cyan on White</source> <translation>Cyan sur blanc</translation> </message> <message> <source>White on Cyan</source> <translation>Blanc sur cyan</translation> </message> <message> <source>Blue on Black</source> <translation>Bleu sur noir</translation> </message> <message> <source>Amber on Black</source> <translation>Ambre sur noir</translation> </message> <message> <source>Colors</source> <translation>Couleurs</translation> </message> <message> <source>Quick Edit</source> <translation>Liste éditable</translation> </message> <message> <source>None</source> <translation>Aucune</translation> </message> <message> <source>Left</source> <translation>Gauche</translation> </message> <message> <source>Right</source> <translation>Droite</translation> </message> <message> <source>ScrollBar</source> <translation>Barre de défilement</translation> </message> <message> <source>Show Command List</source> <translation>Afficher liste</translation> </message> <message> <source>Hide Command List</source> <translation>Cacher liste</translation> </message> <message> <source>Custom</source> <translation>Personaliser</translation> </message> <message> <source>Command List</source> <translation>Liste commandes</translation> </message> <message> <source>Wrap</source> <translation>Retour</translation> </message> <message> <source>Use Beep</source> <translation>Avertissement sonore</translation> </message> <message> <source>Konsole</source> <translation type="unfinished"></translation> </message> <message> <source>Bottom</source> <translation type="unfinished"></translation> </message> <message> <source>Top</source> <translation type="unfinished"></translation> </message> <message> <source>Hidden</source> <translation type="unfinished"></translation> </message> <message> <source>Tabs</source> <translation type="unfinished"></translation> </message> <message> <source>Black on Pink</source> <translation type="unfinished"></translation> </message> <message> <source>Pink on Black</source> <translation type="unfinished"></translation> </message> <message> <source>default</source> <translation type="unfinished"></translation> </message> <message> <source>new session</source> <translation type="unfinished"></translation> </message> <message> <source>View</source> <translation type="unfinished"></translation> </message> <message> <source>Fonts</source> <translation type="unfinished"></translation> </message> <message> <source>Sessions</source> <translation type="unfinished"></translation> </message> <message> <source>Full Screen</source> <translation type="unfinished"></translation> </message> <message> <source>Zoom</source> <translation type="unfinished"></translation> </message> <message> <source>Edit...</source> <translation type="unfinished"></translation> </message> <message> <source>History...</source> <translation type="unfinished"></translation> </message> <message> <source>To exit fullscreen, tap here.</source> <translation type="unfinished"></translation> </message> <message> <source>History Lines:</source> <translation type="unfinished"></translation> </message> <message> <source>Konsole </source> <translation type="unfinished"></translation> </message> <message> <source>Close</source> <translation type="unfinished"></translation> </message> </context> <context> <name>PlayListSelection</name> <message> <source>Command Selection</source> <translation>Sélection commande</translation> </message> </context> <context> <name>editCommandBase</name> <message> <source>Add command</source> <translation>Ajouter commande</translation> </message> <message> <source>Enter command to add:</source> <translation>&lt;B&gt;Entrez commande à ajouter&lt;/B&gt; : </translation> </message> </context> </TS>
gpl-2.0
remvee/xmlbs
src/xmlbs/tokens/CDATAToken.java
1495
/* * xmlbs * * Copyright (C) 2002 R.W. van 't Veer * * 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. */ package xmlbs.tokens; /** * Token to represent and hold CDATA blocks. * * @see <A href="http://www.w3.org/TR/REC-xml#sec-cdata-sect">XML: CDATA Sections</A> * @author R.W. van 't Veer * @version $Revision: 1.1 $ */ public class CDATAToken implements Token { /** character data */ private String data; /** * @param data CDATA content without &lt;![CDATA[ and ]]&gt; */ public CDATAToken (String data) { this.data = data; } /** * @return CDATA content */ public String getData () { return data; } /** * @return wellformed CDATA block */ public String toString () { return "<![CDATA[" + getData() + "]]>"; } }
gpl-2.0
ForAEdesWeb/AEW25
templates/ja_cagox/html/com_paycart/search/default_applied_filter.php
2741
<?php /** * @copyright Copyright (C) 2009 - 2012 Ready Bytes Software Labs Pvt. Ltd. All rights reserved. * @license GNU/GPL, see LICENSE.php * @package PAYCART * @subpackage Front-end * @contact support+paycart@readybytes.in * @author rimjhim jain */ // no direct access defined('_JEXEC') or die(); /** * List of Populated Variables * $displayData : object of stdclass containing data to show applied filters */ $appliedAttr = $filters->attribute->appliedAttr; $attributeOptions = $filters->attribute->appliedAttrDetail; $appliedPriceRange = $filters->core->appliedPriceRange; $appliedWeightRange = $filters->core->appliedWeightRange; $appliedInStock = $filters->core->appliedInStock; ?> <span class="text-muted"><i><?php echo JText::_('COM_PAYCART_FILTERED_BY').' : '?></i></span> <!-- Custom attributes --> <?php foreach ($appliedAttr as $id=>$data):?> <?php if(!empty($data)):?> <?php foreach ($data as $key=>$value):?> <span class="badge label-default pc-cursor-pointer" data-pc-filter="remove" data-pc-filter-applied-ref="filters[attribute][<?php echo $id?>][<?php echo $value?>]"> <?php echo $attributeOptions[$id][$value]->title ;?>&nbsp;&nbsp;<i class="fa fa-times-circle"></i> </span>&nbsp; <?php endforeach;?> <?php endif; ?> <?php endforeach;?> <!-- applied Price Range --> <?php if(!empty($appliedPriceRange)):?> <?php $key = key($appliedPriceRange);?> <?php $value = $appliedPriceRange[$key];?> <span class="badge label-default pc-cursor-pointer" data-pc-filter="remove" data-pc-filter-applied-ref="filters[core][price]"> <?php echo $value;?>&nbsp;&nbsp;<i class="fa fa-times-circle"></i> </span>&nbsp; <?php endif;?> <!-- applied Weight Range --> <?php if(!empty($appliedWeightRange)):?> <?php $key = key($appliedWeightRange);?> <?php $value = $appliedWeightRange[$key];?> <span class="badge label-default pc-cursor-pointer" data-pc-filter="remove" data-pc-filter-applied-ref="filters[core][weight]"> <?php echo $value;?>&nbsp;&nbsp;<i class="fa fa-times-circle"></i> </span>&nbsp; <?php endif;?> <!-- In stock --> <?php if(!empty($appliedInStock)) :?> <?php $key = key($appliedInStock);?> <?php $value = $appliedInStock[$key];?> <span class="badge label-default pc-cursor-pointer" data-pc-filter="remove" data-pc-filter-applied-ref="filters[core][<?php echo $key?>]"> <?php echo $value;?>&nbsp;&nbsp;<i class="fa fa-times-circle"></i> </span>&nbsp; <?php endif;?> <span class="hidden-xs badge pull-right pc-cursor-pointer" data-pc-selector="removeAll"> <?php echo JText::_("COM_PAYCART_FILTER_RESET_ALL")?>&nbsp;&nbsp;<i class="fa fa-times-circle"></i> </span> <?php
gpl-2.0
inverse-inc/sogo-integrator.tb3
chrome/content/messenger/folders-update.js
14731
function jsInclude(files, target) { let loader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"] .getService(Components.interfaces.mozIJSSubScriptLoader); for (let i = 0; i < files.length; i++) { try { loader.loadSubScript(files[i], target); } catch(e) { dump("folders-updates.js: failed to include '" + files[i] + "'\n" + e + "\nFile: " + e.fileName + "\nLine: " + e.lineNumber + "\n\n Stack:\n\n" + e.stack); } } } jsInclude(["chrome://sogo-integrator/content/sogo-config.js", "chrome://sogo-connector/content/general/mozilla.utils.inverse.ca.js", "chrome://inverse-library/content/sogoWebDAV.js", "chrome://sogo-integrator/content/addressbook/folder-handler.js", "chrome://sogo-integrator/content/addressbook/categories.js", "chrome://sogo-integrator/content/calendar/folder-handler.js", "chrome://sogo-integrator/content/calendar/default-classifications.js"]); function directoryChecker(type, handler) { this.type = type; this.handler = handler; this.additionalProperties = null; } directoryChecker.prototype = { additionalProperties: null, baseURL: sogoBaseURL(), _checkHTTPAvailability: function checkAvailability(yesCallback) { try { let target = { onDAVQueryComplete: function(aStatus, aResponse, aHeaders, aData) { if (aStatus != 0 && aStatus != 404 && yesCallback) { yesCallback(); } } }; let options = new sogoWebDAV(this.baseURL + this.type, target); options.options(); } catch(e) { if (yesCallback) { yesCallback(); } } }, checkAvailability: function checkAvailability(yesCallback) { let manager = Components.classes['@inverse.ca/context-manager;1'] .getService(Components.interfaces.inverseIJSContextManager).wrappedJSObject; let context = manager.getContext("inverse.ca/folders-update"); if (!context.availability) context.availability = {}; let available = context.availability[this.type]; if (typeof(available) == "undefined") { this._checkHTTPAvailability(function() { context.availability[this.type] = true; if (yesCallback) yesCallback(); } ); } else { if (available && yesCallback) { yesCallback(); } } }, start: function start() { let propfind = new sogoWebDAV(this.baseURL + this.type, this); let baseProperties = ["DAV: owner", "DAV: resourcetype", "DAV: displayname"]; let properties; if (this.handler.additionalDAVProperties) { this.additionalProperties = this.handler.additionalDAVProperties(); properties = baseProperties.concat(this.additionalProperties); } else properties = baseProperties; propfind.propfind(properties); }, removeAllExisting: function removeAllExisting() { let existing = this.handler.getExistingDirectories(); let remove = []; for (let k in existing) remove.push(existing[k]); this.handler.removeDirectories(remove); }, fixedExisting: function fixedExisting(oldExisting) { let newExisting = {}; let length = this.baseURL.length; for (let url in oldExisting) { if (url.substr(0, length) == this.baseURL) { let oldURL = url; if (url[url.length - 1] != '/') url = url.concat('/'); newExisting[url] = oldExisting[oldURL]; } } return newExisting; }, _fixedOwner: function _fixedOwner(firstOwner) { let ownerArray = firstOwner.split("/"); let ownerIdx = (ownerArray.length - ((firstOwner[firstOwner.length-1] == "/") ? 2 : 1)); return ownerArray[ownerIdx]; }, _fixedURL: function _fixedURL(firstURL) { let fixedURL; if (firstURL[0] == "/") { let baseURLArray = sogoBaseURL().split("/"); fixedURL = baseURLArray[0] + "//" + baseURLArray[2] + firstURL; } else fixedURL = firstURL; if (fixedURL[fixedURL.length - 1] != '/') fixedURL = fixedURL.concat('/'); // if (firstURL != fixedURL) // dump("fixed url: " + fixedURL + "\n"); return fixedURL; }, _isCollection: function _isCollection(resourcetype) { let isCollection = false; if (resourcetype) { for (let k in resourcetype) { if (k == "collection") { isCollection = true; } } } return isCollection; }, foldersFromResponse: function foldersFromResponse(jsonResponse) { let folders = {}; let username = sogoUserName(); let responses = jsonResponse["multistatus"][0]["response"]; for (let i = 0; i < responses.length; i++) { let url = this._fixedURL(responses[i]["href"][0]); let propstats = responses[i]["propstat"]; for (let j = 0; j < propstats.length; j++) { if (propstats[j]["status"][0].indexOf("HTTP/1.1 200") == 0) { let urlArray = url.split("/"); if (urlArray[urlArray.length-3] == this.type) { let prop = propstats[j]["prop"][0]; if (this._isCollection(prop["resourcetype"][0])) { let owner = this._fixedOwner("" + prop["owner"][0]["href"][0]); let additionalProps = []; if (this.additionalProperties) { for (let k = 0; k < this.additionalProperties.length; k++) { let pName = this.additionalProperties[k].split(" ")[1]; let newValue; if (prop[pName]) newValue = xmlUnescape(prop[pName][0]); else newValue = null; additionalProps.push(newValue); } } let newEntry = {owner: owner, displayName: xmlUnescape(prop["displayname"][0]), url: url, additional: additionalProps}; folders[url] = newEntry; } } } } } return folders; }, onDAVQueryComplete: function onDAVQueryComplete(status, response) { // dump("status: " + status + "\n"); if (status > 199 && status < 400) { let existing = this.fixedExisting(this.handler.getExistingDirectories()); this.handler.removeDoubles(); if (response) { let folders = this.foldersFromResponse(response); let comparison = this.compareDirectories(existing, folders); if (comparison['removed'].length) this.handler.removeDirectories(comparison['removed']); if (comparison['renamed'].length) this.handler.renameDirectories(comparison['renamed']); if (comparison['added'].length) this.handler.addDirectories(comparison['added']); } else dump("an empty response was returned, we therefore do nothing\n"); } else dump("the status code (" + status + ") was not acceptable, we therefore do nothing\n"); }, compareDirectories: function compareDirectories(existing, result) { let comparison = { removed: [], renamed: [], added: [] }; for (let url in result) { if (url[url.length - 1] != '/') url = url.concat('/'); if (!existing.hasOwnProperty(url)) { dump(result[url] + "; " + url + " registered for addition\n"); comparison['added'].push(result[url]); } } for (let url in existing) { if (url[url.length - 1] != '/') url = url.concat('/'); if (result.hasOwnProperty(url)) { dump(result[url] + "; " + url + " registered for renaming\n"); comparison['renamed'].push({folder: existing[url], displayName: result[url]['displayName'], additional: result[url].additional}); } else { dump(url + " registered for removal\n"); comparison['removed'].push(existing[url]); } } return comparison; } }; function checkFolders() { let console = Components.classes["@mozilla.org/consoleservice;1"] .getService(Components.interfaces.nsIConsoleService); let gExtensionManager = Components.classes["@mozilla.org/extensions/manager;1"] .getService(Components.interfaces.nsIExtensionManager); let connectorItem = gExtensionManager.getItemForID("sogo-connector@inverse.ca"); if (connectorItem && checkExtensionVersion(connectorItem.version, "3.100")) { let loader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"] .getService(Components.interfaces.mozIJSSubScriptLoader); if (GroupDavSynchronizer) { /* sogo-connector is recent enough for a clean synchronization, otherwise, missing messy symbols will cause exceptions to be thrown */ cleanupAddressBooks(); let handler = new AddressbookHandler(); let ABChecker = new directoryChecker("Contacts", handler); ABChecker.checkAvailability(function() { ABChecker.start(); handler.ensurePersonalIsRemote(); handler.ensureAutoComplete(); SIContactCategories.synchronizeFromServer(); startFolderSync(); }); } } else { console.logStringMessage("You must use at least SOGo Connector 3.1 with this version of SOGo Integrator."); } let lightningItem = gExtensionManager.getItemForID("{e2fda1a4-762b-4020-b5ad-a41df1933103}"); if (lightningItem && checkExtensionVersion(lightningItem.version, "1.0")) { let handler; try { handler = new CalendarHandler(); } catch(e) { // if lightning is not installed, an exception will be thrown so we // need to catch it to keep the synchronization process alive handler = null; } if (handler) { let CalendarChecker = new directoryChecker("Calendar", handler); CalendarChecker.checkAvailability(function() { if (document) { let toolbar = document.getElementById("subscriptionToolbar"); if (toolbar) { toolbar.collapsed = false; } } let prefService = (Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch)); let disableCalendaring; try { disableCalendaring = prefService.getBoolPref("sogo-integrator.disable-calendaring"); } catch(e) { disableCalendaring = false; } if (disableCalendaring) { CalendarChecker.removeAllExisting(); hideLightningWidgets("true"); } else { SICalendarDefaultClassifications.synchronizeFromServer(); handler.removeHomeCalendar(); CalendarChecker.start(); // hideLightningWidgets("false"); } }); } } else { console.logStringMessage("You must use at least Mozilla Lightning 1.0 with this version of SOGo Integrator."); } dump("startup done\n"); } function hideLightningWidgets(hide) { let widgets = [ "mode-toolbar", "today-splitter", "today-pane-panel", "ltnNewEvent", "ltnNewTask", "ltnNewCalendar", "ltnMenu_calendar", "ltnMenu_tasks", "invitations-pane" ]; for each (let name in widgets) { let widget = document.getElementById(name); if (widget) { if (hide == "true") { widget.removeAttribute("persist"); widget.removeAttribute("command"); widget.removeAttribute("name"); widget.setAttribute("collapsed", hide); } else if (!widget.getAttribute("persist")) { widget.setAttribute("collapsed", hide); } } else dump("widget not found '" + name + "'\n"); } }
gpl-2.0
kunj1988/Magento2
lib/internal/Magento/Framework/Test/Unit/Data/Form/Element/HiddenTest.php
1444
<?php declare(strict_types=1); /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Framework\Test\Unit\Data\Form\Element; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; /** * Test for \Magento\Framework\Data\Form\Element\Hidden. */ class HiddenTest extends \PHPUnit\Framework\TestCase { /** * @var \Magento\Framework\Data\Form\Element\Hidden */ private $element; protected function setUp() { $objectManager = new ObjectManager($this); $this->element = $objectManager->getObject(\Magento\Framework\Data\Form\Element\Hidden::class); } /** * @param mixed $value * * @dataProvider getElementHtmlDataProvider */ public function testGetElementHtml($value) { $form = $this->createMock(\Magento\Framework\Data\Form::class); $this->element->setForm($form); $this->element->setValue($value); $html = $this->element->getElementHtml(); if (is_array($value)) { foreach ($value as $item) { $this->assertContains($item, $html); } return; } $this->assertContains($value, $html); } /** * @return array */ public function getElementHtmlDataProvider() { return [ ['some_value'], ['store_ids[]' => ['1', '2']], ]; } }
gpl-2.0
egiggy/githubericgiguere
wp-content/themes/8cells_v1.0/8Cells/_vti_cnf/functions.php
997
vti_encoding:SR|utf8-nl vti_timelastmodified:TR|07 Nov 2011 16:42:00 -0000 vti_extenderversion:SR|12.0.0.0 vti_author:SR|Eric-PC\\Eric vti_modifiedby:SR|Eric-PC\\Eric vti_timecreated:TR|07 Nov 2011 16:42:00 -0000 vti_cacheddtm:TX|07 Nov 2011 16:42:00 -0000 vti_filesize:IR|24384 vti_cachedlinkinfo:VX|H|http://themeforest.net/user/peerapong H|http://twitter.com/ipeerapong H|< S|< H|< H|javascript:; H|http://cufon.shoqolate.com/generate/ H|http://fontsquirrel.com/ S|< vti_cachedsvcrellinks:VX|NHHS|http://themeforest.net/user/peerapong NHHS|http://twitter.com/ipeerapong DHUS|wp-content/themes/8cells_v1.0/8Cells/< DSUS|wp-content/themes/8cells_v1.0/8Cells/< DHUS|wp-content/themes/8cells_v1.0/8Cells/< SHUS|javascript:; NHHS|http://cufon.shoqolate.com/generate/ NHHS|http://fontsquirrel.com/ DSUS|wp-content/themes/8cells_v1.0/8Cells/< vti_cachedneedsrewrite:BR|false vti_cachedhasbots:BR|false vti_cachedhastheme:BR|false vti_cachedhasborder:BR|false vti_charset:SR|utf-8 vti_backlinkinfo:VX|
gpl-2.0
iammyr/Benchmark
src/main/java/org/owasp/benchmark/testcode/BenchmarkTest14540.java
3619
/** * OWASP Benchmark Project v1.1 * * This file is part of the Open Web Application Security Project (OWASP) * Benchmark Project. For details, please see * <a href="https://www.owasp.org/index.php/Benchmark">https://www.owasp.org/index.php/Benchmark</a>. * * The Benchmark 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. * * The Benchmark 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 * * @author Nick Sanidas <a href="https://www.aspectsecurity.com">Aspect Security</a> * @created 2015 */ package org.owasp.benchmark.testcode; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet("/BenchmarkTest14540") public class BenchmarkTest14540 extends HttpServlet { private static final long serialVersionUID = 1L; @Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); } @Override public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { javax.servlet.http.Cookie[] cookies = request.getCookies(); String param = null; boolean foundit = false; if (cookies != null) { for (javax.servlet.http.Cookie cookie : cookies) { if (cookie.getName().equals("foo")) { param = cookie.getValue(); foundit = true; } } if (!foundit) { // no cookie found in collection param = ""; } } else { // no cookies param = ""; } String bar = doSomething(param); String cmd = org.owasp.benchmark.helpers.Utils.getOSCommandString("echo"); String[] argsEnv = { bar }; Runtime r = Runtime.getRuntime(); try { Process p = r.exec(cmd, argsEnv); org.owasp.benchmark.helpers.Utils.printOSCommandResults(p); } catch (IOException e) { System.out.println("Problem executing cmdi - TestCase"); throw new ServletException(e); } } // end doPost private static String doSomething(String param) throws ServletException, IOException { // Chain a bunch of propagators in sequence String a92228 = param; //assign StringBuilder b92228 = new StringBuilder(a92228); // stick in stringbuilder b92228.append(" SafeStuff"); // append some safe content b92228.replace(b92228.length()-"Chars".length(),b92228.length(),"Chars"); //replace some of the end content java.util.HashMap<String,Object> map92228 = new java.util.HashMap<String,Object>(); map92228.put("key92228", b92228.toString()); // put in a collection String c92228 = (String)map92228.get("key92228"); // get it back out String d92228 = c92228.substring(0,c92228.length()-1); // extract most of it String e92228 = new String( new sun.misc.BASE64Decoder().decodeBuffer( new sun.misc.BASE64Encoder().encode( d92228.getBytes() ) )); // B64 encode and decode it String f92228 = e92228.split(" ")[0]; // split it on a space org.owasp.benchmark.helpers.ThingInterface thing = org.owasp.benchmark.helpers.ThingFactory.createThing(); String g92228 = "barbarians_at_the_gate"; // This is static so this whole flow is 'safe' String bar = thing.doSomething(g92228); // reflection return bar; } }
gpl-2.0
SpoonLabs/nopol
nopol/src/test/java/fr/inria/lille/repair/nopol/Defects4jUtils.java
4074
package fr.inria.lille.repair.nopol; import fr.inria.lille.commons.synthesis.smt.solver.SolverFactory; import fr.inria.lille.repair.TestUtility; import fr.inria.lille.repair.common.config.NopolContext; import fr.inria.lille.repair.common.synth.RepairType; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.junit.Test; import java.io.File; import java.io.FileInputStream; import java.net.URL; import java.util.ArrayList; import java.util.List; import java.util.Properties; import static org.junit.Assert.assertEquals; public class Defects4jUtils { private Defects4jUtils(){} // only static methods public final static int FIVE_MINUTES_TIMEOUT =5*60*1000;// 5 minutes in millisecs public final static int TEN_MINUTES_TIMEOUT =10*60*1000;// 10 minutes in millisecs public final static int FIFTEEN_MINUTES_TIMEOUT =15*60*1000;// 15 minutes in millisecs public static boolean testShouldBeRun() { if (System.getenv("NOPOL_EVAL_DEFECTS4J")==null) { return false; } return true; } public static NopolContext nopolConfigFor(String bug_id) throws Exception { return nopolConfigFor(bug_id, ""); } public static NopolContext nopolConfigFor(String bug_id, String mvn_option) throws Exception { String folder = "unknown"; // for Chart, we use ant if (bug_id.startsWith("Chart") && !new File(bug_id).exists()) { // here we use maven to compile String command = "mkdir " + bug_id +";\n cd " + bug_id + ";\n git init;\n git fetch https://github.com/Spirals-Team/defects4j-repair " + bug_id + ":" + bug_id + ";\n git checkout "+bug_id+";\n" +"sed -i -e '/delete dir/ d' ant/build.xml;\n" +"ant -f ant/build.xml compile compile-tests;\n" +"echo -n `pwd`/lib/iText-2.1.4.jar:`pwd`/lib/junit.jar:`pwd`/lib/servlet.jar > cp.txt;\n" ; System.out.println(command); Process p = Runtime.getRuntime().exec(new String[]{"sh", "-c", command}); p.waitFor(); String output = IOUtils.toString(p.getInputStream()); String errorOutput = IOUtils.toString(p.getErrorStream()); System.out.println(output); System.err.println(errorOutput); } else if (!new File(bug_id).exists()) { // for the rest we use Maven String command = "mkdir " + bug_id +";\n cd " + bug_id + ";\n git init;\n git fetch https://github.com/Spirals-Team/defects4j-repair " + bug_id + ":" + bug_id + ";\n git checkout "+bug_id+";\n mvn -q test -DskipTests "+mvn_option+";\n mvn -q dependency:build-classpath -Dmdep.outputFile=cp.txt"; System.out.println(command); Process p = Runtime.getRuntime().exec(new String[]{"sh", "-c", command}); p.waitFor(); String output = IOUtils.toString(p.getInputStream()); String errorOutput = IOUtils.toString(p.getErrorStream()); System.out.println(output); System.err.println(errorOutput); } Properties prop = new Properties(); prop.load(new FileInputStream(bug_id+"/defects4j.build.properties")); NopolContext nopolContext = new NopolContext(); nopolContext.setIdentifier(bug_id); String src = bug_id+"/"+prop.get("d4j.dir.src.classes"); nopolContext.setProjectSourcePath(new File[]{new File(src)}); // getting the classpath from Maven List<URL> cp = new ArrayList<>(); for (String entry : FileUtils.readFileToString(new File(bug_id+"/cp.txt")).split(new String(new char[]{File.pathSeparatorChar}))) { cp.add(new File(entry).toURL()); } File maven_app = new File(bug_id + "/target/classes"); if (maven_app.exists()) { cp.add(maven_app.toURL()); } File maven_test = new File(bug_id + "/target/test-classes"); if (maven_test.exists()) { cp.add(maven_test.toURL()); } File ant_app = new File(bug_id + "/build"); if (ant_app.exists()) { cp.add(ant_app.toURL()); } File ant_test = new File(bug_id + "/build-tests"); if (ant_test.exists()) { cp.add(ant_test.toURL()); } System.out.println(cp); // nopolContext.setProjectClasspath(cp.toArray(new URL[0])); nopolContext.setType(RepairType.PRE_THEN_COND); SolverFactory.setSolver("z3", TestUtility.solverPath); return nopolContext; } }
gpl-2.0
Fluorohydride/ygopro-scripts
c47128571.lua
2278
--報復の隠し歯 function c47128571.initial_effect(c) --activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_DESTROY) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetCountLimit(1,47128571+EFFECT_COUNT_CODE_OATH) e1:SetTarget(c47128571.target) e1:SetOperation(c47128571.activate) c:RegisterEffect(e1) end function c47128571.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,LOCATION_ONFIELD,0,2,e:GetHandler()) end local sg=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_ONFIELD,0,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,2,0,0) if e:IsHasType(EFFECT_TYPE_ACTIVATE) then Duel.SetChainLimit(aux.FALSE) end end function c47128571.desfilter(c,def) return c:IsFaceup() and c:GetAttack()<=def end function c47128571.cfilter(c,tp) return c:IsType(TYPE_MONSTER) and not c:IsType(TYPE_LINK) and c:IsLocation(LOCATION_GRAVE) and Duel.IsExistingMatchingCard(c47128571.desfilter,tp,0,LOCATION_MZONE,1,nil,c:GetDefense()) end function c47128571.activate(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectMatchingCard(tp,Card.IsFacedown,tp,LOCATION_ONFIELD,0,2,2,nil) if g:GetCount()==2 then Duel.HintSelection(g) Duel.Destroy(g,REASON_EFFECT) local sg=Duel.GetOperatedGroup() if sg:GetCount()>0 and Duel.NegateAttack() and sg:IsExists(c47128571.cfilter,1,nil,tp) then Duel.BreakEffect() Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(47128571,0)) local cg=sg:FilterSelect(tp,c47128571.cfilter,1,1,nil,tp) Duel.HintSelection(cg) local dg=Duel.GetMatchingGroup(c47128571.desfilter,tp,0,LOCATION_MZONE,nil,cg:GetFirst():GetDefense()) if Duel.Destroy(dg,REASON_EFFECT)~=0 then Duel.BreakEffect() local turnp=Duel.GetTurnPlayer() Duel.SkipPhase(turnp,PHASE_MAIN1,RESET_PHASE+PHASE_END,1) Duel.SkipPhase(turnp,PHASE_BATTLE,RESET_PHASE+PHASE_END,1,1) Duel.SkipPhase(turnp,PHASE_MAIN2,RESET_PHASE+PHASE_END,1) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_BP) e1:SetTargetRange(1,0) e1:SetReset(RESET_PHASE+PHASE_END) Duel.RegisterEffect(e1,turnp) end end end end
gpl-2.0
Sagenda/sagenda-wp
assets/vendor/pickadate/lib/translations/he_IL.js
808
// Hebrew jQuery.extend( jQuery.fn.pickadate.defaults, { monthsFull: [ 'ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני', 'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'נובמבר', 'דצמבר' ], monthsShort: [ 'ינו', 'פבר', 'מרץ', 'אפר', 'מאי', 'יונ', 'יול', 'אוג', 'ספט', 'אוק', 'נוב', 'דצמ' ], weekdaysFull: [ 'יום ראשון', 'יום שני', 'יום שלישי', 'יום רביעי', 'יום חמישי', 'יום ששי', 'יום שבת' ], weekdaysShort: [ 'א', 'ב', 'ג', 'ד', 'ה', 'ו', 'ש' ], today: 'היום', clear: 'למחוק', format: 'yyyy mmmmב d dddd', formatSubmit: 'yyyy/mm/dd' }); jQuery.extend( jQuery.fn.pickatime = { defaults: { clear: 'למחוק'} });
gpl-2.0
mooflu/critter
utils/FPS.cpp
1137
// Description: // Helpers to count Frames Per Second. // // Copyright (C) 2001 Frank Becker // // 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 // #include "FPS.hpp" #include <stdio.h> #include "Timer.hpp" WPP::WPP( float period): _cpp(0.0), _period(period), _oldTime(0.0), _count(0) { } void WPP::Update( void) { float newTime = Timer::getTime(); _count++; if( (newTime-_oldTime) > _period) { _cpp = ((float)_count)/(newTime-_oldTime); _count = 0; _oldTime = newTime; } } WPP FPS::_wpp(1.0); char FPS::_fpsString[10]; const char *FPS::GetFPSString( void) { sprintf( _fpsString, "%3.1f", FPS::GetFPS()); return _fpsString; }
gpl-2.0
booklein/wpbookle
wp-content/plugins/wp-lister-for-ebay/includes/EbatNs/GetUserRequestType.php
2778
<?php /* Generated on 6/26/15 3:23 AM by globalsync * $Id: $ * $Log: $ */ require_once 'AbstractRequestType.php'; require_once 'ItemIDType.php'; /** * Retrieves data pertaining to a single eBay user. Callers can use this call to * return their own user data or the data of another eBay user. Unless the caller * passes in an ItemID that identifies a current or past common order, not all * data (like email addresses) will be returned in the User object. * **/ class GetUserRequestType extends AbstractRequestType { /** * @var ItemIDType **/ protected $ItemID; /** * @var string **/ protected $UserID; /** * @var boolean **/ protected $IncludeExpressRequirements; /** * @var boolean **/ protected $IncludeFeatureEligibility; /** * Class Constructor **/ function __construct() { parent::__construct('GetUserRequestType', 'urn:ebay:apis:eBLBaseComponents'); if (!isset(self::$_elements[__CLASS__])) { self::$_elements[__CLASS__] = array_merge(self::$_elements[get_parent_class()], array( 'ItemID' => array( 'required' => false, 'type' => 'ItemIDType', 'nsURI' => 'urn:ebay:apis:eBLBaseComponents', 'array' => false, 'cardinality' => '0..1' ), 'UserID' => array( 'required' => false, 'type' => 'string', 'nsURI' => 'http://www.w3.org/2001/XMLSchema', 'array' => false, 'cardinality' => '0..1' ), 'IncludeExpressRequirements' => array( 'required' => false, 'type' => 'boolean', 'nsURI' => 'http://www.w3.org/2001/XMLSchema', 'array' => false, 'cardinality' => '0..1' ), 'IncludeFeatureEligibility' => array( 'required' => false, 'type' => 'boolean', 'nsURI' => 'http://www.w3.org/2001/XMLSchema', 'array' => false, 'cardinality' => '0..1' ))); } $this->_attributes = array_merge($this->_attributes, array( )); } /** * @return ItemIDType **/ function getItemID() { return $this->ItemID; } /** * @return void **/ function setItemID($value) { $this->ItemID = $value; } /** * @return string **/ function getUserID() { return $this->UserID; } /** * @return void **/ function setUserID($value) { $this->UserID = $value; } /** * @return boolean **/ function getIncludeExpressRequirements() { return $this->IncludeExpressRequirements; } /** * @return void **/ function setIncludeExpressRequirements($value) { $this->IncludeExpressRequirements = $value; } /** * @return boolean **/ function getIncludeFeatureEligibility() { return $this->IncludeFeatureEligibility; } /** * @return void **/ function setIncludeFeatureEligibility($value) { $this->IncludeFeatureEligibility = $value; } } ?>
gpl-2.0
dribbroc/HONEI
honei/la/residual.hh
3963
/* vim: set sw=4 sts=4 et nofoldenable : */ /* * Copyright (c) 2007, 2008 Danny van Dyk <danny.dyk@uni-dortmund.de> * * This file is part of the LA C++ library. LibLa is free software; * you can redistribute it and/or modify it under the terms of the GNU Genera * Public License version 2, as published by the Free Software Foundation. * * LibLa 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 */ #pragma once #ifndef LIBLA_GUARD_RESIDUAL_HH #define LIBLA_GUARD_RESIDUAL_HH 1 #include <honei/la/dense_matrix.hh> #include <honei/la/dense_vector.hh> #include <honei/la/dot_product.hh> #include <honei/la/matrix_error.hh> #include <honei/la/sparse_matrix.hh> #include <honei/la/vector_error.hh> #include <honei/util/tags.hh> namespace honei { /** * \brief Residual of a system of linear equations. * * Residual is the class template for the operation * \f[ * \texttt{Residual}(b, A, x): \quad b \leftarrow b - A \cdot x, * \f] * which yields the residual or defect of a given approximative solution to * the system of linear equations * \f[ * A \cdot x = b. * \f] * * \ingroup grplaoperations */ template <typename Tag_ = tags::CPU> struct Residual { /** * \name Residuals * \{ * * Returns the the residual or defect of a given approximative solution * to a linear equation. * * \param b The vector of inhomogenous parts of the system of linear equations. * \param a The matrix that corresponds to the system of lineare * equations. * \param x The vector of approximative solutions to the system of linear * equations. * * \retval b Will modify b and return it. */ template <typename DT1_, typename DT2_, typename VT_> static DenseVectorBase<DT1_> & value(DenseVectorBase<DT1_> & b, const DenseMatrix<DT2_> & a, const VT_ & x) { CONTEXT("When calculating residual for a DenseMatrix:"); if (b.size() != x.size()) throw VectorSizeDoesNotMatch(x.size(), b.size()); if (a.rows() != b.size()) throw VectorSizeDoesNotMatch(b.size(), a.rows()); if (a.rows() != a.columns()) throw MatrixIsNotSquare(a.rows(), a.columns()); for (typename DenseVector<DT1_>::ElementIterator i(b.begin_elements()), i_end(b.end_elements()) ; i != i_end ; ++i) { *i -= DotProduct<>::value(a[i.index()], x); } return b; } template <typename DT1_, typename DT2_, typename VT_> static DenseVectorBase<DT1_> & value(DenseVectorBase<DT1_> & b, const SparseMatrix<DT2_> & a, const VT_ & x) { CONTEXT("When calculating residual for a SparseMatrix:"); if (b.size() != x.size()) throw VectorSizeDoesNotMatch(x.size(), b.size()); if (a.rows() != b.size()) throw VectorSizeDoesNotMatch(b.size(), a.rows()); if (a.rows() != a.columns()) throw MatrixIsNotSquare(a.rows(), a.columns()); for (typename DenseVector<DT1_>::ElementIterator i(b.begin_elements()), i_end(b.end_elements()) ; i != i_end ; ++i) { *i -= DotProduct<>::value(a[i.index()], x); } return b; } /// \} }; } #endif
gpl-2.0
jreades/starspy
stars/gui/tableViewer/main.py
354
import pysal import wx from control import TableViewer class MapFrameApp(wx.App): def OnInit(self): db = pysal.open('/Users/charlie/Documents/data/stl_hom/stl_hom.dbf') self.frame = TableViewer(None,db) self.frame.Show() return True if __name__=='__main__': app = MapFrameApp(redirect=False) app.MainLoop()
gpl-2.0
christophpickl/seetheeye
seetheeye-impl/src/test/java/com/github/christophpickl/seetheeye/impl2/integration/ScopeTest.java
525
package com.github.christophpickl.seetheeye.impl2.integration; import com.github.christophpickl.seetheeye.api.configuration.Configuration; import com.github.christophpickl.seetheeye.api.test.Action1; import com.github.christophpickl.seetheeye.api.SeeTheEyeApi; import com.github.christophpickl.seetheeye.api.integration.ScopeTestSpec; public class ScopeTest extends ScopeTestSpec { @Override protected final SeeTheEyeApi newEye(Action1<Configuration> action) { return SeeTheEyeFactory.newEye(action); } }
gpl-2.0
NeXXEnt/WMS-Official
wms30/controllers/warehouses.php
13560
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Warehouses extends CI_Controller { public function __construct() { parent::__construct(); /* * Warehouse Security Check */ if(! $this->session->userdata('authenticated')) redirect('/auth', 'refresh'); if(! $this->user->init($this->session->userdata('username'))) redirect('/auth', 'refresh'); if(! $this->user->permissions['modulePermissions']['warehouses']->read) redirect('/', 'refresh'); $data['warehousePermissions'] = $this->user->permissions['modulePermissions']['warehouses']; // Add CSS files $this->template->add_css('css/default.css'); $this->template->add_js('js/common.js'); // Set Page Title $this->template->write('title', 'EasyRock WMS - Warehouses'); $data['menuLink'] = $this->user->generate_menu(); $this->template->write_view('header', 'common/header', $data); $data['sideBarLink'] = array( 'Manage Warehouses' => '/warehouses/manage', 'Manage Bins' => '/warehouses/bins' ); if(!$this->session->userdata('currentWarehouse')) $this->session->set_userdata('currentWarehouse', $this->user->warehouse_id); $this->currentWarehouse = new Warehouse; $this->currentWarehouse->build($this->session->userdata('currentWarehouse')); $this->template->write_view('sidebar', 'common/sidebar', $data); $this->output->enable_profiler($this->input->get('profiler')); } public function index() { $this->template->render(); } private function dump($var) { echo '<pre>'; var_dump($var); echo '</pre>'; } public function bins($bin_id = NULL) { $data['errorMessage'] = ''; //get the page data for the view $data = $this->get_bin_page_data(); $data['warehouseName'] = $this->currentWarehouse->name; //Build the Table for the View //If the bin ID is zero then we will add bins by showing the add bins form. if($bin_id === NULL) unset($data['editRegion']); elseif($bin_id == 0) { //permission check to **__** Add **__** if(! $this->user->permissions['warehousePermissions'][$this->currentWarehouse->warehouse_id]->create) redirect('/warehouses/bins', 'refresh'); if(! $this->form_validation->run('addBins')) $data['editRegion'] = $this->load->view('warehouse/addbins', $data, TRUE); else { $startBin = array( 'x' => strtoupper($this->input->post('startXCoord')), 'y' => strtoupper($this->input->post('startYCoord')), 'z' => strtoupper($this->input->post('startZCoord')), 'bin_dim_id' => $this->input->post('bin_dim_id'), 'warehouse_id' => $this->currentWarehouse->warehouse_id, 'binIsInfinite' => $this->input->post('binIsInfinite'), 'binIsAUserBasket' => $this->input->post('binIsAUserBasket'), 'binComment' => $this->input->post('binComment') ); $startBin['binAddress'] = $this->input->post('customAddress') ? strtoupper($this->input->post('binAddress')) : ''; $startBin['user_id'] = $this->input->post('binIsAUserBasket') ? $this->input->post('user_id') : NULL; $endBin = $startBin; $endBin['x'] = strtoupper($this->input->post('endXCoord')); $endBin['y'] = strtoupper($this->input->post('endYCoord')); $endBin['z'] = strtoupper($this->input->post('endZCoord')); //create bin objects and build $startBins = new Bins; if(! $startBins->build_from_array($startBin, $data['errorMessage'])) goto fail; //if we are trying to enter a range of bunks if($endBin['x'] != '' && $endBin['y'] != '' && $endBin['z'] != '') { //then build the end bin $endBins = new Bins; if(! $endBins->build_from_array($endBin, $data['errorMessage'])) goto fail; if(! $startBins->are_compatible_with($endBins, $data['errorMessage'])) goto fail; if(! $startBins->build_insert_array($endBins, $data['errorMessage'])) goto fail; } if(! $startBins->create( $data['errorMessage'])) goto fail; $data['message'] = 'All Bins added successfully'; goto success; } //Edit a specific bin }elseif($bin_id > 0) { //permission check to **__** Update **__** if(! $this->user->permissions['warehousePermissions'][$this->currentWarehouse->warehouse_id]->update) redirect('/warehouses/bins', 'refresh'); //delete a bin or range of bins }elseif($bin_id == -1) { //permission check to **__** Delete **__** if(! $this->user->permissions['warehousePermissions'][$this->currentWarehouse->warehouse_id]->delete) redirect('/warehouses/bins', 'refresh'); if($this->uri->segment(4)) { if(! $this->bins->build($this->uri->segment(4), $data['errorMessage'])) goto fail; if(! $this->bins->rm_bin($data['errorMessage'])) goto fail; else { $data['message'] = $this->bins->binAddress.' has been succesfully removed'; goto success; } }elseif(! $this->form_validation->run('delBins')) $data['editRegion'] = $this->load->view('warehouse/delbins', $data, TRUE); else { foreach($this->input->post() as $key => $value) $delete[$key] = $value; $delete['warehouse_id'] = $this->currentWarehouse->warehouse_id; if(!$return = $this->bins->rm_bin($data['errorMessage'], $delete)) goto fail; $data['message'] = 'All bins removed successfully'; goto success; } } goto end; success: $data['editRegion'] = $this->load->view('common/success', $data, TRUE); goto end; fail: $data['editRegion'] = $this->load->view('common/fail', $data, TRUE); end: $data['tables'][$this->currentWarehouse->name] = Wms::fetch_table( 'Bins', 'bin_id', $this->config->item('binTH'), 'warehouse_id = '.$this->currentWarehouse->warehouse_id ); //write the table view and render the template $this->template->write_view('content', 'common/tables', $data); $this->template->render(); } private function get_bin_page_data() { $data['page']['id'] = 'bins'; $data['page']['links'][$this->currentWarehouse->name] = array(); $links = array(); $data['user_id'] = $this->user->user_id; $optVars = array ( 'link' => '/warehouses/warehouseUpdate', 'hidden' => 'change_warehouse', 'label' => '', 'key' => 'warehouse_id', 'class' => 'Warehouse', 'funct' => 'options', 'user_id' => $this->user->user_id, 'curVal' => $this->currentWarehouse->warehouse_id, 'para' => NULL ); $data['boolrg'] = TRUE; $data['select'][] = $this->load->view('common/select', $optVars, TRUE); if($this->user->permissions['warehousePermissions'][$this->currentWarehouse->warehouse_id]->create) $data['buttons'][] = Wms::button('/warehouses/bins/0', 'Add Bins', ICON_ROOT.'/basket_add.png', 'positive'); if($this->user->permissions['warehousePermissions'][$this->currentWarehouse->warehouse_id]->delete) $data['buttons'][] = Wms::button('/warehouses/bins/-1', 'Remove Bins', ICON_ROOT.'/basket_delete.png', 'negative'); if($this->user->permissions['warehousePermissions'][$this->currentWarehouse->warehouse_id]->delete) $links = array_merge_recursive($this->config->item('binTA-delete'), $links); if($this->user->permissions['warehousePermissions'][$this->currentWarehouse->warehouse_id]->update) $links = array_merge_recursive($this->config->item('binTA-update'), $links); $data['page']['links'][$this->currentWarehouse->name] = $links; return $data; } private function get_warehouse_page_data() { $data['page']['id'] = 'all-warehouses'; $links = array(); if($this->user->permissions['modulePermissions']['warehouses']->create) $data['buttons'][] = Wms::button('/warehouses/manage/0', 'Add Warehouse', ICON_ROOT.'/building_add.png', 'positive'); if($this->user->permissions['modulePermissions']['warehouses']->delete) $links = array_merge_recursive($this->config->item('warehouseTA-delete'), $links); if($this->user->permissions['modulePermissions']['warehouses']->update) $links = array_merge_recursive($this->config->item('warehouseTA-update'), $links); $data['page']['links']['Warehouses'] = $links; $data['tables']['Warehouses'] = Wms::fetch_table( 'Warehouses', 'warehouse_id', $this->config->item('warehouseTH') ); return $data; } public function warehouseUpdate() { if($this->input->post('change_warehouse')) { $warehouse_id = $this->input->post('warehouse_id'); if($this->warehouse->id_is_valid($warehouse_id)) { if(isset($this->user->permissions['warehousePermissions'][$warehouse_id]->read)) { if($this->user->permissions['warehousePermissions'][$warehouse_id]->read) $this->session->set_userdata('currentWarehouse', $warehouse_id); else $this->session->set_userdata('currentWarehouse', $this->user->warehouse_id); } else $this->session->set_userdata('currentWarehouse', $this->user->warehouse_id); } else $this->session->set_userdata('currentWarehouse', $this->user->warehouse_id); } redirect('/warehouses/bins', 'refresh'); } public function manage($warehouse_id = NULL) { $data = $this->get_warehouse_page_data(); if($warehouse_id === NULL) $data['editRegion'] = NULL; elseif($warehouse_id == 0) { if(! $this->user->permissions['modulePermissions']['warehouses']->create) redirect('/warehouses/manage', 'refresh'); if(! $this->form_validation->run('addWarehouse')) $data['editRegion'] = $this->load->view('warehouse/addwarehouse', '', TRUE); else { foreach($this->input->post() as $key => $value) $insertWarehouse[$key] = $value; $insertWarehouse['warehouse_id'] = NULL; $this->db->insert('Warehouses', $insertWarehouse); $data['editRegion'] = $this->load->view('common/success', '', TRUE); } } elseif($warehouse_id > 0) { if(! $this->form_validation->run('editWarehouse')) { $data['editWarehouse'] = new Warehouse; $data['editWarehouse']->build_warehouse($warehouse_id); $data['editRegion'] = $this->load->view('warehouse/editwarehouse', $data, TRUE); } else { foreach($this->input->post() as $key => $value) $editWarehouse[$key] = $value; $this->db->where('warehouse_id', $editWarehouse['warehouse_id']); unset($editWarehouse['warehouse_id']); $this->db->update('Warehouses', $editWarehouse); $data['editRegion'] = $this->load->view('common/success', '', TRUE); } } else redirect('/warehouses', 'refresh'); $this->template->write_view('content', 'common/tables', $data); $this->template->render(); } public function rmwarehouse($warehouse_id = NULL) { if(! $warehouse_id) redirect('warehouses/manage', 'refresh'); if(! $this->input->post('confirmed')){ $data['rmWarehouse'] = new Warehouse; $data['rmWarehouse']->build_warehouse($warehouse_id); $this->template->write_view('content', 'warehouse/rmwarehouse', $data); $this->template->render(); } else { $this->db->where('warehouse_id', $warehouse_id); $this->db->delete('Warehouses'); redirect('warehouses/manage', 'refresh'); } } public function rmaccess($id = NULL) { if($id == NULL) redirect('/warehouses/manage', 'refresh'); if(! $this->user->permissions['modulePermissions']['warehouses']->delete) redirect('/warehouses/manage', 'refresh'); $permission = new WarehousePermission; $permission->build($id); } public function access($warehouse_id = NULL) { if($warehouse_id === NULL) redirect('/warehouses/manage', 'refresh'); $warehouse = new Warehouse; $warehouse->build($warehouse_id); $tableName = $warehouse->name.' User Access'; $data['tables'][$tableName] = Wms::fetch_table( 'view_WarehousePermissions', 'warehouse_permission_id', $this->config->item('warehouseAccessTH'), "warehouse_id = $warehouse_id" ); $data['page']['links'][$tableName] = $this->config->item('warehouseAccessTA'); $data['boolrg'] = TRUE; $data = array_merge_recursive($data, $this->get_warehouse_page_data()); $this->template->write_view('content', 'common/tables', $data); $this->template->render(); } public function addaccess($warehouse_id = NULL) { if($warehouse_id === NULL || !$warehouse_id) redirect('/warehouses/manage'); if(!$this->user->permissions['modulePermissions']['warehouses']->update) redirect('/warehouses/manage', 'refresh'); if(!$this->form_validation->run('addWarehouseAccess')) { $data['warehouse'] = new Warehouse; $data['warehouse']->build($warehouse_id); $data['editRegion'] = $this->load->view('warehouse/addaccess', $data, TRUE); } else { $insert = $this->input->post(); $insert['warehouse_permission_id'] = NULL; if(!isset($insert['create'])) $insert['create'] = FALSE; if(!isset($insert['read'])) $insert['read'] = FALSE; if(!isset($insert['update'])) $insert['update'] = FALSE; if(!isset($insert['delete'])) $insert['delete'] = FALSE; $this->db->insert('WarehousePermissions', $insert); $data['message'] = 'Warehouse Permissions added successfully.'; $data['editRegion'] = $this->load->view('common/success', $data, TRUE); } $data = array_merge_recursive($data, $this->get_warehouse_page_data()); $this->template->write_view('content', 'common/tables', $data); $this->template->render(); } }
gpl-2.0
esar/hexed
HexView.Drawing.cs
25690
/* This file is part of HexEd Copyright (C) 2008-2015 Stephen Robinson <hacks@esar.org.uk> HexEd is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; #if !MONO using System.Runtime.InteropServices; #endif public partial class HexView { private const string stringOfZeros = "0000000000000000000000000000000000000000000000000000000000000000" + "0000000000000000000000000000000000000000000000000000000000000000" + "0000000000000000000000000000000000000000000000000000000000000000" + "0000000000000000000000000000000000000000000000000000000000000000"; protected void ScrollToPixel(long NewPosition) { if(NewPosition < 0) NewPosition = 0; else if(NewPosition > ScrollHeight) NewPosition = ScrollHeight; #if MONO Invalidate(); #else if( NewPosition < ScrollPosition - ClientSize.Height || NewPosition > ScrollPosition + ClientSize.Height) { Invalidate(); } else { ScrollWindowEx(this.Handle, 0, (int)(ScrollPosition - NewPosition), new RECT(0, 0, ClientSize.Width, ClientSize.Height), null, IntPtr.Zero, null, 2); if(NewPosition < ScrollPosition) { Invalidate(new Rectangle(0, 0, ClientSize.Width, (int)(ScrollPosition - NewPosition))); } else { Invalidate(new Rectangle(0, ClientSize.Height - (int)(NewPosition - ScrollPosition), ClientSize.Width, (int)(NewPosition - ScrollPosition))); } } #endif ScrollPosition = NewPosition; VScroll.Value = (int)((double)ScrollPosition / ScrollScaleFactor); InsertCaret.Position = AddressToClientPoint(Selection.Start); } private RectangleF MeasureSubString(Graphics graphics, string text, int start, int length, Font font) { StringFormat format = new StringFormat (); RectangleF rect = new RectangleF(0, 0, 1000, 1000); CharacterRange[] ranges = { new CharacterRange(start, length) }; Region[] regions = new Region[1]; format.SetMeasurableCharacterRanges(ranges); regions = graphics.MeasureCharacterRanges(text, font, rect, format); rect = regions[0].GetBounds(graphics); rect.Width += 1; return rect; } public HexViewHit HitTest(Point p) { if(p.X >= LayoutDimensions.AddressRect.Left && p.X <= LayoutDimensions.AddressRect.Right && p.Y >= LayoutDimensions.AddressRect.Top && p.Y <= LayoutDimensions.AddressRect.Bottom) { return HitTestAddress(p); } else if(p.X >= LayoutDimensions.DataRect.Left && p.X <= LayoutDimensions.DataRect.Right && p.Y >= LayoutDimensions.DataRect.Top && p.Y <= LayoutDimensions.DataRect.Bottom) { return HitTestData(p); } else if(p.X >= LayoutDimensions.AsciiRect.Left && p.X <= LayoutDimensions.AsciiRect.Right && p.Y >= LayoutDimensions.AsciiRect.Top && p.Y <= LayoutDimensions.AsciiRect.Bottom) { return HitTestAscii(p); } else return new HexViewHit(HexViewHit.HitType.Unknown); } public HexViewHit HitTest(Point p, HexViewHit.HitType type) { switch(type) { case HexViewHit.HitType.Address: return HitTestAddress(p); case HexViewHit.HitType.Data: case HexViewHit.HitType.DataSelection: return HitTestData(p); case HexViewHit.HitType.Ascii: case HexViewHit.HitType.AsciiSelection: return HitTestAscii(p); default: return new HexViewHit(HexViewHit.HitType.Unknown); } } protected HexViewHit HitTestAddress(Point p) { long line = (long)((double)(p.Y + ScrollPosition) / LayoutDimensions.WordSize.Height); long lineAddress = line * LayoutDimensions.BitsPerRow; if(lineAddress < 0) lineAddress = 0; else if(lineAddress > Document.Length) lineAddress = Document.Length; return new HexViewHit(HexViewHit.HitType.Address, lineAddress); } protected HexViewHit HitTestData(Point p) { long line = (long)((double)(p.Y + ScrollPosition) / LayoutDimensions.WordSize.Height); long lineAddress = line * LayoutDimensions.BitsPerRow; float halfDigitWidth = LayoutDimensions.WordSize.Width / LayoutDimensions.NumWordDigits / 2; float x = p.X;// - LayoutDimensions.DataRect.Left; int word = 0; while(word < LayoutDimensions.WordRects.Length && x > LayoutDimensions.WordRects[word].Right) ++word; if(word >= LayoutDimensions.WordRects.Length || (word > 0 && x < LayoutDimensions.WordRects[word].Left)) --word; x -= LayoutDimensions.WordRects[word].Left; long digitAddress = word * _BytesPerWord * 8; Graphics g = CreateGraphics(); int i; for(i = 1; i <= LayoutDimensions.NumWordDigits; ++i) { RectangleF r = MeasureSubString(g, stringOfZeros, 0, i, _Font); if(x <= r.Width - halfDigitWidth) break; } g.Dispose(); digitAddress += (i - 1) * ((_BytesPerWord * 8) / LayoutDimensions.NumWordDigits); digitAddress += lineAddress; if(digitAddress < 0) digitAddress = 0; else if(digitAddress > Document.Length * 8) digitAddress = Document.Length * 8; if(digitAddress >= Selection.Start && digitAddress < Selection.End) return new HexViewHit(HexViewHit.HitType.DataSelection, digitAddress, i, new Point(0, 0)); else return new HexViewHit(HexViewHit.HitType.Data, digitAddress, i, new Point(0, 0)); } protected HexViewHit HitTestAscii(Point p) { long line = (long)((double)(p.Y + ScrollPosition) / LayoutDimensions.WordSize.Height); long lineAddress = line * LayoutDimensions.BitsPerRow; float halfDigitWidth = LayoutDimensions.WordSize.Width / LayoutDimensions.NumWordDigits / 2; Graphics g = CreateGraphics(); int i; for(i = 1; i <= LayoutDimensions.BitsPerRow / 8; ++i) { RectangleF r = MeasureSubString(g, stringOfZeros, 0, i, _Font); if(p.X - LayoutDimensions.AsciiRect.Left + halfDigitWidth <= r.Width) break; } g.Dispose(); long address = lineAddress + ((i - 1) * 8); if(address < 0) address = 0; else if(address > Document.Length * 8) address = Document.Length * 8; if(address >= Selection.Start && address < Selection.End) return new HexViewHit(HexViewHit.HitType.AsciiSelection, address, i, new Point(0, 0)); else return new HexViewHit(HexViewHit.HitType.Ascii, address, i, new Point(0, 0)); } protected void RecalcDimensions() { Graphics g = CreateGraphics(); if(_BytesPerWord < 8) { ulong maxWordValue = ((ulong)1 << (_BytesPerWord * 8)) - 1; LayoutDimensions.NumWordDigits = (int)Math.Log(maxWordValue, _DataRadix) + 1; } else LayoutDimensions.NumWordDigits = (int)Math.Log(UInt64.MaxValue, _DataRadix); LayoutDimensions.BitsPerDigit = (_BytesPerWord * 8) / LayoutDimensions.NumWordDigits; LayoutDimensions.WordSize = MeasureSubString(g, stringOfZeros, 0, LayoutDimensions.NumWordDigits, _Font).Size; // Calculate number of visible lines LayoutDimensions.VisibleLines = (int)Math.Ceiling(ClientSize.Height / LayoutDimensions.WordSize.Height); // Calculate width of largest address if(Document.Length == 0) LayoutDimensions.NumAddressDigits = 1; else LayoutDimensions.NumAddressDigits = (int)(Math.Log(Document.Length) / Math.Log(_AddressRadix)) + 1; SizeF AddressSize = MeasureSubString(g, stringOfZeros, 0, LayoutDimensions.NumAddressDigits, _Font).Size; LayoutDimensions.AddressRect = new RectangleF(0, 0, AddressSize.Width, ClientSize.Height); float RemainingWidth = ClientSize.Width - LayoutDimensions.AddressRect.Width - LayoutDimensions.LeftGutterWidth - LayoutDimensions.RightGutterWidth; if(VScroll.Visible) RemainingWidth -= VScroll.Width; int GroupsPerRow = 0; int WordsPerRow = 0; float wordGroupSpacing = LayoutDimensions.WordGroupSpacing; if(_WordsPerGroup == 1) wordGroupSpacing = 0; if(_WordsPerLine < 0) { float width = 0; do { ++GroupsPerRow; WordsPerRow = GroupsPerRow * _WordsPerGroup; LayoutDimensions.BitsPerRow = WordsPerRow * _BytesPerWord * 8; width = (((LayoutDimensions.WordSize.Width + LayoutDimensions.WordSpacing) * _WordsPerGroup) + wordGroupSpacing) * GroupsPerRow; width += LayoutDimensions.RightGutterWidth; width += MeasureSubString(g, stringOfZeros, 0, LayoutDimensions.BitsPerRow / 8, _Font).Width; } while(width <= RemainingWidth); if(GroupsPerRow > 1) --GroupsPerRow; WordsPerRow = GroupsPerRow * _WordsPerGroup; LayoutDimensions.BitsPerRow = WordsPerRow * _BytesPerWord * 8; } else { WordsPerRow = _WordsPerLine; GroupsPerRow = _WordsPerLine / _WordsPerGroup; LayoutDimensions.BitsPerRow = _WordsPerLine * _BytesPerWord * 8; } float x = LayoutDimensions.AddressRect.Width + LayoutDimensions.LeftGutterWidth; LayoutDimensions.WordRects = new RectangleF[WordsPerRow]; for(int group = 0; group < GroupsPerRow; ++group) { for(int word = 0; word < _WordsPerGroup; ++word) { RectangleF r = new RectangleF(x, 0, LayoutDimensions.WordSize.Width, LayoutDimensions.WordSize.Height); LayoutDimensions.WordRects[(group * _WordsPerGroup) + word] = r; x += LayoutDimensions.WordSize.Width + LayoutDimensions.WordSpacing; } if(_WordsPerGroup > 1) x -= LayoutDimensions.WordSpacing; x += wordGroupSpacing; } x -= wordGroupSpacing; LayoutDimensions.DataRect = new RectangleF(LayoutDimensions.AddressRect.Width + LayoutDimensions.LeftGutterWidth, 0, x - (LayoutDimensions.AddressRect.Width + LayoutDimensions.LeftGutterWidth), ClientSize.Height); SizeF AsciiSize = MeasureSubString(g, stringOfZeros, 0, LayoutDimensions.BitsPerRow / 8, _Font).Size; LayoutDimensions.AsciiRect = new RectangleF(LayoutDimensions.DataRect.Right + LayoutDimensions.RightGutterWidth, 0, AsciiSize.Width, ClientSize.Height); const int IntMax = 0x6FFFFFFF; ScrollHeight = (long)((((Document.Length * 8) / LayoutDimensions.BitsPerRow) + 1) * LayoutDimensions.WordSize.Height); if(ScrollHeight <= ClientSize.Height) { VScroll.Visible = false; } else { if(ScrollHeight > IntMax) { VScroll.Maximum = IntMax; ScrollScaleFactor = (double)(ScrollHeight) / (double)IntMax; } else { VScroll.Maximum = (int)ScrollHeight; ScrollScaleFactor = 1; } VScroll.SmallChange = 5; VScroll.LargeChange = ClientSize.Height; VScroll.Visible = true; } if(_EditMode == EditMode.Insert) InsertCaret.Size = new Size(2, (int)LayoutDimensions.WordSize.Height); else InsertCaret.Size = new Size((int)(LayoutDimensions.WordSize.Width / LayoutDimensions.NumWordDigits) + 1, (int)LayoutDimensions.WordSize.Height); g.Dispose(); } protected Point AddressToClientPoint(long address) { double y = address / LayoutDimensions.BitsPerRow; y *= LayoutDimensions.WordSize.Height; y -= ScrollPosition; address -= (address / LayoutDimensions.BitsPerRow) * LayoutDimensions.BitsPerRow; int word = (int)(address / 8) / _BytesPerWord; float x = LayoutDimensions.WordRects[word].Left; address -= word * _BytesPerWord * 8; address /= (_BytesPerWord * 8) / LayoutDimensions.NumWordDigits; if(address >= LayoutDimensions.NumWordDigits) address = LayoutDimensions.NumWordDigits - 1; if(address > 0) { Graphics g = CreateGraphics(); x += MeasureSubString(g, stringOfZeros, 0, (int)address, _Font).Width; g.Dispose(); } return new Point((int)x + 1, (int)(y + LayoutDimensions.WordSize.Height)); } protected Point AddressToClientPointAscii(long address) { double y = address / LayoutDimensions.BitsPerRow; y *= LayoutDimensions.WordSize.Height; y -= ScrollPosition; address -= (address / LayoutDimensions.BitsPerRow) * LayoutDimensions.BitsPerRow; address /= 8; float x = LayoutDimensions.AsciiRect.Left; Graphics g = CreateGraphics(); x += MeasureSubString(g, stringOfZeros, 0, (int)address, _Font).Width; g.Dispose(); return new Point((int)x, (int)(y + LayoutDimensions.WordSize.Height)); } protected GraphicsPath CreateRoundedRectPath(RectangleF rect) { Size CornerSize = new Size(10, 10); GraphicsPath path = new GraphicsPath(); RectangleF tl = new RectangleF(rect.Left, rect.Top, CornerSize.Width, CornerSize.Height); RectangleF tr = new RectangleF(rect.Right - CornerSize.Width, rect.Top, CornerSize.Width, CornerSize.Height); RectangleF bl = new RectangleF(rect.Left, rect.Bottom - CornerSize.Height, CornerSize.Width, CornerSize.Height); RectangleF br = new RectangleF(rect.Right - CornerSize.Width, rect.Bottom - CornerSize.Height, CornerSize.Width, CornerSize.Height); path.AddArc(tl, 180, 90); path.AddArc(tr, 270, 90); path.AddArc(br, 360, 90); path.AddArc(bl, 90, 90); path.CloseAllFigures(); return path; } protected delegate Point AddressToPointDelegate(long address); protected GraphicsPath CreateRoundedSelectionPath(long startAddress, long endAddress, float yOffset, AddressToPointDelegate addrToPoint) { if(startAddress > endAddress) { long tmp = startAddress; startAddress = endAddress; endAddress = tmp; } --endAddress; yOffset = 0 - yOffset; long startRow = startAddress / LayoutDimensions.BitsPerRow; long startCol = startAddress - (startRow * LayoutDimensions.BitsPerRow); long endRow = endAddress / LayoutDimensions.BitsPerRow; long endCol = (endAddress - (endRow * LayoutDimensions.BitsPerRow)) + LayoutDimensions.BitsPerDigit; long firstVisibleRow = (long)(ScrollPosition / LayoutDimensions.WordSize.Height); long lastVisibleRow = (long)((ScrollPosition + ClientSize.Height) / LayoutDimensions.WordSize.Height); RectangleF r = new RectangleF(0, 0, 10, 10); GraphicsPath path = new GraphicsPath(); if(startRow < firstVisibleRow) { // square top // // +-----------------------+ // | | PointF a = addrToPoint((firstVisibleRow - 1) * LayoutDimensions.BitsPerRow); a.Y += -10 + yOffset; PointF b = addrToPoint((firstVisibleRow - 1) * LayoutDimensions.BitsPerRow + LayoutDimensions.BitsPerRow - 1); b.Y += -10 + yOffset; b.X += 10; path.AddLine(a, b); } else if(startCol > 0 && endRow > startRow) { // curved top // // +--------------------+ // | | // +--+ | // | | r.Location = addrToPoint((startRow + 1) * LayoutDimensions.BitsPerRow); r.Offset(0, -LayoutDimensions.WordSize.Height + yOffset); path.AddArc(r, 180, 90); r.Location = addrToPoint(startAddress); r.Offset(-10, -10 + yOffset); path.AddArc(r, 90, -90); r.Location = addrToPoint(startAddress); r.Offset(0, -LayoutDimensions.WordSize.Height + yOffset); path.AddArc(r, 180, 90); r.Location = addrToPoint(startRow * LayoutDimensions.BitsPerRow + LayoutDimensions.BitsPerRow - 1); r.Offset(0, -LayoutDimensions.WordSize.Height + yOffset); path.AddArc(r, 270, 90); } else { // curved top // // +-----------------------+ // | | r.Location = addrToPoint(startAddress); r.Offset(0, -LayoutDimensions.WordSize.Height + yOffset); path.AddArc(r, 180, 90); if(endRow > startRow) r.Location = addrToPoint((startRow * LayoutDimensions.BitsPerRow) + LayoutDimensions.BitsPerRow - 1); else r.Location = addrToPoint(endAddress); r.Offset(0, -LayoutDimensions.WordSize.Height + yOffset); path.AddArc(r, 270, 90); } if(endRow > lastVisibleRow) { // square bottom // // | | // +-----------------------+ PointF a = addrToPoint((lastVisibleRow + 1) * LayoutDimensions.BitsPerRow); a.Y += 10 + yOffset; PointF b = addrToPoint((lastVisibleRow + 1) * LayoutDimensions.BitsPerRow + LayoutDimensions.BitsPerRow - 1); b.Y += 10 + yOffset; b.X += 10; path.AddLine(b, a); } else if(endCol < LayoutDimensions.BitsPerRow && endRow > startRow) { // curved bottom // // | | // | +--+ // | | // +--------------------+ r.Location = addrToPoint((endRow - 1) * LayoutDimensions.BitsPerRow + LayoutDimensions.BitsPerRow - 1); r.Offset(0, - 10 + yOffset); path.AddArc(r, 0, 90); r.Location = addrToPoint(endAddress); r.Offset(10, -LayoutDimensions.WordSize.Height + yOffset); path.AddArc(r, 270, -90); r.Offset(-10, LayoutDimensions.WordSize.Height - 10 + yOffset); path.AddArc(r, 0, 90); r.Location = addrToPoint(endRow * LayoutDimensions.BitsPerRow); r.Offset(0, -10 + yOffset); path.AddArc(r, 90, 90); } else { // curved bottom // // | | // +-----------------------+ r.Location = addrToPoint(endAddress); r.Offset(0, -10 + yOffset); path.AddArc(r, 0, 90); if(endRow > startRow) r.Location = addrToPoint(endRow * LayoutDimensions.BitsPerRow); else r.Location = addrToPoint(startAddress); r.Offset(0, -10 + yOffset); path.AddArc(r, 90, 90); } path.CloseAllFigures(); return path; } protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); e.Graphics.SmoothingMode = SmoothingMode.HighQuality; double pixelOffset = ScrollPosition + (e.ClipRectangle.Top > 0 ? e.ClipRectangle.Top : 0); long firstLine = (long)(pixelOffset / LayoutDimensions.WordSize.Height); double drawingOffset = e.ClipRectangle.Top - (pixelOffset % LayoutDimensions.WordSize.Height); long dataOffset = firstLine * (LayoutDimensions.BitsPerRow / 8); int visibleLines = (int)Math.Ceiling((e.ClipRectangle.Bottom - drawingOffset) / LayoutDimensions.WordSize.Height) + 1; if(visibleLines > ((Document.Length - dataOffset) / (LayoutDimensions.BitsPerRow / 8)) + 1) visibleLines = (int)((Document.Length - dataOffset) / (LayoutDimensions.BitsPerRow / 8)) + 1; long dataEndOffset = dataOffset + (visibleLines * (LayoutDimensions.BitsPerRow / 8)); if(dataEndOffset > Document.Length) dataEndOffset = Document.Length; e.Graphics.FillRectangle(new SolidBrush(Color.FromKnownColor(KnownColor.ButtonFace)), 0, 0, LayoutDimensions.AddressRect.Width + LayoutDimensions.LeftGutterWidth / 2, LayoutDimensions.AddressRect.Height); e.Graphics.DrawLine(new Pen(Color.FromKnownColor(KnownColor.ButtonShadow)), LayoutDimensions.AddressRect.Width + LayoutDimensions.LeftGutterWidth / 2, 0, LayoutDimensions.AddressRect.Width + LayoutDimensions.LeftGutterWidth / 2, LayoutDimensions.AddressRect.Height); if(_EvenColumnColor != Color.Transparent && _EvenColumnColor != BackColor) { for(int i = 0; i < LayoutDimensions.WordRects.Length; ++i) { if(i % 2 == 0) { e.Graphics.FillRectangle(new SolidBrush(_EvenColumnColor), new RectangleF(LayoutDimensions.WordRects[i].Left, 0, LayoutDimensions.WordRects[i].Width, ClientRectangle.Height)); } } } if(_OddColumnColor != Color.Transparent && _OddColumnColor != BackColor) { for(int i = 0; i < LayoutDimensions.WordRects.Length; ++i) { if(i % 2 == 0) { e.Graphics.FillRectangle(new SolidBrush(_OddColumnColor), new RectangleF(LayoutDimensions.WordRects[i].Left, 0, LayoutDimensions.WordRects[i].Width, ClientRectangle.Height)); } } } foreach(SelectionRange sel in Highlights) { long start = sel.Start; long end = sel.End; if(start > end) { start = sel.End; end = sel.Start; } if(start / 8 <= dataEndOffset && end / 8 >= dataOffset) { GraphicsPath p = CreateRoundedSelectionPath(start, end, (float)0, AddressToClientPoint); e.Graphics.FillPath(new SolidBrush(sel.BackColor), p); e.Graphics.DrawPath(new Pen(sel.BorderColor, sel.BorderWidth), p); p = CreateRoundedSelectionPath(start, end, (float)0, AddressToClientPointAscii); e.Graphics.FillPath(new SolidBrush(sel.BackColor), p); e.Graphics.DrawPath(new Pen(sel.BorderColor, sel.BorderWidth), p); } } if(Selection.Length != 0) { long start = Selection.Start; long end = Selection.End; if(start > end) { start = Selection.End; end = Selection.Start; } if(start / 8 <= dataEndOffset && end / 8 >= dataOffset) { GraphicsPath p = CreateRoundedSelectionPath(start, end, (float)0, AddressToClientPoint); e.Graphics.FillPath(new SolidBrush(Color.FromArgb(255, 200, 255, 200)), p); e.Graphics.DrawPath(new Pen(Color.LightGreen, 1), p); p = CreateRoundedSelectionPath(start, end, (float)0, AddressToClientPointAscii); e.Graphics.FillPath(new SolidBrush(Color.FromArgb(255, 200, 255, 200)), p); e.Graphics.DrawPath(new Pen(Color.LightGreen, 1), p); } } string str; for(int line = 0; line < visibleLines; ++line) { str = IntToRadixString((ulong)dataOffset, _AddressRadix, LayoutDimensions.NumAddressDigits); RectangleF rect = new RectangleF(LayoutDimensions.AddressRect.Left, (float)drawingOffset + line * LayoutDimensions.WordSize.Height, LayoutDimensions.AddressRect.Width, LayoutDimensions.WordSize.Height); e.Graphics.DrawString(str, _Font, _Brush, rect.Location); str = String.Empty; rect = new RectangleF(LayoutDimensions.DataRect.Left, (float)drawingOffset + line * LayoutDimensions.WordSize.Height, LayoutDimensions.WordSize.Width, LayoutDimensions.WordSize.Height); int off = 0; foreach(RectangleF wordRect in LayoutDimensions.WordRects) { if(dataOffset + off < Document.Length) { str = IntToRadixString(GetWord((dataOffset + off) * 8), _DataRadix, LayoutDimensions.NumWordDigits); e.Graphics.DrawString(str, _Font, _Brush, wordRect.Left, rect.Top); } else e.Graphics.DrawString(String.Empty.PadLeft(LayoutDimensions.NumWordDigits, '.'), _Font, _GrayBrush, wordRect.Left, rect.Top); off += _BytesPerWord; } str = String.Empty; long i; for(i = 0; i < LayoutDimensions.BitsPerRow / 8 && dataOffset + i < Document.Length; ++i) str += AsciiChar[Document[dataOffset + i]]; rect = new RectangleF(LayoutDimensions.AsciiRect.Left, (float)drawingOffset + line * LayoutDimensions.WordSize.Height, LayoutDimensions.AsciiRect.Width, LayoutDimensions.WordSize.Height); e.Graphics.DrawString(str, _Font, _Brush, rect.Location); if(i < LayoutDimensions.BitsPerRow / 8) { str = String.Empty.PadLeft((int)i, ' '); str = str.PadRight(LayoutDimensions.BitsPerRow / 8, '.'); e.Graphics.DrawString(str, _Font, _GrayBrush, rect.Location); } dataOffset += LayoutDimensions.BitsPerRow / 8; } } #if !MONO [StructLayout(LayoutKind.Sequential)] public class RECT { public Int32 left; public Int32 top; public Int32 right; public Int32 bottom; public RECT() { } public RECT(Int32 l, Int32 t, Int32 r, Int32 b) { left = l; top = t; right = r; bottom = b; } } [DllImport("user32.dll")] private static extern int ScrollWindowEx(System.IntPtr hWnd, int dx, int dy, [MarshalAs(UnmanagedType.LPStruct)] RECT prcScroll, [MarshalAs(UnmanagedType.LPStruct)] RECT prcClip, System.IntPtr hrgnUpdate, [MarshalAs(UnmanagedType.LPStruct)] RECT prcUpdate, System.UInt32 flags); #endif }
gpl-2.0
Screenly/Screenly-Cast-for-WordPress
screenly-cast/theme/screenly-cast/index.php
1027
<?php /** * Main file for archive, page and single posts * * PHP version 5 * * @category PHP * @package ScreenlyCast * @author Peter Monte <pmonte@screenly.io> * @license https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html GPLv2 * @link https://github.com/Screenly/Screenly-Cast-for-WordPress * @since 0.0.1 */ defined('ABSPATH') or die("No script kiddies please!"); /** Template Name: Homepage */ require_once 'header.php'; ?> <main> <?php if (have_posts()) : the_post(); ?> <section> <?php if (srlyHasTheFeaturedImage()) : ?> <div class="figure"<?php srlyTheFeaturedImage();?>></div> <?php endif; ?> <article> <h1><?php the_title();?></h1> <time datetime="<?php echo get_the_date('T Y-m-d H:i'); ?>"> <?php the_date('M d Y'); ?> </time> <?php the_content();?> </article> </section> <?php endif; ?> </main> <?php /** * Require footer */ require_once 'footer.php'; ?>
gpl-2.0
joshmoore/zeroc-ice
cs/test/Ice/operations/MyDerivedClassTieI.cs
12957
// ********************************************************************** // // 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. // // ********************************************************************** using System; using System.Collections.Generic; public sealed class MyDerivedClassI : Test.MyDerivedClassTie_ { public MyDerivedClassI() : base(new MyDerivedClassTieI()) { } } public sealed class MyDerivedClassTieI : Test.MyDerivedClassOperations_ { private static void test(bool b) { if (!b) { throw new Exception(); } } public void shutdown(Ice.Current current) { current.adapter.getCommunicator().shutdown(); } public void delay(int ms, Ice.Current current) { System.Threading.Thread.Sleep(ms); } public void opVoid(Ice.Current current) { test(current.mode == Ice.OperationMode.Normal); } public bool opBool(bool p1, bool p2, out bool p3, Ice.Current current) { p3 = p1; return p2; } public Test.BoolS opBoolS(Test.BoolS p1, Test.BoolS p2, out Test.BoolS p3, Ice.Current current) { p3 = new Test.BoolS(); p3.AddRange(p1); p3.AddRange(p2); Test.BoolS r = new Test.BoolS(); for(int i = 0; i < p1.Count; i++) { r.Add(p1[p1.Count - (i + 1)]); } return r; } public Test.BoolSS opBoolSS(Test.BoolSS p1, Test.BoolSS p2, out Test.BoolSS p3, Ice.Current current) { p3 = new Test.BoolSS(); p3.AddRange(p1); p3.AddRange(p2); Test.BoolSS r = new Test.BoolSS(); for(int i = 0; i < p1.Count; i++) { r.Add(p1[p1.Count - (i + 1)]); } return r; } public byte opByte(byte p1, byte p2, out byte p3, Ice.Current current) { p3 = (byte)(p1 ^ p2); return p1; } public Dictionary<byte, bool> opByteBoolD(Dictionary<byte, bool> p1, Dictionary<byte, bool> p2, out Dictionary<byte, bool> p3, Ice.Current current) { p3 = p1; Dictionary<byte, bool> r = new Dictionary<byte, bool>(); foreach(KeyValuePair<byte, bool> e in p1) { r[e.Key] = e.Value; } foreach(KeyValuePair<byte, bool> e in p2) { r[e.Key] = e.Value; } return r; } public Test.ByteS opByteS(Test.ByteS p1, Test.ByteS p2, out Test.ByteS p3, Ice.Current current) { p3 = new Test.ByteS(); for(int i = 0; i < p1.Count; i++) { p3.Add(p1[p1.Count - (i + 1)]); } Test.ByteS r = new Test.ByteS(p1.ToArray()); r.AddRange(p2); return r; } public Test.ByteSS opByteSS(Test.ByteSS p1, Test.ByteSS p2, out Test.ByteSS p3, Ice.Current current) { p3 = new Test.ByteSS(); for(int i = 0; i < p1.Count; i++) { p3.Add(p1[p1.Count - (i + 1)]); } Test.ByteSS r = new Test.ByteSS(); r.AddRange(p1); r.AddRange(p2); return r; } public double opFloatDouble(float p1, double p2, out float p3, out double p4, Ice.Current current) { p3 = p1; p4 = p2; return p2; } public Test.DoubleS opFloatDoubleS(Test.FloatS p1, Test.DoubleS p2, out Test.FloatS p3, out Test.DoubleS p4, Ice.Current current) { p3 = p1; p4 = new Test.DoubleS(); for(int i = 0; i < p2.Count; i++) { p4.Add(p2[p2.Count - (i + 1)]); } Test.DoubleS r = new Test.DoubleS(); r.AddRange(p2); for(int i = 0; i < p1.Count; i++) { r.Add(p1[i]); } return r; } public Test.DoubleSS opFloatDoubleSS(Test.FloatSS p1, Test.DoubleSS p2, out Test.FloatSS p3, out Test.DoubleSS p4, Ice.Current current) { p3 = p1; p4 = new Test.DoubleSS(); for(int i = 0; i < p2.Count; i++) { p4.Add(p2[p2.Count - (i + 1)]); } Test.DoubleSS r = new Test.DoubleSS(); r.AddRange(p2); r.AddRange(p2); return r; } public Dictionary<long, float> opLongFloatD(Dictionary<long, float> p1, Dictionary<long, float> p2, out Dictionary<long, float> p3, Ice.Current current) { p3 = p1; Dictionary<long, float> r = new Dictionary<long, float>(); foreach(KeyValuePair<long, float> e in p1) { r[e.Key] = e.Value; } foreach(KeyValuePair<long, float> e in p2) { r[e.Key] = e.Value; } return r; } public Test.MyClassPrx opMyClass(Test.MyClassPrx p1, out Test.MyClassPrx p2, out Test.MyClassPrx p3, Ice.Current current) { p2 = p1; p3 = Test.MyClassPrxHelper.uncheckedCast(current.adapter.createProxy( current.adapter.getCommunicator().stringToIdentity("noSuchIdentity"))); return Test.MyClassPrxHelper.uncheckedCast(current.adapter.createProxy(current.id)); } public Test.MyEnum opMyEnum(Test.MyEnum p1, out Test.MyEnum p2, Ice.Current current) { p2 = p1; return Test.MyEnum.enum3; } public Dictionary<short, int> opShortIntD(Dictionary<short, int> p1, Dictionary<short, int> p2, out Dictionary<short, int> p3, Ice.Current current) { p3 = p1; Dictionary<short, int> r = new Dictionary<short, int>(); foreach(KeyValuePair<short, int> e in p1) { r[e.Key] = e.Value; } foreach(KeyValuePair<short, int> e in p2) { r[e.Key] = e.Value; } return r; } public long opShortIntLong(short p1, int p2, long p3, out short p4, out int p5, out long p6, Ice.Current current) { p4 = p1; p5 = p2; p6 = p3; return p3; } public Test.LongS opShortIntLongS(Test.ShortS p1, Test.IntS p2, Test.LongS p3, out Test.ShortS p4, out Test.IntS p5, out Test.LongS p6, Ice.Current current) { p4 = p1; p5 = new Test.IntS(); for(int i = 0; i < p2.Count; i++) { p5.Add(p2[p2.Count - (i + 1)]); } p6 = new Test.LongS(); p6.AddRange(p3); p6.AddRange(p3); return p3; } public Test.LongSS opShortIntLongSS(Test.ShortSS p1, Test.IntSS p2, Test.LongSS p3, out Test.ShortSS p4, out Test.IntSS p5, out Test.LongSS p6, Ice.Current current) { p4 = p1; p5 = new Test.IntSS(); for(int i = 0; i < p2.Count; i++) { p5.Add(p2[p2.Count - (i + 1)]); } p6 = new Test.LongSS(); p6.AddRange(p3); p6.AddRange(p3); return p3; } public string opString(string p1, string p2, out string p3, Ice.Current current) { p3 = p2 + " " + p1; return p1 + " " + p2; } public Dictionary<string, Test.MyEnum> opStringMyEnumD(Dictionary<string, Test.MyEnum> p1, Dictionary<string, Test.MyEnum> p2, out Dictionary<string, Test.MyEnum> p3, Ice.Current current) { p3 = p1; Dictionary<string, Test.MyEnum> r = new Dictionary<string, Test.MyEnum>(); foreach(KeyValuePair<string, Test.MyEnum> e in p1) { r[e.Key] = e.Value; } foreach(KeyValuePair<string, Test.MyEnum> e in p2) { r[e.Key] = e.Value; } return r; } public Dictionary<Test.MyEnum, string> opMyEnumStringD(Dictionary<Test.MyEnum, string> p1, Dictionary<Test.MyEnum, string> p2, out Dictionary<Test.MyEnum, string> p3, Ice.Current current) { p3 = p1; Dictionary<Test.MyEnum, string> r = new Dictionary<Test.MyEnum, string>(); foreach(KeyValuePair<Test.MyEnum, string> e in p1) { r[e.Key] = e.Value; } foreach(KeyValuePair<Test.MyEnum, string> e in p2) { r[e.Key] = e.Value; } return r; } public Dictionary<Test.MyStruct, Test.MyEnum> opMyStructMyEnumD( Dictionary<Test.MyStruct, Test.MyEnum> p1, Dictionary<Test.MyStruct, Test.MyEnum> p2, out Dictionary<Test.MyStruct, Test.MyEnum> p3, Ice.Current current) { p3 = p1; Dictionary<Test.MyStruct, Test.MyEnum> r = new Dictionary<Test.MyStruct, Test.MyEnum>(); foreach(KeyValuePair<Test.MyStruct, Test.MyEnum> e in p1) { r[e.Key] = e.Value; } foreach(KeyValuePair<Test.MyStruct, Test.MyEnum> e in p2) { r[e.Key] = e.Value; } return r; } public Test.IntS opIntS(Test.IntS s, Ice.Current current) { Test.IntS r = new Test.IntS(); for(int i = 0; i < s.Count; ++i) { r.Add(-s[i]); } return r; } public void opByteSOneway(Test.ByteS s, Ice.Current current) { } public Dictionary<string, string> opContext(Ice.Current current) { return current.ctx == null ? new Dictionary<string, string>() : new Dictionary<string, string>(current.ctx); } public void opDoubleMarshaling(double p1, Test.DoubleS p2, Ice.Current current) { double d = 1278312346.0 / 13.0; test(p1 == d); for(int i = 0; i < p2.Count; ++i) { test(p2[i] == d); } } public Test.StringS opStringS(Test.StringS p1, Test.StringS p2, out Test.StringS p3, Ice.Current current) { p3 = new Test.StringS(); p3.AddRange(p1); p3.AddRange(p2); Test.StringS r = new Test.StringS(); for(int i = 0; i < p1.Count; i++) { r.Add(p1[p1.Count - (i + 1)]); } return r; } public Test.StringSS opStringSS(Test.StringSS p1, Test.StringSS p2, out Test.StringSS p3, Ice.Current current) { p3 = new Test.StringSS(); p3.AddRange(p1); p3.AddRange(p2); Test.StringSS r = new Test.StringSS(); for(int i = 0; i < p2.Count; i++) { r.Add(p2[p2.Count - (i + 1)]); } return r; } public Test.StringSS[] opStringSSS(Test.StringSS[] p1, Test.StringSS[] p2, out Test.StringSS[] p3, Ice.Current current) { p3 = new Test.StringSS[p1.Length + p2.Length]; p1.CopyTo(p3, 0); p2.CopyTo(p3, p1.Length); Test.StringSS[] r = new Test.StringSS[p2.Length]; for(int i = 0; i < p2.Length; i++) { r[i] = p2[p2.Length - (i + 1)]; } return r; } public Dictionary<string, string> opStringStringD(Dictionary<string, string> p1, Dictionary<string, string> p2, out Dictionary<string, string> p3, Ice.Current current) { p3 = p1; Dictionary<string, string> r = new Dictionary<string, string>(); foreach(KeyValuePair<string, string> e in p1) { r[e.Key] = e.Value; } foreach(KeyValuePair<string, string> e in p2) { r[e.Key] = e.Value; } return r; } public Test.Structure opStruct(Test.Structure p1, Test.Structure p2, out Test.Structure p3, Ice.Current current) { p3 = p1; p3.s.s = "a new string"; return p2; } public void opIdempotent(Ice.Current current) { test(current.mode == Ice.OperationMode.Idempotent); } public void opNonmutating(Ice.Current current) { test(current.mode == Ice.OperationMode.Nonmutating); } public void opDerived(Ice.Current current) { } }
gpl-2.0
zeypo/pt-coaching
wp-content/themes/ausart/vc_templates/home_blog.php
549
<?php extract(shortcode_atts(array( 'dynamic_title' => '', 'style' => '' ), $atts)); ob_start(); $output = '<div>'; if(!empty($dynamic_title)){ $output .= '<div class="header"><h3>'.$dynamic_title.'</h3></div>'; } query_posts('posts_per_page = -1' ); get_template_part( 'template_inc/loop', $style); wp_reset_query(); $output .= ob_get_clean(); $output .= '</div>'; echo $output; ?>
gpl-2.0
tripnaksha/sourcecode
administrator/components/com_eventlist/views/venue/view.html.php
5586
<?php /** * @version 1.0 $Id: view.html.php 662 2008-05-09 22:28:53Z schlu $ * @package Joomla * @subpackage EventList * @copyright (C) 2005 - 2008 Christoph Lukes * @license GNU/GPL, see LICENSE.php * EventList is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License 2 * as published by the Free Software Foundation. * EventList 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 EventList; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ defined( '_JEXEC' ) or die( 'Restricted access' ); jimport( 'joomla.application.component.view'); /** * View class for the EventList Venueedit screen * * @package Joomla * @subpackage EventList * @since 0.9 */ class EventListViewVenue extends JView { function display($tpl = null) { global $mainframe; // Load pane behavior jimport('joomla.html.pane'); JHTML::_('behavior.tooltip'); //initialise variables $editor = & JFactory::getEditor(); $document = & JFactory::getDocument(); $pane = & JPane::getInstance('sliders'); $user = & JFactory::getUser(); $settings = ELAdmin::config(); //get vars $cid = JRequest::getInt( 'cid' ); //add css and js to document $document->addScript('../includes/js/joomla/popup.js'); $document->addStyleSheet('../includes/js/joomla/popup.css'); $document->addStyleSheet('components/com_eventlist/assets/css/eventlistbackend.css'); // Get data from the model $model = & $this->getModel(); $row = & $this->get( 'Data'); // fail if checked out not by 'me' if ($row->id) { if ($model->isCheckedOut( $user->get('id') )) { JError::raiseWarning( 'SOME_ERROR_CODE', $row->venue.' '.JText::_( 'EDITED BY ANOTHER ADMIN' )); $mainframe->redirect( 'index.php?option=com_eventlist&view=venues' ); } } //create the toolbar if ( $cid ) { JToolBarHelper::title( JText::_( 'EDIT VENUE' ), 'venuesedit' ); //makes data safe JFilterOutput::objectHTMLSafe( $row, ENT_QUOTES, 'locdescription' ); } else { JToolBarHelper::title( JText::_( 'ADD VENUE' ), 'venuesedit' ); //set the submenu JSubMenuHelper::addEntry( JText::_( 'EVENTLIST' ), 'index.php?option=com_eventlist'); JSubMenuHelper::addEntry( JText::_( 'EVENTS' ), 'index.php?option=com_eventlist&view=events'); JSubMenuHelper::addEntry( JText::_( 'VENUES' ), 'index.php?option=com_eventlist&view=venues'); JSubMenuHelper::addEntry( JText::_( 'CATEGORIES' ), 'index.php?option=com_eventlist&view=categories'); JSubMenuHelper::addEntry( JText::_( 'ARCHIVESCREEN' ), 'index.php?option=com_eventlist&view=archive'); JSubMenuHelper::addEntry( JText::_( 'GROUPS' ), 'index.php?option=com_eventlist&view=groups'); JSubMenuHelper::addEntry( JText::_( 'HELP' ), 'index.php?option=com_eventlist&view=help'); if ($user->get('gid') > 24) { JSubMenuHelper::addEntry( JText::_( 'SETTINGS' ), 'index.php?option=com_eventlist&controller=settings&task=edit'); } } JToolBarHelper::apply(); JToolBarHelper::spacer(); JToolBarHelper::save(); JToolBarHelper::spacer(); JToolBarHelper::cancel(); JToolBarHelper::spacer(); JToolBarHelper::help( 'el.editvenues', true ); //Build the image select functionality $js = " function elSelectImage(image, imagename) { document.getElementById('a_image').value = image; document.getElementById('a_imagename').value = imagename; document.getElementById('imagelib').src = '../images/eventlist/venues/' + image; document.getElementById('sbox-window').close(); }"; $link = 'index.php?option=com_eventlist&amp;view=imagehandler&amp;layout=uploadimage&amp;task=venueimg&amp;tmpl=component'; $link2 = 'index.php?option=com_eventlist&amp;view=imagehandler&amp;task=selectvenueimg&amp;tmpl=component'; $document->addScriptDeclaration($js); JHTML::_('behavior.modal', 'a.modal'); $imageselect = "\n<input style=\"background: #ffffff;\" type=\"text\" id=\"a_imagename\" value=\"$row->locimage\" disabled=\"disabled\" onchange=\"javascript:if (document.forms[0].a_imagename.value!='') {document.imagelib.src='../images/eventlist/venues/' + document.forms[0].a_imagename.value} else {document.imagelib.src='../images/blank.png'}\"; /><br />"; $imageselect .= "<div class=\"button2-left\"><div class=\"blank\"><a class=\"modal\" title=\"".JText::_('Upload')."\" href=\"$link\" rel=\"{handler: 'iframe', size: {x: 650, y: 375}}\">".JText::_('Upload')."</a></div></div>\n"; $imageselect .= "<div class=\"button2-left\"><div class=\"blank\"><a class=\"modal\" title=\"".JText::_('SELECTIMAGE')."\" href=\"$link2\" rel=\"{handler: 'iframe', size: {x: 650, y: 375}}\">".JText::_('SELECTIMAGE')."</a></div></div>\n"; $imageselect .= "\n&nbsp;<input class=\"inputbox\" type=\"button\" onclick=\"elSelectImage('', '".JText::_('SELECTIMAGE')."' );\" value=\"".JText::_('Reset')."\" />"; $imageselect .= "\n<input type=\"hidden\" id=\"a_image\" name=\"locimage\" value=\"$row->locimage\" />"; //assign data to template $this->assignRef('row' , $row); $this->assignRef('pane' , $pane); $this->assignRef('editor' , $editor); $this->assignRef('settings' , $settings); $this->assignRef('imageselect' , $imageselect); parent::display($tpl); } } ?>
gpl-2.0
jswattjr/DroneController
DroneManager/Models/MessageContainers/Heartbeat.cs
2950
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using DroneConnection; using NLog; using Utilities; namespace DroneManager.Models.MessageContainers { /* The heartbeat message shows that a system is present and responding. The type of the MAV and Autopilot hardware allow the receiving system to treat further messages from this system appropriate (e.g. by laying out the user interface based on the autopilot). type uint8_t Type of the MAV (quadrotor, helicopter, etc., up to 15 types, defined in MAV_TYPE ENUM) autopilot uint8_t Autopilot type / class. defined in MAV_AUTOPILOT ENUM base_mode uint8_t System mode bitfield, see MAV_MODE_FLAG ENUM in mavlink/include/mavlink_types.h custom_mode uint32_t A bitfield for use for autopilot-specific flags. system_status uint8_t System status flag, see MAV_STATE ENUM mavlink_version uint8_t_mavlink_version MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version */ public class Heartbeat : MessageContainerBase { static Logger logger = LogManager.GetLogger("applog"); // message parameters public MAVLink.MAV_TYPE type { get; set; } public MAVLink.MAV_AUTOPILOT autopilot { get; set; } public UInt32 custom_mode { get; set; } public List<MAVLink.MAV_MODE_FLAG> base_mode { get; set; } public MAVLink.MAV_STATE system_status { get; set; } public int mavlink_version { get; set; } public override MAVLink.MAVLINK_MSG_ID MessageID { get; } = MAVLink.MAVLINK_MSG_ID.HEARTBEAT; public override string DesctiptionUrl { get { return "https://pixhawk.ethz.ch/mavlink/#HEARTBEAT"; } } public Heartbeat(MavLinkMessage message) : base(null) { if (message.messid == this.MessageID) { // this code is faster... run it and pass null to base message for speed increase // base message uses reflection MAVLink.mavlink_heartbeat_t raw_data = (MAVLink.mavlink_heartbeat_t)message.data_struct; type = (MAVLink.MAV_TYPE)raw_data.type; autopilot = (MAVLink.MAV_AUTOPILOT)raw_data.autopilot; custom_mode = raw_data.custom_mode; base_mode = Utilities.BitwiseOperations.parseBitValues<MAVLink.MAV_MODE_FLAG>(raw_data.base_mode); system_status = (MAVLink.MAV_STATE)raw_data.system_status; mavlink_version = (int)raw_data.mavlink_version; } } public override Type getStructType() { return typeof(MAVLink.mavlink_heartbeat_t); } } }
gpl-2.0
reolus/countyfeecollections
src/countyfeecollections/usercontrols/ucDefendant.Designer.cs
58506
/* County Fee Collections, a .NET application for managing fee payments Copyright (C) 2015 Pottawattamie County, Iowa This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ namespace county.feecollections { partial class ucDefendant { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose( bool disposing ) { if( disposing && (components != null) ) { components.Dispose(); } base.Dispose( disposing ); } #region Component Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.Windows.Forms.GroupBox grpDefendnatInfo; System.Windows.Forms.Label lblCellPhone; System.Windows.Forms.Label lblHomePhone; System.Windows.Forms.Label lblCityStateZip; System.Windows.Forms.Label lblStreet2; System.Windows.Forms.Label lblStreet1; System.Windows.Forms.Label lblFirstName; System.Windows.Forms.Label lblSSN; System.Windows.Forms.Label lblLastName; System.Windows.Forms.Label lblMiddleName; System.Windows.Forms.Label lblDriversLicense; System.Windows.Forms.Label lblAKA; System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); this.splitContainerDefendantDetail = new System.Windows.Forms.SplitContainer(); this.lblAddress = new System.Windows.Forms.Label(); this.mskPhoneMobile = new System.Windows.Forms.MaskedTextBox(); this.mskPhoneHome = new System.Windows.Forms.MaskedTextBox(); this.mskZip = new System.Windows.Forms.MaskedTextBox(); this.txtCity = new System.Windows.Forms.TextBox(); this.cmbStates = new System.Windows.Forms.ComboBox(); this.txtStreet1 = new System.Windows.Forms.TextBox(); this.txtStreet2 = new System.Windows.Forms.TextBox(); this.mskBirthDate = new System.Windows.Forms.MaskedTextBox(); this.txtLastName = new System.Windows.Forms.TextBox(); this.txtDriversLicense = new System.Windows.Forms.TextBox(); this.txtAka = new System.Windows.Forms.TextBox(); this.mskSSN = new System.Windows.Forms.MaskedTextBox(); this.txtFirstName = new System.Windows.Forms.TextBox(); this.txtMiddleName = new System.Windows.Forms.TextBox(); this.lblBirthdate = new System.Windows.Forms.Label(); this.tabcontrolModeFields = new System.Windows.Forms.TabControl(); this.tabAttorneyPage = new System.Windows.Forms.TabPage(); this.mskBarredUntil = new System.Windows.Forms.MaskedTextBox(); this.chkHasProbationOfficer = new System.Windows.Forms.CheckBox(); this.lblBarredUntil = new System.Windows.Forms.Label(); this.txtProbationOfficer = new System.Windows.Forms.TextBox(); this.tabJailPage = new System.Windows.Forms.TabPage(); this.tbJudgmentFiledDate = new System.Windows.Forms.MaskedTextBox(); this.label3 = new System.Windows.Forms.Label(); this.cbxHasJudgmentFiled = new System.Windows.Forms.CheckBox(); this.tbBookingNumber = new System.Windows.Forms.TextBox(); this.tbJudgmentDate = new System.Windows.Forms.MaskedTextBox(); this.lblDaysInJail = new System.Windows.Forms.Label(); this.lblJudgmentDate = new System.Windows.Forms.Label(); this.tbDaysInJail = new System.Windows.Forms.MaskedTextBox(); this.lblBookingNumber = new System.Windows.Forms.Label(); this.tabBankruptcy = new System.Windows.Forms.TabPage(); this.cbxInBankruptcy = new System.Windows.Forms.CheckBox(); this.tbBankruptcyDateFiled = new System.Windows.Forms.MaskedTextBox(); this.tbBankruptcyEndDate = new System.Windows.Forms.MaskedTextBox(); this.label2 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.dgvPlanSummary = new System.Windows.Forms.DataGridView(); this.planname = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.CAPP = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.NonCAPP = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.Filed = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.Contempt = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.Insurance = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.Noncompliance = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.fileddate = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.bindingPlans = new System.Windows.Forms.BindingSource(this.components); this.lblEmployers = new System.Windows.Forms.Label(); this.ucEmployer = new county.feecollections.ucEmployer(); grpDefendnatInfo = new System.Windows.Forms.GroupBox(); lblCellPhone = new System.Windows.Forms.Label(); lblHomePhone = new System.Windows.Forms.Label(); lblCityStateZip = new System.Windows.Forms.Label(); lblStreet2 = new System.Windows.Forms.Label(); lblStreet1 = new System.Windows.Forms.Label(); lblFirstName = new System.Windows.Forms.Label(); lblSSN = new System.Windows.Forms.Label(); lblLastName = new System.Windows.Forms.Label(); lblMiddleName = new System.Windows.Forms.Label(); lblDriversLicense = new System.Windows.Forms.Label(); lblAKA = new System.Windows.Forms.Label(); grpDefendnatInfo.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitContainerDefendantDetail)).BeginInit(); this.splitContainerDefendantDetail.Panel1.SuspendLayout(); this.splitContainerDefendantDetail.Panel2.SuspendLayout(); this.splitContainerDefendantDetail.SuspendLayout(); this.tabcontrolModeFields.SuspendLayout(); this.tabAttorneyPage.SuspendLayout(); this.tabJailPage.SuspendLayout(); this.tabBankruptcy.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dgvPlanSummary)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.bindingPlans)).BeginInit(); this.SuspendLayout(); // // grpDefendnatInfo // grpDefendnatInfo.Controls.Add(this.splitContainerDefendantDetail); grpDefendnatInfo.Dock = System.Windows.Forms.DockStyle.Fill; grpDefendnatInfo.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); grpDefendnatInfo.Location = new System.Drawing.Point(0, 0); grpDefendnatInfo.MinimumSize = new System.Drawing.Size(567, 375); grpDefendnatInfo.Name = "grpDefendnatInfo"; grpDefendnatInfo.Size = new System.Drawing.Size(723, 375); grpDefendnatInfo.TabIndex = 10; grpDefendnatInfo.TabStop = false; grpDefendnatInfo.Text = "Defendant Information"; // // splitContainerDefendantDetail // this.splitContainerDefendantDetail.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.splitContainerDefendantDetail.Dock = System.Windows.Forms.DockStyle.Fill; this.splitContainerDefendantDetail.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; this.splitContainerDefendantDetail.Location = new System.Drawing.Point(3, 16); this.splitContainerDefendantDetail.MinimumSize = new System.Drawing.Size(561, 356); this.splitContainerDefendantDetail.Name = "splitContainerDefendantDetail"; // // splitContainerDefendantDetail.Panel1 // this.splitContainerDefendantDetail.Panel1.Controls.Add(this.lblAddress); this.splitContainerDefendantDetail.Panel1.Controls.Add(this.mskPhoneMobile); this.splitContainerDefendantDetail.Panel1.Controls.Add(this.mskPhoneHome); this.splitContainerDefendantDetail.Panel1.Controls.Add(lblCellPhone); this.splitContainerDefendantDetail.Panel1.Controls.Add(lblHomePhone); this.splitContainerDefendantDetail.Panel1.Controls.Add(this.mskZip); this.splitContainerDefendantDetail.Panel1.Controls.Add(this.txtCity); this.splitContainerDefendantDetail.Panel1.Controls.Add(this.cmbStates); this.splitContainerDefendantDetail.Panel1.Controls.Add(this.txtStreet1); this.splitContainerDefendantDetail.Panel1.Controls.Add(this.txtStreet2); this.splitContainerDefendantDetail.Panel1.Controls.Add(lblCityStateZip); this.splitContainerDefendantDetail.Panel1.Controls.Add(lblStreet2); this.splitContainerDefendantDetail.Panel1.Controls.Add(lblStreet1); this.splitContainerDefendantDetail.Panel1.Controls.Add(this.mskBirthDate); this.splitContainerDefendantDetail.Panel1.Controls.Add(this.txtLastName); this.splitContainerDefendantDetail.Panel1.Controls.Add(this.txtDriversLicense); this.splitContainerDefendantDetail.Panel1.Controls.Add(this.txtAka); this.splitContainerDefendantDetail.Panel1.Controls.Add(this.mskSSN); this.splitContainerDefendantDetail.Panel1.Controls.Add(this.txtFirstName); this.splitContainerDefendantDetail.Panel1.Controls.Add(this.txtMiddleName); this.splitContainerDefendantDetail.Panel1.Controls.Add(this.lblBirthdate); this.splitContainerDefendantDetail.Panel1.Controls.Add(lblFirstName); this.splitContainerDefendantDetail.Panel1.Controls.Add(lblSSN); this.splitContainerDefendantDetail.Panel1.Controls.Add(lblLastName); this.splitContainerDefendantDetail.Panel1.Controls.Add(lblMiddleName); this.splitContainerDefendantDetail.Panel1.Controls.Add(lblDriversLicense); this.splitContainerDefendantDetail.Panel1.Controls.Add(lblAKA); this.splitContainerDefendantDetail.Panel1MinSize = 280; // // splitContainerDefendantDetail.Panel2 // this.splitContainerDefendantDetail.Panel2.Controls.Add(this.tabcontrolModeFields); this.splitContainerDefendantDetail.Panel2.Controls.Add(this.dgvPlanSummary); this.splitContainerDefendantDetail.Panel2.Controls.Add(this.lblEmployers); this.splitContainerDefendantDetail.Panel2.Controls.Add(this.ucEmployer); this.splitContainerDefendantDetail.Size = new System.Drawing.Size(717, 356); this.splitContainerDefendantDetail.SplitterDistance = 280; this.splitContainerDefendantDetail.SplitterWidth = 1; this.splitContainerDefendantDetail.TabIndex = 0; // // lblAddress // this.lblAddress.AutoSize = true; this.lblAddress.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblAddress.Location = new System.Drawing.Point(11, 221); this.lblAddress.Name = "lblAddress"; this.lblAddress.Size = new System.Drawing.Size(48, 13); this.lblAddress.TabIndex = 51; this.lblAddress.Text = "Address:"; // // mskPhoneMobile // this.mskPhoneMobile.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.mskPhoneMobile.Location = new System.Drawing.Point(190, 320); this.mskPhoneMobile.Mask = "(999) 000-0000"; this.mskPhoneMobile.Name = "mskPhoneMobile"; this.mskPhoneMobile.Size = new System.Drawing.Size(80, 20); this.mskPhoneMobile.TabIndex = 13; this.mskPhoneMobile.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; // // mskPhoneHome // this.mskPhoneHome.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.mskPhoneHome.Location = new System.Drawing.Point(86, 320); this.mskPhoneHome.Mask = "(999) 000-0000"; this.mskPhoneHome.Name = "mskPhoneHome"; this.mskPhoneHome.Size = new System.Drawing.Size(80, 20); this.mskPhoneHome.TabIndex = 12; this.mskPhoneHome.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; // // lblCellPhone // lblCellPhone.AutoSize = true; lblCellPhone.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); lblCellPhone.Location = new System.Drawing.Point(193, 308); lblCellPhone.Name = "lblCellPhone"; lblCellPhone.Size = new System.Drawing.Size(75, 13); lblCellPhone.TabIndex = 50; lblCellPhone.Text = "Mobile Phone:"; lblCellPhone.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // lblHomePhone // lblHomePhone.AutoSize = true; lblHomePhone.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); lblHomePhone.Location = new System.Drawing.Point(90, 308); lblHomePhone.Name = "lblHomePhone"; lblHomePhone.Size = new System.Drawing.Size(72, 13); lblHomePhone.TabIndex = 49; lblHomePhone.Text = "Home Phone:"; lblHomePhone.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // mskZip // this.mskZip.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.mskZip.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.mskZip.Location = new System.Drawing.Point(204, 283); this.mskZip.Mask = "00000-9999"; this.mskZip.Name = "mskZip"; this.mskZip.Size = new System.Drawing.Size(67, 20); this.mskZip.TabIndex = 11; this.mskZip.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; // // txtCity // this.txtCity.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtCity.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txtCity.Location = new System.Drawing.Point(84, 284); this.txtCity.Name = "txtCity"; this.txtCity.Size = new System.Drawing.Size(73, 20); this.txtCity.TabIndex = 9; this.txtCity.Text = "Council Bluffs"; // // cmbStates // this.cmbStates.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.cmbStates.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbStates.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.cmbStates.FormattingEnabled = true; this.cmbStates.Location = new System.Drawing.Point(160, 283); this.cmbStates.Name = "cmbStates"; this.cmbStates.Size = new System.Drawing.Size(42, 21); this.cmbStates.TabIndex = 10; // // txtStreet1 // this.txtStreet1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtStreet1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txtStreet1.Location = new System.Drawing.Point(84, 237); this.txtStreet1.Name = "txtStreet1"; this.txtStreet1.Size = new System.Drawing.Size(187, 20); this.txtStreet1.TabIndex = 7; // // txtStreet2 // this.txtStreet2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtStreet2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txtStreet2.Location = new System.Drawing.Point(84, 261); this.txtStreet2.Name = "txtStreet2"; this.txtStreet2.Size = new System.Drawing.Size(187, 20); this.txtStreet2.TabIndex = 8; // // lblCityStateZip // lblCityStateZip.AutoSize = true; lblCityStateZip.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); lblCityStateZip.Location = new System.Drawing.Point(11, 288); lblCityStateZip.Name = "lblCityStateZip"; lblCityStateZip.Size = new System.Drawing.Size(76, 13); lblCityStateZip.TabIndex = 47; lblCityStateZip.Text = "City, State Zip:"; // // lblStreet2 // lblStreet2.AutoSize = true; lblStreet2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); lblStreet2.Location = new System.Drawing.Point(43, 265); lblStreet2.Name = "lblStreet2"; lblStreet2.Size = new System.Drawing.Size(44, 13); lblStreet2.TabIndex = 48; lblStreet2.Text = "Street2:"; // // lblStreet1 // lblStreet1.AutoSize = true; lblStreet1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); lblStreet1.Location = new System.Drawing.Point(43, 241); lblStreet1.Name = "lblStreet1"; lblStreet1.Size = new System.Drawing.Size(44, 13); lblStreet1.TabIndex = 46; lblStreet1.Text = "Street1:"; // // mskBirthDate // this.mskBirthDate.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.mskBirthDate.Location = new System.Drawing.Point(84, 136); this.mskBirthDate.Mask = "00/00/0000"; this.mskBirthDate.Name = "mskBirthDate"; this.mskBirthDate.Size = new System.Drawing.Size(70, 20); this.mskBirthDate.TabIndex = 5; this.mskBirthDate.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.mskBirthDate.ValidatingType = typeof(System.DateTime); // // txtLastName // this.txtLastName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtLastName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txtLastName.Location = new System.Drawing.Point(84, 58); this.txtLastName.Name = "txtLastName"; this.txtLastName.Size = new System.Drawing.Size(187, 20); this.txtLastName.TabIndex = 2; // // txtDriversLicense // this.txtDriversLicense.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtDriversLicense.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txtDriversLicense.Location = new System.Drawing.Point(84, 162); this.txtDriversLicense.Name = "txtDriversLicense"; this.txtDriversLicense.Size = new System.Drawing.Size(187, 20); this.txtDriversLicense.TabIndex = 6; // // txtAka // this.txtAka.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtAka.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txtAka.Location = new System.Drawing.Point(84, 84); this.txtAka.Name = "txtAka"; this.txtAka.Size = new System.Drawing.Size(187, 20); this.txtAka.TabIndex = 3; // // mskSSN // this.mskSSN.AllowPromptAsInput = false; this.mskSSN.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.mskSSN.Location = new System.Drawing.Point(84, 110); this.mskSSN.Mask = "000-00-0000"; this.mskSSN.Name = "mskSSN"; this.mskSSN.Size = new System.Drawing.Size(70, 20); this.mskSSN.TabIndex = 4; this.mskSSN.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; // // txtFirstName // this.txtFirstName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtFirstName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txtFirstName.Location = new System.Drawing.Point(84, 6); this.txtFirstName.Name = "txtFirstName"; this.txtFirstName.Size = new System.Drawing.Size(187, 20); this.txtFirstName.TabIndex = 0; // // txtMiddleName // this.txtMiddleName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtMiddleName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txtMiddleName.Location = new System.Drawing.Point(84, 32); this.txtMiddleName.Name = "txtMiddleName"; this.txtMiddleName.Size = new System.Drawing.Size(187, 20); this.txtMiddleName.TabIndex = 1; // // lblBirthdate // this.lblBirthdate.AutoSize = true; this.lblBirthdate.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblBirthdate.Location = new System.Drawing.Point(30, 140); this.lblBirthdate.Name = "lblBirthdate"; this.lblBirthdate.Size = new System.Drawing.Size(57, 13); this.lblBirthdate.TabIndex = 37; this.lblBirthdate.Text = "Birth Date:"; // // lblFirstName // lblFirstName.AutoSize = true; lblFirstName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); lblFirstName.Location = new System.Drawing.Point(27, 10); lblFirstName.Name = "lblFirstName"; lblFirstName.Size = new System.Drawing.Size(60, 13); lblFirstName.TabIndex = 29; lblFirstName.Text = "First Name:"; // // lblSSN // lblSSN.AutoSize = true; lblSSN.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); lblSSN.Location = new System.Drawing.Point(55, 114); lblSSN.Name = "lblSSN"; lblSSN.Size = new System.Drawing.Size(32, 13); lblSSN.TabIndex = 35; lblSSN.Text = "SSN:"; // // lblLastName // lblLastName.AutoSize = true; lblLastName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); lblLastName.Location = new System.Drawing.Point(26, 62); lblLastName.Name = "lblLastName"; lblLastName.Size = new System.Drawing.Size(61, 13); lblLastName.TabIndex = 33; lblLastName.Text = "Last Name:"; // // lblMiddleName // lblMiddleName.AutoSize = true; lblMiddleName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); lblMiddleName.Location = new System.Drawing.Point(15, 36); lblMiddleName.Name = "lblMiddleName"; lblMiddleName.Size = new System.Drawing.Size(72, 13); lblMiddleName.TabIndex = 34; lblMiddleName.Text = "Middle Name:"; // // lblDriversLicense // lblDriversLicense.AutoSize = true; lblDriversLicense.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); lblDriversLicense.Location = new System.Drawing.Point(4, 165); lblDriversLicense.Name = "lblDriversLicense"; lblDriversLicense.Size = new System.Drawing.Size(83, 13); lblDriversLicense.TabIndex = 38; lblDriversLicense.Text = "Drivers License:"; // // lblAKA // lblAKA.AutoSize = true; lblAKA.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); lblAKA.Location = new System.Drawing.Point(56, 88); lblAKA.Name = "lblAKA"; lblAKA.Size = new System.Drawing.Size(31, 13); lblAKA.TabIndex = 36; lblAKA.Text = "AKA:"; // // tabcontrolModeFields // this.tabcontrolModeFields.Appearance = System.Windows.Forms.TabAppearance.FlatButtons; this.tabcontrolModeFields.Controls.Add(this.tabAttorneyPage); this.tabcontrolModeFields.Controls.Add(this.tabJailPage); this.tabcontrolModeFields.Controls.Add(this.tabBankruptcy); this.tabcontrolModeFields.ItemSize = new System.Drawing.Size(80, 18); this.tabcontrolModeFields.Location = new System.Drawing.Point(0, 144); this.tabcontrolModeFields.Margin = new System.Windows.Forms.Padding(1); this.tabcontrolModeFields.Name = "tabcontrolModeFields"; this.tabcontrolModeFields.Padding = new System.Drawing.Point(1, 1); this.tabcontrolModeFields.SelectedIndex = 0; this.tabcontrolModeFields.Size = new System.Drawing.Size(434, 90); this.tabcontrolModeFields.SizeMode = System.Windows.Forms.TabSizeMode.Fixed; this.tabcontrolModeFields.TabIndex = 25; // // tabAttorneyPage // this.tabAttorneyPage.Controls.Add(this.mskBarredUntil); this.tabAttorneyPage.Controls.Add(this.chkHasProbationOfficer); this.tabAttorneyPage.Controls.Add(this.lblBarredUntil); this.tabAttorneyPage.Controls.Add(this.txtProbationOfficer); this.tabAttorneyPage.Location = new System.Drawing.Point(4, 22); this.tabAttorneyPage.Name = "tabAttorneyPage"; this.tabAttorneyPage.Padding = new System.Windows.Forms.Padding(3); this.tabAttorneyPage.Size = new System.Drawing.Size(426, 64); this.tabAttorneyPage.TabIndex = 0; this.tabAttorneyPage.Text = "Basic"; this.tabAttorneyPage.UseVisualStyleBackColor = true; // // mskBarredUntil // this.mskBarredUntil.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.mskBarredUntil.Location = new System.Drawing.Point(65, 6); this.mskBarredUntil.Mask = "00/00/0000"; this.mskBarredUntil.Name = "mskBarredUntil"; this.mskBarredUntil.Size = new System.Drawing.Size(70, 20); this.mskBarredUntil.TabIndex = 16; this.mskBarredUntil.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.mskBarredUntil.ValidatingType = typeof(System.DateTime); // // chkHasProbationOfficer // this.chkHasProbationOfficer.AutoSize = true; this.chkHasProbationOfficer.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.chkHasProbationOfficer.Location = new System.Drawing.Point(9, 32); this.chkHasProbationOfficer.Name = "chkHasProbationOfficer"; this.chkHasProbationOfficer.Size = new System.Drawing.Size(108, 17); this.chkHasProbationOfficer.TabIndex = 20; this.chkHasProbationOfficer.Text = "Probation Officer:"; this.chkHasProbationOfficer.UseVisualStyleBackColor = true; // // lblBarredUntil // this.lblBarredUntil.AutoSize = true; this.lblBarredUntil.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblBarredUntil.Location = new System.Drawing.Point(6, 10); this.lblBarredUntil.Name = "lblBarredUntil"; this.lblBarredUntil.Size = new System.Drawing.Size(65, 13); this.lblBarredUntil.TabIndex = 14; this.lblBarredUntil.Text = "Barred Until:"; // // txtProbationOfficer // this.txtProbationOfficer.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtProbationOfficer.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txtProbationOfficer.Location = new System.Drawing.Point(123, 30); this.txtProbationOfficer.Name = "txtProbationOfficer"; this.txtProbationOfficer.Size = new System.Drawing.Size(297, 20); this.txtProbationOfficer.TabIndex = 21; // // tabJailPage // this.tabJailPage.Controls.Add(this.tbJudgmentFiledDate); this.tabJailPage.Controls.Add(this.label3); this.tabJailPage.Controls.Add(this.cbxHasJudgmentFiled); this.tabJailPage.Controls.Add(this.tbBookingNumber); this.tabJailPage.Controls.Add(this.tbJudgmentDate); this.tabJailPage.Controls.Add(this.lblDaysInJail); this.tabJailPage.Controls.Add(this.lblJudgmentDate); this.tabJailPage.Controls.Add(this.tbDaysInJail); this.tabJailPage.Controls.Add(this.lblBookingNumber); this.tabJailPage.Location = new System.Drawing.Point(4, 22); this.tabJailPage.Name = "tabJailPage"; this.tabJailPage.Padding = new System.Windows.Forms.Padding(3); this.tabJailPage.Size = new System.Drawing.Size(426, 64); this.tabJailPage.TabIndex = 1; this.tabJailPage.Text = "Jail"; this.tabJailPage.UseVisualStyleBackColor = true; // // tbJudgmentFiledDate // this.tbJudgmentFiledDate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.tbJudgmentFiledDate.Location = new System.Drawing.Point(326, 22); this.tbJudgmentFiledDate.Mask = "00/00/0000"; this.tbJudgmentFiledDate.Name = "tbJudgmentFiledDate"; this.tbJudgmentFiledDate.Size = new System.Drawing.Size(80, 20); this.tbJudgmentFiledDate.TabIndex = 27; // // label3 // this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.label3.AutoSize = true; this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); this.label3.Location = new System.Drawing.Point(220, 25); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(104, 13); this.label3.TabIndex = 26; this.label3.Text = "Judgment Filed Date"; // // cbxHasJudgmentFiled // this.cbxHasJudgmentFiled.AutoSize = true; this.cbxHasJudgmentFiled.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.cbxHasJudgmentFiled.Location = new System.Drawing.Point(223, 5); this.cbxHasJudgmentFiled.Name = "cbxHasJudgmentFiled"; this.cbxHasJudgmentFiled.Size = new System.Drawing.Size(97, 17); this.cbxHasJudgmentFiled.TabIndex = 26; this.cbxHasJudgmentFiled.Text = "Judgment Filed"; this.cbxHasJudgmentFiled.UseVisualStyleBackColor = true; // // tbBookingNumber // this.tbBookingNumber.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.tbBookingNumber.Location = new System.Drawing.Point(64, 0); this.tbBookingNumber.MaxLength = 10; this.tbBookingNumber.Name = "tbBookingNumber"; this.tbBookingNumber.Size = new System.Drawing.Size(99, 20); this.tbBookingNumber.TabIndex = 23; // // tbJudgmentDate // this.tbJudgmentDate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.tbJudgmentDate.Location = new System.Drawing.Point(83, 44); this.tbJudgmentDate.Mask = "00/00/0000"; this.tbJudgmentDate.Name = "tbJudgmentDate"; this.tbJudgmentDate.Size = new System.Drawing.Size(80, 20); this.tbJudgmentDate.TabIndex = 25; // // lblDaysInJail // this.lblDaysInJail.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.lblDaysInJail.AutoSize = true; this.lblDaysInJail.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); this.lblDaysInJail.Location = new System.Drawing.Point(7, 25); this.lblDaysInJail.Name = "lblDaysInJail"; this.lblDaysInJail.Size = new System.Drawing.Size(70, 13); this.lblDaysInJail.TabIndex = 16; this.lblDaysInJail.Text = "# Days in Jail"; // // lblJudgmentDate // this.lblJudgmentDate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.lblJudgmentDate.AutoSize = true; this.lblJudgmentDate.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); this.lblJudgmentDate.Location = new System.Drawing.Point(7, 47); this.lblJudgmentDate.Name = "lblJudgmentDate"; this.lblJudgmentDate.Size = new System.Drawing.Size(79, 13); this.lblJudgmentDate.TabIndex = 17; this.lblJudgmentDate.Text = "Judgment Date"; // // tbDaysInJail // this.tbDaysInJail.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.tbDaysInJail.Location = new System.Drawing.Point(83, 22); this.tbDaysInJail.Mask = "#####"; this.tbDaysInJail.Name = "tbDaysInJail"; this.tbDaysInJail.Size = new System.Drawing.Size(45, 20); this.tbDaysInJail.TabIndex = 24; // // lblBookingNumber // this.lblBookingNumber.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.lblBookingNumber.AutoSize = true; this.lblBookingNumber.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); this.lblBookingNumber.Location = new System.Drawing.Point(7, 2); this.lblBookingNumber.Name = "lblBookingNumber"; this.lblBookingNumber.Size = new System.Drawing.Size(56, 13); this.lblBookingNumber.TabIndex = 18; this.lblBookingNumber.Text = "Booking #"; // // tabBankruptcy // this.tabBankruptcy.Controls.Add(this.cbxInBankruptcy); this.tabBankruptcy.Controls.Add(this.tbBankruptcyDateFiled); this.tabBankruptcy.Controls.Add(this.tbBankruptcyEndDate); this.tabBankruptcy.Controls.Add(this.label2); this.tabBankruptcy.Controls.Add(this.label1); this.tabBankruptcy.Location = new System.Drawing.Point(4, 22); this.tabBankruptcy.Name = "tabBankruptcy"; this.tabBankruptcy.Size = new System.Drawing.Size(426, 64); this.tabBankruptcy.TabIndex = 2; this.tabBankruptcy.Text = "Bankruptcy"; this.tabBankruptcy.UseVisualStyleBackColor = true; // // cbxInBankruptcy // this.cbxInBankruptcy.AutoSize = true; this.cbxInBankruptcy.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.cbxInBankruptcy.Location = new System.Drawing.Point(12, -1); this.cbxInBankruptcy.Name = "cbxInBankruptcy"; this.cbxInBankruptcy.Size = new System.Drawing.Size(92, 17); this.cbxInBankruptcy.TabIndex = 30; this.cbxInBankruptcy.Text = "In Bankruptcy"; this.cbxInBankruptcy.UseVisualStyleBackColor = true; this.cbxInBankruptcy.CheckedChanged += new System.EventHandler(this.cbxInBankruptcy_CheckedChanged); // // tbBankruptcyDateFiled // this.tbBankruptcyDateFiled.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.tbBankruptcyDateFiled.Location = new System.Drawing.Point(113, 16); this.tbBankruptcyDateFiled.Mask = "00/00/0000"; this.tbBankruptcyDateFiled.Name = "tbBankruptcyDateFiled"; this.tbBankruptcyDateFiled.Size = new System.Drawing.Size(80, 20); this.tbBankruptcyDateFiled.TabIndex = 31; this.tbBankruptcyDateFiled.Leave += new System.EventHandler(this.tbBankruptcyDateFiled_Leave); // // tbBankruptcyEndDate // this.tbBankruptcyEndDate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.tbBankruptcyEndDate.Location = new System.Drawing.Point(113, 39); this.tbBankruptcyEndDate.Mask = "00/00/0000"; this.tbBankruptcyEndDate.Name = "tbBankruptcyEndDate"; this.tbBankruptcyEndDate.Size = new System.Drawing.Size(80, 20); this.tbBankruptcyEndDate.TabIndex = 32; // // label2 // this.label2.AutoSize = true; this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label2.Location = new System.Drawing.Point(52, 42); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(52, 13); this.label2.TabIndex = 1; this.label2.Text = "End Date"; // // label1 // this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label1.Location = new System.Drawing.Point(52, 19); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(55, 13); this.label1.TabIndex = 0; this.label1.Text = "Date Filed"; // // dgvPlanSummary // this.dgvPlanSummary.AllowUserToAddRows = false; this.dgvPlanSummary.AllowUserToDeleteRows = false; this.dgvPlanSummary.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.dgvPlanSummary.AutoGenerateColumns = false; this.dgvPlanSummary.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.dgvPlanSummary.BackgroundColor = System.Drawing.SystemColors.Window; dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control; dataGridViewCellStyle3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText; dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Window; dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.WindowText; dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.dgvPlanSummary.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle3; this.dgvPlanSummary.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.planname, this.CAPP, this.NonCAPP, this.Filed, this.Contempt, this.Insurance, this.Noncompliance, this.fileddate}); this.dgvPlanSummary.DataSource = this.bindingPlans; this.dgvPlanSummary.Location = new System.Drawing.Point(0, 0); this.dgvPlanSummary.MultiSelect = false; this.dgvPlanSummary.Name = "dgvPlanSummary"; this.dgvPlanSummary.ReadOnly = true; dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control; dataGridViewCellStyle4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText; dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Window; dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.WindowText; dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.dgvPlanSummary.RowHeadersDefaultCellStyle = dataGridViewCellStyle4; this.dgvPlanSummary.RowHeadersVisible = false; this.dgvPlanSummary.RowTemplate.DefaultCellStyle.ForeColor = System.Drawing.SystemColors.WindowText; this.dgvPlanSummary.RowTemplate.DefaultCellStyle.SelectionBackColor = System.Drawing.SystemColors.Window; this.dgvPlanSummary.RowTemplate.DefaultCellStyle.SelectionForeColor = System.Drawing.SystemColors.WindowText; this.dgvPlanSummary.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.dgvPlanSummary.Size = new System.Drawing.Size(429, 144); this.dgvPlanSummary.TabIndex = 15; // // planname // this.planname.DataPropertyName = "PlanName"; this.planname.FillWeight = 163.7316F; this.planname.HeaderText = "Plan"; this.planname.Name = "planname"; this.planname.ReadOnly = true; // // CAPP // this.CAPP.DataPropertyName = "CAPP"; this.CAPP.FillWeight = 60.9137F; this.CAPP.HeaderText = "CAPP"; this.CAPP.Name = "CAPP"; this.CAPP.ReadOnly = true; this.CAPP.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; // // NonCAPP // this.NonCAPP.DataPropertyName = "NonCAPP"; this.NonCAPP.FillWeight = 84.02335F; this.NonCAPP.HeaderText = "NonCAPP"; this.NonCAPP.Name = "NonCAPP"; this.NonCAPP.ReadOnly = true; this.NonCAPP.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; // // Filed // this.Filed.DataPropertyName = "IsFiled"; this.Filed.FillWeight = 66.57639F; this.Filed.HeaderText = "Filed"; this.Filed.Name = "Filed"; this.Filed.ReadOnly = true; this.Filed.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; // // Contempt // this.Contempt.DataPropertyName = "InContempt"; this.Contempt.FillWeight = 95.08791F; this.Contempt.HeaderText = "Contempt"; this.Contempt.Name = "Contempt"; this.Contempt.ReadOnly = true; this.Contempt.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.Contempt.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; // // Insurance // this.Insurance.DataPropertyName = "HasInsurance"; this.Insurance.FillWeight = 97.94103F; this.Insurance.HeaderText = "Insurance"; this.Insurance.Name = "Insurance"; this.Insurance.ReadOnly = true; this.Insurance.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; // // Noncompliance // this.Noncompliance.DataPropertyName = "NonComplianceNotice"; this.Noncompliance.FillWeight = 136.7069F; this.Noncompliance.HeaderText = "Noncompliance"; this.Noncompliance.Name = "Noncompliance"; this.Noncompliance.ReadOnly = true; this.Noncompliance.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; // // fileddate // this.fileddate.DataPropertyName = "FiledDate"; this.fileddate.FillWeight = 95.01917F; this.fileddate.HeaderText = "filed"; this.fileddate.Name = "fileddate"; this.fileddate.ReadOnly = true; // // bindingPlans // this.bindingPlans.AllowNew = false; this.bindingPlans.DataMember = "Plans"; // // lblEmployers // this.lblEmployers.AutoSize = true; this.lblEmployers.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblEmployers.Location = new System.Drawing.Point(13, 221); this.lblEmployers.Name = "lblEmployers"; this.lblEmployers.Size = new System.Drawing.Size(58, 13); this.lblEmployers.TabIndex = 11; this.lblEmployers.Text = "Employers:"; // // ucEmployer // this.ucEmployer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.ucEmployer.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.ucEmployer.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.ucEmployer.Location = new System.Drawing.Point(0, 237); this.ucEmployer.Name = "ucEmployer"; this.ucEmployer.Size = new System.Drawing.Size(429, 112); this.ucEmployer.TabIndex = 40; this.ucEmployer.Load += new System.EventHandler(this.ucEmployer_Load); // // ucDefendant // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.SystemColors.Control; this.Controls.Add(grpDefendnatInfo); this.DoubleBuffered = true; this.MinimumSize = new System.Drawing.Size(567, 375); this.Name = "ucDefendant"; this.Size = new System.Drawing.Size(723, 375); this.GotFocus += new System.EventHandler(this.ucDefendant_GotFocus); grpDefendnatInfo.ResumeLayout(false); this.splitContainerDefendantDetail.Panel1.ResumeLayout(false); this.splitContainerDefendantDetail.Panel1.PerformLayout(); this.splitContainerDefendantDetail.Panel2.ResumeLayout(false); this.splitContainerDefendantDetail.Panel2.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitContainerDefendantDetail)).EndInit(); this.splitContainerDefendantDetail.ResumeLayout(false); this.tabcontrolModeFields.ResumeLayout(false); this.tabAttorneyPage.ResumeLayout(false); this.tabAttorneyPage.PerformLayout(); this.tabJailPage.ResumeLayout(false); this.tabJailPage.PerformLayout(); this.tabBankruptcy.ResumeLayout(false); this.tabBankruptcy.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.dgvPlanSummary)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.bindingPlans)).EndInit(); this.ResumeLayout(false); } #endregion private System.Windows.Forms.SplitContainer splitContainerDefendantDetail; private System.Windows.Forms.MaskedTextBox mskBirthDate; public System.Windows.Forms.TextBox txtLastName; private System.Windows.Forms.TextBox txtDriversLicense; private System.Windows.Forms.TextBox txtAka; private System.Windows.Forms.MaskedTextBox mskSSN; public System.Windows.Forms.TextBox txtFirstName; private System.Windows.Forms.TextBox txtMiddleName; private System.Windows.Forms.Label lblBirthdate; private System.Windows.Forms.MaskedTextBox mskBarredUntil; private System.Windows.Forms.TextBox txtProbationOfficer; private System.Windows.Forms.CheckBox chkHasProbationOfficer; private System.Windows.Forms.MaskedTextBox mskPhoneMobile; private System.Windows.Forms.MaskedTextBox mskPhoneHome; private System.Windows.Forms.MaskedTextBox mskZip; private System.Windows.Forms.TextBox txtCity; private System.Windows.Forms.ComboBox cmbStates; private System.Windows.Forms.TextBox txtStreet1; private System.Windows.Forms.TextBox txtStreet2; private System.Windows.Forms.Label lblEmployers; private ucEmployer ucEmployer; private System.Windows.Forms.Label lblAddress; private System.Windows.Forms.Label lblBarredUntil; private System.Windows.Forms.DataGridView dgvPlanSummary; private System.Windows.Forms.BindingSource bindingPlans; private System.Windows.Forms.DataGridViewTextBoxColumn planname; private System.Windows.Forms.DataGridViewCheckBoxColumn CAPP; private System.Windows.Forms.DataGridViewCheckBoxColumn NonCAPP; private System.Windows.Forms.DataGridViewCheckBoxColumn Filed; private System.Windows.Forms.DataGridViewCheckBoxColumn Contempt; private System.Windows.Forms.DataGridViewCheckBoxColumn Insurance; private System.Windows.Forms.DataGridViewCheckBoxColumn Noncompliance; private System.Windows.Forms.DataGridViewTextBoxColumn fileddate; private System.Windows.Forms.TextBox tbBookingNumber; private System.Windows.Forms.MaskedTextBox tbDaysInJail; private System.Windows.Forms.Label lblBookingNumber; private System.Windows.Forms.Label lblJudgmentDate; private System.Windows.Forms.Label lblDaysInJail; private System.Windows.Forms.MaskedTextBox tbJudgmentDate; private System.Windows.Forms.TabControl tabcontrolModeFields; private System.Windows.Forms.TabPage tabAttorneyPage; private System.Windows.Forms.TabPage tabJailPage; private System.Windows.Forms.CheckBox cbxHasJudgmentFiled; private System.Windows.Forms.TabPage tabBankruptcy; private System.Windows.Forms.CheckBox cbxInBankruptcy; private System.Windows.Forms.MaskedTextBox tbBankruptcyDateFiled; private System.Windows.Forms.MaskedTextBox tbBankruptcyEndDate; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label1; private System.Windows.Forms.MaskedTextBox tbJudgmentFiledDate; private System.Windows.Forms.Label label3; } }
gpl-2.0
FabianodeLimaAbreu/conectby
templates/vivid/html/com_content/category/blog_children.php
2882
<?php /** * @package Joomla.Site * @subpackage Templates.beez5 * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // no direct access defined('_JEXEC') or die; $app = JFactory::getApplication(); $class = ' class="first"'; ?> <?php if (count($this->children[$this->category->id]) > 0) : ?> <ul> <?php foreach($this->children[$this->category->id] as $id => $child) : ?> <?php if ($this->params->get('show_empty_categories') || $child->numitems || count($child->getChildren())) : if (!isset($this->children[$this->category->id][$id + 1])) : $class = ' class="last"'; endif; ?> <li<?php echo $class; ?>> <?php $class = ''; ?> <span class="item-title"><a href="<?php echo JRoute::_(ContentHelperRoute::getCategoryRoute($child->id));?>"> <?php echo $this->escape($child->title); ?></a> </span> <?php if ($this->params->get('show_subcat_desc') == 1) :?> <?php if ($child->description) : ?> <div class="category-desc"> <?php echo JHtml::_('content.prepare', $child->description, '', 'com_content.category'); ?> </div> <?php endif; ?> <?php endif; ?> <?php if ( $this->params->get('show_cat_num_articles', 1)) : ?> <dl> <dt> <?php echo JText::_('COM_CONTENT_NUM_ITEMS') ; ?> </dt> <dd> <?php echo $child->getNumItems(true); ?> </dd> </dl> <?php endif ; ?> <?php if (count($child->getChildren()) > 0): $this->children[$child->id] = $child->getChildren(); $this->category = $child; $this->maxLevel--; if ($this->maxLevel != 0) : echo $this->loadTemplate('children'); endif; $this->category = $child->getParent(); $this->maxLevel++; endif; ?> </li> <?php endif; ?> <?php endforeach; ?> </ul> <?php endif;?>
gpl-2.0
tbinna/granny-gear
test/helpers/internal_gear_hubs_helper_test.rb
83
require 'test_helper' class InternalGearHubsHelperTest < ActionView::TestCase end
gpl-2.0
patrick193/bagstar
plugins/vmcustom/catproduct/catproduct/tmpl/radio.php
27853
<?php /** * * @author SM planet - smplanet.net * @package VirtueMart * @subpackage custom * @copyright Copyright (C) 2012-2014 SM planet - smplanet.net. All rights reserved. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php * **/ defined('_JEXEC') or die(); $stockhandle = VmConfig::get('stockhandle','none'); $check_stock = 0; $global_params = $viewData[3]; if ($global_params['use_default'] == 1) { $parametri = $global_params; } else { $parametri = json_decode($viewData[2]->custom_param, true); } if ($stockhandle == 'disableadd' || $stockhandle == 'disableit_children' || $stockhandle == 'disableit') { $check_stock = 1; } $colspan = 0; $callscript = ''; if (!class_exists ('CurrencyDisplay')) { require(JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'currencydisplay.php'); } $currency = CurrencyDisplay::getInstance (); // for customfields support $use_customfields = json_decode($viewData[2]->custom_param, true); if (isset($use_customfields["add_plugin_support"])) { $use_customfields = $use_customfields["add_plugin_support"]; } else { $use_customfields = 0; } $image_script = ''; ?> <style type="text/css"> .product-fields .product-field input { left: 0px !important; } </style> <form ax:nowrap="1" action="index.php" method="post" name="catproduct_form" id="catproduct_form" onsubmit="<?php echo "handleToCartOneByOne();"; //if ($use_customfields == 0) echo "handleToCart();"; else echo "handleToCartOneByOne();"; ?> return false;"> <table style="width:100%;" class="catproducttable"> <caption><?php echo JText::_('CATPRODUCT_TABLE_TITLE') ?></caption> <thead> <tr> <?php if ($parametri["show_image"] == 1) { ?> <th class="cell_image"><?php echo JText::_('CATPRODUCT_TABLE_IMAGE_FIELD') ?></th> <?php $colspan += 1;} if ($parametri["show_id"] == 1) { ?> <th class="cell_id"><?php echo JText::_('CATPRODUCT_TABLE_ID_FIELD') ?></th> <?php $colspan += 1;} if ($parametri["show_sku"] == 1) { ?> <th class="cell_sku"><?php echo JText::_('CATPRODUCT_TABLE_SKU_FIELD') ?></th> <?php $colspan += 1;} if ($parametri["show_name"] == 1) { ?> <th class="cell_name"><?php echo JText::_('CATPRODUCT_TABLE_NAME_FIELD') ?></th> <?php $colspan += 1;} if ($use_customfields == 1) { ?> <th class="cell_customfields"><?php echo JText::_('CATPRODUCT_TABLE_CUSTOMFIELDS') ?></th> <?php $colspan += 1;} if ($parametri["show_s_desc"] == 1) { ?> <th class="cell_name"><?php echo JText::_('CATPRODUCT_TABLE_DESC_FIELD') ?></th> <?php $colspan += 1;} if ($parametri["show_weight"] == 1) { ?> <th class="cell_weight"><?php echo JText::_('CATPRODUCT_TABLE_WEIGHT') ?></th> <?php $colspan += 1;} if ($parametri["show_sizes"] == 1) { ?> <th class="cell_size"><?php echo JText::_('CATPRODUCT_TABLE_SIZES') ?></th> <?php $colspan += 1;} if ($parametri["show_stock"] == 1) { ?> <th class="cell_stock"><?php echo JText::_('CATPRODUCT_TABLE_STOCK') ?></th> <?php $colspan += 1;} if (isset($parametri["show_min_qty"]) && $parametri["show_min_qty"] == 1) { ?> <th class="cell_stock"><?php echo JText::_('CATPRODUCT_TABLE_MIN_QTY') ?></th> <?php $colspan += 1;} if (isset($parametri["show_max_qty"]) && $parametri["show_max_qty"] == 1) { ?> <th class="cell_stock"><?php echo JText::_('CATPRODUCT_TABLE_MAX_QTY') ?></th> <?php $colspan += 1;} if (isset($parametri["show_step_qty"]) && $parametri["show_step_qty"] == 1) { ?> <th class="cell_stock"><?php echo JText::_('CATPRODUCT_TABLE_STEP_QTY') ?></th> <?php $colspan += 1;} if ($parametri["show_basePrice"] == 1) { ?> <th class="cell_basePrice"><?php echo JText::_('CATPRODUCT_TABLE_BASEPRICE') ?></th> <?php $colspan += 1;} if ($parametri["show_basePriceWithTax"] == 1) { ?> <th class="cell_basePriceWithTax"><?php echo JText::_('CATPRODUCT_TABLE_BASEPRICEWITHTAX') ?></th> <?php $colspan += 1;} if ($parametri["show_priceWithoutTax"] == 1) { ?> <th class="cell_priceWithoutTax"><?php echo JText::_('CATPRODUCT_TABLE_PRICEWITHOUTTAX') ?></th> <?php $colspan += 1;} if ($parametri["show_salesPrice"] == 1) { ?> <th class="cell_salesPrice"><?php echo JText::_('CATPRODUCT_TABLE_SALESPRICE') ?></th> <?php $colspan += 1;} if ($parametri["show_taxAmount"] == 1) { ?> <th class="cell_taxAmount"><?php echo JText::_('CATPRODUCT_TABLE_TAXAMOUNT') ?></th> <?php $colspan += 1;} if ($parametri["show_discountAmount"] == 1) { ?> <th class="cell_discountAmount"><?php echo JText::_('CATPRODUCT_TABLE_DISCOUNTAMOUNT') ?></th> <?php $colspan += 1;} // here is radio buttons title if (!VmConfig::get('use_as_catalog', 0) ) { ?> <th class="cell_quantity"><?php echo JText::_('CATPRODUCT_TABLE_RADIO_TITLE'); $colspan += 1; ?></th> <?php } if ($parametri["show_sum_weight"] == 1) { ?> <th class="cell_sum_weight"><?php echo JText::_('CATPRODUCT_TABLE_SUM_WEIGHT') ?></th> <?php $colspan += 1;$callscript .= 'show_sum(art_id,uom,"sum_weight_","cell_sum_weight_");'; } if ($parametri["show_sum_basePrice"] == 1) { ?> <th class="cell_sum_basePrice"><?php echo JText::_('CATPRODUCT_TABLE_SUM_BASEPRICE') ?></th> <?php $colspan += 1;$callscript .= 'show_sum(art_id,unit,"sum_baseprice_","cell_sum_baseprice_");'; } if ($parametri["show_sum_basePriceWithTax"] == 1) { ?> <th class="cell_sum_basePriceWithTax"><?php echo JText::_('CATPRODUCT_TABLE_SUM_BASEPRICEWITHTAX') ?></th> <?php $colspan += 1;$callscript .= 'show_sum(art_id,unit,"sum_basePriceWithTax_","cell_sum_basePriceWithTax_");'; } if ($parametri["show_sum_taxAmount"] == 1) { ?> <th class="cell_sum_taxAmount"><?php echo JText::_('CATPRODUCT_TABLE_SUM_TAXAMOUNT') ?></th> <?php $colspan += 1;$callscript .= 'show_sum(art_id,unit,"sum_taxAmount_","cell_sum_taxAmount_");'; } if ($parametri["show_sum_discountAmount"] == 1) { ?> <th class="cell_sum_discountAmount"><?php echo JText::_('CATPRODUCT_TABLE_SUM_DISCOUNTAMOUNT') ?></th> <?php $colspan += 1;$callscript .= 'show_sum(art_id,unit,"sum_discountAmount_","cell_sum_discountAmount_");'; } if ($parametri["show_sum_priceWithoutTax"] == 1) { ?> <th class="cell_sum_priceWithoutTax"><?php echo JText::_('CATPRODUCT_TABLE_SUM_PRICEWITHOUTTAX') ?></th> <?php $colspan += 1;$callscript .= 'show_sum(art_id,unit,"sum_priceWithoutTax_","cell_sum_priceWithoutTax_");'; } if ($parametri["show_sum_salesPrice"] == 1) { ?> <th class="cell_sum_salesPrice"><?php echo JText::_('CATPRODUCT_TABLE_SUM_SALESPRICE') ?></th> <?php $colspan += 1;$callscript .= 'show_sum(art_id,unit,"sum_salesPrice_","cell_sum_salesPrice_");'; } ?> </tr> </thead> <tbody> <?php $i = 0; $group = 0; foreach($viewData[0] AS $product){ // min max box quantity $min_order_level = '0'; $max_order_level = '0'; $product_box = '0'; if (isset($product['qparam'])) { $min_order_level = $product['qparam']['min']; $max_order_level = $product['qparam']['max']; $product_box = $product['qparam']['box']; } // min max box end //if attached product title if (empty($product['child']['catproduct_inline_row'])) { // callforprice url $callforprice = 'index.php?option=com_virtuemart&view=productdetails&task=askquestion&tmpl=component&virtuemart_product_id='.$product['child']['virtuemart_product_id']; // start with showing product if ($check_stock == 1 && $product['child']['product_in_stock'] > 0 || $check_stock == 0){ // hidden input with whole product data //product id echo '<input class="product_id" name="product_id" id="product_id_'.$i.'" value="'.$product['child']['virtuemart_product_id'].'" type="hidden">'; //product name echo '<input class="product_name" name="product_name" id="product_name_'.$i.'" value="'.$product['child']['product_name'].'" type="hidden">'; //product weight echo '<input class="product_weight" name="product_weight" id="product_weight_'.$i.'" value="'.$product['child']['product_weight'].'" type="hidden">'; //product_weight_uom echo '<input class="product_weight_uom" name="product_weight_uom" id="product_weight_uom_'.$i.'" value="'.$product['child']['product_weight_uom'].'" type="hidden">'; //product_length echo '<input class="product_length" name="product_length" id="product_length_'.$i.'" value="'.$product['child']['product_length'].'" type="hidden">'; //product_width echo '<input class="product_width" name="product_width" id="product_width_'.$i.'" value="'.$product['child']['product_width'].'" type="hidden">'; //product_height echo '<input class="product_height" name="product_height" id="product_height_'.$i.'" value="'.$product['child']['product_height'].'" type="hidden">'; //product_lwh_uom echo '<input class="product_lwh_uom" name="product_lwh_uom" id="product_lwh_uom_'.$i.'" value="'.$product['child']['product_lwh_uom'].'" type="hidden">'; //product_in_stock echo '<input class="product_in_stock" name="product_in_stock" id="product_in_stock_'.$i.'" value="'.$product['child']['product_in_stock'].'" type="hidden">'; //basePrice $price = '0'; if(!empty($currency->_priceConfig['basePrice'][0])){$price = round($product['prices']['basePrice'],2);} echo '<input type="hidden" class="basePrice" name="basePrice" id="basePrice_'.$i.'" value="'.$price.'">'; //basePriceWithTax $price = '0'; if(!empty($currency->_priceConfig['basePriceWithTax'][0])){$price = round($product['prices']['basePriceWithTax'],2);} echo '<input type="hidden" class="basePriceWithTax" name="basePriceWithTax" id="basePriceWithTax_'.$i.'" value="'.$price.'">'; //salesPrice $price = '0'; if(!empty($currency->_priceConfig['salesPrice'][0])){$price = round($product['prices']['salesPrice'],2);} echo '<input type="hidden" class="salesPrice" name="salesPrice" id="salesPrice_'.$i.'" value="'.$price.'">'; //taxAmount $price = '0'; if(!empty($currency->_priceConfig['taxAmount'][0])){$price = round($product['prices']['taxAmount'],2);} echo '<input type="hidden" class="taxAmount" name="taxAmount" id="taxAmount_'.$i.'" value="'.$price.'">'; //priceWithoutTax $price = '0'; if(!empty($currency->_priceConfig['priceWithoutTax'][0])){$price = round($product['prices']['priceWithoutTax'],2);} echo '<input type="hidden" class="priceWithoutTax" name="priceWithoutTax" id="priceWithoutTax_'.$i.'" value="'.$price.'">'; //discountAmount $price = '0'; if(!empty($currency->_priceConfig['discountAmount'][0])){$price = round($product['prices']['discountAmount'],2);} echo '<input type="hidden" class="discountAmount" name="discountAmount" id="discountAmount_'.$i.'" value="'.$price.'">'; echo '<input type="hidden" class="sum_weight" name="sum_weight" id="sum_weight_'.$i.'" value="0" >'; echo '<input type="hidden" class="sum_basePrice" name="sum_basePrice" id="sum_basePrice_'.$i.'" value="0" >'; echo '<input type="hidden" class="sum_basePriceWithTax" name="sum_basePriceWithTax" id="sum_basePriceWithTax_'.$i.'" value="0" >'; echo '<input type="hidden" class="sum_taxAmount" name="sum_taxAmount" id="sum_taxAmount_'.$i.'" value="0" >'; echo '<input type="hidden" class="sum_discountAmount" name="sum_discountAmount" id="sum_discountAmount_'.$i.'" value="0" >'; echo '<input type="hidden" class="sum_priceWithoutTax" name="sum_priceWithoutTax" id="sum_priceWithoutTax_'.$i.'" value="0" >'; echo '<input type="hidden" class="sum_salesPrice" name="sum_salesPrice" id="sum_salesPrice_'.$i.'" value="0" >'; echo '<input type="hidden" class="min_order_level" name="min_order_level" id="min_order_level_'.$i.'" value='.$min_order_level.' >'; echo '<input type="hidden" class="max_order_level" name="max_order_level" id="max_order_level_'.$i.'" value='.$max_order_level.' >'; echo '<input type="hidden" class="product_box" name="product_box" id="product_box_'.$i.'" value='.$product_box.' >'; } echo '<tr class="row_article" id="row_article_'.$i.'">'; // show table with product //Product_image if ($parametri["show_image"] == 1) { if (isset($product['images'])) { $firsttime = true; echo '<td class="cell_image">'; foreach ($product['images'] as $image) { if ($firsttime) { echo $image->displayMediaThumb('class="product-image"', true, 'rel="catproduct_images_'.$i.'"', true, false); $firsttime = false; } else { echo '<a title="'.$image->file_name.'" rel="catproduct_images_0" href="'.$image->file_url.'"></a>'; } } echo '</td>'; } else { echo '<td class="cell_image"></td>'; } } if(VmConfig::get('usefancy',0)){ $image_script .= 'jQuery(document).ready(function() { jQuery("a[rel=catproduct_images_'.$i.']").fancybox({ "titlePosition" : "inside", "transitionIn" : "elastic", "transitionOut" : "elastic" });});'; } else { $image_script .= 'jQuery(document).ready(function() { jQuery("a[rel=catproduct_images_'.$i.']").facebox();});'; } //Product_ID if ($parametri["show_id"] == 1) { echo '<td class="cell_id">'.$product['child']['virtuemart_product_id'].'</td>'; } //Product_SKU if ($parametri["show_sku"] == 1) { echo '<td class="cell_sku">'.$product['child']['product_sku'].'</td>'; } // Product title if ($parametri["show_name"] == 1) { echo '<td class="cell_name">'.$product['child']['product_name']; echo '</td>'; } // check for customfield if ($use_customfields == 1) { $customfield = ''; if (isset( $product['child']['customfieldsCart'][0])) { foreach($product['child']['customfieldsCart'] as $customfields) { $test = (array) $customfields; $customfield .= ('<strong>'.$test['custom_title'].'</strong><br/>'.$test['display']); } } echo '<td class="cell_customfields">'.$customfield; echo '</td>'; } // Product description if ($parametri["show_s_desc"] == 1) { echo '<td class="cell_s_desc">'.$product['child']['product_s_desc'].'</td>'; } // Product weight if ($parametri["show_weight"] == 1) { echo '<td class="cell_weight">'; if ($product['child']['product_weight'] <> 0) { echo round($product['child']['product_weight'],2).' '.$product['child']['product_weight_uom']; } echo '</td>'; } // Product sizes if ($parametri["show_sizes"] == 1) { $sizes = ''; echo '<td class="cell_size">'; if ($product['child']['product_length'] <> 0) $sizes .= round($product['child']['product_length'],2); if ($product['child']['product_width'] <> 0) { if ($sizes <> '') { $sizes .= ' x '; } $sizes .= round($product['child']['product_width'],2); } if ($product['child']['product_height'] <> 0) { if ($sizes <> '') { $sizes .= ' x '; } $sizes .= round($product['child']['product_height'],2); } if ($sizes <> '') { $sizes .= ' '.$product['child']['product_lwh_uom']; } echo $sizes; echo '</td>'; } // Product stock if ($parametri["show_stock"] == 1) { echo '<td class="cell_stock">'.$product['child']['product_in_stock'].'</td>'; } if (isset($parametri["show_min_qty"]) && $parametri["show_min_qty"] == 1) { $minqty = str_replace('"', "", $product["qparam"]["min"]); if ($minqty == '' || $minqty == 'null') $minqty = JText::_('CATPRODUCT_QTY_NA'); echo '<td class="cell_stock">'.$minqty.'</td>'; } if (isset($parametri["show_max_qty"]) && $parametri["show_max_qty"] == 1) { $minqty = str_replace('"', "", $product["qparam"]["max"]); if ($minqty == '' || $minqty == 'null') $minqty = JText::_('CATPRODUCT_QTY_NA'); echo '<td class="cell_stock">'.$minqty.'</td>'; } if (isset($parametri["show_step_qty"]) && $parametri["show_step_qty"] == 1) { $minqty = str_replace('"', "", $product["qparam"]["box"]); if ($minqty == '' || $minqty == 'null') $minqty = JText::_('CATPRODUCT_QTY_NA'); echo '<td class="cell_stock">'.$minqty.'</td>'; } // Product base price without tax if ($parametri["show_basePrice"] == 1) { if ($product['prices']['basePrice'] <= 0 and VmConfig::get ('askprice', 1)) { echo '<td class="cell_basePrice"><a class="ask-a-question bold" href="'.$callforprice.'" rel="nofollow" >'.JText::_ ('COM_VIRTUEMART_PRODUCT_ASKPRICE').'</a></td>'; } else echo '<td class="cell_basePrice"><div id="basePrice_text_'.$i.'">'.$currency->createPriceDiv ('basePrice', '', $product['prices']).'</div></td>'; } // Product base price with tax if ($parametri["show_basePriceWithTax"] == 1) { if ($product['prices']['basePriceWithTax'] <= 0 and VmConfig::get ('askprice', 1)) { echo '<td class="cell_basePriceWithTax"><a class="ask-a-question bold" href="'.$callforprice.'" rel="nofollow" >'.JText::_ ('COM_VIRTUEMART_PRODUCT_ASKPRICE').'</a></td>'; } else echo '<td class="cell_basePriceWithTax"><div id="basePriceWithTax_text_'.$i.'">'.$currency->createPriceDiv ('basePriceWithTax', '', $product['prices']).'</div></td>'; } // Product final price without tax if ($parametri["show_priceWithoutTax"] == 1) { if ($product['prices']['priceWithoutTax'] <= 0 and VmConfig::get ('askprice', 1)) { echo '<td class="cell_priceWithoutTax"><a class="ask-a-question bold" href="'.$callforprice.'" rel="nofollow" >'.JText::_ ('COM_VIRTUEMART_PRODUCT_ASKPRICE').'</a></td>'; } else echo '<td class="cell_priceWithoutTax"><div id="priceWithoutTax_text_'.$i.'">'.$currency->createPriceDiv ('priceWithoutTax', '', $product['prices']).'</div></td>'; } // Product final price with tax if ($parametri["show_salesPrice"] == 1) { if ($product['prices']['salesPrice'] <= 0 and VmConfig::get ('askprice', 1)) { echo '<td class="cell_salesPrice"><a class="ask-a-question bold" href="'.$callforprice.'" rel="nofollow" >'.JText::_ ('COM_VIRTUEMART_PRODUCT_ASKPRICE').'</a></td>'; } else echo '<td class="cell_salesPrice"><div id="salesPrice_text_'.$i.'">'.$currency->createPriceDiv ('salesPrice', '', $product['prices']).'</div></td>'; } // Tax amount if ($parametri["show_taxAmount"] == 1) { echo '<td class="cell_taxAmount">'.$currency->createPriceDiv ('taxAmount', '', $product['prices']).'</td>'; //.round($product['prices']['taxAmount'],2).' '.JText::_('CATPRODUCT_CURRENCY').'</td>'; } // Discount amount if ($parametri["show_discountAmount"] == 1) { echo '<td class="cell_discountAmount">'.$currency->createPriceDiv ('discountAmount', '', $product['prices']).'</td>'; //.round($product['prices']['discountAmount'],2).' '.JText::_('CATPRODUCT_CURRENCY').'</td>'; } // if stock checking is enabled if ($check_stock == 1 && $product['child']['product_in_stock'] > 0 || $check_stock == 0){ // radio buttons if (!VmConfig::get('use_as_catalog', 0) ) { echo '<td class="cell_quantity"><input name="virtuemart_product_id[]['.$group.']" id="virtuemart_product_id'.$i.'" type="radio" value="'.$product['child']['virtuemart_product_id'].'" onclick=\'changeQuantity('.$i.', "input", '.$min_order_level.', '.$max_order_level.', '.$product_box .')\' /></td>'; } // sum weight if ($parametri["show_sum_weight"] == 1) { echo '<td class="cell_sum_weight" id="cell_sum_weight_'.$i.'"><span>0.00 '.$product['child']['product_weight_uom'].'</span></td>'; } // sum base price without tax if ($parametri["show_sum_basePrice"] == 1) { echo '<td class="cell_sum_basePrice" id="cell_sum_basePrice_'.$i.'"><span >'.$currency->createPriceDiv ('', '', '0.00').'</td>'; } // sum base price with tax if ($parametri["show_sum_basePriceWithTax"] == 1) { echo '<td class="cell_sum_basePriceWithTax" id="cell_sum_basePriceWithTax_'.$i.'"><span>'.$currency->createPriceDiv ('', '', '0.00').'</td>'; } // sum tax if ($parametri["show_sum_taxAmount"] == 1) { echo '<td class="cell_sum_taxAmount" id="cell_sum_taxAmount_'.$i.'"><span>'.$currency->createPriceDiv ('', '', '0.00').'</td>'; } // sum discount if ($parametri["show_sum_discountAmount"] == 1) { echo '<td class="cell_sum_discountAmount" id="cell_sum_discountAmount_'.$i.'"><span>'.$currency->createPriceDiv ('', '', '0.00').'</td>'; } // sum final price without tax if ($parametri["show_sum_priceWithoutTax"] == 1) { echo '<td class="cell_sum_priceWithoutTax" id="cell_sum_priceWithoutTax_'.$i.'"><span>'.$currency->createPriceDiv ('', '', '0.00').'</td>'; } // sum final price with tax if ($parametri["show_sum_salesPrice"] == 1) { echo '<td class="cell_sum_salesPrice" id="cell_sum_salesPrice_'.$i.'"><span>'.$currency->createPriceDiv ('', '', '0.00').'</td>'; } $i++; } else { if ($stockhandle == 'disableadd') {// if notify button echo '<td align="middle" colspan="3">'; echo '<a href="'.JURI::base().'/index.php?option=com_virtuemart&view=productdetails&layout=notify&virtuemart_product_id='.$product['child']['virtuemart_product_id'].'" class="notify" iswrapped="1">'.JText::_('CATPRODUCT_NOTIFYME').'</a>'; echo '</td>'; } else {// if no stock echo '<td align="middle" colspan="3"><span style="color:red;">'.JText::_('CATPRODUCT_OUTOFSTOCK').'</span></td>'; } } echo '</tr>'; } // if title for attached products else { $group++; echo '<tr class="row_attached_product">'; echo '<td colspan="'.$colspan.'" style="text-align:center;">'.$product['child']['catproduct_inline_row'].'</td>'; echo '</tr>'; } } if (!VmConfig::get('use_as_catalog', 0) ) { $i=0; //quantity echo '<tr class="row_quantity"> <td colspan="'.($colspan-1).'" align="right">'.JText::_('CATPRODUCT_TABLE_QUANTITY').'</td> <td class="cell_quantity"> <span class="quantity-box" style="margin-left:20px !important;"><input class="quantity-input js-recalculate" size="2" id="quantity_'.$i.'" name="quantity[]" value="0" type="text" onblur=\'changeQuantity(find_selected(), "input", '.$min_order_level.', '.$max_order_level.', '.$product_box .')\'></span> <span class="quantity-controls js-recalculate"><input class="quantity-controls quantity-plus" onclick=\'changeQuantity(find_selected(), "plus", '.$min_order_level.', '.$max_order_level.', '.$product_box .')\' type="button"> <input class="quantity-controls quantity-minus" onclick=\'changeQuantity(find_selected(), "minus", '.$min_order_level.', '.$max_order_level.', '.$product_box .')\' type="button"></span> </td> </tr>'; } // total weight if ($parametri["show_total_weight"] == 1) { echo '<tr class="row_total_weight"> <td colspan="'.($colspan-1).'" align="right">'.JText::_('CATPRODUCT_TABLE_TOTAL_WEIGHT').'</td> <td align="right" id="total_weight">0.00 '.$product['child']['product_weight_uom'].'</td> </tr>'; $callscript .= 'total_field("sum_weight","total_weight",uom);'; } // total base price without tax if ($parametri["show_total_basePrice"] == 1) { echo '<tr class="row_total_basePrice"> <td colspan="'.($colspan-1).'" align="right">'.JText::_('CATPRODUCT_TABLE_TOTAL_BASEPRICE').'</td> <td align="right" id="total_basePrice">'.$currency->createPriceDiv ('', '', '0.00').'</td> </tr>'; $callscript .= 'total_field("sum_basePrice","total_basePrice",unit);'; } // total base price with tax if ($parametri["show_total_basePriceWithTax"] == 1) { echo '<tr class="row_total_basePriceWithTax"> <td colspan="'.($colspan-1).'" align="right">'.JText::_('CATPRODUCT_TABLE_TOTAL_BASEPRICEWITHTAX').'</td> <td align="right" id="total_basePriceWithTax">'.$currency->createPriceDiv ('', '', '0.00').'</td> </tr>'; $callscript .= 'total_field("sum_basePriceWithTax","total_basePriceWithTax",unit);'; } // total tax amount if ($parametri["show_total_taxAmount"] == 1) { echo '<tr class="row_total_taxAmount"> <td colspan="'.($colspan-1).'" align="right">'.JText::_('CATPRODUCT_TABLE_TOTAL_TAXAMOUNT').'</td> <td align="right" id="total_taxAmount">'.$currency->createPriceDiv ('', '', '0.00').'</td> </tr>'; $callscript .= 'total_field("sum_taxAmount","total_taxAmount",unit);'; } // total discount amount if ($parametri["show_total_discountAmount"] == 1) { echo '<tr class="row_total_discountAmount"> <td colspan="'.($colspan-1).'" align="right">'.JText::_('CATPRODUCT_TABLE_TOTAL_DISCOUNTAMOUNT').'</td> <td align="right" id="total_discountAmount">'.$currency->createPriceDiv ('', '', '0.00').'</td> </tr>'; $callscript .= 'total_field("sum_discountAmount","total_discountAmount",unit);'; } // total final price without tax if ($parametri["show_total_priceWithoutTax"] == 1) { echo '<tr class="row_total_priceWithoutTax"> <td colspan="'.($colspan-1).'" align="right">'.JText::_('CATPRODUCT_TABLE_TOTAL_PRICEWITHOUTTAX').'</td> <td align="right" id="total_priceWithoutTax">'.$currency->createPriceDiv ('', '', '0.00').'</td> </tr>'; $callscript .= 'total_field("sum_priceWithoutTax","total_priceWithoutTax",unit);'; } // total final price with tax if ($parametri["show_total_salesPrice"] == 1) { echo '<tr class="row_total_salesPrice"> <td colspan="'.($colspan-1).'" align="right">'.JText::_('CATPRODUCT_TABLE_TOTAL_SALESPRICE').'</td> <td align="right" id="total_salesPrice">'.$currency->createPriceDiv ('', '', '0.00').'</td> </tr>'; $callscript .= 'total_field("sum_salesPrice","total_salesPrice",unit);'; } // if use as catalog if (!VmConfig::get('use_as_catalog', 0) ) { ?> <tr> <td colspan="<?php echo $colspan ?>" class="cell_addToCart" align="right"> <span class="addtocart-button" style="float:right;"> <input type="submit" name="addtocart" class="addtocart-button" value="<?php echo JText::_('CATPRODUCT_ADDTOCART') ?>" title="<?php echo JText::_('CATPRODUCT_ADDTOCART') ?>"> </span> </td> </tr> <?php } ?> </tbody> </table> <input name="option" value="com_virtuemart" type="hidden"> <input name="view" value="cart" type="hidden"> <input name="task" value="addJS" type="hidden"> <input name="format" value="json" type="hidden"> </form> <div id="catproduct-loading"> <img src="<?php echo JURI::root(true) ?>/plugins/vmcustom/catproduct/catproduct/css/ajax-loader.gif" /> </div> <?php // preventing 2 x load javascript $version = new JVersion(); static $textinputjs; if ($textinputjs) return true; $textinputjs = true ; $document = JFactory::getDocument(); $document->addScriptDeclaration(' function updateSumPrice(art_id1) { var uom = jQuery("#product_weight_uom_"+art_id1).val(); var unit = "'.$currency->getSymbol().'"; jQuery("#catproduct_form input[name^=virtuemart_product_id]").each(function(){ art_id = jQuery(this).attr("id"); art_id = art_id.replace("virtuemart_product_id",""); if (jQuery("#catproduct_form input[id=\'virtuemart_product_id"+art_id+"\']:checked").length != 0) { quantity = getQuantity();} else { quantity = 0;} /*if (art_id == art_id1) { quantity = getQuantity();} else { quantity = 0;}*/ sum_field(art_id,quantity,"product_weight_","sum_weight_"); sum_field(art_id,quantity,"basePrice_","sum_basePrice_"); sum_field(art_id,quantity,"basePriceWithTax_","sum_basePriceWithTax_"); sum_field(art_id,quantity,"taxAmount_","sum_taxAmount_"); sum_field(art_id,quantity,"discountAmount_","sum_discountAmount_"); sum_field(art_id,quantity,"priceWithoutTax_","sum_priceWithoutTax_"); sum_field(art_id,quantity,"salesPrice_","sum_salesPrice_"); '.$callscript.' }) } '); $document->addScriptDeclaration($image_script); $document->addScriptDeclaration('function removeNoQ (text) { return text.replace("'.JText::_('COM_VIRTUEMART_CART_ERROR_NO_VALID_QUANTITY').'","'.JText::_('COM_VIRTUEMART_CART_PRODUCT_ADDED').'"); }'); if ($version->RELEASE <> '1.5') { $document->addScript(JURI::root(true). "/plugins/vmcustom/catproduct/catproduct/js/catproduct-radio.js"); $document->addStyleSheet(JURI::root(true). "/plugins/vmcustom/catproduct/catproduct/css/catproduct.css"); } else { $document->addScript(JURI::root(true). "/plugins/vmcustom/catproduct/js/catproduct-radio.js"); $document->addStyleSheet(JURI::root(true). "/plugins/vmcustom/catproduct/css/catproduct.css"); } ?>
gpl-2.0
bernds/q4Go
src/interfacehandler.cpp
13341
/* * interfacehandler.cpp */ #include <qaction.h> #include <qpushbutton.h> #include <qlabel.h> #include <q3textedit.h> #include <q3buttongroup.h> #include <qlineedit.h> #include <qslider.h> #include <qtabwidget.h> //Added by qt3to4: #include <QPixmap> #include "defines.h" #include "interfacehandler.h" #include "board.h" #include "mainwidget.h" #include "icons.h" #include "move.h" #include "miscdialogs.h" //#ifdef USE_XPM #include ICON_NODE_BLACK #include ICON_NODE_WHITE //#endif struct ButtonState { bool navPrevVar, navNextVar, navBackward, navForward, navFirst, navStartVar, navMainBranch, navLast, navNextBranch, navPrevComment, navNextComment, navIntersection; // SL added eb 11 }; InterfaceHandler::InterfaceHandler() { buttonState = new ButtonState; scored_flag = false; } InterfaceHandler::~InterfaceHandler() { delete buttonState; } void InterfaceHandler::setMoveData(int n, bool black, int brothers, int sons, bool hasParent, bool hasPrev, bool hasNext, int lastX, int lastY) { QString s(QObject::tr("Move") + " "); s.append(QString::number(n)); if (lastX >= 1 && lastX <= board->getBoardSize() && lastY >= 1 && lastY <= board->getBoardSize()) { s.append(" ("); s.append(black ? QObject::tr("W")+" " : QObject::tr("B")+" "); s.append(QString(QChar(static_cast<const char>('A' + (lastX<9?lastX:lastX+1) - 1))) + QString::number(board->getBoardSize()-lastY+1) + ")"); } else if (lastX == 20 && lastY == 20) // Pass { s.append(" ("); s.append(black ? QObject::tr("W")+" " : QObject::tr("B")+" "); s.append(" " + QObject::tr("Pass") + ")"); } s += "\n"; s.append(QString::number(brothers)); if (brothers == 1) s.append(" " + QObject::tr("brother") + "\n"); else s.append(" " + QObject::tr("brothers") + "\n"); s.append(QString::number(sons)); if (sons == 1) s.append(" " + QObject::tr("son")); else s.append(" " + QObject::tr("sons")); moveNumLabel->setText(s); statusTurn->setText(" " + s.right(s.length() - 5) + " "); // Without 'Move ' statusNav->setText(" " + QString::number(brothers) + "/" + QString::number(sons)); s = black ? QObject::tr("Black to play") : QObject::tr("White to play"); turnLabel->setText(s); GameMode mode = board->getGameMode (); if (mode == modeNormal || mode == modeEdit) { // Update the toolbar buttons navPrevVar->setEnabled(hasPrev); navNextVar->setEnabled(hasNext); navBackward->setEnabled(hasParent); navForward->setEnabled(sons); navFirst->setEnabled(hasParent); navStartVar->setEnabled(hasParent); navMainBranch->setEnabled(hasParent); navLast->setEnabled(sons); mainWidget->goPrevButton->setEnabled(hasParent); mainWidget->goNextButton->setEnabled(sons); mainWidget->goFirstButton->setEnabled(hasParent); mainWidget->goLastButton->setEnabled(sons); navNextBranch->setEnabled(sons); navSwapVariations->setEnabled(hasPrev); navPrevComment->setEnabled(hasParent); navNextComment->setEnabled(sons); navIntersection->setEnabled(true); //SL added eb 11 slider->setEnabled(true); } else if (mode == modeObserve) // add eb 8 { // Update the toolbar buttons navBackward->setEnabled(hasParent); navForward->setEnabled(sons); navFirst->setEnabled(hasParent); navLast->setEnabled(sons); mainWidget->goPrevButton->setEnabled(hasParent); mainWidget->goNextButton->setEnabled(sons); mainWidget->goFirstButton->setEnabled(hasParent); mainWidget->goLastButton->setEnabled(sons); navPrevComment->setEnabled(hasParent); navNextComment->setEnabled(sons); navIntersection->setEnabled(true); //SL added eb 11 slider->setEnabled(true); board->getBoardHandler()->display_incoming_move = !bool(sons); //SL added eb 9 - This is used to know whether we are browsing through a game or at the last move } else //end add eb 8 slider->setDisabled(true); // Update slider mainWidget->toggleSliderSignal(false); int mv = slider->maxValue(); // add eb 8 int v = slider->value(); if (slider->maxValue() < n) setSliderMax(n); // we need to be carefull with the slider if (mode != modeObserve || // normal case, slider is moved (mode == modeObserve && mv >= n) || // observing, but browsing (no incoming move) (mode == modeObserve && mv < n && v==n-1))// observing, but at the last move, and an incoming move occurs slider->setValue(n); // end add eb 8 mainWidget->toggleSliderSignal(true); } // clear the big field (offline) void InterfaceHandler::clearComment() { commentEdit->clear(); } // display text void InterfaceHandler::displayComment(const QString &c) { if (board->get_isLocalGame()) { if (c.isEmpty()) commentEdit->clear(); else commentEdit->setText(c); } else if (!c.isEmpty()) commentEdit->append(c); } // get the comment of commentEdit - the multiline field QString InterfaceHandler::getComment() { return commentEdit->text(); } // get the comment of commentEdit2 - the single line QString InterfaceHandler::getComment2() { QString text = commentEdit2->text(); // clear entry commentEdit2->setText(""); // don't show short text if (text.length() < 1) return 0; return text; } void InterfaceHandler::setMarkType(int m) { MarkType t; QString txt; switch(m) { case 0: t = markNone; break; case 1: t = markSquare; break; case 2: t = markCircle; break; case 3: t = markTriangle; break; case 4: t = markCross; break; case 5: t = markText; break; case 6: t = markNumber; break; case 7: { Move *current = board->getBoardHandler()->getTree()->getCurrent(); // set next move's color if (board->getBoardHandler()->getBlackTurn()) { current->setPLinfo(stoneWhite); mainWidget->colorButton->setChecked (true); } else { current->setPLinfo(stoneBlack); mainWidget->colorButton->setChecked (false); } // check if set color is natural color: if (current->getMoveNumber() == 0 && current->getPLnextMove() == stoneBlack || current->getMoveNumber() > 0 && current->getColor() != current->getPLnextMove()) current->clearPLinfo(); board->setCurStoneColor(); return; } default: return; } board->setMarkType(t); } void InterfaceHandler::clearData() { clearComment(); setMoveData(0, true, 0, 0, false, false, false); // modeButton->setOn(false); mainWidget->setToolsTabWidget(tabNormalScore); mainWidget->editButtonGroup->setButton(0); // editTools->hide(); normalTools->capturesBlack->setText("0"); normalTools->capturesWhite->setText("0"); if (board->getGameMode() != modeObserve && board->getGameMode() != modeMatch && board->getGameMode() != modeTeach) { normalTools->pb_timeBlack->setText("00:00"); normalTools->pb_timeWhite->setText("00:00"); } normalTools->show(); scoreButton->setOn(false); slider->setValue(0); setSliderMax(SLIDER_INIT); scored_flag = false; } void InterfaceHandler::toggleSidebar(bool toggle) { if (!toggle) toolsFrame->hide(); else toolsFrame->show(); } QString InterfaceHandler::getTextLabelInput(QWidget *parent, const QString &oldText) { TextEditDialog dlg(parent, QObject::tr("textedit"), true); dlg.textLineEdit->setFocus(); if (!oldText.isNull() && !oldText.isEmpty()) dlg.textLineEdit->setText(oldText); if (dlg.exec() == QDialog::Accepted) return dlg.textLineEdit->text(); return NULL; } void InterfaceHandler::showEditGroup() { // editTools->editButtonGroup->show(); // mainWidget->setToolsTabWidget(tabEdit); } void InterfaceHandler::toggleMarks() { if (board->getGameMode() == modeEdit) return; // if (!modeButton->isChecked()) // return; int cur = board->getMarkType(); cur ++; if (cur > 6) cur = 0; mainWidget->editButtonGroup->setButton(cur); setMarkType(cur); } void InterfaceHandler::setCaptures(float black, float white, bool /*scored*/) { #if 0 if (scored && !scored_flag) { normalTools->capturesFrame->setTitle(QObject::tr("Points")); scored_flag = true; } else if (!scored && scored_flag) { normalTools->capturesFrame->setTitle(QObject::tr("Captures")); scored_flag = false; } #endif capturesBlack->setText(QString::number(black)); capturesWhite->setText(QString::number(white)); } void InterfaceHandler::setTimes(const QString &btime, const QString &bstones, const QString &wtime, const QString &wstones) { if (!btime.isEmpty()) { if (bstones != QString("-1")) normalTools->pb_timeBlack->setText(btime + " / " + bstones); else normalTools->pb_timeBlack->setText(btime); } if (!wtime.isEmpty()) { if (wstones != QString("-1")) normalTools->pb_timeWhite->setText(wtime + " / " + wstones); else normalTools->pb_timeWhite->setText(wtime); } } void InterfaceHandler::setTimes(bool isBlacksTurn, float time, int stones) { QString strTime; int seconds = (int)time; bool neg = seconds < 0; if (neg) seconds = -seconds; int h = seconds / 3600; seconds -= h*3600; int m = seconds / 60; int s = seconds - m*60; QString sec; // prevailling 0 for seconds if ((h || m) && s < 10) sec = "0" + QString::number(s); else sec = QString::number(s); if (h) { QString min; // prevailling 0 for minutes if (h && m < 10) min = "0" + QString::number(m); else min = QString::number(m); strTime = (neg ? "-" : "") + QString::number(h) + ":" + min + ":" + sec; } else strTime = (neg ? "-" : "") + QString::number(m) + ":" + sec; if (isBlacksTurn) setTimes(strTime, QString::number(stones), 0, 0); else setTimes(0, 0, strTime, QString::number(stones)); } void InterfaceHandler::disableToolbarButtons() { CHECK_PTR(buttonState); buttonState->navPrevVar = navPrevVar->isEnabled(); navPrevVar->setEnabled(false); buttonState->navNextVar = navNextVar->isEnabled(); navNextVar->setEnabled(false); buttonState->navBackward = navBackward->isEnabled(); navBackward->setEnabled(false); buttonState->navForward = navForward->isEnabled(); navForward->setEnabled(false); buttonState->navFirst = navFirst->isEnabled(); navFirst->setEnabled(false); buttonState->navStartVar = navStartVar->isEnabled(); navStartVar->setEnabled(false); buttonState->navMainBranch = navMainBranch->isEnabled(); navMainBranch->setEnabled(false); buttonState->navLast = navLast->isEnabled(); navLast->setEnabled(false); buttonState->navNextBranch = navNextBranch->isEnabled(); navNextBranch->setEnabled(false); buttonState->navPrevComment = navPrevComment->isEnabled(); navPrevComment->setEnabled(false); buttonState->navNextComment = navNextComment->isEnabled(); navNextComment->setEnabled(false); buttonState->navIntersection = navIntersection->isEnabled(); // added eb 111 navIntersection->setEnabled(false); // end add eb 11 navNthMove->setEnabled(false); navAutoplay->setEnabled(false); editDelete->setEnabled(false); navSwapVariations->setEnabled(false); fileImportSgfClipB->setEnabled(false); } void InterfaceHandler::restoreToolbarButtons() { CHECK_PTR(buttonState); navPrevVar->setEnabled(buttonState->navPrevVar); navNextVar->setEnabled(buttonState->navNextVar); navBackward->setEnabled(buttonState->navBackward); navForward->setEnabled(buttonState->navForward); navFirst->setEnabled(buttonState->navFirst); navStartVar->setEnabled(buttonState->navStartVar); navMainBranch->setEnabled(buttonState->navMainBranch); navLast->setEnabled(buttonState->navLast); navNextBranch->setEnabled(buttonState->navNextBranch); navPrevComment->setEnabled(buttonState->navPrevComment); navNextComment->setEnabled(buttonState->navNextComment); navIntersection->setEnabled(buttonState->navNextComment); // SL added eb 11 navNthMove->setEnabled(true); navAutoplay->setEnabled(true); editDelete->setEnabled(true); navSwapVariations->setEnabled(true); fileImportSgfClipB->setEnabled(true); } void InterfaceHandler::setScore(int terrB, int capB, int terrW, int capW, float komi) { qDebug() << "setScore " << capW << " " << capB; scoreTools->komi->setText(QString::number(komi)); scoreTools->terrWhite->setText(QString::number(terrW)); scoreTools->capturesWhite->setText(QString::number(capW)); scoreTools->totalWhite->setText(QString::number((float)terrW + (float)capW + komi)); scoreTools->terrBlack->setText(QString::number(terrB)); scoreTools->capturesBlack->setText(QString::number(capB)); scoreTools->totalBlack->setText(QString::number(terrB + capB)); double res = (float)terrW + (float)capW + komi - terrB - capB; if (res < 0) scoreTools->result->setText ("B+" + QString::number (-res)); else if (res == 0) scoreTools->result->setText ("Jigo"); else scoreTools->result->setText ("W+" + QString::number (res)); } void InterfaceHandler::setSliderMax(int n) { if (n < 0) n = 0; slider->setMaxValue(n); mainWidget->sliderRightLabel->setText(QString::number(n)); }
gpl-2.0
drallieiv/EchoNestTools
echonest-tools-core/src/main/java/com/herazade/echonest/tools/core/cli/RemixCli.java
2090
package com.herazade.echonest.tools.core.cli; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.ArrayList; import java.util.List; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.UnsupportedAudioFileException; import org.apache.commons.io.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.echonest.api.v4.TimedEvent; import com.herazade.echonest.tools.core.audio.AudioManager; import com.herazade.echonest.tools.core.remix.strategy.ManualRemix; /** * Main Class for Command Line Interface * * @author drallieiv * */ public class RemixCli { public static void main(String[] args) { if (args.length < 1) { throw new IllegalArgumentException("Requires Action argument"); } CliActionsEnum action = CliActionsEnum.valueOf(args[0].toUpperCase()); if (action == null) { throw new IllegalArgumentException("Unknown Action " + args[0]); } switch (action) { case DEMO: demo(); break; default: break; } } private static void demo() { AudioManager audioManager = new AudioManager(); Logger logger = LoggerFactory.getLogger(RemixCli.class); File out = new File("target/remixed.wav"); try ( InputStream inFile = RemixCli.class.getClassLoader().getResourceAsStream("files/test-music.mp3"); OutputStream outFile = new FileOutputStream(out); AudioInputStream audioIn = audioManager.openMp3AsPcm(inFile);) { ManualRemix remix = ManualRemix.buildNew().addPart(0, 45.60753); for (int i = 0; i < 60; i++) { remix.addPart(45.60753, 104.93201); } remix.addPart(104.93201, 213); audioManager.writeRemix(remix.getRemix(null), audioIn, outFile); outFile.close(); logger.info("Done file written : {}", out.getAbsolutePath()); } catch (FileNotFoundException e) { logger.error("", e); } catch (IOException e) { logger.error("", e); } catch (UnsupportedAudioFileException e) { logger.error("", e); } } }
gpl-2.0
maddy2101/TYPO3.CMS
typo3/sysext/impexp/Classes/Domain/Repository/PresetRepository.php
8788
<?php /* * 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! */ namespace TYPO3\CMS\Impexp\Domain\Repository; use TYPO3\CMS\Core\Database\Connection; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Messaging\FlashMessage; use TYPO3\CMS\Core\Messaging\FlashMessageQueue; use TYPO3\CMS\Core\Messaging\FlashMessageService; use TYPO3\CMS\Core\Utility\GeneralUtility; /** * Handling of presets * @internal this is not part of TYPO3's Core API. */ class PresetRepository { /** * @param int $pageId * @return array */ public function getPresets($pageId) { $options = ['']; $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) ->getQueryBuilderForTable('tx_impexp_presets'); $queryBuilder->select('*') ->from('tx_impexp_presets') ->where( $queryBuilder->expr()->orX( $queryBuilder->expr()->gt( 'public', $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT) ), $queryBuilder->expr()->eq( 'user_uid', $queryBuilder->createNamedParameter($this->getBackendUser()->user['uid'], \PDO::PARAM_INT) ) ) ); if ($pageId) { $queryBuilder->andWhere( $queryBuilder->expr()->orX( $queryBuilder->expr()->eq( 'item_uid', $queryBuilder->createNamedParameter($pageId, \PDO::PARAM_INT) ), $queryBuilder->expr()->eq( 'item_uid', $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT) ) ) ); } $presets = $queryBuilder->execute(); while ($presetCfg = $presets->fetch()) { $options[$presetCfg['uid']] = $presetCfg['title'] . ' [' . $presetCfg['uid'] . ']' . ($presetCfg['public'] ? ' [Public]' : '') . ($presetCfg['user_uid'] === $this->getBackendUser()->user['uid'] ? ' [Own]' : ''); } return $options; } /** * Get single preset record * * @param int $uid Preset record * @return array Preset record, if any (otherwise FALSE) */ public function getPreset($uid) { $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) ->getQueryBuilderForTable('tx_impexp_presets'); return $queryBuilder->select('*') ->from('tx_impexp_presets') ->where( $queryBuilder->expr()->eq( 'uid', $queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT) ) ) ->execute() ->fetch(); } /** * Manipulate presets * * @param array $inData In data array, passed by reference! */ public function processPresets(&$inData) { $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('tx_impexp_presets'); $presetData = GeneralUtility::_GP('preset'); $err = false; $msg = ''; // Save preset $beUser = $this->getBackendUser(); // cast public checkbox to int, since this is an int field and NULL is not allowed $inData['preset']['public'] = (int)$inData['preset']['public']; if (isset($presetData['save'])) { $preset = $this->getPreset($presetData['select']); // Update existing if (is_array($preset)) { if ($beUser->isAdmin() || $preset['user_uid'] === $beUser->user['uid']) { $connection->update( 'tx_impexp_presets', [ 'public' => $inData['preset']['public'], 'title' => $inData['preset']['title'], 'item_uid' => $inData['pagetree']['id'], 'preset_data' => serialize($inData) ], ['uid' => (int)$preset['uid']], ['preset_data' => Connection::PARAM_LOB] ); $msg = 'Preset #' . $preset['uid'] . ' saved!'; } else { $msg = 'ERROR: The preset was not saved because you were not the owner of it!'; $err = true; } } else { // Insert new: $connection->insert( 'tx_impexp_presets', [ 'user_uid' => $beUser->user['uid'], 'public' => $inData['preset']['public'], 'title' => $inData['preset']['title'], 'item_uid' => (int)$inData['pagetree']['id'], 'preset_data' => serialize($inData) ], ['preset_data' => Connection::PARAM_LOB] ); $msg = 'New preset "' . htmlspecialchars($inData['preset']['title']) . '" is created'; } } // Delete preset: if (isset($presetData['delete'])) { $preset = $this->getPreset($presetData['select']); if (is_array($preset)) { // Update existing if ($beUser->isAdmin() || $preset['user_uid'] === $beUser->user['uid']) { $connection->delete( 'tx_impexp_presets', ['uid' => (int)$preset['uid']] ); $msg = 'Preset #' . $preset['uid'] . ' deleted!'; } else { $msg = 'ERROR: You were not the owner of the preset so you could not delete it.'; $err = true; } } else { $msg = 'ERROR: No preset selected for deletion.'; $err = true; } } // Load preset if (isset($presetData['load']) || isset($presetData['merge'])) { $preset = $this->getPreset($presetData['select']); if (is_array($preset)) { // Update existing $inData_temp = unserialize($preset['preset_data'], ['allowed_classes' => false]); if (is_array($inData_temp)) { if (isset($presetData['merge'])) { // Merge records in: if (is_array($inData_temp['record'])) { $inData['record'] = array_merge((array)$inData['record'], $inData_temp['record']); } // Merge lists in: if (is_array($inData_temp['list'])) { $inData['list'] = array_merge((array)$inData['list'], $inData_temp['list']); } } else { $msg = 'Preset #' . $preset['uid'] . ' loaded!'; $inData = $inData_temp; } } else { $msg = 'ERROR: No configuration data found in preset record!'; $err = true; } } else { $msg = 'ERROR: No preset selected for loading.'; $err = true; } } // Show message: if ($msg !== '') { /** @var FlashMessage $flashMessage */ $flashMessage = GeneralUtility::makeInstance( FlashMessage::class, 'Presets', $msg, $err ? FlashMessage::ERROR : FlashMessage::INFO ); /** @var FlashMessageService $flashMessageService */ $flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class); /** @var FlashMessageQueue $defaultFlashMessageQueue */ $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier(); $defaultFlashMessageQueue->enqueue($flashMessage); } } /** * @return \TYPO3\CMS\Core\Authentication\BackendUserAuthentication */ protected function getBackendUser() { return $GLOBALS['BE_USER']; } }
gpl-2.0
hendrasaputra/hendrasaputra.com
wp-content/themes/writr/inc/extras.php
6690
<?php /** * Custom functions that act independently of the theme templates * * Eventually, some of the functionality here could be replaced by core features * * @package Writr */ /** * Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link. */ function writr_page_menu_args( $args ) { $args['show_home'] = true; return $args; } add_filter( 'wp_page_menu_args', 'writr_page_menu_args' ); /** * Adds custom classes to the array of body classes. */ function writr_body_classes( $classes ) { // Adds a class of group-blog to blogs with more than 1 published author if ( is_multi_author() ) $classes[] = 'group-blog'; // Adds a class if Full Page Background Image option is ticked if ( '' != get_theme_mod( 'writr_background_size' ) ) $classes[] = 'custom-background-size'; $colorscheme = get_theme_mod( 'writr_color_scheme' ); if ( $colorscheme && 'default' !== $colorscheme ) $classes[] = 'color-scheme-' . $colorscheme; // Adds a class to control the sidebar status $classes[] = 'sidebar-closed'; return $classes; } add_filter( 'body_class', 'writr_body_classes' ); /** * Filter in a link to a content ID attribute for the next/previous image links on image attachment pages */ function writr_enhanced_image_navigation( $url, $id ) { if ( ! is_attachment() && ! wp_attachment_is_image( $id ) ) return $url; $image = get_post( $id ); if ( ! empty( $image->post_parent ) && $image->post_parent != $id ) $url .= '#main'; return $url; } add_filter( 'attachment_link', 'writr_enhanced_image_navigation', 10, 2 ); /** * Filters wp_title to print a neat <title> tag based on what is being viewed. */ function writr_wp_title( $title, $sep ) { global $page, $paged; if ( is_feed() ) return $title; // Add the blog name $title .= get_bloginfo( 'name' ); // Add the blog description for the home/front page. $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) $title .= " $sep $site_description"; // Add a page number if necessary: if ( $paged >= 2 || $page >= 2 ) $title .= " $sep " . sprintf( __( 'Page %s', 'writr' ), max( $paged, $page ) ); return $title; } add_filter( 'wp_title', 'writr_wp_title', 10, 2 ); /** * Returns the URL from the post. * * @uses get_the_link() to get the URL in the post meta (if it exists) or * the first link found in the post content. * * Falls back to the post permalink if no URL is found in the post. * * @return string URL */ function writr_get_link_url() { $content = get_the_content(); $has_url = get_url_in_content( $content ); return ( $has_url ) ? $has_url : apply_filters( 'the_permalink', get_permalink() ); } /** * Use &hellip; instead of [...] for excerpts. */ function writr_excerpt_more( $more ) { return '&hellip;'; } add_filter( 'excerpt_more', 'writr_excerpt_more' ); /** * Wrap more link */ function writr_more_link( $link ) { return '<span class="more-link-wrapper">' . $link . '</span>'; } add_filter( 'the_content_more_link', 'writr_more_link' ); /** * Adds a wrapper to videos from the whitelisted services and attempts to add * the wmode parameter to YouTube videos and flash embeds. * * @return string */ if ( ! function_exists( 'wpcom_responsive_videos_embed_html' ) ) { function writr_embed_html( $html ) { return '<div class="video-wrapper">' . $html . '</div>'; } add_filter( 'embed_oembed_html', 'writr_embed_html', 10, 3 ); add_filter( 'video_embed_html', 'writr_embed_html' ); // Jetpack } /** * Decrease caption width for non-full-width images. */ function writr_shortcode_atts_caption( $attr ) { global $content_width; if ( isset( $attr['width'] ) && $attr['width'] < $content_width ) $attr['width'] -= 10; return $attr; } add_filter( 'shortcode_atts_caption', 'writr_shortcode_atts_caption' ); /** * Creates an HTML list of nav menu items that introduces multi-levels. */ class writr_nav_walker extends Walker_Nav_Menu { // Each time an element is the child of the prior element, this is called. function start_lvl( &$output, $depth = 0, $args = array() ) { if ( $depth >= 1 ) $output .= apply_filters( 'walker_nav_menu_start_lvl', '<ul class="dropdown-menu submenu-hide">', $depth, $args ); else $output .= apply_filters( 'walker_nav_menu_start_lvl', '<ul class="dropdown-menu">', $depth, $args ); } // Each time an individual element is processed, start_el is called. function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 ) { $css_classes = implode( ' ', $object->classes ); $target = isset( $object->target ) && '' != $object->target ? ' target="_blank" ' : ''; // If the current menu item has children, we need to set the proper class names on the list items and the anchors. Parent menu items can't have blank targets. if ( $args->has_children ) { if ( $object->menu_item_parent == 0 ) { $menu_item = get_permalink() == $object->url ? '<li class="dropdown ' . $css_classes . '">' : '<li class="dropdown ' . $css_classes . '">'; $menu_item .= '<a href="' . $object->url . '" class="dropdown-toggle"' . '>'; } else { $menu_item = '<li class="dropdown submenu ' . $css_classes . '">'; $menu_item .= '<a href="' . $object->url . '" class="dropdown-toggle"' . $target . '>'; } } else { $menu_item = get_permalink() == $object->url ? '<li class="active ' . $css_classes . '">' : '<li class="' . $css_classes . '">'; $menu_item .= '<a href="' . $object->url . '"' . $target . '>'; } // Render the actual menu title $menu_item .= $object->title; // Close the anchor $menu_item .= '</a>'; $output .= apply_filters ( 'nav_walker_start_el', $menu_item, $object, $depth, $args ); } // Set a value in the element's arguments that allow us to determine if the current menu item has children. function display_element( $element, &$children_elements, $max_depth, $depth = 0, $args, &$output ) { $id_field = $this->db_fields['id']; if ( is_object( $args[0] ) ) $args[0]->has_children = ! empty( $children_elements[$element->$id_field] ); return parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output ); } // Each time an element is processed, end_el is called after start_el. function end_el( &$output, $object, $depth = 0, $args = array() ) { $output .= apply_filters( 'nav_walker_end_el', '</li>', $object, $depth, $args ); } // Each time an element is no longer below on of the current parents, this is called. function end_lvl( &$output, $depth = 0, $args = array() ) { $output .= apply_filters( 'nav_walker_end_lvl', '</ul>', $depth, $args ); } }
gpl-2.0
Merthyra/WikitoDB
src/main/java/at/ac/tuwien/docspars/entity/Mode.java
226
package at.ac.tuwien.docspars.entity; /** * * Enum that declares the database types to be written to * * @author hboesch, TuWien * * @since 0.1.0 * @version 0.1.0 */ public enum Mode { V1, V2, V3, V4, V5, V6; }
gpl-2.0
wild0522/9grids
index.php
1005
<?php include_once 'urls.php'; ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>九宮格</title> </head> <link rel="stylesheet" type="text/css" href="style/default.css"> <body> <div class="header"> <img height="92" src="googlelogo_color_272x92dp.png" width="272" alt="Google"><br /> <input id="goosearch" type="text" placeholder="在 Google 上搜尋或輸入網址" onkeydown="if (event.keyCode == 13 || event.which == 13) { location='http://www.google.com/search?q=' + encodeURIComponent(document.getElementById('goosearch').value);}" autofocus /> </div> <?php if( ! empty($list)){ foreach($list as $row): ?> <div class="box" onclick="javascript:location.href='<?=$row['url']?>'"> <div class="image"><img src="snapshot/<?=$row['img']?>" /></div> <div class="name"><?=$row['name']?></div> </div> <?php endforeach;}?> </body> </html>
gpl-2.0
boyns/muffin
src/org/doit/muffin/Icon.java
3407
/* $Id: Icon.java,v 1.7 2006/06/18 23:25:51 forger77 Exp $ */ /* * Copyright (C) 1996-2000 Mark R. Boyns <boyns@doit.org> * * This file is part of Muffin. * * Muffin 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. * * Muffin 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 Muffin; see the file COPYING. If not, write to the * Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. */ package org.doit.muffin; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Image; import java.awt.MediaTracker; import java.awt.Toolkit; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.image.ImageProducer; import java.net.URL; /** * Cute little muffin icon. * * @author Mark Boyns */ class Icon extends java.awt.Canvas implements MouseListener { /** * Serializable class should define this: */ private static final long serialVersionUID = 1L; private boolean raised = true; private Image icon = null; private Image nomuff = null; private Options options = null; /** * Create an Icon. */ Icon(Options options) { this.options = options; try { MediaTracker tracker = new MediaTracker(this); URL url; url = getClass().getResource("/images/mufficon.jpg"); if (url != null) { icon = Toolkit.getDefaultToolkit().createImage((ImageProducer) url.getContent()); tracker.addImage(icon, 1); } url = getClass().getResource("/images/nomuff.jpg"); if (url != null) { nomuff = Toolkit.getDefaultToolkit().createImage((ImageProducer) url.getContent()); tracker.addImage(nomuff, 2); } tracker.waitForAll(); addMouseListener(this); } catch (Exception e) { e.printStackTrace(); } } public Dimension getPreferredSize() { return new Dimension(36, 36); } public Dimension getPreferredSize(int rows) { return new Dimension(36, 36); } public Dimension getMinimumSize() { return new Dimension(36, 36); } public Dimension getMinimumSize(int rows) { return new Dimension(36, 36); } public void mouseReleased(MouseEvent e) { raised = !raised; options.putBoolean("muffin.passthru", !raised); repaint(); } public void mousePressed(MouseEvent e) { } public void mouseClicked(MouseEvent e) { } public void mouseEntered(MouseEvent e) { } public void mouseExited(MouseEvent e) { } /** * Paint the muffin. */ public void paint(Graphics g) { int i; g.setColor(Color.lightGray); for (i = 0; i < 2; i++) { g.draw3DRect(i, i, 36 - i*2, 36 - i*2, raised); } if (icon != null) { g.drawImage(icon, 2, 2, this); } if (!raised && nomuff != null) { g.drawImage(nomuff, 6, 6, this); } g.setColor(Color.lightGray); g.drawRect(2, 2, 32, 32); } }
gpl-2.0
adirkuhn/expressoDrupal
core/modules/language/lib/Drupal/language/Plugin/views/filter/LanguageFilter.php
813
<?php /** * @file * Contains Drupal\language\Plugin\views\filter\LanguageFilter. */ namespace Drupal\language\Plugin\views\filter; use Drupal\views\Plugin\views\filter\InOperator; use Drupal\Core\Annotation\Plugin; /** * Provides filtering by language. * * @ingroup views_filter_handlers * * @Plugin( * id = "language", * module = "language" * ) */ class LanguageFilter extends InOperator { function get_value_options() { if (!isset($this->value_options)) { $this->value_title = t('Language'); $languages = array( '***CURRENT_LANGUAGE***' => t("Current user's language"), '***DEFAULT_LANGUAGE***' => t("Default site language"), ); $languages = array_merge($languages, views_language_list()); $this->value_options = $languages; } } }
gpl-2.0
Teplitsa/old-IT-volunteer
app/controllers/users_controller.rb
1498
# encoding: utf-8 class UsersController < InheritedResources::Base before_filter :authenticate_user! load_and_authorize_resource has_scope :page, default: 1 custom_actions resource: [:ignore, :unignore] def current_search_path @current_search_path ||= users_path end def index @users = User.search(params) end def show @tasks = @user.tasks.group_by(&:state) end def update successfully_updated = if want_to_change_password? or want_to_change_email? @user.update_with_password(params[:user]) else @user.update_without_password(params[:user]) end respond_to do |format| if successfully_updated # Sign in the user by passing validation in case his password changed sign_in @user, :bypass => true if want_to_change_password? and want_to_change_email? format.html { redirect_to @user} format.json { head :no_content } # 204 No Content else format.html { render action: "edit" } format.json { render json: @user.errors, status: :unprocessable_entity } end end end def ignore current_user.ignore! @user end def unignore current_user.unignore! @user end private def want_to_change_password? @want_to_change_password ||= !params[:user][:password].empty? rescue false end def want_to_change_email? @want_to_change_email ||= params[:user][:email].present? and (@user.email != params[:user][:email]) rescue false end end
gpl-2.0
toyatech/etsyjs
etsy.js
250869
(function (root, factory) { 'use strict'; if (typeof define === 'function' && define.amd) { define(['exports'], factory); } else if (typeof exports !== 'undefined') { factory(exports); } else { factory(root.etsyjs = {}); } }(this, function (exports) { 'use strict'; var r = [ 'ApiMethod', 'Avatar', 'BillCharge', 'BillingOverview', 'BillPayment', 'Cart', 'CartListing', 'Category', 'Country', 'Coupon', 'DataType', 'FavoriteListing', 'FavoriteUser', 'FeaturedTreasury', 'Feedback', 'FeedbackInfo', 'ForumPost', 'Guest', 'GuestCart', 'ImageType', 'Ledger', 'LedgerEntry', 'Listing', 'ListingFile', 'ListingImage', 'ListingTranslation', 'Manufacturer', 'ParamList', 'Payment', 'PaymentAdjustment', 'PaymentAdjustmentItem', 'PaymentTemplate', 'Receipt', 'ReceiptShipment', 'Region', 'Segment', 'SegmentPoster', 'ShippingInfo', 'ShippingOption', 'ShippingTemplate', 'ShippingTemplateEntry', 'ShippingUpgrade', 'Shop', 'ShopAbout', 'ShopAboutImage', 'ShopAboutMember', 'ShopSection', 'ShopSectionTranslation', 'ShopTranslation', 'Style', 'Team', 'Transaction', 'Treasury', 'TreasuryCounts', 'TreasuryListing', 'TreasuryListingData', 'User', 'UserAddress', 'UserProfile', 'Variations_Option', 'Variations_Property', 'Variations_PropertyQualifier', 'Variations_PropertySet', 'Variations_PropertySetOption', 'Variations_PropertySetOptionModifier', 'Variations_PropertySetProperty', 'Variations_SelectedProperty' ], ApiMethod_f = [ { 'n': 'name', 't': 'string', 'v': 'public' }, { 'n': 'uri', 't': 'string', 'v': 'public' }, { 'n': 'params', 't': 'ParamList', 'v': 'public' }, { 'n': 'defaults', 't': 'ParamList', 'v': 'public' }, { 'n': 'type', 't': 'string', 'v': 'public' }, { 'n': 'visibility', 't': 'string', 'v': 'public' }, { 'n': 'http_method', 't': 'string', 'v': 'public' } ], ApiMethod_m = [{ 'n': 'getMethodTable', 'u': '/', 'o': false }], Avatar_f = [ { 'n': 'avatar_id', 't': 'int', 'v': 'public' }, { 'n': 'hex_code', 't': 'string', 'v': 'public' }, { 'n': 'red', 't': 'int', 'v': 'public' }, { 'n': 'green', 't': 'int', 'v': 'public' }, { 'n': 'blue', 't': 'int', 'v': 'public' }, { 'n': 'hue', 't': 'int', 'v': 'public' }, { 'n': 'saturation', 't': 'int', 'v': 'public' }, { 'n': 'brightness', 't': 'int', 'v': 'public' }, { 'n': 'is_black_and_white', 't': 'boolean', 'v': 'public' }, { 'n': 'creation_tsz', 't': 'float', 'v': 'public' }, { 'n': 'user_id', 't': 'int', 'v': 'public' } ], Avatar_m = [ { 'n': 'uploadAvatar', 'u': '/users/:user_id/avatar', 'm': 'POST', 's': 'profile_w', 'p': [ { 'n': 'src', 't': 'string' }, { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'image', 't': 'image' } ] }, { 'n': 'getAvatarImgSrc', 'u': '/users/:user_id/avatar/src', 'o': false, 'p': [{ 'n': 'user_id', 't': 'user_id_or_name', 'r': true }] } ], BillCharge_f = [ { 'n': 'bill_charge_id', 't': 'int', 's': 'billing_r' }, { 'n': 'creation_tsz', 't': 'float', 's': 'billing_r' }, { 'n': 'type', 't': 'string', 's': 'billing_r' }, { 'n': 'type_id', 't': 'int', 's': 'billing_r' }, { 'n': 'user_id', 't': 'int', 's': 'billing_r' }, { 'n': 'amount', 't': 'float', 's': 'billing_r' }, { 'n': 'currency_code', 't': 'string', 's': 'billing_r' }, { 'n': 'creation_year', 't': 'int', 's': 'billing_r' }, { 'n': 'creation_month', 't': 'int', 's': 'billing_r' }, { 'n': 'last_modified_tsz', 't': 'float', 's': 'billing_r' } ], BillCharge_m = [ { 'n': 'getUserChargesMetadata', 'u': '/users/:user_id/charges/meta', 's': 'billing_r', 'p': [{ 'n': 'user_id', 't': 'user_id_or_name', 'r': true }] }, { 'n': 'findAllUserCharges', 'u': '/users/:user_id/charges', 's': 'billing_r', 'p': [ { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' }, { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'sort_order', 't': 'enum(up, down)', 'd': 'up' }, { 'n': 'min_created', 't': 'epoch' }, { 'n': 'max_created', 't': 'epoch' } ] } ], BillingOverview_f = [ { 'n': 'is_overdue', 't': 'boolean', 's': 'billing_r' }, { 'n': 'currency_code', 't': 'string', 's': 'billing_r' }, { 'n': 'overdue_balance', 't': 'float', 's': 'billing_r' }, { 'n': 'balance_due', 't': 'float', 's': 'billing_r' }, { 'n': 'total_balance', 't': 'float', 's': 'billing_r' }, { 'n': 'date_due', 't': 'epoch', 's': 'billing_r' }, { 'n': 'date_overdue', 't': 'epoch', 's': 'billing_r' } ], BillingOverview_m = [{ 'n': 'getUserBillingOverview', 'u': '/users/:user_id/billing/overview', 's': 'billing_r', 'p': [{ 'n': 'user_id', 't': 'user_id_or_name', 'r': true }] }], BillPayment_f = [ { 'n': 'bill_payment_id', 't': 'int', 's': 'billing_r' }, { 'n': 'creation_tsz', 't': 'float', 's': 'billing_r' }, { 'n': 'type', 't': 'string', 's': 'billing_r' }, { 'n': 'type_id', 't': 'int', 's': 'billing_r' }, { 'n': 'user_id', 't': 'int', 's': 'billing_r' }, { 'n': 'amount', 't': 'float', 's': 'billing_r' }, { 'n': 'currency_code', 't': 'string', 's': 'billing_r' }, { 'n': 'creation_month', 't': 'int', 's': 'billing_r' }, { 'n': 'creation_year', 't': 'int', 's': 'billing_r' } ], BillPayment_m = [{ 'n': 'findAllUserPayments', 'u': '/users/:user_id/payments', 's': 'billing_r', 'p': [ { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' }, { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'sort_order', 't': 'enum(up, down)', 'd': 'up' }, { 'n': 'min_created', 't': 'epoch' }, { 'n': 'max_created', 't': 'epoch' } ] }], Cart_f = [ { 'n': 'cart_id', 't': 'int', 's': 'cart_rw' }, { 'n': 'shop_name', 't': 'string', 's': 'cart_rw' }, { 'n': 'message_to_seller', 't': 'string', 's': 'cart_rw' }, { 'n': 'destination_country_id', 't': 'int', 's': 'cart_rw' }, { 'n': 'coupon_code', 't': 'string', 's': 'cart_rw' }, { 'n': 'currency_code', 't': 'string', 's': 'cart_rw' }, { 'n': 'total', 't': 'string', 's': 'cart_rw' }, { 'n': 'subtotal', 't': 'string', 's': 'cart_rw' }, { 'n': 'shipping_cost', 't': 'string', 's': 'cart_rw' }, { 'n': 'tax_cost', 't': 'string', 's': 'cart_rw' }, { 'n': 'discount_amount', 't': 'string', 's': 'cart_rw' }, { 'n': 'shipping_discount_amount', 't': 'string', 's': 'cart_rw' }, { 'n': 'tax_discount_amount', 't': 'string', 's': 'cart_rw' }, { 'n': 'url', 't': 'string', 's': 'cart_rw' }, { 'n': 'listings', 't': 'array(CartListing)', 's': 'cart_rw' }, { 'n': 'shipping_option', 't': 'ShippingOption', 's': 'cart_rw' } ], Cart_a = [ { 'n': 'Shop', 't': 'Shop', 's': 'cart_rw' }, { 'n': 'Listings', 't': 'array(Listing)', 's': 'cart_rw' }, { 'n': 'Coupon', 't': 'Coupon', 's': 'cart_rw' }, { 'n': 'ShippingOptions', 't': 'array(ShippingOption)', 's': 'cart_rw' } ], Cart_m = [ { 'n': 'getAllUserCarts', 'u': '/users/:user_id/carts', 's': 'cart_rw', 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'limit', 't': 'int', 'd': '100' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] }, { 'n': 'addToCart', 'u': '/users/:user_id/carts', 'm': 'POST', 's': 'cart_rw', 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'listing_id', 't': 'int', 'r': true }, { 'n': 'quantity', 't': 'int', 'd': '1' }, { 'n': 'selected_variations', 't': 'map(int, int)' } ] }, { 'n': 'updateCartListingQuantity', 'u': '/users/:user_id/carts', 'm': 'PUT', 's': 'cart_rw', 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'listing_id', 't': 'int', 'r': true }, { 'n': 'quantity', 't': 'int', 'r': true }, { 'n': 'listing_customization_id', 't': 'int', 'd': '0' } ] }, { 'n': 'removeCartListing', 'u': '/users/:user_id/carts', 'm': 'DELETE', 's': 'cart_rw', 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'listing_id', 't': 'int', 'r': true }, { 'n': 'listing_customization_id', 't': 'int', 'd': '0' } ] }, { 'n': 'getUserCart', 'u': '/users/:user_id/carts/:cart_id', 's': 'cart_rw', 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'cart_id', 't': 'cart_id', 'r': true } ] }, { 'n': 'updateCart', 'u': '/users/:user_id/carts/:cart_id', 'm': 'PUT', 's': 'cart_rw', 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'cart_id', 't': 'cart_id', 'r': true }, { 'n': 'destination_country_id', 't': 'int' }, { 'n': 'message_to_seller', 't': 'text' }, { 'n': 'coupon_code', 't': 'string' }, { 'n': 'shipping_option_id', 't': 'int' } ] }, { 'n': 'deleteCart', 'u': '/users/:user_id/carts/:cart_id', 'm': 'DELETE', 's': 'cart_rw', 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'cart_id', 't': 'cart_id', 'r': true } ] }, { 'n': 'getUserCartForShop', 'u': '/users/:user_id/carts/shop/:shop_id', 's': 'cart_rw', 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true } ] } ], CartListing_f = [ { 'n': 'listing_id', 't': 'int', 's': 'cart_rw' }, { 'n': 'purchase_quantity', 't': 'int', 's': 'cart_rw' }, { 'n': 'purchase_state', 't': 'string', 's': 'cart_rw' }, { 'n': 'is_digital', 't': 'boolean', 's': 'cart_rw' }, { 'n': 'file_data', 't': 'string', 's': 'cart_rw' }, { 'n': 'listing_customization_id', 't': 'int', 's': 'cart_rw' }, { 'n': 'variations_available', 't': 'boolean', 's': 'cart_rw' }, { 'n': 'has_variations', 't': 'boolean', 's': 'cart_rw' }, { 'n': 'selected_variations', 't': 'array(Variations_SelectedProperty)', 's': 'cart_rw' } ], Category_f = [ { 'n': 'category_id', 't': 'int', 'v': 'public' }, { 'n': 'name', 't': 'string', 'v': 'public' }, { 'n': 'meta_title', 't': 'string', 'v': 'public' }, { 'n': 'meta_keywords', 't': 'string', 'v': 'public' }, { 'n': 'meta_description', 't': 'string', 'v': 'public' }, { 'n': 'page_description', 't': 'string', 'v': 'public' }, { 'n': 'page_title', 't': 'string', 'v': 'public' }, { 'n': 'category_name', 't': 'string', 'v': 'public' }, { 'n': 'short_name', 't': 'string', 'v': 'public' }, { 'n': 'long_name', 't': 'string', 'v': 'public' }, { 'n': 'num_children', 't': 'int', 'v': 'public' } ], Category_m = [ { 'n': 'getCategory', 'u': '/categories/:tag', 'o': false, 'p': [{ 'n': 'tag', 't': 'string', 'r': true }] }, { 'n': 'findAllTopCategory', 'u': '/taxonomy/categories', 'o': false }, { 'n': 'getSubCategory', 'u': '/categories/:tag/:subtag', 'o': false, 'p': [ { 'n': 'tag', 't': 'string', 'r': true }, { 'n': 'subtag', 't': 'string', 'r': true } ] }, { 'n': 'getSubSubCategory', 'u': '/categories/:tag/:subtag/:subsubtag', 'o': false, 'p': [ { 'n': 'tag', 't': 'string', 'r': true }, { 'n': 'subtag', 't': 'string', 'r': true }, { 'n': 'subsubtag', 't': 'string', 'r': true } ] }, { 'n': 'findAllTopCategoryChildren', 'u': '/taxonomy/categories/:tag', 'o': false, 'p': [{ 'n': 'tag', 't': 'string', 'r': true }] }, { 'n': 'findAllSubCategoryChildren', 'u': '/taxonomy/categories/:tag/:subtag', 'o': false, 'p': [ { 'n': 'tag', 't': 'string', 'r': true }, { 'n': 'subtag', 't': 'string', 'r': true } ] } ], Country_f = [ { 'n': 'country_id', 't': 'int', 'v': 'public' }, { 'n': 'iso_country_code', 't': 'string', 'v': 'public' }, { 'n': 'world_bank_country_code', 't': 'string', 'v': 'public' }, { 'n': 'name', 't': 'string', 'v': 'public' }, { 'n': 'slug', 't': 'string', 'v': 'public' }, { 'n': 'lat', 't': 'float', 'v': 'public' }, { 'n': 'lon', 't': 'float', 'v': 'public' } ], Country_m = [ { 'n': 'findAllCountry', 'u': '/countries', 'o': false }, { 'n': 'getCountry', 'u': '/countries/:country_id', 'o': false, 'p': [{ 'n': 'country_id', 't': 'array(int)', 'r': true }] }, { 'n': 'findByIsoCode', 'u': '/countries/iso/:iso_code', 'o': false, 'p': [ { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' }, { 'n': 'iso_code', 't': 'string', 'r': true } ] } ], Coupon_f = [ { 'n': 'coupon_id', 't': 'int', 's': 'shops_rw' }, { 'n': 'coupon_code', 't': 'string', 's': 'shops_rw' }, { 'n': 'seller_active', 't': 'boolean', 's': 'shops_rw' }, { 'n': 'pct_discount', 't': 'int', 's': 'shops_rw' }, { 'n': 'free_shipping', 't': 'boolean', 's': 'shops_rw' }, { 'n': 'domestic_only', 't': 'boolean', 's': 'shops_rw' }, { 'n': 'currency_code', 't': 'string', 's': 'shops_rw' }, { 'n': 'fixed_discount', 't': 'string', 's': 'shops_rw' }, { 'n': 'minimum_purchase_price', 't': 'string', 's': 'shops_rw' }, { 'n': 'expiration_date', 't': 'int', 's': 'shops_rw' }, { 'n': 'coupon_type', 't': 'string', 's': 'shops_rw' } ], Coupon_m = [ { 'n': 'findAllShopCoupons', 'u': '/shops/:shop_id/coupons', 's': 'shops_rw', 'p': [{ 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }] }, { 'n': 'createCoupon', 'u': '/shops/:shop_id/coupons', 'm': 'POST', 's': 'shops_rw', 'p': [ { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }, { 'n': 'coupon_code', 't': 'string', 'r': true }, { 'n': 'pct_discount', 't': 'int' }, { 'n': 'seller_active', 't': 'boolean', 'd': 'false' }, { 'n': 'free_shipping', 't': 'boolean', 'd': 'false' }, { 'n': 'domestic_only', 't': 'boolean', 'd': 'false' }, { 'n': 'currency_code', 't': 'string', 'd': 'USD' }, { 'n': 'fixed_discount', 't': 'string' }, { 'n': 'minimum_purchase_price', 't': 'string' }, { 'n': 'expiration_date', 't': 'int' } ] }, { 'n': 'findCoupon', 'u': '/shops/:shop_id/coupons/:coupon_id', 's': 'shops_rw', 'p': [ { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }, { 'n': 'coupon_id', 't': 'int', 'r': true } ] }, { 'n': 'updateCoupon', 'u': '/shops/:shop_id/coupons/:coupon_id', 'm': 'PUT', 's': 'shops_rw', 'p': [ { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }, { 'n': 'coupon_id', 't': 'int', 'r': true }, { 'n': 'seller_active', 't': 'boolean', 'd': 'false' } ] }, { 'n': 'deleteCoupon', 'u': '/shops/:shop_id/coupons/:coupon_id', 'm': 'DELETE', 's': 'shops_rw', 'p': [ { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }, { 'n': 'coupon_id', 't': 'int', 'r': true } ] } ], DataType_f = [ { 'n': 'type', 't': 'string', 'v': 'public' }, { 'n': 'values', 't': 'string', 'v': 'public' } ], DataType_m = [ { 'n': 'describeOccasionEnum', 'u': '/types/enum/occasion', 'o': false }, { 'n': 'describeRecipientEnum', 'u': '/types/enum/recipient', 'o': false }, { 'n': 'describeWhenMadeEnum', 'u': '/types/enum/when_made', 'o': false, 'p': [{ 'n': 'include_formatted', 't': 'boolean' }] }, { 'n': 'describeWhoMadeEnum', 'u': '/types/enum/who_made', 'o': false } ], FavoriteListing_f = [ { 'n': 'listing_id', 't': 'int', 'v': 'public' }, { 'n': 'user_id', 't': 'int', 'v': 'public/private', 's': 'favorites_rw' }, { 'n': 'listing_state', 't': 'string', 'v': 'public' }, { 'n': 'create_date', 't': 'int', 'v': 'public' } ], FavoriteListing_a = [ { 'n': 'User', 't': 'User', 'v': 'public/private', 's': 'favorites_rw' }, { 'n': 'Listing', 't': 'Listing', 'v': 'public' } ], FavoriteListing_m = [ { 'n': 'findAllListingFavoredBy', 'u': '/listings/:listing_id/favored-by', 'o': false, 'p': [ { 'n': 'listing_id', 't': 'int', 'r': true }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] }, { 'n': 'findAllUserFavoriteListings', 'u': '/users/:user_id/favorites/listings', 'o': false, 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] }, { 'n': 'findUserFavoriteListings', 'u': '/users/:user_id/favorites/listings/:listing_id', 'o': false, 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'listing_id', 't': 'int', 'r': true } ] }, { 'n': 'createUserFavoriteListings', 'u': '/users/:user_id/favorites/listings/:listing_id', 'm': 'POST', 's': 'favorites_rw', 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'listing_id', 't': 'int', 'r': true } ] }, { 'n': 'deleteUserFavoriteListings', 'u': '/users/:user_id/favorites/listings/:listing_id', 'm': 'DELETE', 's': 'favorites_rw', 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'listing_id', 't': 'int', 'r': true } ] } ], FavoriteUser_f = [ { 'n': 'user_id', 't': 'int', 'v': 'public/private', 's': 'favorites_rw' }, { 'n': 'favorite_user_id', 't': 'int', 'v': 'public' }, { 'n': 'target_user_id', 't': 'int', 'v': 'public' }, { 'n': 'creation_tsz', 't': 'float', 'v': 'public' } ], FavoriteUser_a = [ { 'n': 'User', 't': 'User', 'v': 'public/private', 's': 'favorites_rw' }, { 'n': 'TargetUser', 't': 'User', 'v': 'public' } ], FavoriteUser_m = [ { 'n': 'findAllUserFavoredBy', 'u': '/users/:user_id/favored-by', 'o': false, 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] }, { 'n': 'findAllUserFavoriteUsers', 'u': '/users/:user_id/favorites/users', 'o': false, 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] }, { 'n': 'findUserFavoriteUsers', 'u': '/users/:user_id/favorites/users/:target_user_id', 'o': false, 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'target_user_id', 't': 'user_id_or_name', 'r': true } ] }, { 'n': 'createUserFavoriteUsers', 'u': '/users/:user_id/favorites/users/:target_user_id', 'm': 'POST', 's': 'favorites_rw', 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'target_user_id', 't': 'user_id_or_name', 'r': true } ] }, { 'n': 'deleteUserFavoriteUsers', 'u': '/users/:user_id/favorites/users/:target_user_id', 'm': 'DELETE', 's': 'favorites_rw', 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'target_user_id', 't': 'user_id_or_name', 'r': true } ] } ], FeaturedTreasury_f = [ { 'n': 'treasury_key', 't': 'string', 'v': 'public' }, { 'n': 'treasury_id', 't': 'int', 'v': 'public' }, { 'n': 'treasury_owner_id', 't': 'int', 'v': 'public' }, { 'n': 'url', 't': 'string', 'v': 'public' }, { 'n': 'region', 't': 'string', 'v': 'public' }, { 'n': 'active_date', 't': 'float', 'v': 'public' } ], FeaturedTreasury_m = [ { 'n': 'findAllFeaturedTreasuries', 'u': '/featured_treasuries', 'o': false, 'p': [ { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' }, { 'n': 'region', 't': 'region', 'd': '__ALL_REGIONS__' } ] }, { 'n': 'getFeaturedTreasuryById', 'u': '/featured_treasuries/:featured_treasury_id', 'o': false, 'p': [{ 'n': 'featured_treasury_id', 't': 'int', 'r': true }] }, { 'n': 'findAllFeaturedTreasuriesByOwner', 'u': '/featured_treasuries/owner/:owner_id', 'o': false, 'p': [ { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' }, { 'n': 'owner_id', 't': 'int', 'r': true } ] } ], Feedback_f = [ { 'n': 'feedback_id', 't': 'int', 'v': 'public' }, { 'n': 'transaction_id', 't': 'int', 'v': 'public/private', 's': 'feedback_r' }, { 'n': 'creator_user_id', 't': 'int', 'v': 'public/private', 's': 'feedback_r' }, { 'n': 'target_user_id', 't': 'int', 'v': 'public/private', 's': 'feedback_r' }, { 'n': 'seller_user_id', 't': 'int', 'v': 'public/private', 's': 'feedback_r' }, { 'n': 'buyer_user_id', 't': 'int', 'v': 'public/private', 's': 'feedback_r' }, { 'n': 'creation_tsz', 't': 'float', 'v': 'public' }, { 'n': 'message', 't': 'string', 'v': 'public' }, { 'n': 'value', 't': 'int', 'v': 'public' }, { 'n': 'image_feedback_id', 't': 'int', 'v': 'public/private', 's': 'feedback_r' }, { 'n': 'image_url_25x25', 't': 'string', 'v': 'public/private', 's': 'feedback_r' }, { 'n': 'image_url_155x125', 't': 'string', 'v': 'public/private', 's': 'feedback_r' }, { 'n': 'image_url_fullxfull', 't': 'string', 'v': 'public/private', 's': 'feedback_r' } ], Feedback_a = [ { 'n': 'Buyer', 't': 'User', 'v': 'public/private', 's': 'feedback_r' }, { 'n': 'Seller', 't': 'User', 'v': 'public/private', 's': 'feedback_r' }, { 'n': 'Author', 't': 'User', 'v': 'public/private', 's': 'feedback_r' }, { 'n': 'Subject', 't': 'User', 'v': 'public/private', 's': 'feedback_r' }, { 'n': 'Transaction', 't': 'Transaction', 'v': 'public/private', 's': 'feedback_r' }, { 'n': 'Listing', 't': 'Listing', 'v': 'public/private', 's': 'feedback_r' } ], Feedback_m = [ { 'n': 'findAllUserFeedbackAsAuthor', 'u': '/users/:user_id/feedback/as-author', 'o': false, 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] }, { 'n': 'findAllUserFeedbackAsBuyer', 'u': '/users/:user_id/feedback/as-buyer', 'o': false, 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] }, { 'n': 'findAllUserFeedbackAsSeller', 'u': '/users/:user_id/feedback/as-seller', 'o': false, 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] }, { 'n': 'findAllUserFeedbackAsSubject', 'u': '/users/:user_id/feedback/as-subject', 'o': false, 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] }, { 'n': 'findAllFeedbackFromBuyers', 'u': '/users/:user_id/feedback/from-buyers', 'o': false, 'p': [ { 'n': 'user_id', 't': 'user_id_or_name' }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] }, { 'n': 'findAllFeedbackFromSellers', 'u': '/users/:user_id/feedback/from-sellers', 'o': false, 'p': [ { 'n': 'user_id', 't': 'user_id_or_name' }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] } ], FeedbackInfo_f = [ { 'n': 'count', 't': 'int', 'v': 'public' }, { 'n': 'score', 't': 'int', 'v': 'public' } ], ForumPost_f = [ { 'n': 'thread_id', 't': 'int', 'v': 'public' }, { 'n': 'post_id', 't': 'int', 'v': 'public' }, { 'n': 'post', 't': 'string', 'v': 'public' }, { 'n': 'user_id', 't': 'string', 'v': 'public' }, { 'n': 'last_edit_time', 't': 'int', 'v': 'public' }, { 'n': 'create_date', 't': 'int', 'v': 'public' } ], ForumPost_m = [ { 'n': 'findTreasuryComments', 'u': '/treasuries/:treasury_key/comments', 'o': false, 'p': [ { 'n': 'treasury_key', 't': 'treasury_id', 'r': true }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] }, { 'n': 'postTreasuryComment', 'u': '/treasuries/:treasury_key/comments', 'm': 'POST', 's': 'treasury_w', 'p': [{ 'n': 'message', 't': 'forum_post', 'r': true }] }, { 'n': 'deleteTreasuryComment', 'u': '/treasuries/:treasury_key/comments/:comment_id', 'm': 'DELETE', 's': 'treasury_w' } ], Guest_f = [ { 'n': 'guest_id', 't': 'guest_id', 'v': 'public' }, { 'n': 'checkout_url', 't': 'string', 'v': 'public' } ], Guest_m = [ { 'n': 'getGuest', 'u': '/guests/:guest_id', 'o': false, 'p': [{ 'n': 'guest_id', 't': 'guest_id', 'r': true }] }, { 'n': 'generateGuest', 'u': '/guests/generator', 'o': false }, { 'n': 'claimGuest', 'u': '/guests/:guest_id/claim', 'm': 'POST', 's': 'cart_rw', 'p': [{ 'n': 'guest_id', 't': 'guest_id', 'r': true }] }, { 'n': 'mergeGuest', 'u': '/guests/:guest_id/merge', 'm': 'POST', 'p': [ { 'n': 'guest_id', 't': 'guest_id', 'r': true }, { 'n': 'target_guest_id', 't': 'guest_id', 'r': true } ] } ], GuestCart_f = [ { 'n': 'cart_id', 't': 'int', 'v': 'public' }, { 'n': 'shop_name', 't': 'string', 'v': 'public' }, { 'n': 'message_to_seller', 't': 'string', 'v': 'public' }, { 'n': 'destination_country_id', 't': 'int', 'v': 'public' }, { 'n': 'coupon_code', 't': 'string', 'v': 'public' }, { 'n': 'currency_code', 't': 'string', 'v': 'public' }, { 'n': 'total', 't': 'string', 'v': 'public' }, { 'n': 'subtotal', 't': 'string', 'v': 'public' }, { 'n': 'shipping_cost', 't': 'string', 'v': 'public' }, { 'n': 'tax_cost', 't': 'string', 'v': 'public' }, { 'n': 'discount_amount', 't': 'string', 'v': 'public' }, { 'n': 'shipping_discount_amount', 't': 'string', 'v': 'public' }, { 'n': 'tax_discount_amount', 't': 'string', 'v': 'public' }, { 'n': 'url', 't': 'string', 'v': 'public' }, { 'n': 'listings', 't': 'array(CartListing)', 'v': 'public' }, { 'n': 'shipping_option', 't': 'ShippingOption', 'v': 'public' } ], GuestCart_a = [ { 'n': 'Shop', 't': 'Shop', 'v': 'public' }, { 'n': 'Listings', 't': 'array(Listing)', 'v': 'public' }, { 'n': 'Coupon', 't': 'Coupon', 'v': 'public' }, { 'n': 'ShippingOptions', 't': 'array(ShippingOption)', 'v': 'public' } ], GuestCart_m = [ { 'n': 'findAllGuestCarts', 'u': '/guests/:guest_id/carts', 'o': false, 'p': [{ 'n': 'guest_id', 't': 'guest_id', 'r': true }] }, { 'n': 'addToGuestCart', 'u': '/guests/:guest_id/carts', 'm': 'POST', 'o': false, 'p': [ { 'n': 'guest_id', 't': 'guest_id', 'r': true }, { 'n': 'listing_id', 't': 'int', 'r': true }, { 'n': 'quantity', 't': 'int', 'd': '1' }, { 'n': 'selected_variations', 't': 'map(int, int)' } ] }, { 'n': 'updateGuestCartListingQuantity', 'u': '/guests/:guest_id/carts', 'm': 'PUT', 'o': false, 'p': [ { 'n': 'guest_id', 't': 'guest_id', 'r': true }, { 'n': 'listing_id', 't': 'int', 'r': true }, { 'n': 'quantity', 't': 'int', 'r': true }, { 'n': 'listing_customization_id', 't': 'int', 'd': '0' } ] }, { 'n': 'removeGuestCartListing', 'u': '/guests/:guest_id/carts', 'm': 'DELETE', 'o': false, 'p': [ { 'n': 'guest_id', 't': 'guest_id', 'r': true }, { 'n': 'listing_id', 't': 'int', 'r': true }, { 'n': 'listing_customization_id', 't': 'int', 'd': '0' } ] }, { 'n': 'findGuestCart', 'u': '/guests/:guest_id/carts/:cart_id', 'o': false, 'p': [ { 'n': 'guest_id', 't': 'guest_id', 'r': true }, { 'n': 'cart_id', 't': 'cart_id', 'r': true } ] }, { 'n': 'updateGuestCart', 'u': '/guests/:guest_id/carts/:cart_id', 'm': 'PUT', 'o': false, 'p': [ { 'n': 'guest_id', 't': 'guest_id', 'r': true }, { 'n': 'cart_id', 't': 'cart_id', 'r': true }, { 'n': 'destination_country_id', 't': 'int' }, { 'n': 'message_to_seller', 't': 'string' }, { 'n': 'coupon_code', 't': 'string' } ] }, { 'n': 'deleteGuestCart', 'u': '/guests/:guest_id/carts/:cart_id', 'm': 'DELETE', 'o': false, 'p': [ { 'n': 'guest_id', 't': 'guest_id', 'r': true }, { 'n': 'cart_id', 't': 'cart_id', 'r': true } ] } ], ImageType_f = [ { 'n': 'code', 't': 'string', 'v': 'public' }, { 'n': 'desc', 't': 'string', 'v': 'public' }, { 'n': 'sizes', 't': 'string', 'v': 'public' } ], ImageType_m = [{ 'n': 'listImageTypes', 'u': '/image_types', 'o': false }], Ledger_f = [ { 'n': 'ledger_id', 't': 'int', 's': 'transactions_r' }, { 'n': 'shop_id', 't': 'string', 's': 'transactions_r' }, { 'n': 'currency', 't': 'string', 's': 'transactions_r' }, { 'n': 'create_date', 't': 'int', 's': 'transactions_r' }, { 'n': 'update_date', 't': 'int', 's': 'transactions_r' } ], Ledger_m = [{ 'n': 'findLedger', 'u': '/shops/:shop_id/ledger/', 's': 'transactions_r', 'p': [{ 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }] }], LedgerEntry_f = [ { 'n': 'ledger_entry_id', 't': 'int', 's': 'transactions_r' }, { 'n': 'ledger_id', 't': 'int', 's': 'transactions_r' }, { 'n': 'sequence', 't': 'int', 's': 'transactions_r' }, { 'n': 'credit_amount', 't': 'int', 's': 'transactions_r' }, { 'n': 'debit_amount', 't': 'int', 's': 'transactions_r' }, { 'n': 'entry_type', 't': 'string', 's': 'transactions_r' }, { 'n': 'reference_id', 't': 'int', 's': 'transactions_r' }, { 'n': 'running_balance', 't': 'int', 's': 'transactions_r' }, { 'n': 'create_date', 't': 'int', 's': 'transactions_r' } ], LedgerEntry_m = [{ 'n': 'findLedgerEntries', 'u': '/shops/:shop_id/ledger/entries', 's': 'transactions_r', 'p': [ { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }, { 'n': 'min_created', 't': 'epoch' }, { 'n': 'max_created', 't': 'epoch' }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] }], Listing_f = [ { 'n': 'listing_id', 't': 'int', 'v': 'public' }, { 'n': 'state', 't': 'string', 'v': 'public' }, { 'n': 'user_id', 't': 'int', 'v': 'public' }, { 'n': 'category_id', 't': 'int', 'v': 'public' }, { 'n': 'title', 't': 'string', 'v': 'public' }, { 'n': 'description', 't': 'string', 'v': 'public' }, { 'n': 'creation_tsz', 't': 'float', 'v': 'public' }, { 'n': 'ending_tsz', 't': 'float', 'v': 'public' }, { 'n': 'original_creation_tsz', 't': 'float', 'v': 'public' }, { 'n': 'last_modified_tsz', 't': 'float', 'v': 'public' }, { 'n': 'price', 't': 'string', 'v': 'public' }, { 'n': 'currency_code', 't': 'string', 'v': 'public' }, { 'n': 'quantity', 't': 'int', 'v': 'public' }, { 'n': 'tags', 't': 'string', 'v': 'public' }, { 'n': 'category_path', 't': 'string', 'v': 'public' }, { 'n': 'category_path_ids', 't': 'int', 'v': 'public' }, { 'n': 'materials', 't': 'string', 'v': 'public' }, { 'n': 'shop_section_id', 't': 'int', 'v': 'public' }, { 'n': 'featured_rank', 't': 'featured_rank', 'v': 'public' }, { 'n': 'state_tsz', 't': 'float', 'v': 'public' }, { 'n': 'url', 't': 'string', 'v': 'public' }, { 'n': 'views', 't': 'int', 'v': 'public' }, { 'n': 'num_favorers', 't': 'int', 'v': 'public' }, { 'n': 'shipping_template_id', 't': 'int', 'v': 'public' }, { 'n': 'shipping_profile_id', 't': 'int', 'v': 'public' }, { 'n': 'processing_min', 't': 'int', 'v': 'public' }, { 'n': 'processing_max', 't': 'int', 'v': 'public' }, { 'n': 'who_made', 't': 'enum', 'v': 'public' }, { 'n': 'is_supply', 't': 'boolean', 'v': 'public' }, { 'n': 'when_made', 't': 'enum', 'v': 'public' }, { 'n': 'is_private', 't': 'boolean', 'v': 'public' }, { 'n': 'recipient', 't': 'enum', 'v': 'public' }, { 'n': 'occasion', 't': 'enum', 'v': 'public' }, { 'n': 'style', 't': 'string', 'v': 'public' }, { 'n': 'non_taxable', 't': 'boolean', 'v': 'public' }, { 'n': 'is_customizable', 't': 'boolean', 'v': 'public' }, { 'n': 'is_digital', 't': 'boolean', 'v': 'public' }, { 'n': 'file_data', 't': 'string', 'v': 'public' }, { 'n': 'has_variations', 't': 'boolean', 'v': 'public' }, { 'n': 'language', 't': 'language', 'v': 'public' } ], Listing_a = [ { 'n': 'User', 't': 'User', 'v': 'public' }, { 'n': 'Shop', 't': 'Shop', 'v': 'public' }, { 'n': 'Section', 't': 'ShopSection', 'v': 'public' }, { 'n': 'Images', 't': 'array(ListingImage)', 'v': 'public' }, { 'n': 'MainImage', 't': 'ListingImage', 'v': 'public' }, { 'n': 'ShippingInfo', 't': 'array(ShippingInfo)', 'v': 'public' }, { 'n': 'ShippingTemplate', 't': 'ShippingTemplate', 'v': 'public' }, { 'n': 'ShippingUpgrades', 't': 'array(ShippingUpgrade)', 'v': 'public' }, { 'n': 'PaymentInfo', 't': 'array(PaymentTemplate)', 'v': 'public' }, { 'n': 'Translations', 't': 'array(ListingTranslation)', 'v': 'public' }, { 'n': 'Manufacturers', 't': 'array(Manufacturer)', 'v': 'public' }, { 'n': 'Variations', 't': 'array(Variations_Property)', 'v': 'public' } ], Listing_m = [ { 'n': 'createListing', 'u': '/listings', 'm': 'POST', 's': 'listings_w', 'p': [ { 'n': 'quantity', 't': 'int', 'r': true }, { 'n': 'title', 't': 'string', 'r': true }, { 'n': 'description', 't': 'text', 'r': true }, { 'n': 'price', 't': 'float', 'r': true }, { 'n': 'materials', 't': 'array(string)' }, { 'n': 'shipping_template_id', 't': 'int' }, { 'n': 'shop_section_id', 't': 'int' }, { 'n': 'image_ids', 't': 'array(int)' }, { 'n': 'is_customizable', 't': 'boolean' }, { 'n': 'non_taxable', 't': 'boolean' }, { 'n': 'image', 't': 'image' }, { 'n': 'state', 't': 'enum(active, draft)', 'd': 'active' }, { 'n': 'processing_min', 't': 'int' }, { 'n': 'processing_max', 't': 'int' }, { 'n': 'category_id', 't': 'int', 'r': true }, { 'n': 'tags', 't': 'array(string)' }, { 'n': 'who_made', 't': 'enum(i_did, collective, someone_else)', 'r': true }, { 'n': 'is_supply', 't': 'boolean', 'r': true }, { 'n': 'when_made', 't': 'enum(made_to_order, 2010_2014, 2000_2009, 1995_1999, before_1995, 1990_1994, 1980s, 1970s, 1960s, 1950s, 1940s, 1930s, 1920s, 1910s, 1900s, 1800s, 1700s, before_1700)', 'r': true }, { 'n': 'recipient', 't': 'enum(men, women, unisex_adults, teen_boys, teen_girls, teens, boys, girls, children, baby_boys, baby_girls, babies, birds, cats, dogs, pets)' }, { 'n': 'occasion', 't': 'enum(anniversary, baptism, bar_or_bat_mitzvah, birthday, canada_day, chinese_new_year, cinco_de_mayo, confirmation, christmas, day_of_the_dead, easter, eid, engagement, fathers_day, get_well, graduation, halloween, hanukkah, housewarming, kwanzaa, prom, july_4th, mothers_day, new_baby, new_years, quinceanera, retirement, st_patricks_day, sweet_16, sympathy, thanksgiving, valentines, wedding)' }, { 'n': 'style', 't': 'array(string)' } ] }, { 'n': 'findAllFeaturedListings', 'u': '/featured_treasuries/listings', 'o': false, 'p': [ { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' }, { 'n': 'region', 't': 'region', 'd': '__ALL_REGIONS__' } ] }, { 'n': 'getListing', 'u': '/listings/:listing_id', 'o': false, 'p': [{ 'n': 'listing_id', 't': 'array(int)', 'r': true }] }, { 'n': 'updateListing', 'u': '/listings/:listing_id', 'm': 'PUT', 's': 'listings_w', 'p': [ { 'n': 'listing_id', 't': 'int', 'r': true }, { 'n': 'quantity', 't': 'int' }, { 'n': 'title', 't': 'string' }, { 'n': 'description', 't': 'text' }, { 'n': 'price', 't': 'float' }, { 'n': 'wholesale_price', 't': 'float' }, { 'n': 'materials', 't': 'array(string)' }, { 'n': 'renew', 't': 'boolean' }, { 'n': 'shipping_template_id', 't': 'int' }, { 'n': 'shop_section_id', 't': 'int' }, { 'n': 'state', 't': 'enum(active, inactive, draft)', 'd': 'active' }, { 'n': 'image_ids', 't': 'array(int)' }, { 'n': 'is_customizable', 't': 'boolean' }, { 'n': 'non_taxable', 't': 'boolean' }, { 'n': 'category_id', 't': 'int' }, { 'n': 'tags', 't': 'array(string)' }, { 'n': 'who_made', 't': 'enum(i_did, collective, someone_else)' }, { 'n': 'is_supply', 't': 'boolean' }, { 'n': 'when_made', 't': 'enum(made_to_order, 2010_2014, 2000_2009, 1995_1999, before_1995, 1990_1994, 1980s, 1970s, 1960s, 1950s, 1940s, 1930s, 1920s, 1910s, 1900s, 1800s, 1700s, before_1700)' }, { 'n': 'recipient', 't': 'enum(men, women, unisex_adults, teen_boys, teen_girls, teens, boys, girls, children, baby_boys, baby_girls, babies, birds, cats, dogs, pets)' }, { 'n': 'occasion', 't': 'enum(anniversary, baptism, bar_or_bat_mitzvah, birthday, canada_day, chinese_new_year, cinco_de_mayo, confirmation, christmas, day_of_the_dead, easter, eid, engagement, fathers_day, get_well, graduation, halloween, hanukkah, housewarming, kwanzaa, prom, july_4th, mothers_day, new_baby, new_years, quinceanera, retirement, st_patricks_day, sweet_16, sympathy, thanksgiving, valentines, wedding)' }, { 'n': 'style', 't': 'array(string)' }, { 'n': 'processing_min', 't': 'int' }, { 'n': 'processing_max', 't': 'int' }, { 'n': 'featured_rank', 't': 'featured_rank' } ] }, { 'n': 'deleteListing', 'u': '/listings/:listing_id', 'm': 'DELETE', 's': 'listings_d', 'p': [{ 'n': 'listing_id', 't': 'int', 'r': true }] }, { 'n': 'findAllListingActive', 'u': '/listings/active', 'o': false, 'p': [ { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' }, { 'n': 'keywords', 't': 'text' }, { 'n': 'sort_on', 't': 'enum(created, price, score)', 'd': 'created' }, { 'n': 'sort_order', 't': 'enum(up, down)', 'd': 'down' }, { 'n': 'min_price', 't': 'float' }, { 'n': 'max_price', 't': 'float' }, { 'n': 'color', 't': 'color_triplet' }, { 'n': 'color_accuracy', 't': 'color_wiggle', 'd': '0' }, { 'n': 'tags', 't': 'array(string)' }, { 'n': 'category', 't': 'category' }, { 'n': 'location', 't': 'string' }, { 'n': 'lat', 't': 'latitude' }, { 'n': 'lon', 't': 'longitude' }, { 'n': 'region', 't': 'region' }, { 'n': 'geo_level', 't': 'enum(city, state, country)', 'd': 'city' }, { 'n': 'accepts_gift_cards', 't': 'boolean', 'd': 'false' }, { 'n': 'translate_keywords', 't': 'boolean', 'd': 'false' } ] }, { 'n': 'getInterestingListings', 'u': '/listings/interesting', 'o': false, 'p': [ { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] }, { 'n': 'getTrendingListings', 'u': '/listings/trending', 'o': false, 'p': [ { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] }, { 'n': 'findBrowseSegmentListings', 'u': '/segments/listings', 'o': false, 'p': [ { 'n': 'path', 't': 'string', 'r': true }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' }, { 'n': 'keywords', 't': 'text' }, { 'n': 'sort_on', 't': 'enum(created, price, score)', 'd': 'created' }, { 'n': 'sort_order', 't': 'enum(up, down)', 'd': 'down' }, { 'n': 'min_price', 't': 'float' }, { 'n': 'max_price', 't': 'float' }, { 'n': 'ship_to', 't': 'string' }, { 'n': 'location', 't': 'string' }, { 'n': 'lat', 't': 'latitude' }, { 'n': 'lon', 't': 'longitude' }, { 'n': 'geo_level', 't': 'enum(city, state, country)', 'd': 'city' }, { 'n': 'accepts_gift_cards', 't': 'boolean', 'd': 'false' } ] }, { 'n': 'findAllListingsForFeaturedTreasuryId', 'u': '/featured_treasuries/:featured_treasury_id/listings', 'o': false, 'p': [{ 'n': 'featured_treasury_id', 't': 'int', 'r': true }] }, { 'n': 'findAllActiveListingsForFeaturedTreasuryId', 'u': '/featured_treasuries/:featured_treasury_id/listings/active', 'o': false, 'p': [{ 'n': 'featured_treasury_id', 't': 'int', 'r': true }] }, { 'n': 'findAllCurrentFeaturedListings', 'u': '/featured_treasuries/listings/homepage_current', 'o': false, 'p': [{ 'n': 'region', 't': 'region', 'd': 'US' }] }, { 'n': 'findAllReceiptListings', 'u': '/receipts/:receipt_id/listings', 's': 'transactions_r', 'p': [ { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' }, { 'n': 'receipt_id', 't': 'int', 'r': true } ] }, { 'n': 'findAllShopListingsActive', 'u': '/shops/:shop_id/listings/active', 'o': false, 'p': [ { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' }, { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }, { 'n': 'keywords', 't': 'string' }, { 'n': 'sort_on', 't': 'enum(created, price, score)', 'd': 'created' }, { 'n': 'sort_order', 't': 'enum(up, down)', 'd': 'down' }, { 'n': 'min_price', 't': 'float' }, { 'n': 'max_price', 't': 'float' }, { 'n': 'color', 't': 'color_triplet' }, { 'n': 'color_accuracy', 't': 'color_wiggle', 'd': '0' }, { 'n': 'tags', 't': 'array(string)' }, { 'n': 'category', 't': 'category' }, { 'n': 'translate_keywords', 't': 'boolean', 'd': 'false' }, { 'n': 'include_private', 't': 'boolean', 'd': '0' } ] }, { 'n': 'findAllShopListingsDraft', 'u': '/shops/:shop_id/listings/draft', 's': 'listings_r', 'p': [ { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] }, { 'n': 'findAllShopListingsExpired', 'u': '/shops/:shop_id/listings/expired', 's': 'listings_r', 'p': [ { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] }, { 'n': 'getShopListingExpired', 'u': '/shops/:shop_id/listings/expired/:listing_id', 's': 'listings_r', 'p': [ { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }, { 'n': 'listing_id', 't': 'int', 'r': true } ] }, { 'n': 'findAllShopListingsFeatured', 'u': '/shops/:shop_id/listings/featured', 'o': false, 'p': [ { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] }, { 'n': 'findAllShopListingsInactive', 'u': '/shops/:shop_id/listings/inactive', 's': 'listings_r', 'p': [ { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] }, { 'n': 'getShopListingInactive', 'u': '/shops/:shop_id/listings/inactive/:listing_id', 's': 'listings_r', 'p': [ { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }, { 'n': 'listing_id', 't': 'int', 'r': true } ] }, { 'n': 'findAllShopSectionListings', 'u': '/shops/:shop_id/sections/:shop_section_id/listings', 'o': false, 'p': [ { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' }, { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }, { 'n': 'shop_section_id', 't': 'int', 'r': true } ] }, { 'n': 'findAllShopSectionListingsActive', 'u': '/shops/:shop_id/sections/:shop_section_id/listings/active', 'o': false, 'p': [ { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' }, { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }, { 'n': 'shop_section_id', 't': 'array(int)', 'r': true }, { 'n': 'sort_on', 't': 'enum(created, price)', 'd': 'created' }, { 'n': 'sort_order', 't': 'enum(up, down)', 'd': 'down' } ] }, { 'n': 'findAllCartListings', 'u': '/users/:user_id/carts/:cart_id/listings', 's': 'cart_rw', 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'cart_id', 't': 'cart_id', 'r': true } ] } ], ListingFile_f = [ { 'n': 'listing_file_id', 't': 'int', 'v': 'public' }, { 'n': 'listing_id', 't': 'int', 'v': 'public' }, { 'n': 'rank', 't': 'int', 'v': 'public' }, { 'n': 'filename', 't': 'string', 'v': 'public' }, { 'n': 'filesize', 't': 'string', 'v': 'public' }, { 'n': 'size_bytes', 't': 'int', 'v': 'public' }, { 'n': 'filetype', 't': 'string', 'v': 'public' }, { 'n': 'create_date', 't': 'int', 'v': 'public' } ], ListingFile_m = [ { 'n': 'findAllListingFiles', 'u': '/listings/:listing_id/files', 's': 'listings_r', 'p': [{ 'n': 'listing_id', 't': 'int', 'r': true }] }, { 'n': 'uploadListingFile', 'u': '/listings/:listing_id/files', 'm': 'POST', 's': 'listings_w', 'p': [ { 'n': 'listing_id', 't': 'int', 'r': true }, { 'n': 'listing_file_id', 't': 'int' }, { 'n': 'file', 't': 'imagefile' }, { 'n': 'name', 't': 'string' }, { 'n': 'rank', 't': 'int', 'd': '1' } ] }, { 'n': 'findListingFile', 'u': '/listings/:listing_id/files/:listing_file_id', 's': 'listings_r', 'p': [ { 'n': 'listing_id', 't': 'int', 'r': true }, { 'n': 'listing_file_id', 't': 'int', 'r': true } ] }, { 'n': 'deleteListingFile', 'u': '/listings/:listing_id/files/:listing_file_id', 'm': 'DELETE', 's': 'listings_w', 'p': [ { 'n': 'listing_id', 't': 'int', 'r': true }, { 'n': 'listing_file_id', 't': 'int', 'r': true } ] } ], ListingImage_f = [ { 'n': 'listing_image_id', 't': 'int', 'v': 'public' }, { 'n': 'hex_code', 't': 'string', 'v': 'public' }, { 'n': 'red', 't': 'int', 'v': 'public' }, { 'n': 'green', 't': 'int', 'v': 'public' }, { 'n': 'blue', 't': 'int', 'v': 'public' }, { 'n': 'hue', 't': 'int', 'v': 'public' }, { 'n': 'saturation', 't': 'int', 'v': 'public' }, { 'n': 'brightness', 't': 'int', 'v': 'public' }, { 'n': 'is_black_and_white', 't': 'boolean', 'v': 'public' }, { 'n': 'creation_tsz', 't': 'float', 'v': 'public' }, { 'n': 'listing_id', 't': 'int', 'v': 'public' }, { 'n': 'rank', 't': 'int', 'v': 'public' }, { 'n': 'url_75x75', 't': 'string', 'v': 'public' }, { 'n': 'url_170x135', 't': 'string', 'v': 'public' }, { 'n': 'url_570xN', 't': 'string', 'v': 'public' }, { 'n': 'url_fullxfull', 't': 'string', 'v': 'public' }, { 'n': 'full_height', 't': 'int', 'v': 'public' }, { 'n': 'full_width', 't': 'int', 'v': 'public' } ], ListingImage_a = [{ 'n': 'Listing', 't': 'Listing', 'v': 'public' }], ListingImage_m = [ { 'n': 'findAllListingImages', 'u': '/listings/:listing_id/images', 'o': false, 'p': [{ 'n': 'listing_id', 't': 'int', 'r': true }] }, { 'n': 'uploadListingImage', 'u': '/listings/:listing_id/images', 'm': 'POST', 's': 'listings_w', 'p': [ { 'n': 'listing_id', 't': 'int', 'r': true }, { 'n': 'listing_image_id', 't': 'int' }, { 'n': 'image', 't': 'imagefile' }, { 'n': 'rank', 't': 'int', 'd': '1' }, { 'n': 'overwrite', 't': 'boolean', 'd': '0' } ] }, { 'n': 'getImage_Listing', 'u': '/listings/:listing_id/images/:listing_image_id', 'o': false, 'p': [ { 'n': 'listing_image_id', 't': 'array(int)', 'r': true }, { 'n': 'listing_id', 't': 'int', 'r': true } ] }, { 'n': 'deleteListingImage', 'u': '/listings/:listing_id/images/:listing_image_id', 'm': 'DELETE', 's': 'listings_w', 'p': [ { 'n': 'listing_id', 't': 'int', 'r': true }, { 'n': 'listing_image_id', 't': 'int', 'r': true } ] } ], ListingTranslation_f = [ { 'n': 'listing_id', 't': 'int', 'v': 'public' }, { 'n': 'language', 't': 'language', 'v': 'public' }, { 'n': 'title', 't': 'string', 'v': 'public' }, { 'n': 'description', 't': 'string', 'v': 'public' }, { 'n': 'tags', 't': 'string', 'v': 'public' } ], ListingTranslation_m = [ { 'n': 'getListingTranslation', 'u': '/listings/:listing_id/translations/:language', 'o': false, 'p': [ { 'n': 'listing_id', 't': 'int', 'r': true }, { 'n': 'language', 't': 'language', 'r': true } ] }, { 'n': 'createListingTranslation', 'u': '/listings/:listing_id/translations/:language', 'm': 'POST', 's': 'listings_w', 'p': [ { 'n': 'listing_id', 't': 'int', 'r': true }, { 'n': 'language', 't': 'language', 'r': true }, { 'n': 'title', 't': 'string' }, { 'n': 'description', 't': 'string' }, { 'n': 'tags', 't': 'array(string)' } ] }, { 'n': 'updateListingTranslation', 'u': '/listings/:listing_id/translations/:language', 'm': 'PUT', 's': 'listings_w', 'p': [ { 'n': 'listing_id', 't': 'int', 'r': true }, { 'n': 'language', 't': 'language', 'r': true }, { 'n': 'title', 't': 'string' }, { 'n': 'description', 't': 'string' }, { 'n': 'tags', 't': 'array(string)' } ] }, { 'n': 'deleteListingTranslation', 'u': '/listings/:listing_id/translations/:language', 'm': 'DELETE', 's': 'listings_d', 'p': [ { 'n': 'listing_id', 't': 'int', 'r': true }, { 'n': 'language', 't': 'language', 'r': true } ] } ], Manufacturer_f = [ { 'n': 'name', 't': 'string', 'v': 'public' }, { 'n': 'description', 't': 'string', 'v': 'public' }, { 'n': 'location', 't': 'string', 'v': 'public' } ], Manufacturer_a = [{ 'n': 'Shop', 't': 'Shop', 'v': 'public' }], ParamList_f = [{ 'n': 'param_name', 't': 'string', 'v': 'public' }], Payment_f = [ { 'n': 'payment_id', 't': 'int', 's': 'transactions_r' }, { 'n': 'buyer_user_id', 't': 'int', 's': 'transactions_r' }, { 'n': 'shop_id', 't': 'int', 's': 'transactions_r' }, { 'n': 'receipt_id', 't': 'int', 's': 'transactions_r' }, { 'n': 'amount_gross', 't': 'int', 's': 'transactions_r' }, { 'n': 'amount_fees', 't': 'int', 's': 'transactions_r' }, { 'n': 'amount_net', 't': 'int', 's': 'transactions_r' }, { 'n': 'posted_gross', 't': 'int', 's': 'transactions_r' }, { 'n': 'posted_fees', 't': 'int', 's': 'transactions_r' }, { 'n': 'posted_net', 't': 'int', 's': 'transactions_r' }, { 'n': 'adjusted_gross', 't': 'int', 's': 'transactions_r' }, { 'n': 'adjusted_fees', 't': 'int', 's': 'transactions_r' }, { 'n': 'adjusted_net', 't': 'int', 's': 'transactions_r' }, { 'n': 'currency', 't': 'string', 's': 'transactions_r' }, { 'n': 'shipping_user_id', 't': 'int', 's': 'transactions_r' }, { 'n': 'shipping_address_id', 't': 'int', 's': 'transactions_r' }, { 'n': 'billing_address_id', 't': 'int', 's': 'transactions_r' }, { 'n': 'status', 't': 'string', 's': 'transactions_r' }, { 'n': 'shipped_date', 't': 'int', 's': 'transactions_r' }, { 'n': 'create_date', 't': 'int', 's': 'transactions_r' }, { 'n': 'update_date', 't': 'int', 's': 'transactions_r' } ], Payment_m = [ { 'n': 'findPayment', 'u': '/payments/:payment_id', 's': 'transactions_r', 'p': [{ 'n': 'payment_id', 't': 'array(int)', 'r': true }] }, { 'n': 'findShopPaymentByReceipt', 'u': '/shops/:shop_id/receipts/:receipt_id/payments', 's': 'transactions_r', 'p': [ { 'n': 'receipt_id', 't': 'int', 'r': true }, { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true } ] } ], PaymentAdjustment_f = [ { 'n': 'payment_adjustment_id', 't': 'int', 's': 'transactions_r' }, { 'n': 'payment_id', 't': 'int', 's': 'transactions_r' }, { 'n': 'status', 't': 'string', 's': 'transactions_r' }, { 'n': 'user_id', 't': 'int', 's': 'transactions_r' }, { 'n': 'reason_code', 't': 'string', 's': 'transactions_r' }, { 'n': 'total_adjustment_amount', 't': 'int', 's': 'transactions_r' }, { 'n': 'total_fee_adjustment_amount', 't': 'int', 's': 'transactions_r' }, { 'n': 'create_date', 't': 'int', 's': 'transactions_r' }, { 'n': 'update_date', 't': 'int', 's': 'transactions_r' } ], PaymentAdjustment_m = [ { 'n': 'findPaymentAdjustments', 'u': '/payments/:payment_id/adjustments', 's': 'transactions_r', 'p': [ { 'n': 'payment_id', 't': 'int', 'r': true }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] }, { 'n': 'findPaymentAdjustment', 'u': '/payments/:payment_id/adjustments/:payment_adjustment_id', 's': 'transactions_r', 'p': [ { 'n': 'payment_id', 't': 'int', 'r': true }, { 'n': 'payment_adjustment_id', 't': 'int', 'r': true } ] } ], PaymentAdjustmentItem_f = [ { 'n': 'payment_adjustment_item_id', 't': 'int', 's': 'transactions_r' }, { 'n': 'payment_adjustment_id', 't': 'int', 's': 'transactions_r' }, { 'n': 'adjustment_type', 't': 'string', 's': 'transactions_r' }, { 'n': 'amount', 't': 'int', 's': 'transactions_r' }, { 'n': 'transaction_id', 't': 'int', 's': 'transactions_r' }, { 'n': 'create_date', 't': 'int', 's': 'transactions_r' } ], PaymentAdjustmentItem_m = [ { 'n': 'findPaymentAdjustmentItem', 'u': '/payments/:payment_id/adjustments/:payment_adjustment_id/items', 's': 'transactions_r', 'p': [ { 'n': 'payment_id', 't': 'int', 'r': true }, { 'n': 'payment_adjustment_id', 't': 'int', 'r': true }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] }, { 'n': 'findPaymentAdjustmentItem', 'u': '/payments/:payment_id/adjustments/:payment_adjustment_id/items/:payment_adjustment_item_id', 's': 'transactions_r', 'p': [ { 'n': 'payment_id', 't': 'int', 'r': true }, { 'n': 'payment_adjustment_id', 't': 'int', 'r': true }, { 'n': 'payment_adjustment_item_id', 't': 'int', 'r': true } ] } ], PaymentTemplate_f = [ { 'n': 'payment_template_id', 't': 'int', 'v': 'public' }, { 'n': 'allow_bt', 't': 'boolean', 'v': 'public' }, { 'n': 'allow_check', 't': 'boolean', 'v': 'public' }, { 'n': 'allow_mo', 't': 'boolean', 'v': 'public' }, { 'n': 'allow_other', 't': 'boolean', 'v': 'public' }, { 'n': 'allow_paypal', 't': 'boolean', 'v': 'public' }, { 'n': 'allow_cc', 't': 'boolean', 'v': 'public' }, { 'n': 'paypal_email', 't': 'string', 's': 'listings_r' }, { 'n': 'name', 't': 'string', 's': 'listings_r' }, { 'n': 'first_line', 't': 'string', 's': 'listings_r' }, { 'n': 'second_line', 't': 'string', 's': 'listings_r' }, { 'n': 'city', 't': 'string', 's': 'listings_r' }, { 'n': 'state', 't': 'string', 's': 'listings_r' }, { 'n': 'zip', 't': 'string', 's': 'listings_r' }, { 'n': 'country_id', 't': 'int', 's': 'listings_r' }, { 'n': 'user_id', 't': 'int', 's': 'listings_r' }, { 'n': 'listing_payment_id', 't': 'int', 'v': 'public' } ], PaymentTemplate_a = [ { 'n': 'Country', 't': 'Country', 's': 'listings_r' }, { 'n': 'User', 't': 'User', 's': 'listings_r' } ], PaymentTemplate_m = [ { 'n': 'findShopPaymentTemplates', 'u': '/shops/:shop_id/payment_templates', 'o': false, 'p': [{ 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }] }, { 'n': 'createShopPaymentTemplate', 'u': '/shops/:shop_id/payment_templates', 'm': 'POST', 's': 'listings_w', 'p': [ { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }, { 'n': 'allow_check', 't': 'boolean' }, { 'n': 'allow_mo', 't': 'boolean' }, { 'n': 'allow_other', 't': 'boolean' }, { 'n': 'allow_paypal', 't': 'boolean' }, { 'n': 'allow_cc', 't': 'boolean' }, { 'n': 'paypal_email', 't': 'string' }, { 'n': 'name', 't': 'string' }, { 'n': 'first_line', 't': 'string' }, { 'n': 'second_line', 't': 'string' }, { 'n': 'city', 't': 'string' }, { 'n': 'state', 't': 'string' }, { 'n': 'zip', 't': 'string' }, { 'n': 'country_id', 't': 'int' } ] }, { 'n': 'updateShopPaymentTemplate', 'u': '/shops/:shop_id/payment_templates/:payment_template_id', 'm': 'PUT', 's': 'listings_w', 'p': [ { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }, { 'n': 'allow_check', 't': 'boolean' }, { 'n': 'allow_mo', 't': 'boolean' }, { 'n': 'allow_other', 't': 'boolean' }, { 'n': 'allow_paypal', 't': 'boolean' }, { 'n': 'allow_cc', 't': 'boolean' }, { 'n': 'paypal_email', 't': 'string' }, { 'n': 'name', 't': 'string' }, { 'n': 'first_line', 't': 'string' }, { 'n': 'second_line', 't': 'string' }, { 'n': 'city', 't': 'string' }, { 'n': 'state', 't': 'string' }, { 'n': 'zip', 't': 'string' }, { 'n': 'country_id', 't': 'int' }, { 'n': 'payment_template_id', 't': 'int', 'r': true } ] }, { 'n': 'findAllUserPaymentTemplates', 'u': '/users/:user_id/payments/templates', 's': 'listings_r', 'p': [{ 'n': 'user_id', 't': 'user_id_or_name', 'r': true }] } ], Receipt_f = [ { 'n': 'receipt_id', 't': 'int', 's': 'transactions_r' }, { 'n': 'order_id', 't': 'int', 's': 'transactions_r' }, { 'n': 'seller_user_id', 't': 'int', 's': 'transactions_r' }, { 'n': 'buyer_user_id', 't': 'int', 's': 'transactions_r' }, { 'n': 'creation_tsz', 't': 'float', 's': 'transactions_r' }, { 'n': 'last_modified_tsz', 't': 'float', 's': 'transactions_r' }, { 'n': 'name', 't': 'string', 's': 'transactions_r' }, { 'n': 'first_line', 't': 'string', 's': 'transactions_r' }, { 'n': 'second_line', 't': 'string', 's': 'transactions_r' }, { 'n': 'city', 't': 'string', 's': 'transactions_r' }, { 'n': 'state', 't': 'string', 's': 'transactions_r' }, { 'n': 'zip', 't': 'string', 's': 'transactions_r' }, { 'n': 'country_id', 't': 'int', 's': 'transactions_r' }, { 'n': 'payment_method', 't': 'string', 's': 'transactions_r' }, { 'n': 'payment_email', 't': 'string', 's': 'transactions_r' }, { 'n': 'message_from_seller', 't': 'string', 's': 'transactions_r' }, { 'n': 'message_from_buyer', 't': 'string', 's': 'transactions_r' }, { 'n': 'was_paid', 't': 'boolean', 's': 'transactions_r' }, { 'n': 'total_tax_cost', 't': 'float', 's': 'transactions_r' }, { 'n': 'total_price', 't': 'float', 's': 'transactions_r' }, { 'n': 'total_shipping_cost', 't': 'float', 's': 'transactions_r' }, { 'n': 'currency_code', 't': 'string', 's': 'transactions_r' }, { 'n': 'message_from_payment', 't': 'string', 's': 'transactions_r' }, { 'n': 'was_shipped', 't': 'boolean', 's': 'transactions_r' }, { 'n': 'buyer_email', 't': 'string', 's': 'transactions_r' }, { 'n': 'seller_email', 't': 'string', 's': 'transactions_r' }, { 'n': 'discount_amt', 't': 'float', 's': 'transactions_r' }, { 'n': 'subtotal', 't': 'float', 's': 'transactions_r' }, { 'n': 'grandtotal', 't': 'float', 's': 'transactions_r' }, { 'n': 'shipping_tracking_code', 't': 'string', 's': 'transactions_r' }, { 'n': 'shipping_tracking_url', 't': 'string', 's': 'transactions_r' }, { 'n': 'shipping_carrier', 't': 'string', 's': 'transactions_r' }, { 'n': 'shipping_note', 't': 'string', 's': 'transactions_r' }, { 'n': 'shipping_notification_date', 't': 'int', 's': 'transactions_r' }, { 'n': 'shipments', 't': 'array(ReceiptShipment)', 's': 'transactions_r' } ], Receipt_a = [ { 'n': 'Coupon', 't': 'Coupon', 's': 'transactions_r' }, { 'n': 'Country', 't': 'Country', 's': 'transactions_r' }, { 'n': 'Buyer', 't': 'User', 's': 'transactions_r' }, { 'n': 'Seller', 't': 'User', 's': 'transactions_r' }, { 'n': 'Transactions', 't': 'array(Transaction)', 's': 'transactions_r' }, { 'n': 'Listings', 't': 'array(Listing)', 's': 'transactions_r' } ], Receipt_m = [ { 'n': 'getReceipt', 'u': '/receipts/:receipt_id', 's': 'transactions_r', 'p': [{ 'n': 'receipt_id', 't': 'array(int)', 'r': true }] }, { 'n': 'updateReceipt', 'u': '/receipts/:receipt_id', 'm': 'PUT', 's': 'transactions_w', 'p': [ { 'n': 'receipt_id', 't': 'int', 'r': true }, { 'n': 'was_paid', 't': 'boolean' }, { 'n': 'was_shipped', 't': 'boolean' }, { 'n': 'message_from_seller', 't': 'string' }, { 'n': 'message_from_buyer', 't': 'string' } ] }, { 'n': 'findAllShopReceipts', 'u': '/shops/:shop_id/receipts', 's': 'transactions_r', 'p': [ { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }, { 'n': 'min_created', 't': 'epoch' }, { 'n': 'max_created', 't': 'epoch' }, { 'n': 'min_last_modified', 't': 'int' }, { 'n': 'max_last_modified', 't': 'int' }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' }, { 'n': 'was_paid', 't': 'boolean' }, { 'n': 'was_shipped', 't': 'boolean' } ] }, { 'n': 'submitTracking', 'u': '/shops/:shop_id/receipts/:receipt_id/tracking', 'm': 'POST', 's': 'transactions_w', 'p': [ { 'n': 'tracking_code', 't': 'string', 'r': true }, { 'n': 'carrier_name', 't': 'string', 'r': true }, { 'n': 'send_bcc', 't': 'boolean' } ] }, { 'n': 'findAllShopReceiptsByStatus', 'u': '/shops/:shop_id/receipts/:status', 's': 'transactions_r', 'p': [ { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }, { 'n': 'status', 't': 'enum(open, unshipped, unpaid, completed, processing, all)', 'r': true }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] }, { 'n': 'searchAllShopReceipts', 'u': '/shops/:shop_id/receipts/search', 's': 'transactions_r', 'p': [ { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }, { 'n': 'search_query', 't': 'string', 'r': true }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] }, { 'n': 'findAllUserBuyerReceipts', 'u': '/users/:user_id/receipts', 's': 'transactions_r', 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] } ], ReceiptShipment_f = [ { 'n': 'carrier_name', 't': 'string', 's': 'transactions_r' }, { 'n': 'receipt_shipping_id', 't': 'int', 's': 'transactions_r' }, { 'n': 'tracking_code', 't': 'string', 's': 'transactions_r' }, { 'n': 'tracking_url', 't': 'string', 's': 'transactions_r' }, { 'n': 'buyer_note', 't': 'string', 's': 'transactions_r' }, { 'n': 'notification_date', 't': 'int', 's': 'transactions_r' } ], Region_f = [ { 'n': 'region_id', 't': 'int', 'v': 'public' }, { 'n': 'region_name', 't': 'string', 'v': 'public' }, { 'n': 'is_dead', 't': 'boolean', 'v': 'public' } ], Region_m = [ { 'n': 'findAllRegion', 'u': '/regions', 'o': false }, { 'n': 'getRegion', 'u': '/regions/:region_id', 'o': false, 'p': [{ 'n': 'region_id', 't': 'array(int)', 'r': true }] }, { 'n': 'findEligibleRegions', 'u': '/regions/eligible', 'o': false } ], Segment_f = [ { 'n': 'name', 't': 'string', 'v': 'public' }, { 'n': 'path', 't': 'string', 'v': 'public' }, { 'n': 'short_name', 't': 'string', 'v': 'public' }, { 'n': 'has_children', 't': 'boolean', 'v': 'public' }, { 'n': 'image_url', 't': 'string', 'v': 'public' }, { 'n': 'shop_id', 't': 'int', 'v': 'public' }, { 'n': 'shop_name', 't': 'int', 'v': 'public' }, { 'n': 'listing_id', 't': 'int', 'v': 'public' } ], Segment_a = [{ 'n': 'MainImage', 't': 'ListingImage', 'v': 'public' }], Segment_m = [{ 'n': 'findBrowseSegments', 'u': '/segments', 'o': false, 'p': [ { 'n': 'region', 't': 'string', 'd': 'US' }, { 'n': 'path', 't': 'string' } ] }], SegmentPoster_f = [ { 'n': 'name', 't': 'string', 'v': 'public' }, { 'n': 'path', 't': 'string', 'v': 'public' }, { 'n': 'image_url', 't': 'string', 'v': 'public' }, { 'n': 'shop_id', 't': 'int', 'v': 'public' }, { 'n': 'shop_name', 't': 'int', 'v': 'public' }, { 'n': 'weight', 't': 'int', 'v': 'public' }, { 'n': 'listing_id', 't': 'int', 'v': 'public' } ], SegmentPoster_m = [{ 'n': 'findBrowseSegmentPosters', 'u': '/segments/posters', 'o': false, 'p': [{ 'n': 'path', 't': 'string' }] }], ShippingInfo_f = [ { 'n': 'shipping_info_id', 't': 'int', 'v': 'public' }, { 'n': 'origin_country_id', 't': 'int', 'v': 'public' }, { 'n': 'destination_country_id', 't': 'int', 'v': 'public' }, { 'n': 'currency_code', 't': 'string', 'v': 'public' }, { 'n': 'primary_cost', 't': 'float', 'v': 'public' }, { 'n': 'secondary_cost', 't': 'float', 'v': 'public' }, { 'n': 'listing_id', 't': 'int', 'v': 'public' }, { 'n': 'region_id', 't': 'int', 'v': 'public' }, { 'n': 'origin_country_name', 't': 'string', 'v': 'public' }, { 'n': 'destination_country_name', 't': 'string', 'v': 'public' } ], ShippingInfo_a = [ { 'n': 'DestinationCountry', 't': 'Country', 'v': 'public' }, { 'n': 'OriginCountry', 't': 'Country', 'v': 'public' }, { 'n': 'Region', 't': 'Region', 'v': 'public' } ], ShippingInfo_m = [ { 'n': 'findAllListingShippingProfileEntries', 'u': '/listings/:listing_id/shipping/info', 'o': false }, { 'n': 'createShippingInfo', 'u': '/listings/:listing_id/shipping/info', 'm': 'POST', 's': 'listings_w', 'p': [ { 'n': 'destination_country_id', 't': 'int' }, { 'n': 'primary_cost', 't': 'float', 'r': true }, { 'n': 'secondary_cost', 't': 'float', 'r': true }, { 'n': 'region_id', 't': 'int' }, { 'n': 'listing_id', 't': 'int', 'r': true } ] }, { 'n': 'getShippingInfo', 'u': '/shipping/info/:shipping_info_id', 's': 'listings_w', 'p': [{ 'n': 'shipping_info_id', 't': 'array(int)', 'r': true }] }, { 'n': 'updateShippingInfo', 'u': '/shipping/info/:shipping_info_id', 'm': 'PUT', 's': 'listings_w', 'p': [ { 'n': 'shipping_info_id', 't': 'int', 'r': true }, { 'n': 'destination_country_id', 't': 'int' }, { 'n': 'primary_cost', 't': 'float' }, { 'n': 'secondary_cost', 't': 'float' }, { 'n': 'region_id', 't': 'int' }, { 'n': 'listing_id', 't': 'int' } ] }, { 'n': 'deleteShippingInfo', 'u': '/shipping/info/:shipping_info_id', 'm': 'DELETE', 's': 'listings_w', 'p': [{ 'n': 'shipping_info_id', 't': 'int', 'r': true }] } ], ShippingOption_f = [ { 'n': 'shipping_option_id', 't': 'int', 'v': 'public' }, { 'n': 'value', 't': 'string', 'v': 'public' }, { 'n': 'price', 't': 'string', 'v': 'public' }, { 'n': 'currency_code', 't': 'string', 'v': 'public' } ], ShippingTemplate_f = [ { 'n': 'shipping_template_id', 't': 'int', 's': 'listings_r' }, { 'n': 'title', 't': 'string', 's': 'listings_r' }, { 'n': 'user_id', 't': 'int', 's': 'listings_r' }, { 'n': 'min_processing_days', 't': 'int', 's': 'listings_r' }, { 'n': 'max_processing_days', 't': 'int', 's': 'listings_r' }, { 'n': 'processing_days_display_label', 't': 'string', 's': 'listings_r' }, { 'n': 'origin_country_id', 't': 'int', 's': 'listings_r' } ], ShippingTemplate_a = [ { 'n': 'Entries', 't': 'array(ShippingTemplateEntry)', 's': 'listings_r' }, { 'n': 'Upgrades', 't': 'array(ShippingUpgrade)', 's': 'listings_r' } ], ShippingTemplate_m = [ { 'n': 'createShippingTemplate', 'u': '/shipping/templates', 'm': 'POST', 's': 'listings_w', 'p': [ { 'n': 'title', 't': 'string', 'r': true }, { 'n': 'origin_country_id', 't': 'int', 'r': true }, { 'n': 'destination_country_id', 't': 'int' }, { 'n': 'primary_cost', 't': 'float', 'r': true }, { 'n': 'secondary_cost', 't': 'float', 'r': true }, { 'n': 'destination_region_id', 't': 'int' }, { 'n': 'min_processing_days', 't': 'int' }, { 'n': 'max_processing_days', 't': 'int' } ] }, { 'n': 'getShippingTemplate', 'u': '/shipping/templates/:shipping_template_id', 's': 'listings_r', 'p': [{ 'n': 'shipping_template_id', 't': 'array(int)', 'r': true }] }, { 'n': 'updateShippingTemplate', 'u': '/shipping/templates/:shipping_template_id', 'm': 'PUT', 's': 'listings_w', 'p': [ { 'n': 'shipping_template_id', 't': 'int', 'r': true }, { 'n': 'title', 't': 'string' }, { 'n': 'origin_country_id', 't': 'int' }, { 'n': 'min_processing_days', 't': 'int' }, { 'n': 'max_processing_days', 't': 'int' } ] }, { 'n': 'deleteShippingTemplate', 'u': '/shipping/templates/:shipping_template_id', 'm': 'DELETE', 's': 'listings_w', 'p': [{ 'n': 'shipping_template_id', 't': 'int', 'r': true }] }, { 'n': 'findAllShippingTemplateEntries', 'u': '/shipping/templates/:shipping_template_id/entries', 's': 'listings_r', 'p': [ { 'n': 'shipping_template_id', 't': 'int', 'r': true }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] }, { 'n': 'findAllUserShippingProfiles', 'u': '/users/:user_id/shipping/templates', 'p': [{ 'n': 'user_id', 't': 'user_id_or_name', 'r': true }] } ], ShippingTemplateEntry_f = [ { 'n': 'shipping_template_entry_id', 't': 'int', 's': 'listings_r' }, { 'n': 'shipping_template_id', 't': 'int', 's': 'listings_r' }, { 'n': 'currency_code', 't': 'string', 's': 'listings_r' }, { 'n': 'origin_country_id', 't': 'int', 's': 'listings_r' }, { 'n': 'destination_country_id', 't': 'int', 's': 'listings_r' }, { 'n': 'destination_region_id', 't': 'int', 's': 'listings_r' }, { 'n': 'primary_cost', 't': 'float', 's': 'listings_r' }, { 'n': 'secondary_cost', 't': 'float', 's': 'listings_r' } ], ShippingTemplateEntry_a = [ { 'n': 'OriginCountry', 't': 'Country', 's': 'listings_r' }, { 'n': 'DestinationCountry', 't': 'Country', 's': 'listings_r' }, { 'n': 'DestinationRegion', 't': 'Region', 's': 'listings_r' }, { 'n': 'Template', 't': 'ShippingTemplate', 's': 'listings_r' } ], ShippingTemplateEntry_m = [ { 'n': 'createShippingTemplateEntry', 'u': '/shipping/templates/entries', 'm': 'POST', 's': 'listings_w', 'p': [ { 'n': 'shipping_template_id', 't': 'int', 'r': true }, { 'n': 'destination_country_id', 't': 'int' }, { 'n': 'primary_cost', 't': 'float', 'r': true }, { 'n': 'secondary_cost', 't': 'float', 'r': true }, { 'n': 'destination_region_id', 't': 'int' } ] }, { 'n': 'getShippingTemplateEntry', 'u': '/shipping/templates/entries/:shipping_template_entry_id', 's': 'listings_w', 'p': [{ 'n': 'shipping_template_entry_id', 't': 'array(int)', 'r': true }] }, { 'n': 'updateShippingTemplateEntry', 'u': '/shipping/templates/entries/:shipping_template_entry_id', 'm': 'PUT', 's': 'listings_w', 'p': [ { 'n': 'shipping_template_entry_id', 't': 'int', 'r': true }, { 'n': 'destination_country_id', 't': 'int' }, { 'n': 'primary_cost', 't': 'float' }, { 'n': 'secondary_cost', 't': 'float' } ] }, { 'n': 'deleteShippingTemplateEntry', 'u': '/shipping/templates/entries/:shipping_template_entry_id', 'm': 'DELETE', 's': 'listings_w', 'p': [{ 'n': 'shipping_template_entry_id', 't': 'int', 'r': true }] } ], ShippingUpgrade_f = [ { 'n': 'shipping_profile_id', 't': 'int', 'v': 'public' }, { 'n': 'value_id', 't': 'int', 'v': 'public' }, { 'n': 'value', 't': 'string', 'v': 'public' }, { 'n': 'price', 't': 'float', 'v': 'public' }, { 'n': 'secondary_price', 't': 'float', 'v': 'public' }, { 'n': 'currency_code', 't': 'string', 'v': 'public' }, { 'n': 'type', 't': 'int', 'v': 'public' }, { 'n': 'order', 't': 'int', 'v': 'public' }, { 'n': 'language', 't': 'int', 'v': 'public' } ], ShippingUpgrade_m = [ { 'n': 'getListingShippingUpgrades', 'u': '/listings/:listing_id/shipping/upgrades', 's': 'listings_r', 'p': [{ 'n': 'listing_id', 't': 'int', 'r': true }] }, { 'n': 'createListingShippingUpgrade', 'u': '/listings/:listing_id/shipping/upgrades', 'm': 'POST', 's': 'listings_w', 'p': [ { 'n': 'listing_id', 't': 'int', 'r': true }, { 'n': 'type', 't': 'int', 'r': true }, { 'n': 'value', 't': 'string', 'r': true }, { 'n': 'price', 't': 'float', 'r': true }, { 'n': 'secondary_price', 't': 'float', 'r': true } ] }, { 'n': 'updateListingShippingUpgrade', 'u': '/listings/:listing_id/shipping/upgrades', 'm': 'PUT', 's': 'listings_w', 'p': [ { 'n': 'listing_id', 't': 'int', 'r': true }, { 'n': 'value_id', 't': 'int', 'r': true }, { 'n': 'type', 't': 'int', 'r': true }, { 'n': 'price', 't': 'float', 'r': true }, { 'n': 'secondary_price', 't': 'float', 'r': true } ] }, { 'n': 'deleteListingShippingUpgrade', 'u': '/listings/:listing_id/shipping/upgrades', 'm': 'DELETE', 's': 'listings_w', 'p': [ { 'n': 'listing_id', 't': 'int', 'r': true }, { 'n': 'value_id', 't': 'int', 'r': true }, { 'n': 'type', 't': 'int', 'r': true } ] }, { 'n': 'findAllShippingTemplateUpgrades', 'u': '/shipping/templates/:shipping_template_id/upgrades', 's': 'listings_r', 'p': [{ 'n': 'shipping_template_id', 't': 'int', 'r': true }] }, { 'n': 'createShippingTemplateUpgrade', 'u': '/shipping/templates/:shipping_template_id/upgrades', 'm': 'POST', 's': 'listings_w', 'p': [ { 'n': 'shipping_template_id', 't': 'int', 'r': true }, { 'n': 'type', 't': 'int', 'r': true }, { 'n': 'value', 't': 'string', 'r': true }, { 'n': 'price', 't': 'float', 'r': true }, { 'n': 'secondary_price', 't': 'float', 'r': true } ] }, { 'n': 'updateShippingTemplateUpgrade', 'u': '/shipping/templates/:shipping_template_id/upgrades', 'm': 'PUT', 's': 'listings_w', 'p': [ { 'n': 'shipping_template_id', 't': 'int', 'r': true }, { 'n': 'value_id', 't': 'int', 'r': true }, { 'n': 'type', 't': 'int', 'r': true }, { 'n': 'price', 't': 'float', 'r': true }, { 'n': 'secondary_price', 't': 'float', 'r': true } ] }, { 'n': 'deleteShippingTemplateUpgrade', 'u': '/shipping/templates/:shipping_template_id/upgrades', 'm': 'DELETE', 's': 'listings_w', 'p': [ { 'n': 'shipping_template_id', 't': 'int', 'r': true }, { 'n': 'value_id', 't': 'int', 'r': true }, { 'n': 'type', 't': 'int', 'r': true } ] } ], Shop_f = [ { 'n': 'shop_id', 't': 'int', 'v': 'public' }, { 'n': 'shop_name', 't': 'string', 'v': 'public' }, { 'n': 'first_line', 't': 'string', 's': 'shops_rw' }, { 'n': 'second_line', 't': 'string', 's': 'shops_rw' }, { 'n': 'city', 't': 'string', 's': 'shops_rw' }, { 'n': 'state', 't': 'string', 's': 'shops_rw' }, { 'n': 'zip', 't': 'string', 's': 'shops_rw' }, { 'n': 'country_id', 't': 'int', 's': 'shops_rw' }, { 'n': 'user_id', 't': 'int', 'v': 'public' }, { 'n': 'creation_tsz', 't': 'float', 'v': 'public' }, { 'n': 'title', 't': 'string', 'v': 'public' }, { 'n': 'announcement', 't': 'string', 'v': 'public' }, { 'n': 'currency_code', 't': 'string', 'v': 'public' }, { 'n': 'is_vacation', 't': 'boolean', 'v': 'public' }, { 'n': 'vacation_message', 't': 'string', 'v': 'public' }, { 'n': 'sale_message', 't': 'string', 'v': 'public' }, { 'n': 'digital_sale_message', 't': 'string', 'v': 'public' }, { 'n': 'last_updated_tsz', 't': 'float', 'v': 'public' }, { 'n': 'listing_active_count', 't': 'int', 'v': 'public' }, { 'n': 'login_name', 't': 'string', 'v': 'public' }, { 'n': 'lat', 't': 'float', 's': 'shops_rw' }, { 'n': 'lon', 't': 'float', 's': 'shops_rw' }, { 'n': 'accepts_custom_requests', 't': 'boolean', 'v': 'public' }, { 'n': 'policy_welcome', 't': 'string', 'v': 'public' }, { 'n': 'policy_payment', 't': 'string', 'v': 'public' }, { 'n': 'policy_shipping', 't': 'string', 'v': 'public' }, { 'n': 'policy_refunds', 't': 'string', 'v': 'public' }, { 'n': 'policy_additional', 't': 'string', 'v': 'public' }, { 'n': 'policy_seller_info', 't': 'string', 'v': 'public' }, { 'n': 'policy_updated_tsz', 't': 'float', 'v': 'public' }, { 'n': 'vacation_autoreply', 't': 'string', 'v': 'public' }, { 'n': 'ga_code', 't': 'string', 's': 'shops_rw' }, { 'n': 'name', 't': 'string', 's': 'shops_rw' }, { 'n': 'url', 't': 'string', 'v': 'public' }, { 'n': 'image_url_760x100', 't': 'string', 'v': 'public' }, { 'n': 'num_favorers', 't': 'int', 'v': 'public' }, { 'n': 'languages', 't': 'string', 'v': 'public' } ], Shop_a = [ { 'n': 'User', 't': 'User', 'v': 'public' }, { 'n': 'About', 't': 'ShopAbout', 'v': 'public' }, { 'n': 'Sections', 't': 'array(ShopSection)', 'v': 'public' }, { 'n': 'Listings', 't': 'array(Listing)', 'v': 'public' }, { 'n': 'Receipts', 't': 'array(Receipt)', 's': 'shops_rw' }, { 'n': 'Transactions', 't': 'array(Transaction)', 's': 'shops_rw' }, { 'n': 'Translations', 't': 'array(ShopTranslation)', 'v': 'public' } ], Shop_m = [ { 'n': 'findAllShops', 'u': '/shops', 'o': false, 'p': [ { 'n': 'shop_name', 't': 'string' }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' }, { 'n': 'lat', 't': 'latitude' }, { 'n': 'lon', 't': 'longitude' }, { 'n': 'distance_max', 't': 'float', 'd': '35' } ] }, { 'n': 'getShop', 'u': '/shops/:shop_id', 'o': false, 'p': [{ 'n': 'shop_id', 't': 'array(shop_id_or_name)', 'r': true }] }, { 'n': 'updateShop', 'u': '/shops/:shop_id', 'm': 'PUT', 's': 'shops_rw', 'p': [ { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }, { 'n': 'title', 't': 'string' }, { 'n': 'announcement', 't': 'text' }, { 'n': 'sale_message', 't': 'text' }, { 'n': 'policy_welcome', 't': 'text' }, { 'n': 'policy_payment', 't': 'text' }, { 'n': 'policy_shipping', 't': 'text' }, { 'n': 'policy_refunds', 't': 'text' }, { 'n': 'policy_additional', 't': 'text' }, { 'n': 'policy_seller_info', 't': 'text' }, { 'n': 'digital_sale_message', 't': 'text' } ] }, { 'n': 'uploadShopBanner', 'u': '/shops/:shop_id/appearance/banner', 'm': 'POST', 's': 'shops_rw', 'p': [ { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }, { 'n': 'image', 't': 'imagefile', 'r': true } ] }, { 'n': 'deleteShopBanner', 'u': '/shops/:shop_id/appearance/banner', 'm': 'DELETE', 's': 'shops_rw', 'p': [{ 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }] }, { 'n': 'getListingShop', 'u': '/shops/listing/:listing_id', 'o': false, 'p': [{ 'n': 'listing_id', 't': 'int', 'r': true }] }, { 'n': 'findAllUserShops', 'u': '/users/:user_id/shops', 'o': false, 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] } ], ShopAbout_f = [ { 'n': 'shop_id', 't': 'int', 'v': 'public' }, { 'n': 'status', 't': 'string', 'v': 'public' }, { 'n': 'story_headline', 't': 'string', 'v': 'public' }, { 'n': 'story_leading_paragraph', 't': 'string', 'v': 'public' }, { 'n': 'story', 't': 'string', 'v': 'public' }, { 'n': 'related_links', 't': 'string', 'v': 'public' } ], ShopAbout_a = [ { 'n': 'Shop', 't': 'Shop', 'v': 'public' }, { 'n': 'Members', 't': 'array(ShopAboutMember)', 'v': 'public' }, { 'n': 'Images', 't': 'array(ShopAboutImages)', 'v': 'public' } ], ShopAbout_m = [{ 'n': 'getShopAbout', 'u': '/shops/:shop_id/about', 'o': false, 'p': [{ 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }] }], ShopAboutImage_f = [ { 'n': 'shop_id', 't': 'int', 'v': 'public' }, { 'n': 'image_id', 't': 'int', 'v': 'public' }, { 'n': 'caption', 't': 'string', 'v': 'public' }, { 'n': 'rank', 't': 'int', 'v': 'public' }, { 'n': 'url_178x178', 't': 'string', 'v': 'public' }, { 'n': 'url_545xN', 't': 'string', 'v': 'public' }, { 'n': 'url_760xN', 't': 'string', 'v': 'public' }, { 'n': 'url_fullxfull', 't': 'string', 'v': 'public' } ], ShopAboutMember_f = [ { 'n': 'shop_about_member_id', 't': 'int', 'v': 'public' }, { 'n': 'shop_id', 't': 'int', 'v': 'public' }, { 'n': 'name', 't': 'string', 'v': 'public' }, { 'n': 'role', 't': 'string', 'v': 'public' }, { 'n': 'bio', 't': 'string', 'v': 'public' }, { 'n': 'rank', 't': 'int', 'v': 'public' }, { 'n': 'is_owner', 't': 'boolean', 'v': 'public' }, { 'n': 'url_90x90', 't': 'string', 'v': 'public' }, { 'n': 'url_190x190', 't': 'string', 'v': 'public' }, { 'n': 'has_stale_translations', 't': 'boolean', 'v': 'public' } ], ShopSection_f = [ { 'n': 'shop_section_id', 't': 'int', 'v': 'public' }, { 'n': 'title', 't': 'string', 'v': 'public' }, { 'n': 'rank', 't': 'int', 'v': 'public' }, { 'n': 'user_id', 't': 'int', 'v': 'public' }, { 'n': 'active_listing_count', 't': 'int', 'v': 'public' } ], ShopSection_a = [ { 'n': 'Shop', 't': 'Shop', 'v': 'public' }, { 'n': 'Listings', 't': 'array(Listing)', 'v': 'public' }, { 'n': 'Translations', 't': 'array(ShopSectionTranslation)', 'v': 'public' } ], ShopSection_m = [ { 'n': 'findAllShopSections', 'u': '/shops/:shop_id/sections', 'o': false, 'p': [{ 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }] }, { 'n': 'createShopSection', 'u': '/shops/:shop_id/sections', 'm': 'POST', 's': 'shops_rw', 'p': [ { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }, { 'n': 'title', 't': 'text' }, { 'n': 'user_id', 't': 'int' } ] }, { 'n': 'getShopSection', 'u': '/shops/:shop_id/sections/:shop_section_id', 'o': false, 'p': [ { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }, { 'n': 'shop_section_id', 't': 'array(int)', 'r': true } ] }, { 'n': 'updateShopSection', 'u': '/shops/:shop_id/sections/:shop_section_id', 'm': 'PUT', 's': 'shops_rw', 'p': [ { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }, { 'n': 'shop_section_id', 't': 'int', 'r': true }, { 'n': 'title', 't': 'text' }, { 'n': 'user_id', 't': 'int' } ] }, { 'n': 'deleteShopSection', 'u': '/shops/:shop_id/sections/:shop_section_id', 'm': 'DELETE', 's': 'shops_rw', 'p': [ { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }, { 'n': 'shop_section_id', 't': 'int', 'r': true } ] } ], ShopSectionTranslation_f = [ { 'n': 'shop_section_id', 't': 'int', 'v': 'public' }, { 'n': 'language', 't': 'language', 'v': 'public' }, { 'n': 'title', 't': 'string', 'v': 'public' } ], ShopSectionTranslation_a = [{ 'n': 'ShopSection', 't': 'ShopSection', 'v': 'public' }], ShopSectionTranslation_m = [ { 'n': 'getShopSectionTranslation', 'u': '/shops/:shop_id/sections/:shop_section_id/translations/:language', 'o': false, 'p': [ { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }, { 'n': 'shop_section_id', 't': 'int', 'r': true }, { 'n': 'language', 't': 'language', 'r': true } ] }, { 'n': 'createShopSectionTranslation', 'u': '/shops/:shop_id/sections/:shop_section_id/translations/:language', 'm': 'POST', 's': 'shops_rw', 'p': [ { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }, { 'n': 'shop_section_id', 't': 'int', 'r': true }, { 'n': 'language', 't': 'language', 'r': true }, { 'n': 'title', 't': 'string' } ] }, { 'n': 'updateShopSectionTranslation', 'u': '/shops/:shop_id/sections/:shop_section_id/translations/:language', 'm': 'PUT', 's': 'shops_rw', 'p': [ { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }, { 'n': 'shop_section_id', 't': 'int', 'r': true }, { 'n': 'language', 't': 'language', 'r': true }, { 'n': 'title', 't': 'string' } ] }, { 'n': 'deleteShopSectionTranslation', 'u': '/shops/:shop_id/sections/:shop_section_id/translations/:language', 'm': 'DELETE', 's': 'shops_rw', 'p': [ { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }, { 'n': 'shop_section_id', 't': 'int', 'r': true }, { 'n': 'language', 't': 'language', 'r': true } ] } ], ShopTranslation_f = [ { 'n': 'shop_id', 't': 'int', 'v': 'public' }, { 'n': 'language', 't': 'language', 'v': 'public' }, { 'n': 'announcement', 't': 'string', 'v': 'public' }, { 'n': 'policy_welcome', 't': 'string', 'v': 'public' }, { 'n': 'policy_payment', 't': 'string', 'v': 'public' }, { 'n': 'policy_shipping', 't': 'string', 'v': 'public' }, { 'n': 'policy_refunds', 't': 'string', 'v': 'public' }, { 'n': 'policy_additional', 't': 'string', 'v': 'public' }, { 'n': 'policy_seller_info', 't': 'string', 'v': 'public' }, { 'n': 'sale_message', 't': 'string', 'v': 'public' }, { 'n': 'digital_sale_message', 't': 'string', 'v': 'public' }, { 'n': 'title', 't': 'string', 'v': 'public' }, { 'n': 'vacation_autoreply', 't': 'string', 'v': 'public' }, { 'n': 'vacation_message', 't': 'string', 'v': 'public' } ], ShopTranslation_m = [ { 'n': 'getShopTranslation', 'u': '/shops/:shop_id/translations/:language', 'o': false, 'p': [ { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }, { 'n': 'language', 't': 'language', 'r': true } ] }, { 'n': 'createShopTranslation', 'u': '/shops/:shop_id/translations/:language', 'm': 'POST', 's': 'shops_rw', 'p': [ { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }, { 'n': 'language', 't': 'language', 'r': true }, { 'n': 'title', 't': 'string' }, { 'n': 'sale_message', 't': 'string' }, { 'n': 'announcement', 't': 'string' }, { 'n': 'policy_welcome', 't': 'string' }, { 'n': 'policy_payment', 't': 'string' }, { 'n': 'policy_shipping', 't': 'string' }, { 'n': 'policy_refunds', 't': 'string' }, { 'n': 'policy_additional', 't': 'string' }, { 'n': 'policy_seller_info', 't': 'string' }, { 'n': 'vacation_autoreply', 't': 'string' }, { 'n': 'vacation_message', 't': 'string' } ] }, { 'n': 'updateShopTranslation', 'u': '/shops/:shop_id/translations/:language', 'm': 'PUT', 's': 'shops_rw', 'p': [ { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }, { 'n': 'language', 't': 'language', 'r': true }, { 'n': 'title', 't': 'string' }, { 'n': 'sale_message', 't': 'string' }, { 'n': 'announcement', 't': 'string' }, { 'n': 'policy_welcome', 't': 'string' }, { 'n': 'policy_payment', 't': 'string' }, { 'n': 'policy_shipping', 't': 'string' }, { 'n': 'policy_refunds', 't': 'string' }, { 'n': 'policy_additional', 't': 'string' }, { 'n': 'policy_seller_info', 't': 'string' }, { 'n': 'vacation_autoreply', 't': 'string' }, { 'n': 'vacation_message', 't': 'string' } ] }, { 'n': 'deleteShopTranslation', 'u': '/shops/:shop_id/translations/:language', 'm': 'DELETE', 's': 'shops_rw', 'p': [ { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }, { 'n': 'language', 't': 'language', 'r': true } ] } ], Style_f = [ { 'n': 'style_id', 't': 'int', 'v': 'public' }, { 'n': 'style', 't': 'string', 'v': 'public' } ], Style_m = [{ 'n': 'findSuggestedStyles', 'u': '/taxonomy/styles', 'o': false }], Team_f = [ { 'n': 'group_id', 't': 'int', 'v': 'public' }, { 'n': 'name', 't': 'string', 'v': 'public' }, { 'n': 'create_date', 't': 'int', 'v': 'public' }, { 'n': 'update_date', 't': 'int', 'v': 'public' }, { 'n': 'tags', 't': 'string', 'v': 'public' } ], Team_m = [ { 'n': 'findAllTeams', 'u': '/teams', 'o': false, 'p': [ { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] }, { 'n': 'findTeams', 'u': '/teams/:team_ids/', 'o': false, 'p': [{ 'n': 'team_ids', 't': 'array(team_id_or_name)', 'r': true }] }, { 'n': 'findAllTeamsForUser', 'u': '/users/:user_id/teams', 'o': false, 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] } ], Transaction_f = [ { 'n': 'transaction_id', 't': 'int', 'v': 'public' }, { 'n': 'title', 't': 'string', 'v': 'public' }, { 'n': 'description', 't': 'string', 'v': 'public' }, { 'n': 'seller_user_id', 't': 'int', 'v': 'public' }, { 'n': 'buyer_user_id', 't': 'int', 's': 'transactions_r' }, { 'n': 'creation_tsz', 't': 'float', 'v': 'public' }, { 'n': 'paid_tsz', 't': 'float', 's': 'transactions_r' }, { 'n': 'shipped_tsz', 't': 'float', 's': 'transactions_r' }, { 'n': 'price', 't': 'float', 's': 'transactions_r' }, { 'n': 'currency_code', 't': 'string', 's': 'transactions_r' }, { 'n': 'quantity', 't': 'int', 's': 'transactions_r' }, { 'n': 'tags', 't': 'string', 'v': 'public' }, { 'n': 'materials', 't': 'string', 'v': 'public' }, { 'n': 'image_listing_id', 't': 'int', 'v': 'public' }, { 'n': 'receipt_id', 't': 'int', 's': 'transactions_r' }, { 'n': 'shipping_cost', 't': 'float', 's': 'transactions_r' }, { 'n': 'is_digital', 't': 'boolean', 'v': 'public' }, { 'n': 'file_data', 't': 'string', 'v': 'public' }, { 'n': 'listing_id', 't': 'int', 'v': 'public' }, { 'n': 'seller_feedback_id', 't': 'int', 'v': 'public' }, { 'n': 'buyer_feedback_id', 't': 'int', 'v': 'public' }, { 'n': 'transaction_type', 't': 'string', 's': 'transactions_r' }, { 'n': 'url', 't': 'string', 'v': 'public' }, { 'n': 'variations', 't': 'array(Variations_SelectedProperty)', 'v': 'public' } ], Transaction_a = [ { 'n': 'Buyer', 't': 'User', 's': 'transactions_r' }, { 'n': 'MainImage', 't': 'ListingImage', 'v': 'public' }, { 'n': 'Listing', 't': 'Listing', 'v': 'public' }, { 'n': 'Seller', 't': 'User', 'v': 'public' }, { 'n': 'Receipt', 't': 'Receipt', 's': 'transactions_r' } ], Transaction_m = [ { 'n': 'getTransaction', 'u': '/transactions/:transaction_id', 's': 'transactions_r', 'p': [{ 'n': 'transaction_id', 't': 'array(int)', 'r': true }] }, { 'n': 'findAllListingTransactions', 'u': '/listings/:listing_id/transactions', 's': 'transactions_r', 'p': [ { 'n': 'listing_id', 't': 'int', 'r': true }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] }, { 'n': 'findAllReceiptTransactions', 'u': '/receipts/:receipt_id/transactions', 's': 'transactions_r', 'p': [ { 'n': 'receipt_id', 't': 'int', 'r': true }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] }, { 'n': 'findAllShopTransactions', 'u': '/shops/:shop_id/transactions', 's': 'transactions_r', 'p': [ { 'n': 'shop_id', 't': 'shop_id_or_name', 'r': true }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] }, { 'n': 'findAllUserBuyerTransactions', 'u': '/users/:user_id/transactions', 's': 'transactions_r', 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] } ], Treasury_f = [ { 'n': 'id', 't': 'string', 'v': 'public' }, { 'n': 'title', 't': 'string', 'v': 'public' }, { 'n': 'description', 't': 'string', 'v': 'public' }, { 'n': 'homepage', 't': 'int', 'v': 'public' }, { 'n': 'mature', 't': 'boolean', 'v': 'public' }, { 'n': 'private', 't': 'boolean', 'v': 'public' }, { 'n': 'locale', 't': 'string', 'v': 'public' }, { 'n': 'comment_count', 't': 'int', 'v': 'public' }, { 'n': 'tags', 't': 'string', 'v': 'public' }, { 'n': 'counts', 't': 'TreasuryCounts', 'v': 'public' }, { 'n': 'hotness', 't': 'float', 'v': 'public' }, { 'n': 'hotness_color', 't': 'string', 'v': 'public' }, { 'n': 'user_id', 't': 'int', 'v': 'public' }, { 'n': 'user_name', 't': 'string', 'v': 'public' }, { 'n': 'user_avatar_id', 't': 'int', 'v': 'public' }, { 'n': 'listings', 't': 'array(TreasuryListing)', 'v': 'public' }, { 'n': 'creation_tsz', 't': 'float', 'v': 'public' }, { 'n': 'became_public_date', 't': 'int', 'v': 'public' } ], Treasury_m = [ { 'n': 'findAllTreasuries', 'u': '/treasuries', 'o': false, 'p': [ { 'n': 'keywords', 't': 'treasury_search_string' }, { 'n': 'sort_on', 't': 'enum(hotness, created)', 'd': 'hotness' }, { 'n': 'sort_order', 't': 'enum(up, down)', 'd': 'down' }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] }, { 'n': 'createTreasury', 'u': '/treasuries', 'm': 'POST', 's': 'treasury_w', 'p': [ { 'n': 'title', 't': 'treasury_title', 'r': true }, { 'n': 'description', 't': 'treasury_description' }, { 'n': 'listing_ids', 't': 'array(int)', 'r': true }, { 'n': 'tags', 't': 'array(string)' }, { 'n': 'private', 't': 'boolean', 'd': '0' } ] }, { 'n': 'getTreasury', 'u': '/treasuries/:treasury_key', 'o': false, 'p': [{ 'n': 'treasury_key', 't': 'treasury_id', 'r': true }] }, { 'n': 'deleteTreasury', 'u': '/treasuries/:treasury_key', 'm': 'DELETE', 's': 'treasury_w' }, { 'n': 'findAllUserTreasuries', 'u': '/users/:user_id/treasuries', 'o': false, 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'sort_on', 't': 'enum(hotness, created)', 'd': 'hotness' }, { 'n': 'sort_order', 't': 'enum(up, down)', 'd': 'down' }, { 'n': 'include_private', 't': 'boolean', 'd': '0' }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] } ], TreasuryCounts_f = [ { 'n': 'clicks', 't': 'int', 'v': 'public' }, { 'n': 'views', 't': 'int', 'v': 'public' }, { 'n': 'shares', 't': 'int', 'v': 'public' }, { 'n': 'reports', 't': 'int', 'v': 'public' } ], TreasuryListing_f = [ { 'n': 'data', 't': 'TreasuryListingData', 'v': 'public' }, { 'n': 'creation_tsz', 't': 'float', 'v': 'public' } ], TreasuryListing_m = [ { 'n': 'addTreasuryListing', 'u': '/treasuries/:treasury_key/listings', 'm': 'POST', 's': 'treasury_w', 'p': [ { 'n': 'treasury_key', 't': 'treasury_id', 'r': true }, { 'n': 'listing_id', 't': 'int', 'r': true } ] }, { 'n': 'removeTreasuryListing', 'u': '/treasuries/:treasury_key/listings/:listing_id', 'm': 'DELETE', 's': 'treasury_w', 'p': [ { 'n': 'treasury_key', 't': 'treasury_id', 'r': true }, { 'n': 'listing_id', 't': 'int', 'r': true } ] } ], TreasuryListingData_f = [ { 'n': 'user_id', 't': 'int', 'v': 'public' }, { 'n': 'title', 't': 'string', 'v': 'public' }, { 'n': 'price', 't': 'float', 'v': 'public' }, { 'n': 'currency_code', 't': 'string', 'v': 'public' }, { 'n': 'listing_id', 't': 'int', 'v': 'public' }, { 'n': 'state', 't': 'string', 'v': 'public' }, { 'n': 'shop_name', 't': 'string', 'v': 'public' }, { 'n': 'image_id', 't': 'int', 'v': 'public' }, { 'n': 'image_url_75x75', 't': 'string', 'v': 'public' }, { 'n': 'image_url_170x135', 't': 'string', 'v': 'public' } ], User_f = [ { 'n': 'user_id', 't': 'int', 'v': 'public' }, { 'n': 'login_name', 't': 'string', 'v': 'public' }, { 'n': 'primary_email', 't': 'string', 's': 'email_r' }, { 'n': 'creation_tsz', 't': 'float', 'v': 'public' }, { 'n': 'referred_by_user_id', 't': 'int', 'v': 'public' }, { 'n': 'feedback_info', 't': 'FeedbackInfo', 'v': 'public' }, { 'n': 'awaiting_feedback_count', 't': 'int' } ], User_a = [ { 'n': 'Shops', 't': 'array(Shop)', 'v': 'public' }, { 'n': 'Profile', 't': 'UserProfile', 'v': 'public' }, { 'n': 'BuyerReceipts', 't': 'array(Receipt)', 's': 'transactions_r' }, { 'n': 'BuyerTransactions', 't': 'array(Transaction)', 's': 'transactions_r' }, { 'n': 'Addresses', 't': 'array(UserAddress)', 's': 'profile_r' }, { 'n': 'Charges', 't': 'array(BillCharge)', 's': 'billing_r' }, { 'n': 'Payments', 't': 'array(BillPayment)', 's': 'billing_r' } ], User_m = [ { 'n': 'findAllUsers', 'u': '/users', 'o': false, 'p': [ { 'n': 'keywords', 't': 'string' }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] }, { 'n': 'getUser', 'u': '/users/:user_id', 'o': false, 'p': [{ 'n': 'user_id', 't': 'array(user_id_or_name)', 'r': true }] }, { 'n': 'findAllUsersForTeam', 'u': '/teams/:team_id/users/', 'o': false, 'p': [ { 'n': 'team_id', 't': 'int', 'r': true }, { 'n': 'status', 't': 'enum(active, invited, pending)', 'd': 'active' }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] }, { 'n': 'getCirclesContainingUser', 'u': '/users/:user_id/circles', 'o': false, 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] }, { 'n': 'getConnectedUser', 'u': '/users/:user_id/circles/:to_user_id', 'o': false, 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'to_user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] }, { 'n': 'unconnectUsers', 'u': '/users/:user_id/circles/:to_user_id', 'm': 'DELETE', 's': 'profile_w', 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'to_user_id', 't': 'user_id_or_name', 'r': true } ] }, { 'n': 'getConnectedUsers', 'u': '/users/:user_id/connected_users', 'o': false, 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] }, { 'n': 'connectUsers', 'u': '/users/:user_id/connected_users', 'm': 'POST', 's': 'profile_w', 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'to_user_id', 't': 'user_id_or_name', 'r': true } ] } ], UserAddress_f = [ { 'n': 'user_address_id', 't': 'int', 's': 'address_r' }, { 'n': 'user_id', 't': 'int', 's': 'address_r' }, { 'n': 'name', 't': 'text', 's': 'address_r' }, { 'n': 'first_line', 't': 'text', 's': 'address_r' }, { 'n': 'second_line', 't': 'text', 's': 'address_r' }, { 'n': 'city', 't': 'text', 's': 'address_r' }, { 'n': 'state', 't': 'text', 's': 'address_r' }, { 'n': 'zip', 't': 'text', 's': 'address_r' }, { 'n': 'country_id', 't': 'int', 's': 'address_r' }, { 'n': 'country_name', 't': 'string', 's': 'address_r' } ], UserAddress_a = [ { 'n': 'Country', 't': 'Country', 's': 'address_r' }, { 'n': 'User', 't': 'User', 's': 'address_r' } ], UserAddress_m = [ { 'n': 'findAllUserAddresses', 'u': '/users/:user_id/addresses', 's': 'address_r', 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'limit', 't': 'int', 'd': '25' }, { 'n': 'offset', 't': 'int', 'd': '0' }, { 'n': 'page', 't': 'int' } ] }, { 'n': 'createUserAddress', 'u': '/users/:user_id/addresses/', 'm': 'POST', 's': 'address_w', 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'name', 't': 'string', 'r': true }, { 'n': 'first_line', 't': 'string', 'r': true }, { 'n': 'second_line', 't': 'string' }, { 'n': 'city', 't': 'string', 'r': true }, { 'n': 'state', 't': 'string' }, { 'n': 'zip', 't': 'string', 'r': true }, { 'n': 'country_id', 't': 'int', 'r': true } ] }, { 'n': 'getUserAddress', 'u': '/users/:user_id/addresses/:user_address_id', 's': 'address_r', 'p': [{ 'n': 'user_address_id', 't': 'array(int)', 'r': true }] }, { 'n': 'deleteUserAddress', 'u': '/users/:user_id/addresses/:user_address_id', 'm': 'DELETE', 's': 'address_w', 'p': [{ 'n': 'user_address_id', 't': 'int', 'r': true }] } ], UserProfile_f = [ { 'n': 'user_profile_id', 't': 'int', 'v': 'public' }, { 'n': 'user_id', 't': 'int', 'v': 'public' }, { 'n': 'login_name', 't': 'string', 'v': 'public' }, { 'n': 'bio', 't': 'string', 'v': 'public' }, { 'n': 'gender', 't': 'string', 'v': 'public' }, { 'n': 'birth_month', 't': 'string', 'v': 'public' }, { 'n': 'birth_day', 't': 'string', 'v': 'public' }, { 'n': 'birth_year', 't': 'string', 's': 'profile_r' }, { 'n': 'join_tsz', 't': 'float', 'v': 'public' }, { 'n': 'materials', 't': 'string', 'v': 'public' }, { 'n': 'country_id', 't': 'int', 'v': 'public' }, { 'n': 'region', 't': 'string', 'v': 'public' }, { 'n': 'city', 't': 'string', 'v': 'public' }, { 'n': 'location', 't': 'string', 'v': 'public' }, { 'n': 'avatar_id', 't': 'int', 'v': 'public' }, { 'n': 'lat', 't': 'float', 's': 'profile_r' }, { 'n': 'lon', 't': 'float', 's': 'profile_r' }, { 'n': 'transaction_buy_count', 't': 'int', 'v': 'public' }, { 'n': 'transaction_sold_count', 't': 'int', 'v': 'public' }, { 'n': 'is_seller', 't': 'boolean', 'v': 'public' }, { 'n': 'image_url_75x75', 't': 'string', 'v': 'public' }, { 'n': 'first_name', 't': 'string', 'v': 'public' }, { 'n': 'last_name', 't': 'string', 'v': 'public' } ], UserProfile_a = [{ 'n': 'Country', 't': 'Country', 'v': 'public' }], UserProfile_m = [ { 'n': 'findUserProfile', 'u': '/users/:user_id/profile', 'o': false, 'p': [{ 'n': 'user_id', 't': 'user_id_or_name', 'r': true }] }, { 'n': 'updateUserProfile', 'u': '/users/:user_id/profile', 'm': 'PUT', 's': 'profile_w', 'p': [ { 'n': 'user_id', 't': 'user_id_or_name', 'r': true }, { 'n': 'bio', 't': 'text' }, { 'n': 'gender', 't': 'string' }, { 'n': 'birth_month', 't': 'int' }, { 'n': 'birth_day', 't': 'int' }, { 'n': 'birth_year', 't': 'int' }, { 'n': 'materials', 't': 'string' }, { 'n': 'country_id', 't': 'string' }, { 'n': 'region', 't': 'string' }, { 'n': 'city', 't': 'string' } ] } ], Variations_Option_f = [ { 'n': 'value_id', 't': 'int', 'v': 'public' }, { 'n': 'value', 't': 'string', 'v': 'public' }, { 'n': 'formatted_value', 't': 'string', 'v': 'public' }, { 'n': 'is_available', 't': 'boolean', 'v': 'public' }, { 'n': 'price_diff', 't': 'int', 'v': 'public' }, { 'n': 'price', 't': 'int', 'v': 'public' } ], Variations_Property_f = [ { 'n': 'property_id', 't': 'int', 'v': 'public' }, { 'n': 'formatted_name', 't': 'string', 'v': 'public' }, { 'n': 'options', 't': 'array(Variations_Option)', 'v': 'public' } ], Variations_Property_m = [ { 'n': 'getListingVariations', 'u': '/listings/:listing_id/variations', 's': 'listings_r', 'p': [{ 'n': 'listing_id', 't': 'int', 'r': true }] }, { 'n': 'createListingVariations', 'u': '/listings/:listing_id/variations', 'm': 'POST', 's': 'listings_w', 'p': [ { 'n': 'listing_id', 't': 'int', 'r': true }, { 'n': 'variations', 't': 'array(listing_variation)', 'r': true }, { 'n': 'custom_property_names', 't': 'map(int, string)' }, { 'n': 'recipient_id', 't': 'int' }, { 'n': 'sizing_scale', 't': 'int' }, { 'n': 'weight_scale', 't': 'int' }, { 'n': 'height_scale', 't': 'int' }, { 'n': 'length_scale', 't': 'int' }, { 'n': 'width_scale', 't': 'int' }, { 'n': 'diameter_scale', 't': 'int' }, { 'n': 'dimensions_scale', 't': 'int' } ] }, { 'n': 'updateListingVariations', 'u': '/listings/:listing_id/variations', 'm': 'PUT', 's': 'listings_w', 'p': [ { 'n': 'listing_id', 't': 'int', 'r': true }, { 'n': 'variations', 't': 'array(listing_variation)', 'r': true }, { 'n': 'custom_property_names', 't': 'map(int, string)' }, { 'n': 'recipient_id', 't': 'int' }, { 'n': 'sizing_scale', 't': 'int' }, { 'n': 'weight_scale', 't': 'int' }, { 'n': 'height_scale', 't': 'int' }, { 'n': 'length_scale', 't': 'int' }, { 'n': 'width_scale', 't': 'int' }, { 'n': 'diameter_scale', 't': 'int' }, { 'n': 'dimensions_scale', 't': 'int' } ] }, { 'n': 'createListingVariation', 'u': '/listings/:listing_id/variations/:property_id', 'm': 'POST', 's': 'listings_w', 'p': [ { 'n': 'listing_id', 't': 'int', 'r': true }, { 'n': 'property_id', 't': 'int', 'r': true }, { 'n': 'value', 't': 'string', 'r': true }, { 'n': 'is_available', 't': 'boolean', 'd': '1' }, { 'n': 'price', 't': 'float' } ] }, { 'n': 'updateListingVariation', 'u': '/listings/:listing_id/variations/:property_id', 'm': 'PUT', 's': 'listings_w', 'p': [ { 'n': 'listing_id', 't': 'int', 'r': true }, { 'n': 'property_id', 't': 'int', 'r': true }, { 'n': 'value', 't': 'string', 'r': true }, { 'n': 'is_available', 't': 'boolean', 'r': true }, { 'n': 'price', 't': 'float' } ] }, { 'n': 'deleteListingVariation', 'u': '/listings/:listing_id/variations/:property_id', 'm': 'DELETE', 's': 'listings_w', 'p': [ { 'n': 'listing_id', 't': 'int', 'r': true }, { 'n': 'property_id', 't': 'int', 'r': true }, { 'n': 'value', 't': 'string', 'r': true } ] } ], Variations_PropertyQualifier_f = [ { 'n': 'property_id', 't': 'int', 'v': 'public' }, { 'n': 'options', 't': 'int', 'v': 'public' }, { 'n': 'results', 't': 'map(string, Variations_PropertyQualifier)', 'v': 'public' }, { 'n': 'aliases', 't': 'string', 'v': 'public' } ], Variations_PropertySet_f = [ { 'n': 'property_set_id', 't': 'int', 'v': 'public' }, { 'n': 'properties', 't': 'map(int, Variations_PropertySetProperty)', 'v': 'public' }, { 'n': 'qualifying_properties', 't': 'map(int, Variations_PropertySetProperty)', 'v': 'public' }, { 'n': 'options', 't': 'int', 'v': 'public' }, { 'n': 'qualifiers', 't': 'map(int, array(Variations_PropertyQualifier))', 'v': 'public' } ], Variations_PropertySet_m = [{ 'n': 'findPropertySet', 'u': '/property_sets', 'o': false, 'p': [{ 'n': 'category_id', 't': 'int' }] }], Variations_PropertySetOption_f = [ { 'n': 'property_option_id', 't': 'int', 'v': 'public' }, { 'n': 'name', 't': 'string', 'v': 'public' }, { 'n': 'formatted_name', 't': 'string', 'v': 'public' } ], Variations_PropertySetOption_m = [{ 'n': 'findAllSuggestedPropertyOptions', 'u': '/property_options/suggested', 'o': false, 'p': [ { 'n': 'property_id', 't': 'int', 'r': true }, { 'n': 'category_id', 't': 'int' }, { 'n': 'recipient_id', 't': 'int' }, { 'n': 'sizing_scale', 't': 'int' }, { 'n': 'weight_scale', 't': 'int' }, { 'n': 'height_scale', 't': 'int' }, { 'n': 'length_scale', 't': 'int' }, { 'n': 'width_scale', 't': 'int' }, { 'n': 'diameter_scale', 't': 'int' }, { 'n': 'dimensions_scale', 't': 'int' } ] }], Variations_PropertySetOptionModifier_f = [ { 'n': 'prefix', 't': 'string', 'v': 'public' }, { 'n': 'suffix', 't': 'string', 'v': 'public' } ], Variations_PropertySetOptionModifier_m = [{ 'n': 'getPropertyOptionModifier', 'u': '/property_options/modifiers', 'o': false, 'p': [ { 'n': 'property_id', 't': 'int', 'r': true }, { 'n': 'category_id', 't': 'int' }, { 'n': 'recipient_id', 't': 'int' }, { 'n': 'sizing_scale', 't': 'int' }, { 'n': 'weight_scale', 't': 'int' }, { 'n': 'height_scale', 't': 'int' }, { 'n': 'length_scale', 't': 'int' }, { 'n': 'width_scale', 't': 'int' }, { 'n': 'diameter_scale', 't': 'int' }, { 'n': 'dimensions_scale', 't': 'int' } ] }], Variations_PropertySetProperty_f = [ { 'n': 'property_id', 't': 'int', 'v': 'public' }, { 'n': 'name', 't': 'string', 'v': 'public' }, { 'n': 'input_name', 't': 'string', 'v': 'public' }, { 'n': 'label', 't': 'string', 'v': 'public' }, { 'n': 'param', 't': 'string', 'v': 'public' }, { 'n': 'default_option', 't': 'string', 'v': 'public' }, { 'n': 'description', 't': 'string', 'v': 'public' }, { 'n': 'is_custom', 't': 'boolean', 'v': 'public' }, { 'n': 'title', 't': 'string', 'v': 'public' } ], Variations_SelectedProperty_f = [ { 'n': 'property_id', 't': 'int', 'v': 'public' }, { 'n': 'value_id', 't': 'int', 'v': 'public' }, { 'n': 'formatted_name', 't': 'string', 'v': 'public' }, { 'n': 'formatted_value', 't': 'string', 'v': 'public' }, { 'n': 'is_valid', 't': 'boolean', 'v': 'public' } ]; }));
gpl-2.0
FauxFaux/jdk9-hotspot
test/compiler/intrinsics/mathexact/NegExactILoadTest.java
1513
/* * Copyright (c) 2013, 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. */ /* * @test * @bug 8026844 * @summary Test negExact * @library /testlibrary / * @modules java.base/jdk.internal.misc * java.management * * @run main compiler.intrinsics.mathexact.NegExactILoadTest */ package compiler.intrinsics.mathexact; public class NegExactILoadTest { public static void main(String[] args) { Verify.LoadTest.init(); Verify.LoadTest.verify(new Verify.UnaryToBinary(new Verify.NegExactI())); } }
gpl-2.0
jacobajit/ion
intranet/apps/notifications/models.py
1283
# -*- coding: utf-8 -*- import hashlib import json from django.db import models from ..users.models import User class NotificationConfig(models.Model): user = models.OneToOneField(User) gcm_token = models.CharField(max_length=250, blank=True, null=True) gcm_time = models.DateTimeField(blank=True, null=True) gcm_optout = models.BooleanField(default=False) android_gcm_rand = models.CharField(max_length=100, blank=True, null=True) @property def gcm_token_sha256(self): return hashlib.sha256(self.gcm_token.encode()).hexdigest() def __str__(self): return "{}".format(self.user) class GCMNotification(models.Model): multicast_id = models.CharField(max_length=250) num_success = models.IntegerField(default=0) num_failure = models.IntegerField(default=0) sent_data = models.CharField(max_length=10000) sent_to = models.ManyToManyField(NotificationConfig) time = models.DateTimeField(auto_now=True) user = models.ForeignKey(User) def __str__(self): return "{} at {}".format(self.multicast_id, self.time) @property def data(self): json_data = json.loads(self.sent_data) if json_data and "data" in json_data: return json_data["data"] return {}
gpl-2.0
eltharin/glpi
front/commonitilcost.form.php
2724
<?php /** * --------------------------------------------------------------------- * GLPI - Gestionnaire Libre de Parc Informatique * Copyright (C) 2015-2017 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/>. * --------------------------------------------------------------------- */ /** @file * @brief * @since version 0.85 */ use Glpi\Event; // autoload include in objecttask.form (ticketcost, problemcost,...) if (!defined('GLPI_ROOT')) { die("Sorry. You can't access this file directly"); } Session::checkCentralAccess(); if (!($cost instanceof CommonITILCost)) { Html::displayErrorAndDie(''); } if (!$cost->canView()) { Html::displayRightError(); } $itemtype = $cost->getItilObjectItemType(); $fk = getForeignKeyFieldForItemType($itemtype); if (isset($_POST["add"])) { $cost->check(-1, CREATE, $_POST); if ($newID = $cost->add($_POST)) { Event::log($_POST[$fk], strtolower($itemtype), 4, "tracking", //TRANS: %s is the user login sprintf(__('%s adds a cost'), $_SESSION["glpiname"])); } Html::back(); } else if (isset($_POST["purge"])) { $cost->check($_POST["id"], PURGE); if ($cost->delete($_POST, 1)) { Event::log($cost->fields[$fk], strtolower($itemtype), 4, "tracking", //TRANS: %s is the user login sprintf(__('%s purges a cost'), $_SESSION["glpiname"])); } Html::redirect(Toolbox::getItemTypeFormURL($itemtype).'?id='.$cost->fields[$fk]); } else if (isset($_POST["update"])) { $cost->check($_POST["id"], UPDATE); if ($cost->update($_POST)) { Event::log($cost->fields[$fk], strtolower($itemtype), 4, "tracking", //TRANS: %s is the user login sprintf(__('%s updates a cost'), $_SESSION["glpiname"])); } Html::back(); } Html::displayErrorAndDie('Lost');
gpl-2.0
danielja/mudpy
health_tracker/health_tracker.py
2521
import meta import sage from sage import player, triggers, aliases from sage.signals import pre_shutdown from sage.signals.gmcp import skills, vitals import time import MySQLdb as mysql import MySQLdb.cursors class HealthTracker(object): def __init__(self): self.health = 100 self.mana = 100 self.last_health = 0 self.last_mana = 0 self.ema_health_gain = 0 self.ema_health_loss = 0 self.cur_health_gain = 0 self.cur_health_loss = 0 self.ema_mana_gain = 0 self.ema_mana_loss = 0 self.cur_mana_gain = 0 self.cur_mana_loss = 0 def update_health_stats(self, **kwargs): cur_health = kwargs['health'] cur_mana = kwargs['mana'] self.health = cur_health.value self.mana = cur_mana.value if self.last_health == 0: self.last_health = cur_health.value self.last_mana = cur_mana.value d_health = cur_health.value - self.last_health d_mana = cur_mana.value - self.last_mana if d_health > 0: self.cur_health_gain = self.cur_health_gain + d_health if d_health < 0: self.cur_health_loss = self.cur_health_loss - d_health if d_mana > 0: self.cur_mana_gain = self.cur_mana_gain + d_mana if d_mana < 0: self.cur_mana_loss = self.cur_mana_loss - d_mana self.last_health = cur_health.value self.last_mana = cur_mana.value def update_health_gain(self, trigger): self.ema_health_gain = self.ema_health_gain *.1 + self.cur_health_gain self.ema_health_loss = max(self.ema_health_loss *.1 + .9 * self.cur_health_loss, self.cur_health_loss) self.cur_health_gain = 0 self.cur_health_loss = 0 self.ema_mana_gain = self.ema_mana_gain *.5 + self.cur_mana_gain self.ema_mana_loss = self.ema_mana_loss *.5 + self.cur_mana_loss self.cur_mana_gain = 0 self.cur_mana_loss = 0 tracker = HealthTracker() health_trigs = triggers.create_group('health', app='explorer') health_trigs.enable() @health_trigs.exact("You may drink another health or mana elixir.") def snap_health(trigger): tracker.update_health_gain(trigger) vitals.connect(tracker.update_health_stats)
gpl-2.0
siemens/fossology
src/www/ui/page/AdminGroupUsers.php
6563
<?php /*********************************************************** Copyright (C) 2014-2015, 2018 Siemens AG Author: Steffen Weber This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 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. ***********************************************************/ namespace Fossology\UI\Page; use Fossology\Lib\Auth\Auth; use Fossology\Lib\Dao\UserDao; use Fossology\Lib\Plugin\DefaultPlugin; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; /** * \class group_manage extends FO_Plugin * \brief edit group user permissions */ class AdminGroupUsers extends DefaultPlugin { var $groupPermissions = array(-1 => "None", UserDao::USER => "User", UserDao::ADMIN => "Admin", UserDao::ADVISOR => "Advisor"); const NAME = 'group_manage_users'; function __construct() { parent::__construct(self::NAME, array( self::TITLE => _("Manage Group Users"), self::MENU_LIST => "Admin::Groups::Manage Group Users", self::PERMISSION => Auth::PERM_WRITE, self::REQUIRES_LOGIN => TRUE )); } /** * @param Request $request * @return Response */ protected function handle(Request $request) { $userId = Auth::getUserId(); /** @var UserDao */ $userDao = $this->getObject('dao.user'); $groupMap = $userDao->getAdminGroupMap($userId, $_SESSION[Auth::USER_LEVEL]); if (empty($groupMap)) { $text = _("You have no permission to manage any group."); return $this->render('include/base.html.twig', $this->mergeWithDefault(array('message' => $text))); } /** @var DbManager */ $dbManager = $this->getObject('db.manager'); $group_pk = intval($request->get('group')); if (empty($group_pk) || !array_key_exists($group_pk, $groupMap)) { $group_pk = key($groupMap); } $gum_pk = intval($request->get('gum_pk')); if ($gum_pk) { $perm = intval($request->get('perm')); $this->updateGUMPermission($gum_pk, $perm); $groupMap = $userDao->getAdminGroupMap($userId, $_SESSION[Auth::USER_LEVEL]); } $newuser = intval($request->get('newuser')); $newperm = intval($request->get('newperm')); if ($newuser && $group_pk) { // do not produce duplicate $dbManager->prepare($stmt = __METHOD__ . ".delByGroupAndUser", "delete from group_user_member where group_fk=$1 and user_fk=$2"); $dbManager->freeResult($dbManager->execute($stmt, array($group_pk, $newuser))); if ($newperm >= 0) { $dbManager->prepare($stmt = __METHOD__ . ".insertGUP", "insert into group_user_member (group_fk, user_fk, group_perm) values ($1,$2,$3)"); $dbManager->freeResult($dbManager->execute($stmt, array($group_pk, $newuser, $newperm))); } if ($newuser == $userId) { $groupMap = $userDao->getAdminGroupMap($userId, $_SESSION[Auth::USER_LEVEL]); } $newperm = $newuser = 0; } natcasesort($groupMap); $baseUrl = Traceback_uri() . "?mod=" . $this->getName() . '&group='; $onchange = "onchange=\"js_url(this.value, '$baseUrl')\""; $baseUrl .= $group_pk; $vars = array('groupMap' => $groupMap, 'groupId' => $group_pk, 'permissionMap' => $this->groupPermissions, 'baseUrl' => $baseUrl, 'groupMapAction' => $onchange); $stmt = __METHOD__ . "getUsersWithGroup"; $dbManager->prepare($stmt, "select user_pk, user_name, group_user_member_pk, group_perm FROM users LEFT JOIN group_user_member gum ON gum.user_fk=users.user_pk AND gum.group_fk=$1 ORDER BY user_name"); $result = $dbManager->execute($stmt, array($group_pk)); $vars['usersWithGroup'] = $dbManager->fetchAll($result); $dbManager->freeResult($result); $otherUsers = array('0' => ''); foreach ($vars['usersWithGroup'] as $row) { if ($row['group_user_member_pk']) { continue; } $otherUsers[$row['user_pk']] = $row['user_name']; } $vars['existsOtherUsers'] = count($otherUsers) - 1; if ($vars['existsOtherUsers']) { $vars['newPermissionMap'] = $this->groupPermissions; unset($vars['newPermissionMap'][-1]); $script = "var newpermurl; function setNewPermUrl(newperm){ newpermurl='" . $baseUrl . "&newperm='+newperm+'&newuser='; } setNewPermUrl($newperm);"; $scripts = js_url() . '<script type="text/javascript"> ' . $script . '</script>'; $vars['otherUsers'] = $otherUsers; } else { $scripts = js_url(); } $vars['scripts'] = $scripts; return $this->render('admin_group_users.html.twig', $this->mergeWithDefault($vars)); } private function updateGUMPermission($gum_pk, $perm) { $dbManager = $this->getObject('db.manager'); if ($perm === -1) { $dbManager->prepare($stmt = __METHOD__ . ".delByGUM", "DELETE FROM group_user_member WHERE group_user_member_pk=$1 RETURNING user_fk, group_fk"); $deletedEntry = $dbManager->execute($stmt, array($gum_pk)); $effectedUser = $dbManager->fetchArray($deletedEntry); $isEffected = $dbManager->getSingleRow("SELECT count(*) cnt FROM users WHERE user_pk=$1 AND group_fk = $2", array($effectedUser['user_fk'], $effectedUser['group_fk']), $stmt = __METHOD__ . ".isUserEffectedFromRemoval"); if($isEffected['cnt'] == 1) { $dbManager->getSingleRow("UPDATE users SET group_fk = ( SELECT group_fk FROM group_user_member WHERE user_fk = $1 AND group_perm >= 0 LIMIT 1) WHERE user_pk = $1", array($effectedUser['user_fk']), $stmt = __METHOD__ . ".setNewGroupId"); } $dbManager->freeResult($deletedEntry); } else if (array_key_exists($perm, $this->groupPermissions)) { $dbManager->getSingleRow("UPDATE group_user_member SET group_perm=$1 WHERE group_user_member_pk=$2", array($perm, $gum_pk), $stmt = __METHOD__ . ".updatePermInGUM"); } } } register_plugin(new AdminGroupUsers());
gpl-2.0
glaubitz/ppsspp-debian
Core/Dialog/PSPOskDialog.cpp
6815
// Copyright (c) 2012- PPSSPP Project. // 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.0 or later versions. // 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 2.0 for more details. // A copy of the GPL 2.0 should have been included with the program. // If not, see http://www.gnu.org/licenses/ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. #include "PSPOskDialog.h" #include "../Util/PPGeDraw.h" #include "../HLE/sceCtrl.h" #define NUMKEYROWS 4 #define KEYSPERROW 12 #define NUMBEROFVALIDCHARS (KEYSPERROW * NUMKEYROWS) const char oskKeys[NUMKEYROWS][KEYSPERROW + 1] = { {'1','2','3','4','5','6','7','8','9','0','-','+','\0'}, {'Q','W','E','R','T','Y','U','I','O','P','[',']','\0'}, {'A','S','D','F','G','H','J','K','L',';','@','~','\0'}, {'Z','X','C','V','B','N','M',',','.','/','?','\\','\0'}, }; PSPOskDialog::PSPOskDialog() : PSPDialog() { } PSPOskDialog::~PSPOskDialog() { } // Same as get string but read out 16bit void PSPOskDialog::HackyGetStringWide(std::string& _string, const u32 em_address) { char stringBuffer[2048]; char *string = stringBuffer; char c; u32 addr = em_address; while ((c = (char)(Memory::Read_U16(addr)))) { *string++ = c; addr+=2; } *string++ = '\0'; _string = stringBuffer; } int PSPOskDialog::Init(u32 oskPtr) { // Ignore if already running if (status != SCE_UTILITY_STATUS_NONE && status != SCE_UTILITY_STATUS_SHUTDOWN) { return -1; } status = SCE_UTILITY_STATUS_INITIALIZE; memset(&oskParams, 0, sizeof(oskParams)); memset(&oskData, 0, sizeof(oskData)); // TODO: should this be init'd to oskIntext? inputChars.clear(); oskParamsAddr = oskPtr; selectedChar = 0; if (Memory::IsValidAddress(oskPtr)) { Memory::ReadStruct(oskPtr, &oskParams); Memory::ReadStruct(oskParams.SceUtilityOskDataPtr, &oskData); HackyGetStringWide(oskDesc, oskData.descPtr); HackyGetStringWide(oskIntext, oskData.intextPtr); HackyGetStringWide(oskOuttext, oskData.outtextPtr); Memory::WriteStruct(oskParams.SceUtilityOskDataPtr, &oskData); Memory::WriteStruct(oskPtr, &oskParams); } else { return -1; } // Eat any keys pressed before the dialog inited. __CtrlReadLatch(); StartFade(true); return 0; } void PSPOskDialog::RenderKeyboard() { int selectedRow = selectedChar / KEYSPERROW; int selectedExtra = selectedChar % KEYSPERROW; char temp[2]; temp[1] = '\0'; int limit = oskData.outtextlimit; // TODO: Test more thoroughly. Encountered a game where this was 0. if (limit <= 0) limit = 16; const float keyboardLeftSide = (480.0f - (23.0f * KEYSPERROW)) / 2.0f; float previewLeftSide = (480.0f - (15.0f * limit)) / 2.0f; float title = (480.0f - (7.0f * limit)) / 2.0f; PPGeDrawText(oskDesc.c_str(), title , 20, PPGE_ALIGN_CENTER, 0.5f, CalcFadedColor(0xFFFFFFFF)); for (int i = 0; i < limit; ++i) { u32 color = CalcFadedColor(0xFFFFFFFF); if (i < (int) inputChars.size()) temp[0] = inputChars[i]; else if (i == inputChars.size()) { temp[0] = oskKeys[selectedRow][selectedExtra]; color = CalcFadedColor(0xFF3060FF); } else temp[0] = '_'; PPGeDrawText(temp, previewLeftSide + (i * 16.0f), 40.0f, 0, 0.5f, color); } for (int row = 0; row < NUMKEYROWS; ++row) { for (int col = 0; col < KEYSPERROW; ++col) { u32 color = CalcFadedColor(0xFFFFFFFF); if (selectedRow == row && col == selectedExtra) color = CalcFadedColor(0xFF7f7f7f); temp[0] = oskKeys[row][col]; PPGeDrawText(temp, keyboardLeftSide + (25.0f * col), 70.0f + (25.0f * row), 0, 0.6f, color); if (selectedRow == row && col == selectedExtra) PPGeDrawText("_", keyboardLeftSide + (25.0f * col), 70.0f + (25.0f * row), 0, 0.6f, CalcFadedColor(0xFFFFFFFF)); } } } int PSPOskDialog::Update() { buttons = __CtrlReadLatch(); int selectedRow = selectedChar / KEYSPERROW; int selectedExtra = selectedChar % KEYSPERROW; int limit = oskData.outtextlimit; // TODO: Test more thoroughly. Encountered a game where this was 0. if (limit <= 0) limit = 16; if (status == SCE_UTILITY_STATUS_INITIALIZE) { status = SCE_UTILITY_STATUS_RUNNING; } else if (status == SCE_UTILITY_STATUS_RUNNING) { UpdateFade(); StartDraw(); RenderKeyboard(); PPGeDrawImage(I_CROSS, 100, 220, 20, 20, 0, CalcFadedColor(0xFFFFFFFF)); PPGeDrawText("Select", 130, 220, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF)); PPGeDrawImage(I_CIRCLE, 200, 220, 20, 20, 0, CalcFadedColor(0xFFFFFFFF)); PPGeDrawText("Delete", 230, 220, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF)); PPGeDrawImage(I_BUTTON, 290, 220, 50, 20, 0, CalcFadedColor(0xFFFFFFFF)); PPGeDrawText("Start", 305, 220, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF)); PPGeDrawText("Finish", 350, 220, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF)); if (IsButtonPressed(CTRL_UP)) { selectedChar -= KEYSPERROW; } else if (IsButtonPressed(CTRL_DOWN)) { selectedChar += KEYSPERROW; } else if (IsButtonPressed(CTRL_LEFT)) { selectedChar--; if (((selectedChar + KEYSPERROW) % KEYSPERROW) == KEYSPERROW - 1) selectedChar += KEYSPERROW; } else if (IsButtonPressed(CTRL_RIGHT)) { selectedChar++; if ((selectedChar % KEYSPERROW) == 0) selectedChar -= KEYSPERROW; } selectedChar = (selectedChar + NUMBEROFVALIDCHARS) % NUMBEROFVALIDCHARS; if (IsButtonPressed(CTRL_CROSS)) { if ((int) inputChars.size() < limit) inputChars += oskKeys[selectedRow][selectedExtra]; } else if (IsButtonPressed(CTRL_CIRCLE)) { if (inputChars.size() > 0) inputChars.resize(inputChars.size() - 1); } else if (IsButtonPressed(CTRL_START)) { StartFade(false); } EndDraw(); } else if (status == SCE_UTILITY_STATUS_FINISHED) { status = SCE_UTILITY_STATUS_SHUTDOWN; } for (int i = 0; i < limit; ++i) { u16 value = 0; if (i < (int) inputChars.size()) value = 0x0000 ^ inputChars[i]; Memory::Write_U16(value, oskData.outtextPtr + (2 * i)); } oskData.outtextlength = (int) inputChars.size(); oskParams.base.result= 0; oskData.result = PSP_UTILITY_OSK_RESULT_CHANGED; Memory::WriteStruct(oskParams.SceUtilityOskDataPtr, &oskData); Memory::WriteStruct(oskParamsAddr, &oskParams); return 0; } void PSPOskDialog::DoState(PointerWrap &p) { PSPDialog::DoState(p); p.Do(oskParams); p.Do(oskData); p.Do(oskDesc); p.Do(oskIntext); p.Do(oskOuttext); p.Do(oskParamsAddr); p.Do(selectedChar); p.Do(inputChars); p.DoMarker("PSPOskDialog"); }
gpl-2.0
notabadminer/UniversalCoins
src/main/java/universalcoins/container/UCSlotCoinInput.java
838
package universalcoins.container; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import universalcoins.UniversalCoins; public class UCSlotCoinInput extends Slot { public UCSlotCoinInput(IInventory par1IInventory, int par2, int par3, int par4) { super(par1IInventory, par2, par3, par4); } @Override public boolean isItemValid(ItemStack par1ItemStack) { if (par1ItemStack == null) { return true; } Item itemInStack = par1ItemStack.getItem(); return (itemInStack == UniversalCoins.Items.iron_coin || itemInStack == UniversalCoins.Items.emerald_coin || itemInStack == UniversalCoins.Items.gold_coin || itemInStack == UniversalCoins.Items.diamond_coin || itemInStack == UniversalCoins.Items.obsidian_coin); } }
gpl-2.0
HuayraLinux/python-apt
tests/test_configuration.py
954
#!/usr/bin/python # # Copyright (C) 2011 Julian Andres Klode <jak@debian.org> # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. """Unit tests for verifying the correctness of apt_pkg.Configuration""" import unittest import apt_pkg class TestConfiguration(unittest.TestCase): """Test various configuration things""" def setUp(self): """Prepare the tests, create reference values...""" apt_pkg.init_config() def test_lp707416(self): """configuration: Test empty arguments (LP: #707416)""" self.assertRaises(ValueError, apt_pkg.parse_commandline, apt_pkg.config, [], []) self.assertRaises(SystemError, apt_pkg.parse_commandline, apt_pkg.config, [], ["cmd", "--arg0"]) if __name__ == "__main__": unittest.main()
gpl-2.0
marcelinoar/FrameworkWeb
src/base/cliente/lib/ListadoControllerBase.js
22129
/*************************************************************************************************** * * Archivo: ListadoControllerBase.js * ------------------------------------------------------------------------------------------------ * * Autor: Marcelino Morales * * Version: 1.0 * * Descripcion: Clase base que contiene las funcionalidades estandar de las pantallas de listado. * ***************************************************************************************************/ /* * Parametros: * * - comboFiltrosUrl : Url al script que genera los listados de los combos. * - nuevaEntidad : Tipo de entidad nueva a crear. * - editarEntidad : Tipo de entidad a actualizar. * - storeGrilla : Nombre clompleto de la clase que representa el store de la grilla. * - xtypeListado : Xtype del listado * - ventanaMaximizable : Permite que la ventana sea maximizable. * - ventanaMaximized : Abre la ventana maximizada. * - ventanaModal : Abre las ventanas de edicion en forma modal. De lo contrario permite que se minimize y que se mantengan abiertas varias ventanas al mismo tiempo. */ var ListadoControllerBase = { // // Agrega las funciones de esta clase al controller pasado por parametro y tambien // las propiedades paramsEntrada y datosRetorno de la vista. // InyectarDependencia: function (controller, nombre_entidad_permisos) { // Cargamos store_params como un atributo del objeto, no de la clase. Ext.apply (controller, { permisos: null, store_params: {}, params: null // Va a pisar el actual objeto que se llama params por uno que no este compartido por todas las instancias de la clase. }); Ext.apply (controller.getView (), { paramsEntrada : { modoEjecucion : null, verColEditar : null, verColBorrar : null }, datosRetorno : { itemsSeleccionados: [] } }); // Asignamos los permisos de la entidad que corresponden a la pantalla. controller.permisos = sesionUsuario.GetPermiso (nombre_entidad_permisos); // Agregamos los metodos estandar ControllerBase.InyectarDependencia (controller); controller.onBtnAceptarClick = this.onBtnAceptarClick; controller.onBtnCancelarClick = this.onBtnCancelarClick; controller.onRender = this.onRender; controller.onFilterComboRender = this.onFilterComboRender; controller.onFilterComboSelect = this.onFilterComboSelect; controller.onBtnBuscarClick = this.onBtnBuscarClick; controller.onBtnLimpiarFiltrosClick = this.onBtnLimpiarFiltrosClick; controller.onEditarRegistroGrilla = this.onEditarRegistroGrilla; controller.onBorrarRegistroGrilla = this.onBorrarRegistroGrilla; controller.onBtnRecargarListadoClick = this.onBtnRecargarListadoClick; controller.onBtnNuevoClick = this.onBtnNuevoClick; controller.onListadoGrillaCellDblClick = this.onListadoGrillaCellDblClick; controller.AgregarItemsSeleccionados = this.AgregarItemsSeleccionados; controller.ConfigurarModoVista = this.ConfigurarModoVista; controller.ConfigurarModoSeleccion = this.ConfigurarModoSeleccion; controller.ConfigurarModoSeleccionIndividual= this.ConfigurarModoSeleccionIndividual; controller.RefrescarGrilla = this.RefrescarGrilla; controller.RefrescarFiltros = this.RefrescarFiltros; controller.ConfigurarPantalla = this.ConfigurarPantalla; controller.SetDatoSalida = this.SetDatoSalida; controller.CargarStoreParams = this.CargarStoreParams; controller.IntentarCerrarVentanaContenedora = this.IntentarCerrarVentanaContenedora; controller.CargarParametrosFiltro = this.CargarParametrosFiltro; controller.GetComponenteFoco = this.GetComponenteFoco; controller.AplicarParametrosDeEntrada = this.AplicarParametrosDeEntrada; controller.InicializarListado = this.InicializarListado; controller.SeleccionarItemIndividual = this.SeleccionarItemIndividual; controller.CambiarValorFiltro = this.CambiarValorFiltro; controller.EditarRegistro = this.EditarRegistro; controller.onGridStoreBeforeLoad = this.onGridStoreBeforeLoad; controller.onFilterTextoBlur = this.onFilterTextoBlur; controller.onFilterTextoSpecialKey = this.onFilterTextoSpecialKey; controller.onTbBuscarSpecialKey = this.onTbBuscarSpecialKey; controller.onFilterFechaChange = this.onFilterFechaChange; controller.AplicarConfiguracionDeSeguridad = this.AplicarConfiguracionDeSeguridad; controller.CrearStoreGrilla = this.CrearStoreGrilla; }, //--------------------- EventHandlers --------------------- // Ver. Parece que no se usa. onGridStoreBeforeLoad: function (source, operation) { operation.params = Ext.apply(operation.params || {}, this.store_params); }, // // Devuelve un array con los ids de los items seleccionados en la grilla y cierra la ventana // onBtnAceptarClick: function () { var store = this.getView ().down ("grid").getStore (); var listado = Array (); store.each (function (rec, idx) { if (rec.get ('seleccion') == true) { listado.push (rec); } }); this.SetDatoSalida ('itemsSeleccionados', listado); this.SetDatoSalida ('accion', AccionRetorno.Guardar); this.IntentarCerrarVentanaContenedora (); }, // // Devuelve como resultado un array vacio y cierra la ventana. // onBtnCancelarClick: function () { this.SetDatoSalida ('itemsSeleccionados', []); this.IntentarCerrarVentanaContenedora (); }, // // Este es el evento onRender del panel que contiene a la grilla. // Carga la configuracion inicial del programa. // onRender: function () { this.InicializarListado (); }, // // Crea un store para cada filtro y lo carga. // onFilterComboRender: function (me, opts) { }, // // Actualiza el store de la grilla al seleccionar un filtro. // onFilterComboSelect: function (me, rec, opts) { this.store_params[me.filterName] = me.value; this.RefrescarGrilla ({start:0, page:1}); }, // // Actualiza el store de la grilla al realizar una busqueda por texto. // onBtnBuscarClick: function () { this.onBtnRecargarListadoClick (); }, // // Limpia los valores de los filtros y actualiza la grilla. // onBtnLimpiarFiltrosClick: function () { var filtros = this.getView().query ("fieldset[name='FilterFieldSet'] combo"); var me = this; // Limpia los combos filtros.forEach (function (item) { item.clearValue (); delete me.store_params[item.filterName]; }); // Limpia los filtros de fecha var filtros_date = this.getView().query ("fieldset[name='FilterFieldSet'] datefield"); filtros_date.forEach (function (item) { item.setValue (''); delete me.store_params[item.filterName]; }); // Limpia los filtros de codigo var filtros_codigo = this.getView ().query ("fieldset[name='FilterFieldSet'] textfield"); filtros_codigo.forEach (function (item) { item.setValue (''); delete me.store_params[item.filterName]; }); this.RefrescarGrilla (); }, // // Abre el abm para editar el item seleccionado en la grilla. // onEditarRegistroGrilla: function (grid, rowIndex, colIndex) { var item = grid.getStore ().getAt (rowIndex); this.EditarRegistro (item); }, // // Abre el ABM al hacer click en el boton para crear uno nuevo. // onBtnNuevoClick: function() { var me = this; var frm = Ext.create (this.params.nuevaEntidad, {}); frm.paramsEntrada = me.GetOnNuevoParamsEntrada (me.getView().paramsEntrada); var comp = frm.getController ().GetComponenteFoco (); var win = Ext.create('Ext.window.Window', { title : frm.controller.params.nombreEntidad + ': ' + 'Crear', height : frm.controller.params.altoVentana, width : frm.controller.params.anchoVentana, modal : this.params.ventanaModal, maximizable : this.params.ventanaMaximizable, maximized : this.params.ventanaMaximized, collapsible : !this.params.ventanaModal, resizable : false, layout : 'fit', defaultFocus: comp, listeners: { close: function () { // Chequeamos que la grilla todavia exista. if (me.getView () != null) { me.AgregarItemsSeleccionados (frm.datosRetorno, function () { me.RefrescarGrilla (); me.RefrescarFiltros (); }); } this.remove (frm); } } }); win.add (frm); win.show (); }, // // Permite borrar un elemento de la grilla al hacer click en la columna de borrar. // onBorrarRegistroGrilla: function(grid, rowIndex, colIndex) { var me = this; Ext.MessageBox.confirm('Borrar', 'Esta seguro de que desea borrar el registro?', function(btn){ if(btn === 'yes'){ grid.getStore ().getAt (rowIndex).erase ({ success: function () { me.RefrescarGrilla (); me.RefrescarFiltros (); } }); } }); }, // // Recarga los datos de la grilla al hacer click en el boton de refrescar. // onBtnRecargarListadoClick: function () { this.RefrescarGrilla (); }, // // Se dispara cuando se hace doble click sobre una celda de la grilla. // onListadoGrillaCellDblClick: function(grid, rowIndex, colIndex, store, row) { this.SeleccionarItemIndividual (grid.getRecord (row)); }, // // Se dispara cuando se pierde el foco de un filtro del tipo texto. // onFilterTextoBlur: function (comp, val) { this.CambiarValorFiltro (comp.filterName, comp.getValue ()); }, // // Se dispara cuando se preciona enter o tab haciendo foco en un filtro del tipo texto. // onFilterTextoSpecialKey: function (comp, e) { if (e.getKey () == e.ENTER || e.getKey () == e.TAB) { this.CambiarValorFiltro (comp.filterName, comp.getValue ()); } }, onFilterFechaChange: function (comp, val) { this.CambiarValorFiltro (comp.filterName, comp.getSubmitValue ()); }, // // se dispara cuando se preciona enter o tab en el campo de busqueda. // onTbBuscarSpecialKey: function () { this.onBtnRecargarListadoClick (); }, //--------------------- Metodos Privados --------------------- // // Esto es lo primero que hay que hacerle a una grilla. Creamos el store que va a usar y se lo asociamos. // CrearStoreGrilla: function () { var st = Ext.create (this.params.storeGrilla, {autoDestroy:true}); var grilla = this.getView ().down ('grid'); var paging = this.getView ().down ('pagingtoolbar'); grilla.reconfigure (st); // Si la grilla tiene habilitado el plugin de paginado asociamos el // store de la grilla con el del plugin. if (paging != null) { paging.bindStore (st); } }, // // Si estamos ejecutando el listado en modo SeleccionIndividual entonces devolvemos // el registro seleccionado como si fuera una seleccion de un solo item. // En el otro caso abre la ventana de edicion. // SeleccionarItemIndividual: function (rec) { var listado = Array (); if (this.params.modoEjecucion == ModoEjecucionListado.SeleccionIndividual) { listado.push (rec); this.SetDatoSalida ('itemsSeleccionados', listado); this.SetDatoSalida ('accion', AccionRetorno.Guardar); this.IntentarCerrarVentanaContenedora (); } else { this.EditarRegistro (rec); } }, // // Abre una ventana para editar el registro pasado como parametro en el abm correspondiente. // EditarRegistro: function (reg) { if (this.permisos.verRegistro) { var me = this, comp; var frm = Ext.create (this.params.editarEntidad, {}); frm.paramsEntrada = me.GetOnEditarParamsEntrada (reg, me.getView ().paramsEntrada); comp = frm.getController ().GetComponenteFoco (); var win = Ext.create('Ext.window.Window', { title : frm.controller.params.nombreEntidad + ': ' + 'Editar', height : frm.controller.params.altoVentana, width : frm.controller.params.anchoVentana, modal : this.params.ventanaModal, maximizable : this.params.ventanaMaximizable, maximized : this.params.ventanaMaximized, collapsible : !this.params.ventanaModal, resizable : false, defaultFocus: comp, layout : 'fit', listeners: { close: function () { this.remove (frm); // Chequeamos que la grilla todavia exista, si es asi refrescamos su contenido. if (me.getView () != null) { me.RefrescarGrilla (); me.RefrescarFiltros (); } } } }); win.add (frm); win.show (); } }, // // Devuelve el elemento del formulario que debe recibir el foco al momento de abrirse la ventana. // Este metodo por default devuelve el primer textfield del formulario. // GetComponenteFoco: function () { return this.getView ().down ("textfield[name='tbBuscar']"); }, // // Guarda los items seleccionados al abrir la ventana pop-up // Llama a la funcion callback una vez guardados los items. // Los guarda uno por uno. Ver esto, por que habria que cambiarlo y hacer que se guarden de una sola vez. // AgregarItemsSeleccionados: function (datos_retorno, callback) { var params_entrada = this.getView ().paramsEntrada; if (datos_retorno.itemsSeleccionados != null) { for (var i = 0; i < datos_retorno.itemsSeleccionados.length; i++) { this.GuardarItemSeleccionado (datos_retorno.itemsSeleccionados[i], params_entrada); } } callback (); }, // // Cambia la configuracion de la pantalla para modo Vista. // ConfigurarModoVista: function () { this.getView ().down ("button[name='btnCancelar']").hide (); this.getView ().down ("button[name='btnAceptar']").hide (); this.getView ().down ("checkcolumn[name='colSeleccion']").hide (); this.getView ().down ("actioncolumn[name='colEditar']").hide (); }, // // Cambia la configuracion de la pantalla para modo Seleccion Multiple. // ConfigurarModoSeleccion: function () { this.getView ().down ("button[name='btnExportar']").hide (); this.getView ().down ("actioncolumn[name='colEditar']").hide (); }, // // Configura el listado en modo SeleccionIndividual. // ConfigurarModoSeleccionIndividual: function () { this.getView ().down ("button[name='btnCancelar']").hide (); this.getView ().down ("button[name='btnAceptar']").hide (); this.getView ().down ("checkcolumn[name='colSeleccion']").hide (); }, // // Recarga el store de la grilla con los parametros seteados en this.store_params. // Recibe un objeto con parametros para pasarle al metodo load (). Esto Se usa para paginado, para // cuando cambio un filtro de valor y quiero que el store vuelva a una pagina valida. // RefrescarGrilla: function (load_params) { /* DEBUG ---> var tbBuscarValue = this.getView ().down ("textfield[name='tbBuscar']").getValue (); var cbNombreCampo = this.getView ().down ("combo[name='cbCampos']"); var combo_values = cbNombreCampo.store.data.items; // Siempre limpiamos de los parametros todos los filtros de busqueda, luego // agregamos el seleccionado si es que hay alguno seleccionado. for (i = 0; i < combo_values.length; i++) { delete this.store_params[combo_values[i].data.id_field]; } if (tbBuscarValue != '') { this.store_params[cbNombreCampo.getValue ()] = tbBuscarValue; } <-----*/ /* // Vamos a agregar a los filtros todos los componentes que sean del tipo datefield. En realidad // lo que seria mejor es poder listar los componentes que no son combos, pero parece que no se puede, asi que // vamos a listar por tipo. var filtros_datefield = this.getView ().query ("fieldset[name='FilterFieldSet'] datefield"); for (i = 0; i < filtros_datefield.length; i++) { this.store_params[filtros_datefield[i].filterName] = filtros_datefield[i].getValue (); } */ // // Con esto logramos que los parametros definidos en los filtros y la busqueda sean compatibles con el paginado, // osea que se mantengan. // this.getView ().down ("grid").store.proxy.extraParams = this.store_params; if (load_params != undefined) { this.getView ().down ("grid").store.load (load_params); } else { this.getView ().down ("grid").store.load (); } /* this.getView ().down ("grid").store.load ({ params: this.store_params }); */ }, // // Recarga los stores asociados a los filtros. // RefrescarFiltros: function () { var filtros = this.getView ().query ("fieldset[name='FilterFieldSet'] combo"); var params_filtro; var me = this; for (i = 0; i < filtros.length; i++) { params_filtro = this.CargarParametrosFiltro (this.getView ().paramsEntrada, filtros[i].filterName); if (filtros[i].autoCarga) { var st = Ext.create ("Ext.data.Store", { fields : ['id_field', 'desc_field'], proxy : { type: 'ajax', url: me.params.comboFiltrosUrl, reader: { type: 'json', rootProperty: 'root' } } }); filtros[i].store = st; params_filtro['fname'] = filtros[i].filterName; } else { st = filtros[i].store; } st.load ({params : params_filtro}); } }, // // Inicializa los parametros del listado y configura la pantalla. // InicializarListado: function () { this.AplicarParametrosDeEntrada (this.getView ().paramsEntrada, this.params); this.CargarStoreParams (this.store_params, this.params); this.CrearStoreGrilla (); this.ConfigurarPantalla (); this.RefrescarGrilla (); }, // // Pisa los valores de params con los de ParamsEntrada si estos no son nulos. // AplicarParametrosDeEntrada: function (paramsEntrada, params) { if (paramsEntrada.modoEjecucion != null) { params.modoEjecucion = paramsEntrada.modoEjecucion; } if (paramsEntrada.verColEditar != null) { params.verColEditar = paramsEntrada.verColEditar; } if (paramsEntrada.verColBorrar != null) { params.verColBorrar = paramsEntrada.verColBorrar; } }, // // Configura la pantalla en funcion de los parametros recibidos. // ConfigurarPantalla: function () { switch (this.params.modoEjecucion) { case ModoEjecucionListado.SeleccionIndividual: this.ConfigurarModoSeleccionIndividual (); break; case ModoEjecucionListado.Seleccion: this.ConfigurarModoSeleccion (); break; default: this.ConfigurarModoVista (); break; } if (!this.params.verColEditar) { this.getView ().down ("actioncolumn[name='colEditar']").hide (); } if (!this.params.verColBorrar) { this.getView ().down ("actioncolumn[name='colBorrar']").hide (); } this.AplicarConfiguracionDeSeguridad (); this.RefrescarFiltros (); }, // // Esta funcion aplica la configuracion de seguridad asociada a la entidad. // // Aplica las restricciones de: // - Crear Registro: Deshabilita el boton de crear nuevo registro // - Borrar Registro: Oculta la columna de botones de borrar // - Ver Registro: Deshabilita la apertura del formulario de edicion // AplicarConfiguracionDeSeguridad: function () { this.getView ().down ("button[name='btnNuevo']").setDisabled (!this.permisos.crear); if (!this.permisos.borrar) { this.getView ().down ("actioncolumn[name='colBorrar']").hide (); } if (!this.permisos.verRegistro) { this.onEditarRegistroGrilla = function () {}; } }, // // Hace la carga de un modelo pasado por parametros o crea uno nuevo. // IntentarCerrarVentanaContenedora: function () { var f2 = this.getView (); var win = f2.up ('window'); if (win != null) { win.close (); } }, // // Establece el valor de un parametro de salida. // SetDatoSalida: function (nombre, valor) { this.getView ().datosRetorno[nombre] = valor; }, //--------------------- Metodos Publicos --------------------- // // Esta funcion cambia el valor asociado a un filtro en los parametros del store de la grilla. // Se usa para los filtros que no son combos por que esos no son manejados por dentro de esta clase, hay que agregar un // eventhandler en la clase derivada y llamar a esta funcion cada vez que se cambie el valor de ese campo indicando // // $nombre: nombre del filtro. Ej:'fnom', 'ftipo', etc. // $valor: valor del filtro, que es el valor del componente // CambiarValorFiltro: function (nombre, valor) { if (valor != '') { this.store_params[nombre] = valor; this.RefrescarGrilla (); } }, //--------------------- Metodos Sobrecargables (Protegidos) --------------------- // // Metodo establecido por default. Le permite al listado cargar sus propios parametros // customizados para pasar a los store de los filtros. // CargarStoreParams: function (storep, params) { }, // // Metodo vacio establecido por default. // GuardarItemSeleccionado: function (item_id, params_entrada) { }, // // Setea parametros custom para la carga de cada filtro. // Recibe los parametros de entrada del formulario y el nombre del filtro. // el parametro fname se carga automaticamente y no debe indicarse aca. // CargarParametrosFiltro: function (paramsEntrada, nombreFiltro) { return {}; } //--------------------- Metodos Virtuales --------------------- // // Los siguientes metodos no estan definidos en esta clase pero si son invocados desde aca, // por eso es que deben ser definidos obligatoriamente en las clases derivadas para que no surjan // errores en tiempo de ejecucion. // // // Metodo: GetOnNuevoParamsEntrada: function (params) // // Este metodo arma el objeto paramsEntrada pasado al formulario/listado que crea un nuevo y lo devuelve como retorno. // - params: paramsEntrada del listado. // // // Metodo: GetOnEditarParamsEntrada: function (item, params) // // Este metodo arma el objeto paramsEntrada pasado al formulario que edita una entidad del listado y lo devuelve como retorno. // - item : registro a editar. // - params : paramsEntrada de este listado. // }
gpl-2.0
mfursov/ugene
src/corelibs/U2Designer/src/dashboard/ParametersWidget.cpp
4680
/** * UGENE - Integrated Bioinformatics Tools. * Copyright (C) 2008-2017 UniPro <ugene@unipro.ru> * http://ugene.net * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include "ParametersWidget.h" #include <U2Core/U2SafePoints.h> #include <U2Lang/Dataset.h> #include <U2Lang/URLAttribute.h> #include <U2Lang/URLContainer.h> #include <U2Lang/WorkflowUtils.h> namespace U2 { ParametersWidget::ParametersWidget(const QWebElement &container, Dashboard *parent) : DashboardWidget(container, parent) { const WorkflowMonitor *workflowMonitor = dashboard->monitor(); SAFE_POINT(NULL != workflowMonitor, "NULL workflow monitor!", ); const QList<WorkerParamsInfo> &workersParamsInfo = workflowMonitor->getWorkersParameters(); createWidget(workersParamsInfo); } void ParametersWidget::createWidget(const QList<WorkerParamsInfo> &workersParamsInfo) { int i = 0; foreach (const WorkerParamsInfo &info, workersParamsInfo) { // Create the tab QString tabId = "params_tab_id_" + QString::number(i); QString createTabFunc; if (0 == i) { createTabFunc = "pwInitAndActiveTab"; } else { createTabFunc = "pwAddTab"; } createTabFunc += "(this, '" + info.workerName + "', '" + tabId + "')"; container.evaluateJavaScript(createTabFunc); // Add the parameters foreach (Attribute* param, info.parameters) { SAFE_POINT(NULL != param, "NULL attribute!", ); QVariant paramValueVariant = param->getAttributePureValue(); if (paramValueVariant.canConvert< QList<Dataset> >()) { QList<Dataset> sets = paramValueVariant.value< QList<Dataset > >(); foreach (const Dataset &set, sets) { QString paramName = param->getDisplayName(); if (sets.size() > 1) { paramName += ": <i>" + set.getName() + "</i>"; } QStringList urls; foreach (URLContainer *c, set.getUrls()) { urls << c->getUrl(); } QString paramValue = urls.join(";"); QString createParamFunc = "pwAddFilesParameter"; createParamFunc += "('" + tabId + "', "; createParamFunc += "'" + paramName + "', "; createParamFunc += "'" + paramValue + "', false)"; container.evaluateJavaScript(createParamFunc); } } else { QString paramName = param->getDisplayName(); QString paramValue = WorkflowUtils::getStringForParameterDisplayRole(paramValueVariant); QString createParamFunc; UrlAttributeType type = WorkflowUtils::isUrlAttribute(param, info.actor); if (type == NotAnUrl || QString::compare(paramValueVariant.toString(), "default", Qt::CaseInsensitive) == 0) { createParamFunc = "pwAddCommonParameter"; } else { createParamFunc = "pwAddFilesParameter"; } createParamFunc += "('" + tabId + "', "; createParamFunc += "'" + paramName + "', "; createParamFunc += "'" + paramValue + "'"; if (type != NotAnUrl && QString::compare(paramValueVariant.toString(), "default", Qt::CaseInsensitive) != 0) { bool disableOpeningByUgene = false; if (type == InputDir || type == OutputDir) { disableOpeningByUgene = true; } createParamFunc += ", " + QString::number(disableOpeningByUgene); } createParamFunc += ")"; container.evaluateJavaScript(createParamFunc); } } // Increase the iterator i++; } } } // namespace U2
gpl-2.0
osarrat/sigmah-website
issues/api/soap/mc_issue_api.php
46822
<?php # MantisConnect - A webservice interface to Mantis Bug Tracker # Copyright (C) 2004-2010 Victor Boctor - vboctor@users.sourceforge.net # This program is distributed under dual licensing. These include # GPL and a commercial licenses. Victor Boctor reserves the right to # change the license of future releases. # See docs/ folder for more details require_once( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'mc_core.php' ); /** * Check if an issue with the given id exists. * * @param string $p_username The name of the user trying to access the issue. * @param string $p_password The password of the user. * @param integer $p_issue_id The id of the issue to check. * @return boolean true if there is an issue with the given id, false otherwise. */ function mc_issue_exists( $p_username, $p_password, $p_issue_id ) { $t_user_id = mci_check_login( $p_username, $p_password ); if( $t_user_id === false ) { return mci_soap_fault_login_failed(); } if( !bug_exists( $p_issue_id ) ) { return false; } $t_project_id = bug_get_field( $p_issue_id, 'project_id' ); if( !mci_has_readonly_access( $t_user_id, $t_project_id ) ) { // if we return an error here, then we answered the question! return false; } return true; } /** * Get all details about an issue. * * @param string $p_username The name of the user trying to access the issue. * @param string $p_password The password of the user. * @param integer $p_issue_id The id of the issue to retrieve. * @return Array that represents an IssueData structure */ function mc_issue_get( $p_username, $p_password, $p_issue_id ) { $t_user_id = mci_check_login( $p_username, $p_password ); if( $t_user_id === false ) { return mci_soap_fault_login_failed(); } $t_lang = mci_get_user_lang( $t_user_id ); if( !bug_exists( $p_issue_id ) ) { return new soap_fault( 'Client', '', 'Issue does not exist.' ); } $t_project_id = bug_get_field( $p_issue_id, 'project_id' ); if( !mci_has_readonly_access( $t_user_id, $t_project_id ) ) { return mci_soap_fault_access_denied( $t_user_id ); } $t_bug = bug_get( $p_issue_id, true ); $t_issue_data = array(); $t_issue_data['id'] = $p_issue_id; $t_issue_data['view_state'] = mci_enum_get_array_by_id( $t_bug->view_state, 'view_state', $t_lang ); $t_issue_data['last_updated'] = timestamp_to_iso8601( $t_bug->last_updated ); $t_issue_data['project'] = mci_project_as_array_by_id( $t_bug->project_id ); $t_issue_data['category'] = mci_get_category( $t_bug->category_id ); $t_issue_data['priority'] = mci_enum_get_array_by_id( $t_bug->priority, 'priority', $t_lang ); $t_issue_data['severity'] = mci_enum_get_array_by_id( $t_bug->severity, 'severity', $t_lang ); $t_issue_data['status'] = mci_enum_get_array_by_id( $t_bug->status, 'status', $t_lang ); $t_issue_data['reporter'] = mci_account_get_array_by_id( $t_bug->reporter_id ); $t_issue_data['summary'] = $t_bug->summary; $t_issue_data['version'] = mci_null_if_empty( $t_bug->version ); $t_issue_data['build'] = mci_null_if_empty( $t_bug->build ); $t_issue_data['platform'] = mci_null_if_empty( $t_bug->platform ); $t_issue_data['os'] = mci_null_if_empty( $t_bug->os ); $t_issue_data['os_build'] = mci_null_if_empty( $t_bug->os_build ); $t_issue_data['reproducibility'] = mci_enum_get_array_by_id( $t_bug->reproducibility, 'reproducibility', $t_lang ); $t_issue_data['date_submitted'] = timestamp_to_iso8601( $t_bug->date_submitted ); $t_issue_data['sponsorship_total'] = $t_bug->sponsorship_total; if( !empty( $t_bug->handler_id ) ) { $t_issue_data['handler'] = mci_account_get_array_by_id( $t_bug->handler_id ); } $t_issue_data['projection'] = mci_enum_get_array_by_id( $t_bug->projection, 'projection', $t_lang ); $t_issue_data['eta'] = mci_enum_get_array_by_id( $t_bug->eta, 'eta', $t_lang ); $t_issue_data['resolution'] = mci_enum_get_array_by_id( $t_bug->resolution, 'resolution', $t_lang ); $t_issue_data['fixed_in_version'] = mci_null_if_empty( $t_bug->fixed_in_version ); $t_issue_data['target_version'] = mci_null_if_empty( $t_bug->target_version ); $t_issue_data['due_date'] = mci_issue_get_due_date( $t_bug ); $t_issue_data['description'] = $t_bug->description; $t_issue_data['steps_to_reproduce'] = mci_null_if_empty( $t_bug->steps_to_reproduce ); $t_issue_data['additional_information'] = mci_null_if_empty( $t_bug->additional_information ); $t_issue_data['attachments'] = mci_issue_get_attachments( $p_issue_id ); $t_issue_data['relationships'] = mci_issue_get_relationships( $p_issue_id, $t_user_id ); $t_issue_data['notes'] = mci_issue_get_notes( $p_issue_id ); $t_issue_data['custom_fields'] = mci_issue_get_custom_fields( $p_issue_id ); return $t_issue_data; } /** * Returns the category name, possibly null if no category is assigned * * @param int $p_category_id * @return string */ function mci_get_category( $p_category_id ) { if ( $p_category_id == 0 ) return ''; return mci_null_if_empty( category_get_name( $p_category_id ) ); } /** * * @param BugData $bug * @return soapval the value to be encoded as the due date */ function mci_issue_get_due_date( $p_bug ) { if ( access_has_bug_level( config_get( 'due_date_view_threshold' ), $p_bug->id ) && !date_is_null( $p_bug->due_date ) ) { return new soapval( 'due_date', 'xsd:dateTime', timestamp_to_iso8601( $p_bug->due_date ) ); } else { return new soapval( 'due_date','xsd:dateTime', null ); } } /** * Sets the supplied array of custom field values to the specified issue id. * * @param $p_issue_id Issue id to apply custom field values to. * @param $p_custom_fields The array of custom field values as described in the webservice complex types. * @param boolean $p_log_insert create history logs for new values */ function mci_issue_set_custom_fields( $p_issue_id, &$p_custom_fields, $p_log_insert ) { # set custom field values on the submitted issue if( isset( $p_custom_fields ) && is_array( $p_custom_fields ) ) { foreach( $p_custom_fields as $t_custom_field ) { # get custom field id from object ref $t_custom_field_id = mci_get_custom_field_id_from_objectref( $t_custom_field['field'] ); if( $t_custom_field_id == 0 ) { return new soap_fault( 'Client', '', 'Custom field ' . $t_custom_field['field']['name'] . ' not found.' ); } # skip if current user doesn't have login access. if( !custom_field_has_write_access( $t_custom_field_id, $p_issue_id ) ) { continue; } $t_value = $t_custom_field['value']; if( !custom_field_validate( $t_custom_field_id, $t_value ) ) { return new soap_fault( 'Client', '', 'Invalid custom field value for field id ' . $t_custom_field_id . ' .'); } if( !custom_field_set_value( $t_custom_field_id, $p_issue_id, $t_value, $p_log_insert ) ) { return new soap_fault( 'Server', '', 'Unable to set custom field value for field id ' . $t_custom_field_id . ' to issue ' . $p_issue_id. ' .' ); } } } } /** * Get the custom field values associated with the specified issue id. * * @param $p_issue_id Issue id to get the custom field values for. * * @return null if no custom field defined for the project that contains the issue, or if no custom * fields are accessible to the current user. */ function mci_issue_get_custom_fields( $p_issue_id ) { $t_project_id = bug_get_field( $p_issue_id, 'project_id' ); $t_custom_fields = array(); $t_related_custom_field_ids = custom_field_get_linked_ids( $t_project_id ); foreach( $t_related_custom_field_ids as $t_id ) { $t_def = custom_field_get_definition( $t_id ); if( custom_field_has_read_access( $t_id, $p_issue_id ) ) { # user has not access to read this custom field. $t_value = custom_field_get_value( $t_id, $p_issue_id ); if( $t_value === false ) { continue; } # return a blank string if the custom field value is undefined if( $t_value === null ) { $t_value = ''; } $t_custom_field_value = array(); $t_custom_field_value['field'] = array(); $t_custom_field_value['field']['id'] = $t_id; $t_custom_field_value['field']['name'] = $t_def['name']; $t_custom_field_value['value'] = $t_value; $t_custom_fields[] = $t_custom_field_value; } } # foreach return( count( $t_custom_fields ) == 0 ? null : $t_custom_fields ); } /** * Get the attachments of an issue. * * @param integer $p_issue_id The id of the issue to retrieve the attachments for * @return Array that represents an AttachmentData structure */ function mci_issue_get_attachments( $p_issue_id ) { $t_attachment_rows = bug_get_attachments( $p_issue_id ); if ( $t_attachment_rows == null) { return array(); } $t_result = array(); foreach( $t_attachment_rows as $t_attachment_row ) { $t_attachment = array(); $t_attachment['id'] = $t_attachment_row['id']; $t_attachment['filename'] = $t_attachment_row['filename']; $t_attachment['size'] = $t_attachment_row['filesize']; $t_attachment['content_type'] = $t_attachment_row['file_type']; $t_attachment['date_submitted'] = timestamp_to_iso8601( $t_attachment_row['date_added'] ); $t_attachment['download_url'] = mci_get_mantis_path() . 'file_download.php?file_id=' . $t_attachment_row['id'] . '&amp;type=bug'; $t_result[] = $t_attachment; } return $t_result; } /** * Get the relationships of an issue. * * @param integer $p_issue_id The id of the issue to retrieve the relationships for * @return Array that represents an RelationShipData structure */ function mci_issue_get_relationships( $p_issue_id, $p_user_id ) { $t_relationships = array(); $t_src_relationships = relationship_get_all_src( $p_issue_id ); foreach( $t_src_relationships as $t_relship_row ) { if( access_has_bug_level( config_get( 'mc_readonly_access_level_threshold' ), $t_relship_row->dest_bug_id, $p_user_id ) ) { $t_relationship = array(); $t_reltype = array(); $t_relationship['id'] = $t_relship_row->id; $t_reltype['id'] = $t_relship_row->type; $t_reltype['name'] = relationship_get_description_src_side( $t_relship_row->type ); $t_relationship['type'] = $t_reltype; $t_relationship['target_id'] = $t_relship_row->dest_bug_id; $t_relationships[] = $t_relationship; } } $t_dest_relationships = relationship_get_all_dest( $p_issue_id ); foreach( $t_dest_relationships as $t_relship_row ) { if( access_has_bug_level( config_get( 'mc_readonly_access_level_threshold' ), $t_relship_row->src_bug_id, $p_user_id ) ) { $t_relationship = array(); $t_relationship['id'] = $t_relship_row->id; $t_reltype = array(); $t_reltype['id'] = relationship_get_complementary_type( $t_relship_row->type ); $t_reltype['name'] = relationship_get_description_dest_side( $t_relship_row->type ); $t_relationship['type'] = $t_reltype; $t_relationship['target_id'] = $t_relship_row->src_bug_id; $t_relationships[] = $t_relationship; } } return (count( $t_relationships ) == 0 ? null : $t_relationships ); } /** * Get all visible notes for a specific issue * * @param integer $p_issue_id The id of the issue to retrieve the notes for * @return Array that represents an IssueNoteData structure */ function mci_issue_get_notes( $p_issue_id ) { $t_user_id = auth_get_current_user_id(); $t_lang = mci_get_user_lang( $t_user_id ); $t_project_id = bug_get_field( $p_issue_id, 'project_id' ); $t_user_bugnote_order = 'ASC'; // always get the notes in ascending order for consistency to the calling application. $t_has_time_tracking_access = access_has_bug_level( config_get( 'time_tracking_view_threshold' ), $p_issue_id ); $t_result = array(); foreach( bugnote_get_all_visible_bugnotes( $p_issue_id, $t_user_bugnote_order, 0 ) as $t_value ) { $t_bugnote = array(); $t_bugnote['id'] = $t_value->id; $t_bugnote['reporter'] = mci_account_get_array_by_id( $t_value->reporter_id ); $t_bugnote['date_submitted'] = timestamp_to_iso8601( $t_value->date_submitted ); $t_bugnote['last_modified'] = timestamp_to_iso8601( $t_value->last_modified ); $t_bugnote['text'] = $t_value->note; $t_bugnote['view_state'] = mci_enum_get_array_by_id( $t_value->view_state, 'view_state', $t_lang ); $t_bugnote['time_tracking'] = $t_has_time_tracking_access ? $t_value->time_tracking : 0; $t_result[] = $t_bugnote; } return (count( $t_result ) == 0 ? null : $t_result ); } /** * Get the biggest issue id currently used. * * @param string $p_username The name of the user trying to retrieve the information * @param string $p_password The password of the user. * @param int $p_project_id -1 default project, 0 for all projects, otherwise project id. * @return integer The biggest used issue id. */ function mc_issue_get_biggest_id( $p_username, $p_password, $p_project_id ) { $t_user_id = mci_check_login( $p_username, $p_password ); if( $t_user_id === false ) { return mci_soap_fault_login_failed(); } $t_any = defined( 'META_FILTER_ANY' ) ? META_FILTER_ANY : 'any'; $t_none = defined( 'META_FILTER_NONE' ) ? META_FILTER_NONE : 'none'; $t_filter = array( 'show_category' => Array( '0' => $t_any, ), 'show_severity' => Array( '0' => $t_any, ), 'show_status' => Array( '0' => $t_any, ), 'highlight_changed' => 0, 'reporter_id' => Array( '0' => $t_any, ), 'handler_id' => Array( '0' => $t_any, ), 'show_resolution' => Array( '0' => $t_any, ), 'show_build' => Array( '0' => $t_any, ), 'show_version' => Array( '0' => $t_any, ), 'hide_status' => Array( '0' => $t_none, ), 'user_monitor' => Array( '0' => $t_any, ), 'dir' => 'DESC', 'sort' => 'date_submitted', ); $t_page_number = 1; $t_per_page = 1; $t_bug_count = 0; $t_page_count = 0; # Get project id, if -1, then retrieve the current which will be the default since there is no cookie. $t_project_id = $p_project_id; if( $t_project_id == -1 ) { $t_project_id = helper_get_current_project(); } if(( $t_project_id > 0 ) && !project_exists( $t_project_id ) ) { return new soap_fault( 'Client', '', "Project '$t_project_id' does not exist." ); } if( !mci_has_readonly_access( $t_user_id, $t_project_id ) ) { return mci_soap_fault_access_denied( $t_user_id ); } $t_rows = filter_get_bug_rows( $t_page_number, $t_per_page, $t_page_count, $t_bug_count, $t_filter, $t_project_id, $t_user_id ); if( count( $t_rows ) == 0 ) { return 0; } else { return $t_rows[0]->id; } } /** * Get the id of an issue via the issue's summary. * * @param string $p_username The name of the user trying to delete the issue. * @param string $p_password The password of the user. * @param string $p_summary The summary of the issue to retrieve. * @return integer The id of the issue with the given summary, 0 if there is no such issue. */ function mc_issue_get_id_from_summary( $p_username, $p_password, $p_summary ) { $t_user_id = mci_check_login( $p_username, $p_password ); if( $t_user_id === false ) { return mci_soap_fault_login_failed(); } $t_bug_table = db_get_table( 'mantis_bug_table' ); $query = "SELECT id FROM $t_bug_table WHERE summary = " . db_param(); $result = db_query_bound( $query, Array( $p_summary ), 1 ); if( db_num_rows( $result ) == 0 ) { return 0; } else { while(( $row = db_fetch_array( $result ) ) !== false ) { $t_issue_id = (int) $row['id']; $t_project_id = bug_get_field( $t_issue_id, 'project_id' ); if( mci_has_readonly_access( $t_user_id, $t_project_id ) ) { return $t_issue_id; } } // no issue found that belongs to a project that the user has read access to. return 0; } } /** * Add an issue to the database. * * @param string $p_username The name of the user trying to add the issue. * @param string $p_password The password of the user. * @param Array $p_issue A IssueData structure containing information about the new issue. * @return integer The id of the created issue. */ function mc_issue_add( $p_username, $p_password, $p_issue ) { $t_user_id = mci_check_login( $p_username, $p_password ); if( $t_user_id === false ) { return mci_soap_fault_login_failed(); } $t_project = $p_issue['project']; $t_project_id = mci_get_project_id( $t_project ); if( !mci_has_readwrite_access( $t_user_id, $t_project_id ) ) { return mci_soap_fault_access_denied( $t_user_id ); } $t_handler_id = isset( $p_issue['handler'] ) ? mci_get_user_id( $p_issue['handler'] ) : 0; $t_priority_id = isset( $p_issue['priority'] ) ? mci_get_priority_id( $p_issue['priority'] ) : config_get( 'default_bug_priority' ); $t_severity_id = isset( $p_issue['severity'] ) ? mci_get_severity_id( $p_issue['severity'] ) : config_get( 'default_bug_severity' ); $t_status_id = isset( $p_issue['status'] ) ? mci_get_status_id( $p_issue['status'] ) : config_get( 'bug_submit_status' ); $t_reproducibility_id = isset( $p_issue['reproducibility'] ) ? mci_get_reproducibility_id( $p_issue['reproducibility'] ) : config_get( 'default_bug_reproducibility' ); $t_resolution_id = isset( $p_issue['resolution'] ) ? mci_get_resolution_id( $p_issue['resolution'] ) : config_get('default_bug_resolution'); $t_projection_id = isset( $p_issue['projection'] ) ? mci_get_projection_id( $p_issue['projection'] ) : config_get('default_bug_resolution'); $t_eta_id = isset( $p_issue['eta'] ) ? mci_get_eta_id( $p_issue['eta'] ) : config_get('default_bug_eta'); $t_view_state_id = isset( $p_issue['view_state'] ) ? mci_get_view_state_id( $p_issue['view_state'] ) : config_get( 'default_bug_view_status' ); $t_reporter_id = isset( $p_issue['reporter'] ) ? mci_get_user_id( $p_issue['reporter'] ) : 0; $t_summary = $p_issue['summary']; $t_description = $p_issue['description']; $t_notes = isset( $p_issue['notes'] ) ? $p_issue['notes'] : array(); if( $t_reporter_id == 0 ) { $t_reporter_id = $t_user_id; } else { if( $t_reporter_id != $t_user_id ) { # Make sure that active user has access level required to specify a different reporter. $t_specify_reporter_access_level = config_get( 'mc_specify_reporter_on_add_access_level_threshold' ); if( !access_has_project_level( $t_specify_reporter_access_level, $t_project_id, $t_user_id ) ) { return mci_soap_fault_access_denied( $t_user_id, "Active user does not have access level required to specify a different issue reporter" ); } } } if(( $t_project_id == 0 ) || !project_exists( $t_project_id ) ) { if( $t_project_id == 0 ) { return new soap_fault( 'Client', '', "Project '" . $t_project['name'] . "' does not exist." ); } else { return new soap_fault( 'Client', '', "Project with id '" . $t_project_id . "' does not exist." ); } } if( !access_has_project_level( config_get( 'report_bug_threshold' ), $t_project_id, $t_user_id ) ) { return mci_soap_fault_access_denied( "User '$t_user_id' does not have access right to report issues" ); } #if ( !access_has_project_level( config_get( 'report_bug_threshold' ), $t_project_id ) || # !access_has_project_level( config_get( 'report_bug_threshold' ), $t_project_id, $v_reporter ) ) { # return new soap_fault( 'Client', '', "User does not have access right to report issues." ); #} if(( $t_handler_id != 0 ) && !user_exists( $t_handler_id ) ) { return new soap_fault( 'Client', '', "User '$t_handler_id' does not exist." ); } $t_category = isset ( $p_issue['category'] ) ? $p_issue['category'] : null; $t_category_id = translate_category_name_to_id( $t_category, $t_project_id ); if ( $t_category_id == 0 && !config_get( 'allow_no_category' ) ) { if ( !isset( $p_issue['category'] ) || is_blank( $p_issue['category'] ) ) { return new soap_fault( 'Client', '', "Category field must be supplied." ); } else { return new soap_fault( 'Client', '', "Category '" . $p_issue['category'] . "' not found for project '$t_project_id'." ); } } if ( isset( $p_issue['version'] ) && !is_blank( $p_issue['version'] ) && !version_get_id( $p_issue['version'], $t_project_id ) ) { $t_version = $p_issue['version']; $t_error_when_version_not_found = config_get( 'mc_error_when_version_not_found' ); if( $t_error_when_version_not_found == ON ) { $t_project_name = project_get_name( $t_project_id ); return new soap_fault( 'Client', '', "Version '$t_version' does not exist in project '$t_project_name'." ); } else { $t_version_when_not_found = config_get( 'mc_version_when_not_found' ); $t_version = $t_version_when_not_found; } } if ( is_blank( $t_summary ) ) { return new soap_fault( 'Client', '', "Mandatory field 'summary' is missing." ); } if ( is_blank( $t_description ) ) { return new soap_fault( 'Client', '', "Mandatory field 'description' is missing." ); } $t_bug_data = new BugData; $t_bug_data->profile_id = 0; $t_bug_data->project_id = $t_project_id; $t_bug_data->reporter_id = $t_reporter_id; $t_bug_data->handler_id = $t_handler_id; $t_bug_data->priority = $t_priority_id; $t_bug_data->severity = $t_severity_id; $t_bug_data->reproducibility = $t_reproducibility_id; $t_bug_data->status = $t_status_id; $t_bug_data->resolution = $t_resolution_id; $t_bug_data->projection = $t_projection_id; $t_bug_data->category_id = $t_category_id; $t_bug_data->date_submitted = isset( $p_issue['date_submitted'] ) ? $p_issue['date_submitted'] : ''; $t_bug_data->last_updated = isset( $p_issue['last_updated'] ) ? $p_issue['last_updated'] : ''; $t_bug_data->eta = $t_eta_id; $t_bug_data->os = isset( $p_issue['os'] ) ? $p_issue['os'] : ''; $t_bug_data->os_build = isset( $p_issue['os_build'] ) ? $p_issue['os_build'] : ''; $t_bug_data->platform = isset( $p_issue['platform'] ) ? $p_issue['platform'] : ''; $t_bug_data->version = isset( $p_issue['version'] ) ? $p_issue['version'] : ''; $t_bug_data->fixed_in_version = isset( $p_issue['fixed_in_version'] ) ? $p_issue['fixed_in_version'] : ''; $t_bug_data->build = isset( $p_issue['build'] ) ? $p_issue['build'] : ''; $t_bug_data->view_state = $t_view_state_id; $t_bug_data->summary = $t_summary; $t_bug_data->sponsorship_total = isset( $p_issue['sponsorship_total'] ) ? $p_issue['sponsorship_total'] : 0; if ( isset( $p_issue['due_date'] ) && access_has_global_level( config_get( 'due_date_update_threshold' ) ) ) { $t_bug_data->due_date = mci_iso8601_to_timestamp( $p_issue['due_date'] ); } else { $t_bug_data->due_date = date_get_null(); } if( access_has_project_level( config_get( 'roadmap_update_threshold' ), $t_bug_data->project_id, $t_user_id ) ) { $t_bug_data->target_version = isset( $p_issue['target_version'] ) ? $p_issue['target_version'] : ''; } # omitted: # var $bug_text_id # $t_bug_data->profile_id; # extended info $t_bug_data->description = $t_description; $t_bug_data->steps_to_reproduce = isset( $p_issue['steps_to_reproduce'] ) ? $p_issue['steps_to_reproduce'] : ''; $t_bug_data->additional_information = isset( $p_issue['additional_information'] ) ? $p_issue['additional_information'] : ''; # submit the issue $t_issue_id = $t_bug_data->create(); mci_issue_set_custom_fields( $t_issue_id, $p_issue['custom_fields'], false ); if( isset( $t_notes ) && is_array( $t_notes ) ) { foreach( $t_notes as $t_note ) { if( isset( $t_note['view_state'] ) ) { $t_view_state = $t_note['view_state']; } else { $t_view_state = config_get( 'default_bugnote_view_status' ); } $t_view_state_id = mci_get_enum_id_from_objectref( 'view_state', $t_view_state ); bugnote_add( $t_issue_id, $t_note['text'], mci_get_time_tracking_from_note( $t_issue_id, $t_note ), $t_view_state_id == VS_PRIVATE, BUGNOTE, '', $t_user_id, FALSE ); } } email_new_bug( $t_issue_id ); return $t_issue_id; } /** * Update Issue in database * * Created By KGB * @param string $p_username The name of the user trying to add the issue. * @param string $p_password The password of the user. * @param Array $p_issue A IssueData structure containing information about the new issue. * @return integer The id of the created issue. */ function mc_issue_update( $p_username, $p_password, $p_issue_id, $p_issue ) { $t_user_id = mci_check_login( $p_username, $p_password ); if( $t_user_id === false ) { return mci_soap_fault_login_failed(); } if( !bug_exists( $p_issue_id ) ) { return new soap_fault( 'Client', '', "Issue '$p_issue_id' does not exist." ); } $t_project_id = bug_get_field( $p_issue_id, 'project_id' ); if( !mci_has_readwrite_access( $t_user_id, $t_project_id ) ) { return mci_soap_fault_access_denied( $t_user_id ); } $t_project_id = mci_get_project_id( $p_issue['project'] ); $t_handler_id = isset( $p_issue['handler'] ) ? mci_get_user_id( $p_issue['handler'] ) : 0; $t_priority_id = isset( $p_issue['priority'] ) ? mci_get_priority_id( $p_issue['priority'] ) : config_get( 'default_bug_priority' ); $t_severity_id = isset( $p_issue['severity'] ) ? mci_get_severity_id( $p_issue['severity'] ) : config_get( 'default_bug_severity' ); $t_status_id = isset( $p_issue['status'] ) ? mci_get_status_id( $p_issue['status'] ) : config_get( 'bug_submit_status' ); $t_reproducibility_id = isset( $p_issue['reproducibility'] ) ? mci_get_reproducibility_id( $p_issue['reproducibility'] ) : config_get( 'default_bug_reproducibility' ); $t_resolution_id = isset( $p_issue['resolution'] ) ? mci_get_resolution_id( $p_issue['resolution'] ) : config_get('default_bug_resolution'); $t_projection_id = isset( $p_issue['projection'] ) ? mci_get_projection_id( $p_issue['projection'] ) : config_get('default_bug_resolution'); $t_eta_id = isset( $p_issue['eta'] ) ? mci_get_eta_id( $p_issue['eta'] ) : config_get('default_bug_eta'); $t_view_state_id = isset( $p_issue['view_state'] ) ? mci_get_view_state_id( $p_issue['view_state'] ) : config_get( 'default_bug_view_status' ); $t_reporter_id = isset( $p_issue['reporter'] ) ? mci_get_user_id( $p_issue['reporter'] ) : 0; $t_project = $p_issue['project']; $t_summary = isset( $p_issue['summary'] ) ? $p_issue['summary'] : ''; $t_description = isset( $p_issue['description'] ) ? $p_issue['description'] : ''; $t_additional_information = isset( $p_issue['additional_information'] ) ? $p_issue['additional_information'] : ''; $t_steps_to_reproduce = isset( $p_issue['steps_to_reproduce'] ) ? $p_issue['steps_to_reproduce'] : ''; $t_build = isset( $p_issue['build'] ) ? $p_issue['build'] : ''; $t_platform = isset( $p_issue['platform'] ) ? $p_issue['platform'] : ''; $t_os = isset( $p_issue['os'] ) ? $p_issue['os'] : ''; $t_os_build = isset( $p_issue['os_build'] ) ? $p_issue['os_build'] : ''; $t_sponsorship_total = isset( $p_issue['sponsorship_total'] ) ? $p_issue['sponsorship_total'] : 0; if( $t_reporter_id == 0 ) { $t_reporter_id = $t_user_id; } if(( $t_project_id == 0 ) || !project_exists( $t_project_id ) ) { if( $t_project_id == 0 ) { return new soap_fault( 'Client', '', "Project '" . $t_project['name'] . "' does not exist." ); } return new soap_fault( 'Client', '', "Project '$t_project_id' does not exist." ); } if( !access_has_bug_level( config_get( 'update_bug_threshold' ), $p_issue_id, $t_user_id ) ) { return mci_soap_fault_access_denied( $t_user_id, "Not enough rights to update issues" ); } if(( $t_handler_id != 0 ) && !user_exists( $t_handler_id ) ) { return new soap_fault( 'Client', '', "User '$t_handler_id' does not exist." ); } $t_category = isset ( $p_issue['category'] ) ? $p_issue['category'] : null; $t_category_id = translate_category_name_to_id( $t_category, $t_project_id ); if ( $t_category_id == 0 && !config_get( 'allow_no_category' ) ) { if ( isset( $p_issue['category'] ) && !is_blank( $p_issue['category'] ) ) { return new soap_fault( 'Client', '', "Category field must be supplied." ); } else { return new soap_fault( 'Client', '', "Category '" . $p_issue['category'] . "' not found for project '$t_project_name'." ); } } if ( isset( $p_issue['version'] ) && !is_blank( $p_issue['version'] ) && !version_get_id( $p_issue['version'], $t_project_id ) ) { $t_error_when_version_not_found = config_get( 'mc_error_when_version_not_found' ); if( $t_error_when_version_not_found == ON ) { $t_project_name = project_get_name( $t_project_id ); return new soap_fault( 'Client', '', "Version '" . $p_issue['version'] . "' does not exist in project '$t_project_name'." ); } else { $t_version_when_not_found = config_get( 'mc_version_when_not_found' ); $p_issue['version'] = $t_version_when_not_found; } } if ( is_blank( $t_summary ) ) { return new soap_fault( 'Client', '', "Mandatory field 'summary' is missing." ); } if ( is_blank( $t_description ) ) { return new soap_fault( 'Client', '', "Mandatory field 'description' is missing." ); } if ( $t_priority_id == 0 ) { $t_priority_id = config_get( 'default_bug_priority' ); } if ( $t_severity_id == 0 ) { $t_severity_id = config_get( 'default_bug_severity' ); } if ( $t_view_state_id == 0 ) { $t_view_state_id = config_get( 'default_bug_view_status' ); } if ( $t_reproducibility_id == 0 ) { $t_reproducibility_id = config_get( 'default_bug_reproducibility' ); } $t_bug_data = new BugData; $t_bug_data->id = $p_issue_id; $t_bug_data->project_id = $t_project_id; $t_bug_data->reporter_id = $t_reporter_id; $t_bug_data->handler_id = $t_handler_id; $t_bug_data->priority = $t_priority_id; $t_bug_data->severity = $t_severity_id; $t_bug_data->reproducibility = $t_reproducibility_id; $t_bug_data->status = $t_status_id; $t_bug_data->resolution = $t_resolution_id; $t_bug_data->projection = $t_projection_id; $t_bug_data->category_id = $t_category_id; $t_bug_data->date_submitted = isset( $v_date_submitted ) ? $v_date_submitted : ''; $t_bug_data->last_updated = isset( $v_last_updated ) ? $v_last_updated : ''; $t_bug_data->eta = $t_eta_id; $t_bug_data->os = $t_os; $t_bug_data->os_build = $t_os_build; $t_bug_data->platform = $t_platform; $t_bug_data->version = isset( $p_issue['version'] ) ? $p_issue['version'] : ''; $t_bug_data->fixed_in_version = isset( $p_issue['fixed_in_version'] ) ? $p_issue['fixed_in_version'] : ''; $t_bug_data->build = $t_build; $t_bug_data->view_state = $t_view_state_id; $t_bug_data->summary = $t_summary; $t_bug_data->sponsorship_total = $t_sponsorship_total; if ( isset( $p_issue['due_date'] ) && access_has_global_level( config_get( 'due_date_update_threshold' ) ) ) { $t_bug_data->due_date = mci_iso8601_to_timestamp( $p_issue['due_date'] ); } else { $t_bug_data->due_date = date_get_null(); } if( access_has_project_level( config_get( 'roadmap_update_threshold' ), $t_bug_data->project_id, $t_user_id ) ) { $t_bug_data->target_version = isset( $p_issue['target_version'] ) ? $p_issue['target_version'] : ''; } # omitted: # var $bug_text_id # $t_bug_data->profile_id; # extended info $t_bug_data->description = $t_description; $t_bug_data->steps_to_reproduce = isset( $t_steps_to_reproduce ) ? $t_steps_to_reproduce : ''; $t_bug_data->additional_information = isset( $t_additional_information ) ? $t_additional_information : ''; # submit the issue $t_is_success = $t_bug_data->update( /* update_extended */ true, /* bypass_email */ true ); mci_issue_set_custom_fields( $p_issue_id, $p_issue['custom_fields'], true ); if ( isset( $p_issue['notes'] ) && is_array( $p_issue['notes'] ) ) { foreach ( $p_issue['notes'] as $t_note ) { if ( isset( $t_note['view_state'] ) ) { $t_view_state = $t_note['view_state']; } else { $t_view_state = config_get( 'default_bugnote_view_status' ); } if ( isset( $t_note['id'] ) && ( (int)$t_note['id'] > 0 ) ) { $t_bugnote_id = (integer)$t_note['id']; if ( bugnote_exists( $t_bugnote_id ) ) { bugnote_set_text( $t_bugnote_id, $t_note['text'] ); bugnote_set_view_state( $t_bugnote_id, $t_view_state_id == VS_PRIVATE ); bugnote_date_update( $t_bugnote_id ); if ( isset( $t_note['time_tracking'] ) ) bugnote_set_time_tracking( $t_bugnote_id, mci_get_time_tracking_from_note( $p_issue_id, $t_note ) ); } } else { $t_view_state_id = mci_get_enum_id_from_objectref( 'view_state', $t_view_state ); bugnote_add( $p_issue_id, $t_note['text'], mci_get_time_tracking_from_note( $p_issue_id, $t_note ), $t_view_state_id == VS_PRIVATE, BUGNOTE, '', $t_user_id, FALSE ); } } } return $t_is_success; } /** * Delete the specified issue. * * @param string $p_username The name of the user trying to delete the issue. * @param string $p_password The password of the user. * @param integer $p_issue_id The id of the issue to delete. * @return boolean True if the issue has been deleted successfully, false otherwise. */ function mc_issue_delete( $p_username, $p_password, $p_issue_id ) { $t_user_id = mci_check_login( $p_username, $p_password ); if( $t_user_id === false ) { return mci_soap_fault_login_failed(); } if( !bug_exists( $p_issue_id ) ) { return new soap_fault( 'Client', '', "Issue '$p_issue_id' does not exist."); } $t_project_id = bug_get_field( $p_issue_id, 'project_id' ); if( !mci_has_readwrite_access( $t_user_id, $t_project_id ) ) { return mci_soap_fault_access_denied( $t_user_id ); } return bug_delete( $p_issue_id ); } /** * Add a note to an existing issue. * * @param string $p_username The name of the user trying to add a note to an issue. * @param string $p_password The password of the user. * @param integer $p_issue_id The id of the issue to add the note to. * @param IssueNoteData $p_note The note to add. * @return integer The id of the added note. */ function mc_issue_note_add( $p_username, $p_password, $p_issue_id, $p_note ) { $t_user_id = mci_check_login( $p_username, $p_password ); if( $t_user_id === false ) { return mci_soap_fault_login_failed(); } if( (integer) $p_issue_id < 1 ) { return new soap_fault( 'Client', '', "Invalid issue id '$p_issue_id'" ); } if( !bug_exists( $p_issue_id ) ) { return new soap_fault( 'Client', '', "Issue '$p_issue_id' does not exist." ); } if ( !isset( $p_note['text'] ) || is_blank( $p_note['text'] ) ) { return new soap_fault( 'Client', '', "Issue note text must not be blank." ); } $t_project_id = bug_get_field( $p_issue_id, 'project_id' ); if( !mci_has_readwrite_access( $t_user_id, $t_project_id ) ) { return mci_soap_fault_access_denied( $t_user_id ); } if( !access_has_bug_level( config_get( 'add_bugnote_threshold' ), $p_issue_id, $t_user_id ) ) { return mci_soap_fault_access_denied( $t_user_id, "You do not have access rights to add notes to this issue" ); } if( bug_is_readonly( $p_issue_id ) ) { return mci_soap_fault_access_denied( $t_user_id, "Issue '$p_issue_id' is readonly" ); } if( isset( $p_note['view_state'] ) ) { $t_view_state = $p_note['view_state']; } else { $t_view_state = array( 'id' => config_get( 'default_bug_view_status' ), ); } $t_view_state_id = mci_get_enum_id_from_objectref( 'view_state', $t_view_state ); return bugnote_add( $p_issue_id, $p_note['text'], mci_get_time_tracking_from_note( $p_issue_id, $p_note ), $t_view_state_id == VS_PRIVATE, BUGNOTE, '', $t_user_id ); } /** * Delete a note given its id. * * @param string $p_username The name of the user trying to add a note to an issue. * @param string $p_password The password of the user. * @param integer $p_issue_note_id The id of the note to be deleted. * @return true: success, false: failure */ function mc_issue_note_delete( $p_username, $p_password, $p_issue_note_id ) { $t_user_id = mci_check_login( $p_username, $p_password ); if( $t_user_id === false ) { return mci_soap_fault_login_failed(); } if( (integer) $p_issue_note_id < 1 ) { return new soap_fault( 'Client', '', "Invalid issue note id '$p_issue_note_id'."); } if( !bugnote_exists( $p_issue_note_id ) ) { return new soap_fault( 'Client', '', "Issue note '$p_issue_note_id' does not exist."); } $t_issue_id = bugnote_get_field( $p_issue_note_id, 'bug_id' ); $t_project_id = bug_get_field( $t_issue_id, 'project_id' ); if( !mci_has_readwrite_access( $t_user_id, $t_project_id ) ) { return mci_soap_fault_access_denied( $t_user_id ); } return bugnote_delete( $p_issue_note_id ); } /** * Submit a new relationship. * * @param string $p_username The name of the user trying to add a note to an issue. * @param string $p_password The password of the user. * @param integer $p_issue_id The id of the issue of the source issue. * @param RelationshipData $p_relationship The relationship to add. * @return integer The id of the added relationship. */ function mc_issue_relationship_add( $p_username, $p_password, $p_issue_id, $p_relationship ) { $t_user_id = mci_check_login( $p_username, $p_password ); $t_dest_issue_id = $p_relationship['target_id']; $t_rel_type = $p_relationship['type']; if( $t_user_id === false ) { return mci_soap_fault_login_failed(); } $t_project_id = bug_get_field( $p_issue_id, 'project_id' ); if( !mci_has_readwrite_access( $t_user_id, $t_project_id ) ) { return mci_soap_fault_access_denied( $t_user_id ); } # user has access to update the bug... if( !access_has_bug_level( config_get( 'update_bug_threshold' ), $p_issue_id, $t_user_id ) ) { return mci_soap_fault_access_denied( $t_user_id, "Active user does not have access level required to add a relationship to this issue" ); } # source and destination bugs are the same bug... if( $p_issue_id == $t_dest_issue_id ) { return new soap_fault( 'Client', '', "An issue can't be related to itself." ); } # the related bug exists... if( !bug_exists( $t_dest_issue_id ) ) { return new soap_fault( 'Client', '', "Issue '$t_dest_issue_id' not found." ); } # bug is not read-only... if( bug_is_readonly( $p_issue_id ) ) { return new mci_soap_fault_access_denied( $t_user_id, "Issue '$p_issue_id' is readonly" ); } # user can access to the related bug at least as viewer... if( !access_has_bug_level( VIEWER, $t_dest_issue_id, $t_user_id ) ) { return mci_soap_fault_access_denied( $t_user_id, "The issue '$t_dest_issue_id' requires higher access level" ); } $t_old_id_relationship = relationship_same_type_exists( $p_issue_id, $t_dest_issue_id, $t_rel_type['id'] ); if( $t_old_id_relationship == 0 ) { relationship_add( $p_issue_id, $t_dest_issue_id, $t_rel_type['id'] ); // The above function call into MantisBT does not seem to return a valid BugRelationshipData object. // So we call db_insert_id in order to find the id of the created relationship. $t_relationship_id = db_insert_id( db_get_table( 'mantis_bug_relationship_table' ) ); # Add log line to the history (both bugs) history_log_event_special( $p_issue_id, BUG_ADD_RELATIONSHIP, $t_rel_type['id'], $t_dest_issue_id ); history_log_event_special( $t_dest_issue_id, BUG_ADD_RELATIONSHIP, relationship_get_complementary_type( $t_rel_type['id'] ), $p_issue_id ); # update bug last updated (just for the src bug) bug_update_date( $p_issue_id ); # send email notification to the users addressed by both the bugs email_relationship_added( $p_issue_id, $t_dest_issue_id, $t_rel_type['id'] ); email_relationship_added( $t_dest_issue_id, $p_issue_id, relationship_get_complementary_type( $t_rel_type['id'] ) ); return $t_relationship_id; } else { return new soap_fault( 'Client', '', "Relationship already exists." ); } } /** * Delete the relationship with the specified target id. * * @param string $p_username The name of the user trying to add a note to an issue. * @param string $p_password The password of the user. * @param integer $p_issue_id The id of the source issue for the relationship * @param integer $p_relationship_id The id of relationship to delete. * @return true: success, false: failure */ function mc_issue_relationship_delete( $p_username, $p_password, $p_issue_id, $p_relationship_id ) { $t_user_id = mci_check_login( $p_username, $p_password ); if( $t_user_id === false ) { return mci_soap_fault_login_failed(); } $t_project_id = bug_get_field( $p_issue_id, 'project_id' ); if( !mci_has_readwrite_access( $t_user_id, $t_project_id ) ) { return mci_soap_fault_access_denied( $t_user_id ); } # user has access to update the bug... if( !access_has_bug_level( config_get( 'update_bug_threshold' ), $p_issue_id, $t_user_id ) ) { return mci_soap_fault_access_denied( $t_user_id , "Active user does not have access level required to remove a relationship from this issue." ); } # bug is not read-only... if( bug_is_readonly( $p_issue_id ) ) { return mci_soap_fault_access_denied( $t_user_id , "Issue '$p_issue_id' is readonly." ); } # retrieve the destination bug of the relationship $t_dest_issue_id = relationship_get_linked_bug_id( $p_relationship_id, $p_issue_id ); # user can access to the related bug at least as viewer, if it's exist... if( bug_exists( $t_dest_issue_id ) ) { if( !access_has_bug_level( VIEWER, $t_dest_issue_id, $t_user_id ) ) { return mci_soap_fault_access_denied( $t_user_id , "The issue '$t_dest_issue_id' requires higher access level." ); } } $t_bug_relationship_data = relationship_get( $p_relationship_id ); $t_rel_type = $t_bug_relationship_data->type; # delete relationship from the DB relationship_delete( $p_relationship_id ); # update bug last updated (just for the src bug) bug_update_date( $p_issue_id ); # set the rel_type for both bug and dest_bug based on $t_rel_type and on who is the dest bug if( $p_issue_id == $t_bug_relationship_data->src_bug_id ) { $t_bug_rel_type = $t_rel_type; $t_dest_bug_rel_type = relationship_get_complementary_type( $t_rel_type ); } else { $t_bug_rel_type = relationship_get_complementary_type( $t_rel_type ); $t_dest_bug_rel_type = $t_rel_type; } # send email and update the history for the src issue history_log_event_special( $p_issue_id, BUG_DEL_RELATIONSHIP, $t_bug_rel_type, $t_dest_issue_id ); email_relationship_deleted( $p_issue_id, $t_dest_issue_id, $t_bug_rel_type ); if( bug_exists( $t_dest_issue_id ) ) { # send email and update the history for the dest issue history_log_event_special( $t_dest_issue_id, BUG_DEL_RELATIONSHIP, $t_dest_bug_rel_type, $p_issue_id ); email_relationship_deleted( $t_dest_issue_id, $p_issue_id, $t_dest_bug_rel_type ); } return true; } /** * Log a checkin event on the issue * * @param string $p_username The name of the user trying to access the issue. * @param string $p_password The password of the user. * @param integer $p_issue_id The id of the issue to log a checkin. * @param string $p_comment The comment to add * @param boolean $p_fixed True if the issue is to be set to fixed * @return boolean true success, false otherwise. */ function mc_issue_checkin( $p_username, $p_password, $p_issue_id, $p_comment, $p_fixed ) { $t_user_id = mci_check_login( $p_username, $p_password ); if( $t_user_id === false ) { return mci_soap_fault_login_failed(); } if( !bug_exists( $p_issue_id ) ) { return new soap_fault( 'Client', '', "Issue '$p_issue_id' not found." ); } $t_project_id = bug_get_field( $p_issue_id, 'project_id' ); if( !mci_has_readwrite_access( $t_user_id, $t_project_id ) ) { return mci_soap_fault_access_denied( $t_user_id ); } helper_call_custom_function( 'checkin', array( $p_issue_id, $p_comment, '', '', $p_fixed ) ); return true; } /** * Returns the date in iso8601 format, with proper timezone offset applied * * @param string $p_date the date in iso8601 format * @return int the timestamp */ function mci_iso8601_to_timestamp( $p_date ) { // retrieve the offset, seems to be lost by nusoap $t_utc_date = new DateTime( $p_date, new DateTimeZone( 'UTC' ) ); $t_timezone = new DateTimeZone( date_default_timezone_get() ); $t_offset = $t_timezone->getOffset( $t_utc_date ); $t_raw_timestamp = iso8601_to_timestamp( $p_date ); return $t_raw_timestamp - $t_offset; } /** * Returns an array for SOAP encoding from a BugData object * * @param BugData $p_issue_data * @param int $p_user_id * @param string $p_lang * @return array The issue as an array */ function mci_issue_data_as_array( $p_issue_data, $p_user_id, $p_lang ) { $t_id = $p_issue_data->id; $t_issue = array(); $t_issue['id'] = $t_id; $t_issue['view_state'] = mci_enum_get_array_by_id( $p_issue_data->view_state, 'view_state', $p_lang ); $t_issue['last_updated'] = timestamp_to_iso8601( $p_issue_data->last_updated ); $t_issue['project'] = mci_project_as_array_by_id( $p_issue_data->project_id ); $t_issue['category'] = mci_get_category( $p_issue_data->category_id ); $t_issue['priority'] = mci_enum_get_array_by_id( $p_issue_data->priority, 'priority', $p_lang ); $t_issue['severity'] = mci_enum_get_array_by_id( $p_issue_data->severity, 'severity', $p_lang ); $t_issue['status'] = mci_enum_get_array_by_id( $p_issue_data->status, 'status', $p_lang ); $t_issue['reporter'] = mci_account_get_array_by_id( $p_issue_data->reporter_id ); $t_issue['summary'] = $p_issue_data->summary; $t_issue['version'] = mci_null_if_empty( $p_issue_data->version ); $t_issue['build'] = mci_null_if_empty( $p_issue_data->build ); $t_issue['platform'] = mci_null_if_empty( $p_issue_data->platform ); $t_issue['os'] = mci_null_if_empty( $p_issue_data->os ); $t_issue['os_build'] = mci_null_if_empty( $p_issue_data->os_build ); $t_issue['reproducibility'] = mci_enum_get_array_by_id( $p_issue_data->reproducibility, 'reproducibility', $p_lang ); $t_issue['date_submitted'] = timestamp_to_iso8601( $p_issue_data->date_submitted ); $t_issue['sponsorship_total'] = $p_issue_data->sponsorship_total; if( !empty( $p_issue_data->handler_id ) ) { $t_issue['handler'] = mci_account_get_array_by_id( $p_issue_data->handler_id ); } $t_issue['projection'] = mci_enum_get_array_by_id( $p_issue_data->projection, 'projection', $p_lang ); $t_issue['eta'] = mci_enum_get_array_by_id( $p_issue_data->eta, 'eta', $p_lang ); $t_issue['resolution'] = mci_enum_get_array_by_id( $p_issue_data->resolution, 'resolution', $p_lang ); $t_issue['fixed_in_version'] = mci_null_if_empty( $p_issue_data->fixed_in_version ); $t_issue['target_version'] = mci_null_if_empty( $p_issue_data->target_version ); $t_issue['description'] = bug_get_text_field( $t_id, 'description' ); $t_steps_to_reproduce = bug_get_text_field( $t_id, 'steps_to_reproduce' ); $t_issue['steps_to_reproduce'] = mci_null_if_empty( $t_steps_to_reproduce ); $t_additional_information = bug_get_text_field( $t_id, 'additional_information' ); $t_issue['additional_information'] = mci_null_if_empty( $t_additional_information ); $t_issue['attachments'] = mci_issue_get_attachments( $p_issue_data->id ); $t_issue['relationships'] = mci_issue_get_relationships( $p_issue_data->id, $p_user_id ); $t_issue['notes'] = mci_issue_get_notes( $p_issue_data->id ); $t_issue['custom_fields'] = mci_issue_get_custom_fields( $p_issue_data->id ); return $t_issue; }
gpl-2.0
shukdelmadrij/shukdelmadrij
administrator/components/com_autotweet/libs/SimplePie/SimplePie/IRI.php
28843
<?php /** * @package Extly.Components * @subpackage com_autotweet - AutoTweetNG posts content to social channels (Twitter, Facebook, LinkedIn, etc). * * @author Prieco S.A. <support@extly.com> * @copyright Copyright (C) 2007 - 2014 Prieco, S.A. All rights reserved. * @license http://http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL * @link http://www.extly.com http://support.extly.com */ // No direct access defined('_JEXEC') or die('Restricted access'); /** * SimplePie * * A PHP-Based RSS and Atom Feed Framework. * Takes the hard work out of managing a complete RSS/Atom solution. * * Copyright (c) 2004-2012, Ryan Parman, Geoffrey Sneddon, Ryan McCue, and contributors * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS * AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie * @version 1.3.1 * @copyright 2004-2012 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon * @author Ryan McCue * @link http://simplepie.org/ SimplePie * @license http://www.opensource.org/licenses/bsd-license.php BSD License */ /** * IRI parser/serialiser/normaliser * * @package SimplePie * @subpackage HTTP * @author Geoffrey Sneddon * @author Steve Minutillo * @author Ryan McCue * @copyright 2007-2012 Geoffrey Sneddon, Steve Minutillo, Ryan McCue * @license http://www.opensource.org/licenses/bsd-license.php */ class SimplePie_IRI { /** * Scheme * * @var string */ protected $scheme = null; /** * User Information * * @var string */ protected $iuserinfo = null; /** * ihost * * @var string */ protected $ihost = null; /** * Port * * @var string */ protected $port = null; /** * ipath * * @var string */ protected $ipath = ''; /** * iquery * * @var string */ protected $iquery = null; /** * ifragment * * @var string */ protected $ifragment = null; /** * Normalization database * * Each key is the scheme, each value is an array with each key as the IRI * part and value as the default value for that part. */ protected $normalization = array( 'acap' => array( 'port' => 674 ), 'dict' => array( 'port' => 2628 ), 'file' => array( 'ihost' => 'localhost' ), 'http' => array( 'port' => 80, 'ipath' => '/' ), 'https' => array( 'port' => 443, 'ipath' => '/' ), ); /** * Return the entire IRI when you try and read the object as a string * * @return string */ public function __toString() { return $this->get_iri(); } /** * Overload __set() to provide access via properties * * @param string $name Property name * @param mixed $value Property value */ public function __set($name, $value) { if (method_exists($this, 'set_' . $name)) { call_user_func(array($this, 'set_' . $name), $value); } elseif ( $name === 'iauthority' || $name === 'iuserinfo' || $name === 'ihost' || $name === 'ipath' || $name === 'iquery' || $name === 'ifragment' ) { call_user_func(array($this, 'set_' . substr($name, 1)), $value); } } /** * Overload __get() to provide access via properties * * @param string $name Property name * @return mixed */ public function __get($name) { // isset() returns false for null, we don't want to do that // Also why we use array_key_exists below instead of isset() $props = get_object_vars($this); if ( $name === 'iri' || $name === 'uri' || $name === 'iauthority' || $name === 'authority' ) { $return = $this->{"get_$name"}(); } elseif (array_key_exists($name, $props)) { $return = $this->$name; } // host -> ihost elseif (($prop = 'i' . $name) && array_key_exists($prop, $props)) { $name = $prop; $return = $this->$prop; } // ischeme -> scheme elseif (($prop = substr($name, 1)) && array_key_exists($prop, $props)) { $name = $prop; $return = $this->$prop; } else { trigger_error('Undefined property: ' . get_class($this) . '::' . $name, E_USER_NOTICE); $return = null; } if ($return === null && isset($this->normalization[$this->scheme][$name])) { return $this->normalization[$this->scheme][$name]; } else { return $return; } } /** * Overload __isset() to provide access via properties * * @param string $name Property name * @return bool */ public function __isset($name) { if (method_exists($this, 'get_' . $name) || isset($this->$name)) { return true; } else { return false; } } /** * Overload __unset() to provide access via properties * * @param string $name Property name */ public function __unset($name) { if (method_exists($this, 'set_' . $name)) { call_user_func(array($this, 'set_' . $name), ''); } } /** * Create a new IRI object, from a specified string * * @param string $iri */ public function __construct($iri = null) { $this->set_iri($iri); } /** * Create a new IRI object by resolving a relative IRI * * Returns false if $base is not absolute, otherwise an IRI. * * @param IRI|string $base (Absolute) Base IRI * @param IRI|string $relative Relative IRI * @return IRI|false */ public static function absolutize($base, $relative) { if (!($relative instanceof SimplePie_IRI)) { $relative = new SimplePie_IRI($relative); } if (!$relative->is_valid()) { return false; } elseif ($relative->scheme !== null) { return clone $relative; } else { if (!($base instanceof SimplePie_IRI)) { $base = new SimplePie_IRI($base); } if ($base->scheme !== null && $base->is_valid()) { if ($relative->get_iri() !== '') { if ($relative->iuserinfo !== null || $relative->ihost !== null || $relative->port !== null) { $target = clone $relative; $target->scheme = $base->scheme; } else { $target = new SimplePie_IRI; $target->scheme = $base->scheme; $target->iuserinfo = $base->iuserinfo; $target->ihost = $base->ihost; $target->port = $base->port; if ($relative->ipath !== '') { if ($relative->ipath[0] === '/') { $target->ipath = $relative->ipath; } elseif (($base->iuserinfo !== null || $base->ihost !== null || $base->port !== null) && $base->ipath === '') { $target->ipath = '/' . $relative->ipath; } elseif (($last_segment = strrpos($base->ipath, '/')) !== false) { $target->ipath = substr($base->ipath, 0, $last_segment + 1) . $relative->ipath; } else { $target->ipath = $relative->ipath; } $target->ipath = $target->remove_dot_segments($target->ipath); $target->iquery = $relative->iquery; } else { $target->ipath = $base->ipath; if ($relative->iquery !== null) { $target->iquery = $relative->iquery; } elseif ($base->iquery !== null) { $target->iquery = $base->iquery; } } $target->ifragment = $relative->ifragment; } } else { $target = clone $base; $target->ifragment = null; } $target->scheme_normalization(); return $target; } else { return false; } } } /** * Parse an IRI into scheme/authority/path/query/fragment segments * * @param string $iri * @return array */ protected function parse_iri($iri) { $iri = trim($iri, "\x20\x09\x0A\x0C\x0D"); if (preg_match('/^((?P<scheme>[^:\/?#]+):)?(\/\/(?P<authority>[^\/?#]*))?(?P<path>[^?#]*)(\?(?P<query>[^#]*))?(#(?P<fragment>.*))?$/', $iri, $match)) { if ($match[1] === '') { $match['scheme'] = null; } if (!isset($match[3]) || $match[3] === '') { $match['authority'] = null; } if (!isset($match[5])) { $match['path'] = ''; } if (!isset($match[6]) || $match[6] === '') { $match['query'] = null; } if (!isset($match[8]) || $match[8] === '') { $match['fragment'] = null; } return $match; } else { // This can occur when a paragraph is accidentally parsed as a URI return false; } } /** * Remove dot segments from a path * * @param string $input * @return string */ protected function remove_dot_segments($input) { $output = ''; while (strpos($input, './') !== false || strpos($input, '/.') !== false || $input === '.' || $input === '..') { // A: If the input buffer begins with a prefix of "../" or "./", then remove that prefix from the input buffer; otherwise, if (strpos($input, '../') === 0) { $input = substr($input, 3); } elseif (strpos($input, './') === 0) { $input = substr($input, 2); } // B: if the input buffer begins with a prefix of "/./" or "/.", where "." is a complete path segment, then replace that prefix with "/" in the input buffer; otherwise, elseif (strpos($input, '/./') === 0) { $input = substr($input, 2); } elseif ($input === '/.') { $input = '/'; } // C: if the input buffer begins with a prefix of "/../" or "/..", where ".." is a complete path segment, then replace that prefix with "/" in the input buffer and remove the last segment and its preceding "/" (if any) from the output buffer; otherwise, elseif (strpos($input, '/../') === 0) { $input = substr($input, 3); $output = substr_replace($output, '', strrpos($output, '/')); } elseif ($input === '/..') { $input = '/'; $output = substr_replace($output, '', strrpos($output, '/')); } // D: if the input buffer consists only of "." or "..", then remove that from the input buffer; otherwise, elseif ($input === '.' || $input === '..') { $input = ''; } // E: move the first path segment in the input buffer to the end of the output buffer, including the initial "/" character (if any) and any subsequent characters up to, but not including, the next "/" character or the end of the input buffer elseif (($pos = strpos($input, '/', 1)) !== false) { $output .= substr($input, 0, $pos); $input = substr_replace($input, '', 0, $pos); } else { $output .= $input; $input = ''; } } return $output . $input; } /** * Replace invalid character with percent encoding * * @param string $string Input string * @param string $extra_chars Valid characters not in iunreserved or * iprivate (this is ASCII-only) * @param bool $iprivate Allow iprivate * @return string */ protected function replace_invalid_with_pct_encoding($string, $extra_chars, $iprivate = false) { // Normalize as many pct-encoded sections as possible $string = preg_replace_callback('/(?:%[A-Fa-f0-9]{2})+/', array($this, 'remove_iunreserved_percent_encoded'), $string); // Replace invalid percent characters $string = preg_replace('/%(?![A-Fa-f0-9]{2})/', '%25', $string); // Add unreserved and % to $extra_chars (the latter is safe because all // pct-encoded sections are now valid). $extra_chars .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~%'; // Now replace any bytes that aren't allowed with their pct-encoded versions $position = 0; $strlen = strlen($string); while (($position += strspn($string, $extra_chars, $position)) < $strlen) { $value = ord($string[$position]); // Start position $start = $position; // By default we are valid $valid = true; // No one byte sequences are valid due to the while. // Two byte sequence: if (($value & 0xE0) === 0xC0) { $character = ($value & 0x1F) << 6; $length = 2; $remaining = 1; } // Three byte sequence: elseif (($value & 0xF0) === 0xE0) { $character = ($value & 0x0F) << 12; $length = 3; $remaining = 2; } // Four byte sequence: elseif (($value & 0xF8) === 0xF0) { $character = ($value & 0x07) << 18; $length = 4; $remaining = 3; } // Invalid byte: else { $valid = false; $length = 1; $remaining = 0; } if ($remaining) { if ($position + $length <= $strlen) { for ($position++; $remaining; $position++) { $value = ord($string[$position]); // Check that the byte is valid, then add it to the character: if (($value & 0xC0) === 0x80) { $character |= ($value & 0x3F) << (--$remaining * 6); } // If it is invalid, count the sequence as invalid and reprocess the current byte: else { $valid = false; $position--; break; } } } else { $position = $strlen - 1; $valid = false; } } // Percent encode anything invalid or not in ucschar if ( // Invalid sequences !$valid // Non-shortest form sequences are invalid || $length > 1 && $character <= 0x7F || $length > 2 && $character <= 0x7FF || $length > 3 && $character <= 0xFFFF // Outside of range of ucschar codepoints // Noncharacters || ($character & 0xFFFE) === 0xFFFE || $character >= 0xFDD0 && $character <= 0xFDEF || ( // Everything else not in ucschar $character > 0xD7FF && $character < 0xF900 || $character < 0xA0 || $character > 0xEFFFD ) && ( // Everything not in iprivate, if it applies !$iprivate || $character < 0xE000 || $character > 0x10FFFD ) ) { // If we were a character, pretend we weren't, but rather an error. if ($valid) $position--; for ($j = $start; $j <= $position; $j++) { $string = substr_replace($string, sprintf('%%%02X', ord($string[$j])), $j, 1); $j += 2; $position += 2; $strlen += 2; } } } return $string; } /** * Callback function for preg_replace_callback. * * Removes sequences of percent encoded bytes that represent UTF-8 * encoded characters in iunreserved * * @param array $match PCRE match * @return string Replacement */ protected function remove_iunreserved_percent_encoded($match) { // As we just have valid percent encoded sequences we can just explode // and ignore the first member of the returned array (an empty string). $bytes = explode('%', $match[0]); // Initialize the new string (this is what will be returned) and that // there are no bytes remaining in the current sequence (unsurprising // at the first byte!). $string = ''; $remaining = 0; // Loop over each and every byte, and set $value to its value for ($i = 1, $len = count($bytes); $i < $len; $i++) { $value = hexdec($bytes[$i]); // If we're the first byte of sequence: if (!$remaining) { // Start position $start = $i; // By default we are valid $valid = true; // One byte sequence: if ($value <= 0x7F) { $character = $value; $length = 1; } // Two byte sequence: elseif (($value & 0xE0) === 0xC0) { $character = ($value & 0x1F) << 6; $length = 2; $remaining = 1; } // Three byte sequence: elseif (($value & 0xF0) === 0xE0) { $character = ($value & 0x0F) << 12; $length = 3; $remaining = 2; } // Four byte sequence: elseif (($value & 0xF8) === 0xF0) { $character = ($value & 0x07) << 18; $length = 4; $remaining = 3; } // Invalid byte: else { $valid = false; $remaining = 0; } } // Continuation byte: else { // Check that the byte is valid, then add it to the character: if (($value & 0xC0) === 0x80) { $remaining--; $character |= ($value & 0x3F) << ($remaining * 6); } // If it is invalid, count the sequence as invalid and reprocess the current byte as the start of a sequence: else { $valid = false; $remaining = 0; $i--; } } // If we've reached the end of the current byte sequence, append it to Unicode::$data if (!$remaining) { // Percent encode anything invalid or not in iunreserved if ( // Invalid sequences !$valid // Non-shortest form sequences are invalid || $length > 1 && $character <= 0x7F || $length > 2 && $character <= 0x7FF || $length > 3 && $character <= 0xFFFF // Outside of range of iunreserved codepoints || $character < 0x2D || $character > 0xEFFFD // Noncharacters || ($character & 0xFFFE) === 0xFFFE || $character >= 0xFDD0 && $character <= 0xFDEF // Everything else not in iunreserved (this is all BMP) || $character === 0x2F || $character > 0x39 && $character < 0x41 || $character > 0x5A && $character < 0x61 || $character > 0x7A && $character < 0x7E || $character > 0x7E && $character < 0xA0 || $character > 0xD7FF && $character < 0xF900 ) { for ($j = $start; $j <= $i; $j++) { $string .= '%' . strtoupper($bytes[$j]); } } else { for ($j = $start; $j <= $i; $j++) { $string .= chr(hexdec($bytes[$j])); } } } } // If we have any bytes left over they are invalid (i.e., we are // mid-way through a multi-byte sequence) if ($remaining) { for ($j = $start; $j < $len; $j++) { $string .= '%' . strtoupper($bytes[$j]); } } return $string; } protected function scheme_normalization() { if (isset($this->normalization[$this->scheme]['iuserinfo']) && $this->iuserinfo === $this->normalization[$this->scheme]['iuserinfo']) { $this->iuserinfo = null; } if (isset($this->normalization[$this->scheme]['ihost']) && $this->ihost === $this->normalization[$this->scheme]['ihost']) { $this->ihost = null; } if (isset($this->normalization[$this->scheme]['port']) && $this->port === $this->normalization[$this->scheme]['port']) { $this->port = null; } if (isset($this->normalization[$this->scheme]['ipath']) && $this->ipath === $this->normalization[$this->scheme]['ipath']) { $this->ipath = ''; } if (isset($this->normalization[$this->scheme]['iquery']) && $this->iquery === $this->normalization[$this->scheme]['iquery']) { $this->iquery = null; } if (isset($this->normalization[$this->scheme]['ifragment']) && $this->ifragment === $this->normalization[$this->scheme]['ifragment']) { $this->ifragment = null; } } /** * Check if the object represents a valid IRI. This needs to be done on each * call as some things change depending on another part of the IRI. * * @return bool */ public function is_valid() { $isauthority = $this->iuserinfo !== null || $this->ihost !== null || $this->port !== null; if ($this->ipath !== '' && ( $isauthority && ( $this->ipath[0] !== '/' || substr($this->ipath, 0, 2) === '//' ) || ( $this->scheme === null && !$isauthority && strpos($this->ipath, ':') !== false && (strpos($this->ipath, '/') === false ? true : strpos($this->ipath, ':') < strpos($this->ipath, '/')) ) ) ) { return false; } return true; } /** * Set the entire IRI. Returns true on success, false on failure (if there * are any invalid characters). * * @param string $iri * @return bool */ public function set_iri($iri) { static $cache; if (!$cache) { $cache = array(); } if ($iri === null) { return true; } elseif (isset($cache[$iri])) { list($this->scheme, $this->iuserinfo, $this->ihost, $this->port, $this->ipath, $this->iquery, $this->ifragment, $return) = $cache[$iri]; return $return; } else { $parsed = $this->parse_iri((string) $iri); if (!$parsed) { return false; } $return = $this->set_scheme($parsed['scheme']) && $this->set_authority($parsed['authority']) && $this->set_path($parsed['path']) && $this->set_query($parsed['query']) && $this->set_fragment($parsed['fragment']); $cache[$iri] = array($this->scheme, $this->iuserinfo, $this->ihost, $this->port, $this->ipath, $this->iquery, $this->ifragment, $return); return $return; } } /** * Set the scheme. Returns true on success, false on failure (if there are * any invalid characters). * * @param string $scheme * @return bool */ public function set_scheme($scheme) { if ($scheme === null) { $this->scheme = null; } elseif (!preg_match('/^[A-Za-z][0-9A-Za-z+\-.]*$/', $scheme)) { $this->scheme = null; return false; } else { $this->scheme = strtolower($scheme); } return true; } /** * Set the authority. Returns true on success, false on failure (if there are * any invalid characters). * * @param string $authority * @return bool */ public function set_authority($authority) { static $cache; if (!$cache) $cache = array(); if ($authority === null) { $this->iuserinfo = null; $this->ihost = null; $this->port = null; return true; } elseif (isset($cache[$authority])) { list($this->iuserinfo, $this->ihost, $this->port, $return) = $cache[$authority]; return $return; } else { $remaining = $authority; if (($iuserinfo_end = strrpos($remaining, '@')) !== false) { $iuserinfo = substr($remaining, 0, $iuserinfo_end); $remaining = substr($remaining, $iuserinfo_end + 1); } else { $iuserinfo = null; } if (($port_start = strpos($remaining, ':', strpos($remaining, ']'))) !== false) { if (($port = substr($remaining, $port_start + 1)) === false) { $port = null; } $remaining = substr($remaining, 0, $port_start); } else { $port = null; } $return = $this->set_userinfo($iuserinfo) && $this->set_host($remaining) && $this->set_port($port); $cache[$authority] = array($this->iuserinfo, $this->ihost, $this->port, $return); return $return; } } /** * Set the iuserinfo. * * @param string $iuserinfo * @return bool */ public function set_userinfo($iuserinfo) { if ($iuserinfo === null) { $this->iuserinfo = null; } else { $this->iuserinfo = $this->replace_invalid_with_pct_encoding($iuserinfo, '!$&\'()*+,;=:'); $this->scheme_normalization(); } return true; } /** * Set the ihost. Returns true on success, false on failure (if there are * any invalid characters). * * @param string $ihost * @return bool */ public function set_host($ihost) { if ($ihost === null) { $this->ihost = null; return true; } elseif (substr($ihost, 0, 1) === '[' && substr($ihost, -1) === ']') { if (SimplePie_Net_IPv6::check_ipv6(substr($ihost, 1, -1))) { $this->ihost = '[' . SimplePie_Net_IPv6::compress(substr($ihost, 1, -1)) . ']'; } else { $this->ihost = null; return false; } } else { $ihost = $this->replace_invalid_with_pct_encoding($ihost, '!$&\'()*+,;='); // Lowercase, but ignore pct-encoded sections (as they should // remain uppercase). This must be done after the previous step // as that can add unescaped characters. $position = 0; $strlen = strlen($ihost); while (($position += strcspn($ihost, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ%', $position)) < $strlen) { if ($ihost[$position] === '%') { $position += 3; } else { $ihost[$position] = strtolower($ihost[$position]); $position++; } } $this->ihost = $ihost; } $this->scheme_normalization(); return true; } /** * Set the port. Returns true on success, false on failure (if there are * any invalid characters). * * @param string $port * @return bool */ public function set_port($port) { if ($port === null) { $this->port = null; return true; } elseif (strspn($port, '0123456789') === strlen($port)) { $this->port = (int) $port; $this->scheme_normalization(); return true; } else { $this->port = null; return false; } } /** * Set the ipath. * * @param string $ipath * @return bool */ public function set_path($ipath) { static $cache; if (!$cache) { $cache = array(); } $ipath = (string) $ipath; if (isset($cache[$ipath])) { $this->ipath = $cache[$ipath][(int) ($this->scheme !== null)]; } else { $valid = $this->replace_invalid_with_pct_encoding($ipath, '!$&\'()*+,;=@:/'); $removed = $this->remove_dot_segments($valid); $cache[$ipath] = array($valid, $removed); $this->ipath = ($this->scheme !== null) ? $removed : $valid; } $this->scheme_normalization(); return true; } /** * Set the iquery. * * @param string $iquery * @return bool */ public function set_query($iquery) { if ($iquery === null) { $this->iquery = null; } else { $this->iquery = $this->replace_invalid_with_pct_encoding($iquery, '!$&\'()*+,;=:@/?', true); $this->scheme_normalization(); } return true; } /** * Set the ifragment. * * @param string $ifragment * @return bool */ public function set_fragment($ifragment) { if ($ifragment === null) { $this->ifragment = null; } else { $this->ifragment = $this->replace_invalid_with_pct_encoding($ifragment, '!$&\'()*+,;=:@/?'); $this->scheme_normalization(); } return true; } /** * Convert an IRI to a URI (or parts thereof) * * @return string */ public function to_uri($string) { static $non_ascii; if (!$non_ascii) { $non_ascii = implode('', range("\x80", "\xFF")); } $position = 0; $strlen = strlen($string); while (($position += strcspn($string, $non_ascii, $position)) < $strlen) { $string = substr_replace($string, sprintf('%%%02X', ord($string[$position])), $position, 1); $position += 3; $strlen += 2; } return $string; } /** * Get the complete IRI * * @return string */ public function get_iri() { if (!$this->is_valid()) { return false; } $iri = ''; if ($this->scheme !== null) { $iri .= $this->scheme . ':'; } if (($iauthority = $this->get_iauthority()) !== null) { $iri .= '//' . $iauthority; } if ($this->ipath !== '') { $iri .= $this->ipath; } elseif (!empty($this->normalization[$this->scheme]['ipath']) && $iauthority !== null && $iauthority !== '') { $iri .= $this->normalization[$this->scheme]['ipath']; } if ($this->iquery !== null) { $iri .= '?' . $this->iquery; } if ($this->ifragment !== null) { $iri .= '#' . $this->ifragment; } return $iri; } /** * Get the complete URI * * @return string */ public function get_uri() { return $this->to_uri($this->get_iri()); } /** * Get the complete iauthority * * @return string */ protected function get_iauthority() { if ($this->iuserinfo !== null || $this->ihost !== null || $this->port !== null) { $iauthority = ''; if ($this->iuserinfo !== null) { $iauthority .= $this->iuserinfo . '@'; } if ($this->ihost !== null) { $iauthority .= $this->ihost; } if ($this->port !== null) { $iauthority .= ':' . $this->port; } return $iauthority; } else { return null; } } /** * Get the complete authority * * @return string */ protected function get_authority() { $iauthority = $this->get_iauthority(); if (is_string($iauthority)) return $this->to_uri($iauthority); else return $iauthority; } }
gpl-2.0
pastewka/lammps
lib/kokkos/core/src/impl/Kokkos_HostSpace.cpp
18584
/* //@HEADER // ************************************************************************ // // Kokkos v. 3.0 // Copyright (2020) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // the U.S. Government retains certain rights in this software. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // 3. Neither the name of the Corporation nor the names of the // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER */ #include <cstdio> #include <algorithm> #include <Kokkos_Macros.hpp> #include <impl/Kokkos_Error.hpp> #include <impl/Kokkos_MemorySpace.hpp> #if defined(KOKKOS_ENABLE_PROFILING) #include <impl/Kokkos_Profiling_Interface.hpp> #endif /*--------------------------------------------------------------------------*/ #if defined(__INTEL_COMPILER) && !defined(KOKKOS_ENABLE_CUDA) // Intel specialized allocator does not interoperate with CUDA memory allocation #define KOKKOS_ENABLE_INTEL_MM_ALLOC #endif /*--------------------------------------------------------------------------*/ #if defined(KOKKOS_ENABLE_POSIX_MEMALIGN) #include <unistd.h> #include <sys/mman.h> /* mmap flags for private anonymous memory allocation */ #if defined(MAP_ANONYMOUS) && defined(MAP_PRIVATE) #define KOKKOS_IMPL_POSIX_MMAP_FLAGS (MAP_PRIVATE | MAP_ANONYMOUS) #elif defined(MAP_ANON) && defined(MAP_PRIVATE) #define KOKKOS_IMPL_POSIX_MMAP_FLAGS (MAP_PRIVATE | MAP_ANON) #endif // mmap flags for huge page tables // the Cuda driver does not interoperate with MAP_HUGETLB #if defined(KOKKOS_IMPL_POSIX_MMAP_FLAGS) #if defined(MAP_HUGETLB) && !defined(KOKKOS_ENABLE_CUDA) #define KOKKOS_IMPL_POSIX_MMAP_FLAGS_HUGE \ (KOKKOS_IMPL_POSIX_MMAP_FLAGS | MAP_HUGETLB) #else #define KOKKOS_IMPL_POSIX_MMAP_FLAGS_HUGE KOKKOS_IMPL_POSIX_MMAP_FLAGS #endif #endif #endif /*--------------------------------------------------------------------------*/ #include <cstddef> #include <cstdlib> #include <cstdint> #include <cstring> #include <iostream> #include <sstream> #include <cstring> #include <Kokkos_HostSpace.hpp> #include <impl/Kokkos_Error.hpp> #include <Kokkos_Atomic.hpp> #if (defined(KOKKOS_ENABLE_ASM) || defined(KOKKOS_ENABLE_TM)) && \ defined(KOKKOS_ENABLE_ISA_X86_64) && !defined(KOKKOS_COMPILER_PGI) #include <immintrin.h> #endif //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- namespace Kokkos { /* Default allocation mechanism */ HostSpace::HostSpace() : m_alloc_mech( #if defined(KOKKOS_ENABLE_INTEL_MM_ALLOC) HostSpace::INTEL_MM_ALLOC #elif defined(KOKKOS_IMPL_POSIX_MMAP_FLAGS) HostSpace::POSIX_MMAP #elif defined(KOKKOS_ENABLE_POSIX_MEMALIGN) HostSpace::POSIX_MEMALIGN #else HostSpace::STD_MALLOC #endif ) { } /* Default allocation mechanism */ HostSpace::HostSpace(const HostSpace::AllocationMechanism &arg_alloc_mech) : m_alloc_mech(HostSpace::STD_MALLOC) { if (arg_alloc_mech == STD_MALLOC) { m_alloc_mech = HostSpace::STD_MALLOC; } #if defined(KOKKOS_ENABLE_INTEL_MM_ALLOC) else if (arg_alloc_mech == HostSpace::INTEL_MM_ALLOC) { m_alloc_mech = HostSpace::INTEL_MM_ALLOC; } #elif defined(KOKKOS_ENABLE_POSIX_MEMALIGN) else if (arg_alloc_mech == HostSpace::POSIX_MEMALIGN) { m_alloc_mech = HostSpace::POSIX_MEMALIGN; } #elif defined(KOKKOS_IMPL_POSIX_MMAP_FLAGS) else if (arg_alloc_mech == HostSpace::POSIX_MMAP) { m_alloc_mech = HostSpace::POSIX_MMAP; } #endif else { const char *const mech = (arg_alloc_mech == HostSpace::INTEL_MM_ALLOC) ? "INTEL_MM_ALLOC" : ((arg_alloc_mech == HostSpace::POSIX_MEMALIGN) ? "POSIX_MEMALIGN" : ((arg_alloc_mech == HostSpace::POSIX_MMAP) ? "POSIX_MMAP" : "")); std::string msg; msg.append("Kokkos::HostSpace "); msg.append(mech); msg.append(" is not available"); Kokkos::Impl::throw_runtime_exception(msg); } } void *HostSpace::allocate(const size_t arg_alloc_size) const { static_assert(sizeof(void *) == sizeof(uintptr_t), "Error sizeof(void*) != sizeof(uintptr_t)"); static_assert( Kokkos::Impl::is_integral_power_of_two(Kokkos::Impl::MEMORY_ALIGNMENT), "Memory alignment must be power of two"); constexpr uintptr_t alignment = Kokkos::Impl::MEMORY_ALIGNMENT; constexpr uintptr_t alignment_mask = alignment - 1; void *ptr = nullptr; if (arg_alloc_size) { if (m_alloc_mech == STD_MALLOC) { // Over-allocate to and round up to guarantee proper alignment. size_t size_padded = arg_alloc_size + sizeof(void *) + alignment; void *alloc_ptr = malloc(size_padded); if (alloc_ptr) { auto address = reinterpret_cast<uintptr_t>(alloc_ptr); // offset enough to record the alloc_ptr address += sizeof(void *); uintptr_t rem = address % alignment; uintptr_t offset = rem ? (alignment - rem) : 0u; address += offset; ptr = reinterpret_cast<void *>(address); // record the alloc'd pointer address -= sizeof(void *); *reinterpret_cast<void **>(address) = alloc_ptr; } } #if defined(KOKKOS_ENABLE_INTEL_MM_ALLOC) else if (m_alloc_mech == INTEL_MM_ALLOC) { ptr = _mm_malloc(arg_alloc_size, alignment); } #endif #if defined(KOKKOS_ENABLE_POSIX_MEMALIGN) else if (m_alloc_mech == POSIX_MEMALIGN) { posix_memalign(&ptr, alignment, arg_alloc_size); } #endif #if defined(KOKKOS_IMPL_POSIX_MMAP_FLAGS) else if (m_alloc_mech == POSIX_MMAP) { constexpr size_t use_huge_pages = (1u << 27); constexpr int prot = PROT_READ | PROT_WRITE; const int flags = arg_alloc_size < use_huge_pages ? KOKKOS_IMPL_POSIX_MMAP_FLAGS : KOKKOS_IMPL_POSIX_MMAP_FLAGS_HUGE; // read write access to private memory ptr = mmap(nullptr /* address hint, if nullptr OS kernel chooses address */ , arg_alloc_size /* size in bytes */ , prot /* memory protection */ , flags /* visibility of updates */ , -1 /* file descriptor */ , 0 /* offset */ ); /* Associated reallocation: ptr = mremap( old_ptr , old_size , new_size , MREMAP_MAYMOVE ); */ } #endif } if ((ptr == nullptr) || (reinterpret_cast<uintptr_t>(ptr) == ~uintptr_t(0)) || (reinterpret_cast<uintptr_t>(ptr) & alignment_mask)) { Experimental::RawMemoryAllocationFailure::FailureMode failure_mode = Experimental::RawMemoryAllocationFailure::FailureMode:: AllocationNotAligned; if (ptr == nullptr) { failure_mode = Experimental::RawMemoryAllocationFailure::FailureMode:: OutOfMemoryError; } Experimental::RawMemoryAllocationFailure::AllocationMechanism alloc_mec = Experimental::RawMemoryAllocationFailure::AllocationMechanism:: StdMalloc; switch (m_alloc_mech) { case STD_MALLOC: break; // default case POSIX_MEMALIGN: alloc_mec = Experimental::RawMemoryAllocationFailure:: AllocationMechanism::PosixMemAlign; break; case POSIX_MMAP: alloc_mec = Experimental::RawMemoryAllocationFailure:: AllocationMechanism::PosixMMap; break; case INTEL_MM_ALLOC: alloc_mec = Experimental::RawMemoryAllocationFailure:: AllocationMechanism::IntelMMAlloc; break; } throw Kokkos::Experimental::RawMemoryAllocationFailure( arg_alloc_size, alignment, failure_mode, alloc_mec); } return ptr; } void HostSpace::deallocate(void *const arg_alloc_ptr, const size_t #if defined(KOKKOS_IMPL_POSIX_MMAP_FLAGS) arg_alloc_size #endif ) const { if (arg_alloc_ptr) { if (m_alloc_mech == STD_MALLOC) { void *alloc_ptr = *(reinterpret_cast<void **>(arg_alloc_ptr) - 1); free(alloc_ptr); } #if defined(KOKKOS_ENABLE_INTEL_MM_ALLOC) else if (m_alloc_mech == INTEL_MM_ALLOC) { _mm_free(arg_alloc_ptr); } #endif #if defined(KOKKOS_ENABLE_POSIX_MEMALIGN) else if (m_alloc_mech == POSIX_MEMALIGN) { free(arg_alloc_ptr); } #endif #if defined(KOKKOS_IMPL_POSIX_MMAP_FLAGS) else if (m_alloc_mech == POSIX_MMAP) { munmap(arg_alloc_ptr, arg_alloc_size); } #endif } } } // namespace Kokkos //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- namespace Kokkos { namespace Impl { #ifdef KOKKOS_DEBUG SharedAllocationRecord<void, void> SharedAllocationRecord<Kokkos::HostSpace, void>::s_root_record; #endif void SharedAllocationRecord<Kokkos::HostSpace, void>::deallocate( SharedAllocationRecord<void, void> *arg_rec) { delete static_cast<SharedAllocationRecord *>(arg_rec); } SharedAllocationRecord<Kokkos::HostSpace, void>::~SharedAllocationRecord() #if defined( \ KOKKOS_IMPL_INTEL_WORKAROUND_NOEXCEPT_SPECIFICATION_VIRTUAL_FUNCTION) noexcept #endif { #if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::deallocateData( Kokkos::Profiling::SpaceHandle(Kokkos::HostSpace::name()), RecordBase::m_alloc_ptr->m_label, data(), size()); } #endif m_space.deallocate(SharedAllocationRecord<void, void>::m_alloc_ptr, SharedAllocationRecord<void, void>::m_alloc_size); } SharedAllocationHeader *_do_allocation(Kokkos::HostSpace const &space, std::string const &label, size_t alloc_size) { try { return reinterpret_cast<SharedAllocationHeader *>( space.allocate(alloc_size)); } catch (Experimental::RawMemoryAllocationFailure const &failure) { if (failure.failure_mode() == Experimental::RawMemoryAllocationFailure:: FailureMode::AllocationNotAligned) { // TODO: delete the misaligned memory } std::cerr << "Kokkos failed to allocate memory for label \"" << label << "\". Allocation using MemorySpace named \"" << space.name() << " failed with the following error: "; failure.print_error_message(std::cerr); std::cerr.flush(); Kokkos::Impl::throw_runtime_exception("Memory allocation failure"); } return nullptr; // unreachable } SharedAllocationRecord<Kokkos::HostSpace, void>::SharedAllocationRecord( const Kokkos::HostSpace &arg_space, const std::string &arg_label, const size_t arg_alloc_size, const SharedAllocationRecord<void, void>::function_type arg_dealloc) // Pass through allocated [ SharedAllocationHeader , user_memory ] // Pass through deallocation function : SharedAllocationRecord<void, void>( #ifdef KOKKOS_DEBUG &SharedAllocationRecord<Kokkos::HostSpace, void>::s_root_record, #endif Impl::checked_allocation_with_header(arg_space, arg_label, arg_alloc_size), sizeof(SharedAllocationHeader) + arg_alloc_size, arg_dealloc), m_space(arg_space) { #if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::allocateData( Kokkos::Profiling::SpaceHandle(arg_space.name()), arg_label, data(), arg_alloc_size); } #endif // Fill in the Header information RecordBase::m_alloc_ptr->m_record = static_cast<SharedAllocationRecord<void, void> *>(this); strncpy(RecordBase::m_alloc_ptr->m_label, arg_label.c_str(), SharedAllocationHeader::maximum_label_length); // Set last element zero, in case c_str is too long RecordBase::m_alloc_ptr ->m_label[SharedAllocationHeader::maximum_label_length - 1] = (char)0; } //---------------------------------------------------------------------------- void *SharedAllocationRecord<Kokkos::HostSpace, void>::allocate_tracked( const Kokkos::HostSpace &arg_space, const std::string &arg_alloc_label, const size_t arg_alloc_size) { if (!arg_alloc_size) return nullptr; SharedAllocationRecord *const r = allocate(arg_space, arg_alloc_label, arg_alloc_size); RecordBase::increment(r); return r->data(); } void SharedAllocationRecord<Kokkos::HostSpace, void>::deallocate_tracked( void *const arg_alloc_ptr) { if (arg_alloc_ptr != nullptr) { SharedAllocationRecord *const r = get_record(arg_alloc_ptr); RecordBase::decrement(r); } } void *SharedAllocationRecord<Kokkos::HostSpace, void>::reallocate_tracked( void *const arg_alloc_ptr, const size_t arg_alloc_size) { SharedAllocationRecord *const r_old = get_record(arg_alloc_ptr); SharedAllocationRecord *const r_new = allocate(r_old->m_space, r_old->get_label(), arg_alloc_size); Kokkos::Impl::DeepCopy<HostSpace, HostSpace>( r_new->data(), r_old->data(), std::min(r_old->size(), r_new->size())); RecordBase::increment(r_new); RecordBase::decrement(r_old); return r_new->data(); } SharedAllocationRecord<Kokkos::HostSpace, void> * SharedAllocationRecord<Kokkos::HostSpace, void>::get_record(void *alloc_ptr) { typedef SharedAllocationHeader Header; typedef SharedAllocationRecord<Kokkos::HostSpace, void> RecordHost; SharedAllocationHeader const *const head = alloc_ptr ? Header::get_header(alloc_ptr) : nullptr; RecordHost *const record = head ? static_cast<RecordHost *>(head->m_record) : nullptr; if (!alloc_ptr || record->m_alloc_ptr != head) { Kokkos::Impl::throw_runtime_exception( std::string("Kokkos::Impl::SharedAllocationRecord< Kokkos::HostSpace , " "void >::get_record ERROR")); } return record; } // Iterate records to print orphaned memory ... #ifdef KOKKOS_DEBUG void SharedAllocationRecord<Kokkos::HostSpace, void>::print_records( std::ostream &s, const Kokkos::HostSpace &, bool detail) { SharedAllocationRecord<void, void>::print_host_accessible_records( s, "HostSpace", &s_root_record, detail); } #else void SharedAllocationRecord<Kokkos::HostSpace, void>::print_records( std::ostream &, const Kokkos::HostSpace &, bool) { throw_runtime_exception( "SharedAllocationRecord<HostSpace>::print_records only works with " "KOKKOS_DEBUG enabled"); } #endif } // namespace Impl } // namespace Kokkos /*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/ namespace Kokkos { namespace { const unsigned HOST_SPACE_ATOMIC_MASK = 0xFFFF; const unsigned HOST_SPACE_ATOMIC_XOR_MASK = 0x5A39; static int HOST_SPACE_ATOMIC_LOCKS[HOST_SPACE_ATOMIC_MASK + 1]; } // namespace namespace Impl { void init_lock_array_host_space() { static int is_initialized = 0; if (!is_initialized) for (int i = 0; i < static_cast<int>(HOST_SPACE_ATOMIC_MASK + 1); i++) HOST_SPACE_ATOMIC_LOCKS[i] = 0; } bool lock_address_host_space(void *ptr) { #if defined(KOKKOS_ENABLE_ISA_X86_64) && defined(KOKKOS_ENABLE_TM) && \ !defined(KOKKOS_COMPILER_PGI) const unsigned status = _xbegin(); if (_XBEGIN_STARTED == status) { const int val = HOST_SPACE_ATOMIC_LOCKS[((size_t(ptr) >> 2) & HOST_SPACE_ATOMIC_MASK) ^ HOST_SPACE_ATOMIC_XOR_MASK]; if (0 == val) { HOST_SPACE_ATOMIC_LOCKS[((size_t(ptr) >> 2) & HOST_SPACE_ATOMIC_MASK) ^ HOST_SPACE_ATOMIC_XOR_MASK] = 1; } else { _xabort(1); } _xend(); return 1; } else { #endif return 0 == atomic_compare_exchange( &HOST_SPACE_ATOMIC_LOCKS[((size_t(ptr) >> 2) & HOST_SPACE_ATOMIC_MASK) ^ HOST_SPACE_ATOMIC_XOR_MASK], 0, 1); #if defined(KOKKOS_ENABLE_ISA_X86_64) && defined(KOKKOS_ENABLE_TM) && \ !defined(KOKKOS_COMPILER_PGI) } #endif } void unlock_address_host_space(void *ptr) { #if defined(KOKKOS_ENABLE_ISA_X86_64) && defined(KOKKOS_ENABLE_TM) && \ !defined(KOKKOS_COMPILER_PGI) const unsigned status = _xbegin(); if (_XBEGIN_STARTED == status) { HOST_SPACE_ATOMIC_LOCKS[((size_t(ptr) >> 2) & HOST_SPACE_ATOMIC_MASK) ^ HOST_SPACE_ATOMIC_XOR_MASK] = 0; } else { #endif atomic_exchange( &HOST_SPACE_ATOMIC_LOCKS[((size_t(ptr) >> 2) & HOST_SPACE_ATOMIC_MASK) ^ HOST_SPACE_ATOMIC_XOR_MASK], 0); #if defined(KOKKOS_ENABLE_ISA_X86_64) && defined(KOKKOS_ENABLE_TM) && \ !defined(KOKKOS_COMPILER_PGI) } #endif } } // namespace Impl } // namespace Kokkos
gpl-2.0
firemark/herman
init.js
2837
var tapes = []; var machines = []; var fineMachines = []; var actualMachines = []; var counter = 0; var counterMachine = 0; var statusNode = null; var scoresNode = null; var generation = 0; function init(){ statusNode = document.getElementById('status'); tapes = [new Tape('firstCanvas'), new Tape('secondCanvas')]; machines = genArray(numOfTurs * 2, function(i){return new Machine();}) changeMachines(); window.setTimeout(changeState, 1); } function changeMachines(){ var pos = counterMachine * 2; actualMachines = [machines[pos], machines[pos + 1]]; statusNode.innerHTML = 'turn: ' + counterMachine + ' generation: ' + 0; for(var i=0; i < 2; i++) actualMachines[i].showTable('machineTable' + i); } function setBackgroundInCell(tableId, row, coll, color){ var cell = document.getElementById(tableId).rows[row + 1].cells[coll + 1]; cell.style.backgroundColor = color; } function changeState(){ for(var i=0; i < 2; i++) for(var c=0; c < 32; c++){ var tape = tapes[i]; var machine = actualMachines[i]; machine.changeState(tape.getSymbol()); var state = machine.getState(); tape.setSymbol(state.symbol); tape.move(state.move); var ratio = state.counter / ++counter; //console.log(state.symbol, state.state, ratio); if (ratio > 0.25) setBackgroundInCell('machineTable' + i, state.symbol, state.state, '#FF48D0'); else if (ratio > 0.15) setBackgroundInCell('machineTable' + i, state.symbol, state.state, '#FF2B2B'); else if (ratio > 0.1) setBackgroundInCell('machineTable' + i, state.symbol, state.state, '#FF6E4A'); else if (ratio > 0.5) setBackgroundInCell('machineTable' + i, state.symbol, state.state, '#FFA343'); else if (ratio > 0.025) setBackgroundInCell('machineTable' + i, state.symbol, state.state, '#FFF44F'); else if (ratio > 0.0125) setBackgroundInCell('machineTable' + i, state.symbol, state.state, '#FFFF99'); else if (ratio > 0.0025) setBackgroundInCell('machineTable' + i, state.symbol, state.state, '#F0E891'); } for(var i=0; i < 2; i++) tapes[i].refresh(); if (counter < maxMachineIterators) window.setTimeout(changeState, 1); } function addFineMachine(machineNum){ window.clearTimeout(changeState); counter = 0; fineMachines.push(actualMachines[machineNum]); for(var i=0; i < 2; i++) tapes[i].reset(); if (++counterMachine >= numOfTurs){ counterMachine = 0; generation++; var genetic = new Genetic(fineMachines); genetic.selection(); genetic.crossover(); machines = genetic.newMachines; fineMachines = []; } changeMachines(); statusNode.innerHTML = 'turn: ' + counterMachine + ' generation: ' + generation; window.setTimeout(changeState, 1); }
gpl-2.0
fernandaos12/ateliebambolina
cache/smarty/compile/81/5a/ab/815aabd18e78e50aee55862194e7362b793c4583.file.modal_not_trusted.tpl.php
4640
<?php /* Smarty version Smarty-3.1.19, created on 2016-03-28 17:55:51 compiled from "C:\wamp\www\atelieshop\admin723qbu3tt\themes\default\template\controllers\modules\modal_not_trusted.tpl" */ ?> <?php /*%%SmartyHeaderCode:805356f99a57a8d407-68287789%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed'); $_valid = $_smarty_tpl->decodeProperties(array ( 'file_dependency' => array ( '815aabd18e78e50aee55862194e7362b793c4583' => array ( 0 => 'C:\\wamp\\www\\atelieshop\\admin723qbu3tt\\themes\\default\\template\\controllers\\modules\\modal_not_trusted.tpl', 1 => 1452109828, 2 => 'file', ), ), 'nocache_hash' => '805356f99a57a8d407-68287789', 'function' => array ( ), 'has_nocache_code' => false, 'version' => 'Smarty-3.1.19', 'unifunc' => 'content_56f99a57cdb286_04653272', ),false); /*/%%SmartyHeaderCode%%*/?> <?php if ($_valid && !is_callable('content_56f99a57cdb286_04653272')) {function content_56f99a57cdb286_04653272($_smarty_tpl) {?> <div class="untrusted-content-action"> <div class="modal-body"> <div class="alert alert-warning"> <h3><?php echo smartyTranslate(array('s'=>'Do you want to install this module that could not be verified by PrestaShop?'),$_smarty_tpl);?> </h3> <p><?php echo smartyTranslate(array('s'=>"This generally happens when the module isn't distributed through our official marketplace, PrestaShop Addons - or when your server failed to communicate with PrestaShop Addons."),$_smarty_tpl);?> </p> </div> <div class="row"> <div class="col-sm-2" style="text-align: center;"> <img id="untrusted-module-logo" class="" src="" alt="" style="max-width:96px;"> </div> <div class="col-sm-10"> <table class="table"> <tr> <td><?php echo smartyTranslate(array('s'=>'Module'),$_smarty_tpl);?> </td> <td><strong><span class="module-display-name-placeholder"></span></strong></td> </tr> <tr> <td><?php echo smartyTranslate(array('s'=>'Author'),$_smarty_tpl);?> </td> <td><strong><span class="author-name-placeholder"></span></strong></td> </tr> </table> </div> <div class="col-sm-12" style="text-align: center; padding-top: 12px;"> <a id="proceed-install-anyway" href="#" class="btn btn-warning"><?php echo smartyTranslate(array('s'=>'Proceed with the installation'),$_smarty_tpl);?> </a> <button type="button" class="btn btn-default" data-dismiss="modal"><?php echo smartyTranslate(array('s'=>'Back to modules list'),$_smarty_tpl);?> </button> </div> </div> </div> <div class="modal-footer"> <div class="alert alert-info"> <p> <?php echo smartyTranslate(array('s'=>'Since you may not have downloaded this module from PrestaShop Addons, we cannot assert that the module is not adding some undisclosed functionalities. We advise you to install it only if you trust the source of the content.'),$_smarty_tpl);?> <a id="untrusted-show-risk" href="#"><strong><?php echo smartyTranslate(array('s'=>"What's the risk?"),$_smarty_tpl);?> </strong></a> </p> </div> </div> </div> <div class="untrusted-content-more-info" style="display:none;"> <div class="modal-body"> <h4><?php echo smartyTranslate(array('s'=>'Am I at Risk?'),$_smarty_tpl);?> </h4> <p><?php echo smartyTranslate(array('s'=>"A module that hasn't been verified may be dangerous and could add hidden functionalities like backdoors, ads, hidden links, spam, etc. Don’t worry, this alert is simply a warning."),$_smarty_tpl);?> </p> <p><?php echo smartyTranslate(array('s'=>"PrestaShop, being an open-source software, has an awesome community with a long history of developing and sharing high quality modules. Before installing this module, making sure its author is a known community member is always a good idea (by checking [1]our forum[/1] for instance).",'tags'=>array('<a href="https://www.prestashop.com/forums/">')),$_smarty_tpl);?> </p> <h4><?php echo smartyTranslate(array('s'=>'What Should I Do?'),$_smarty_tpl);?> </h4> <p><?php echo smartyTranslate(array('s'=>"If you trust or find the author of this module to be an active community member, you can proceed with the installation."),$_smarty_tpl);?> <p><?php echo smartyTranslate(array('s'=>"Otherwise you can look for similar modules on the official marketplace. [1]Click here to browse PrestaShop Addons[/1].",'tags'=>array('<a class="catalog-link" href="#">')),$_smarty_tpl);?> </div> <div class="modal-footer"> <a id="untrusted-show-action" class="btn btn-default" href="#"><?php echo smartyTranslate(array('s'=>'Back'),$_smarty_tpl);?> </a> </div> </div> <?php }} ?>
gpl-2.0
bembelimen/joomla-cms
administrator/components/com_newsfeeds/tmpl/newsfeeds/modal.php
4982
<?php /** * @package Joomla.Administrator * @subpackage com_newsfeeds * * @copyright (C) 2010 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; use Joomla\CMS\Factory; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Multilanguage; use Joomla\CMS\Language\Text; use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; use Joomla\Component\Newsfeeds\Site\Helper\RouteHelper; HTMLHelper::_('behavior.core'); $app = Factory::getApplication(); $function = $app->input->getCmd('function', 'jSelectNewsfeed'); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); $multilang = Multilanguage::isEnabled(); ?> <div class="container-popup"> <form action="<?php echo Route::_('index.php?option=com_newsfeeds&view=newsfeeds&layout=modal&tmpl=component&function=' . $function); ?>" method="post" name="adminForm" id="adminForm"> <?php echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?> <?php if (empty($this->items)) : ?> <div class="alert alert-info"> <span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span> <?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?> </div> <?php else : ?> <table class="table table-sm"> <caption class="visually-hidden"> <?php echo Text::_('COM_NEWSFEEDS_TABLE_CAPTION'); ?>, <span id="orderedBy"><?php echo Text::_('JGLOBAL_SORTED_BY'); ?> </span>, <span id="filteredBy"><?php echo Text::_('JGLOBAL_FILTERED_BY'); ?></span> </caption> <thead> <tr> <th scope="col" class="w-1 text-center"> <?php echo HTMLHelper::_('searchtools.sort', 'JSTATUS', 'a.published', $listDirn, $listOrder); ?> </th> <th scope="col" class="title"> <?php echo HTMLHelper::_('searchtools.sort', 'JGLOBAL_TITLE', 'a.name', $listDirn, $listOrder); ?> </th> <th scope="col" class="w-15 d-none d-md-table-cell"> <?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ACCESS', 'access_level', $listDirn, $listOrder); ?> </th> <?php if ($multilang) : ?> <th scope="col" class="w-15 d-none d-md-table-cell"> <?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_LANGUAGE', 'language_title', $listDirn, $listOrder); ?> </th> <?php endif; ?> <th scope="col" class="w-1 d-none d-md-table-cell"> <?php echo HTMLHelper::_('searchtools.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?> </th> </tr> </thead> <tbody> <?php $iconStates = array( -2 => 'icon-trash', 0 => 'icon-times', 1 => 'icon-check', 2 => 'icon-folder', ); ?> <?php foreach ($this->items as $i => $item) : ?> <?php if ($item->language && $multilang) { $tag = strlen($item->language); if ($tag == 5) { $lang = substr($item->language, 0, 2); } elseif ($tag == 6) { $lang = substr($item->language, 0, 3); } else { $lang = ''; } } elseif (!$multilang) { $lang = ''; } ?> <tr class="row<?php echo $i % 2; ?>"> <td class="text-center tbody-icon"> <span class="<?php echo $iconStates[$this->escape($item->published)]; ?>" aria-hidden="true"></span> </td> <th scope="row"> <a href="javascript:void(0)" onclick="if (window.parent) window.parent.<?php echo $this->escape($function); ?>('<?php echo $item->id; ?>', '<?php echo $this->escape(addslashes($item->name)); ?>', '<?php echo $this->escape($item->catid); ?>', null, '<?php echo $this->escape(RouteHelper::getNewsfeedRoute($item->id, $item->catid, $item->language)); ?>', '<?php echo $this->escape($lang); ?>', null);"> <?php echo $this->escape($item->name); ?></a> <div class="small"> <?php echo Text::_('JCATEGORY') . ': ' . $this->escape($item->category_title); ?> </div> </th> <td class="small d-none d-md-table-cell"> <?php echo $this->escape($item->access_level); ?> </td> <?php if ($multilang) : ?> <td class="small d-none d-md-table-cell"> <?php echo LayoutHelper::render('joomla.content.language', $item); ?> </td> <?php endif; ?> <td class="d-none d-md-table-cell"> <?php echo (int) $item->id; ?> </td> </tr> <?php endforeach; ?> </tbody> </table> <?php // load the pagination. ?> <?php echo $this->pagination->getListFooter(); ?> <?php endif; ?> <input type="hidden" name="task" value=""> <input type="hidden" name="boxchecked" value="0"> <input type="hidden" name="forcedLanguage" value="<?php echo $app->input->get('forcedLanguage', '', 'CMD'); ?>"> <?php echo HTMLHelper::_('form.token'); ?> </form> </div>
gpl-2.0
10211509/maketaobao
app/src/main/java/nobugs/team/shopping/repo/api/retrofit/GetUnitListApiImpl.java
1407
package nobugs.team.shopping.repo.api.retrofit; import java.util.List; import nobugs.team.shopping.mvp.model.ProductType; import nobugs.team.shopping.repo.api.GetShopListApi; import nobugs.team.shopping.repo.api.GetUnitListApi; import nobugs.team.shopping.repo.api.entity.TypeListResult; import nobugs.team.shopping.repo.api.entity.UnitListResult; import nobugs.team.shopping.repo.mapper.UnitListMapper; import retrofit.RetrofitError; import retrofit.client.Response; /** * Created by Administrator on 2015/8/23 0023. */ public class GetUnitListApiImpl extends BaseRetrofitHandler implements GetUnitListApi { public GetUnitListApiImpl(RetrofitAdapter adapter) { super(adapter); this.mapper = new UnitListMapper(); } @Override public List<String> getUnitList() { return (List<String>) mapper.map(getService().getUnitList()); } @Override public void getUnitList(final Callback callback) { getService().getUnitList(new retrofit.Callback<UnitListResult>() { @Override public void success(UnitListResult unitListResult, Response response) { callback.onFinish((List<String>) mapper.map(unitListResult)); } @Override public void failure(RetrofitError error) { callback.onError(getErrorType(error), error.getMessage()); } }); } }
gpl-2.0
jmperaltagalisteo/Aprendizaje-Visual
mods/propiedad/condiciones/index.php
2125
<?php session_start(); //Idioma if(empty($_SESSION['lang'])) $_SESSION['lang'] = 'es'; //Numero if(empty($_SESSION['numero'])) $_SESSION['numero'] = 1; //Vocal if(empty($_SESSION['vocal'])) $_SESSION['vocal'] = 'a'; ?> <!DOCTYPE html> <html lang="es"> <!--Incluimos los css y atributos--> <?php include_once("../cargar/head.php"); ?> <body> <!--Cargarmos el nav principal--> <?php include_once("../cargar/cabecera.php"); ?> <!-- Page Content --> <div class="container"> <!-- Page Header --> <div class="row"> <div class="col-lg-12"> <h1 class="page-header">Condiciones <small>Condiciones de uso y términos legales </small> </h1> </div> </div> <!-- /.row --> <br> <!-- Projects Row --> <div class="row"> <div class="col-lg-12"> <p> <strong>Copyrights</strong><br /> El diseño, textos, gráficos y otros elementos son propiedad de Aprendizaje Visual. Todos los derechos reservados. Está terminantemente prohibida la reproducción parcial o total del presente portal sin permiso expreso. </p> <p> <strong>Limitación de la responsabilidad</strong><br /> Aprendizaje Visual declina cualquier responsabilidad relativa a daños producidos por terceros debido a los medios electrónicos utilizados tales como virus, troyanos, bombas lógicas o cualquier otras rutinas de programación contra la propiedad y que hayan utilizado Aprendizaje Visual como medio para ello. </p> <p> <strong>Cookies</strong><br /> Aprendizaje Visual no utiliza cookies en ninguna de sus páginas.Puede ver toda la información de nuestras Cookies pulsando <a class="enlac" href="cookies.php">aquí</a>. </p> </div> </div> <!-- /.row --> <hr> <!--Cargamos el pie--> <?php include_once("../cargar/pie.php"); ?> </div> <!-- /.container --> <!-- Cargar de JS --> <?php include_once("../cargar/js.php"); ?> </body> </html>
gpl-2.0
shlomsky/ivo
administrator/components/com_zoo/views/configuration/tmpl/importcsv.php
4310
<?php /** * @package ZOO Component * @file importcsv.php * @version 2.3.0 December 2010 * @author YOOtheme http://www.yootheme.com * @copyright Copyright (C) 2007 - 2011 YOOtheme GmbH * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only */ // no direct access defined('_JEXEC') or die('Restricted access'); // add js JHTML::script('import.js', 'administrator/components/com_zoo/assets/js/'); ?> <form id="configuration-import" class="menu-has-level3" action="index.php" method="post" name="adminForm" accept-charset="utf-8" enctype="multipart/form-data"> <?php echo $this->partial('menu'); ?> <div class="box-bottom"> <div class="col col-left width-60"> <h2><?php echo JText::_('CSV Import'); ?>:</h2> <fieldset class="items"> <legend><?php echo (int) $this->info['item_count']; ?> x <?php echo JText::_('Items'); ?></legend> <div class="assign-group"> <div class="info"> <label for="type-select"><?php echo JText::_('CHOOSE_TYPE_MATCH_DATA'); ?></label> <?php $options = array(JHTML::_('select.option', '', '- '.JText::_('Select Type').' -')); echo JHTML::_('zoo.typelist', $options, 'type', 'class="type"', 'value', 'text'); ?> </div> <ul> <?php foreach ($this->info['columns'] as $key => $column) : ?> <li class="assign"> <?php foreach ($this->info['types'] as $type => $element_types) { $options = array(); $options[] = JHTML::_('select.option', '', JText::_('Ignore')); $options[] = JHTML::_('select.option', '<OPTGROUP>', JText::_('Core Atributes') ); $options[] = JHTML::_('select.option', '_name', JText::_('Name')); $options[] = JHTML::_('select.option', '_category', JText::_('Category')); $options[] = JHTML::_('select.option', '_created_by_alias', JText::_('Author Alias')); $options[] = JHTML::_('select.option', '_created', JText::_('Created Date')); $options[] = JHTML::_('select.option', '</OPTGROUP>' ); $options[] = JHTML::_('select.option', '<OPTGROUP>', JText::_('Elements') ); foreach ($element_types as $element_type => $elements) { foreach ($elements as $element) { $options[] = JHTML::_('select.option', $element->identifier, $element->getConfig()->get('name') . ' (' . ucfirst($element->getElementType()) . ')'); } } $options[] = JHTML::_('select.option', '</OPTGROUP>' ); echo JHTML::_('select.genericlist', $options, 'element-assign['.$key.']['.$type.']', array('class' => 'assign' )); } ?> <span class="name"><?php echo empty($column) ? JText::_('Column') . ' ' . ($key + 1) : $column; ?></span> </li> <?php endforeach; ?> </ul> </div> </fieldset> <button class="button-grey" id="submit-button" type="button"><?php echo JText::_('Import'); ?></button> </div> <h2><?php echo JText::_('Information'); ?>:</h2> <div class="col col-right width-40"> <div class="creation-form infobox"> <p><?php echo JText::_("CSV-IMPORT-INFO-1"); ?></p> <p><?php echo JText::_("CSV-IMPORT-INFO-2"); ?></p> <p><?php echo JText::_("CSV-IMPORT-INFO-3"); ?></p> </div> </div> </div> <input type="hidden" name="option" value="<?php echo $this->option; ?>" /> <input type="hidden" name="controller" value="<?php echo $this->controller; ?>" /> <input type="hidden" name="task" value="" /> <input type="hidden" name="contains-headers" value="<?php echo $this->contains_headers; ?>" /> <input type="hidden" name="field-separator" value="<?php echo htmlentities($this->field_separator); ?>" /> <input type="hidden" name="field-enclosure" value="<?php echo htmlentities($this->field_enclosure); ?>" /> <input type="hidden" name="file" value="<?php echo $this->file; ?>" /> <?php echo JHTML::_('form.token'); ?> <script type="text/javascript"> jQuery(function($){ $('#configuration-import').Import({ msgNameWarning: "<?php echo JText::_("Please choose a name column."); ?>", msgSelectWarning: "<?php echo JText::_("MSG_ASSIGN_WARNING"); ?>", msgWarningDuplicate: "<?php echo JText::_("There are duplicate assignments."); ?>", task: "doimportcsv" }); }); </script> </form> <?php echo ZOO_COPYRIGHT; ?>
gpl-2.0
Fluorohydride/ygopro-scripts
c93912845.lua
2361
--リバイバル・ギフト function c93912845.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetHintTiming(0,TIMING_END_PHASE) e1:SetTarget(c93912845.target) e1:SetOperation(c93912845.activate) c:RegisterEffect(e1) end function c93912845.spfilter(c,e,tp) return c:IsType(TYPE_TUNER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c93912845.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c93912845.spfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)>1 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and not Duel.IsPlayerAffectedByEffect(tp,59822133) and Duel.IsExistingTarget(c93912845.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.IsPlayerCanSpecialSummonMonster(tp,93912846,0,TYPES_TOKEN_MONSTER,1500,1500,3,RACE_FIEND,ATTRIBUTE_DARK,POS_FACEUP,1-tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,c93912845.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function c93912845.activate(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DISABLE) e1:SetReset(RESET_EVENT+RESETS_STANDARD) tc:RegisterEffect(e1,true) local e2=Effect.CreateEffect(e:GetHandler()) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetReset(RESET_EVENT+RESETS_STANDARD) tc:RegisterEffect(e2,true) end end if Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)>1 and Duel.IsPlayerCanSpecialSummonMonster(tp,93912846,0,TYPES_TOKEN_MONSTER,1500,1500,3,RACE_FIEND,ATTRIBUTE_DARK,POS_FACEUP,1-tp) and not Duel.IsPlayerAffectedByEffect(tp,59822133) then for i=1,2 do local token=Duel.CreateToken(tp,93912846) Duel.SpecialSummonStep(token,0,tp,1-tp,false,false,POS_FACEUP) end end Duel.SpecialSummonComplete() end
gpl-2.0
mmilidoni/rubiz
app/models.py
1295
from django.db import models from . import enum from django.utils.translation import ugettext as _ class Etichetta(models.Model): nome = models.CharField(max_length=255, verbose_name=_("Nome")) def __unicode__(self): return self.nome class Meta: verbose_name = _('Etichetta') verbose_name_plural = _('Etichette') class Persona(models.Model): cognome = models.CharField(max_length=255, verbose_name=_("Cognome")) nome = models.CharField(max_length=255, blank=True, verbose_name=_("Nome")) email = models.EmailField(blank=True, verbose_name=_("Email")) fax = models.CharField(max_length=255, blank=True, verbose_name="Fax") telefono1 = models.CharField(max_length=255, blank=True, verbose_name="Tel. 1") telefono2 = models.CharField(max_length=255, blank=True, verbose_name="Tel. 2") codice1 = models.CharField(max_length=255, verbose_name=_("Codice"), blank=True) codiceco = models.CharField(max_length=255, verbose_name=_("Cod.2"), blank=True) codicecs = models.CharField(max_length=255, verbose_name=_("Cod.3"), blank=True) etichette = models.ManyToManyField(Etichetta, blank=True, verbose_name=_("Etichette")) class Meta: verbose_name = _('Persona') verbose_name_plural = _('Persone')
gpl-2.0
noba3/KoTos
xbmc/FileItem.cpp
88049
/* * Copyright (C) 2005-2015 Team Kodi * http://kodi.tv * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (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 Kodi; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ #include <cstdlib> #include "FileItem.h" #include "guilib/LocalizeStrings.h" #include "utils/StringUtils.h" #include "utils/URIUtils.h" #include "utils/Archive.h" #include "Util.h" #include "playlists/PlayListFactory.h" #include "utils/Crc32.h" #include "filesystem/Directory.h" #include "filesystem/File.h" #include "filesystem/StackDirectory.h" #include "filesystem/CurlFile.h" #include "filesystem/MultiPathDirectory.h" #include "filesystem/MusicDatabaseDirectory.h" #include "filesystem/VideoDatabaseDirectory.h" #include "filesystem/VideoDatabaseDirectory/QueryParams.h" #include "music/tags/MusicInfoTagLoaderFactory.h" #include "CueDocument.h" #include "video/VideoDatabase.h" #include "music/MusicDatabase.h" #include "epg/Epg.h" #include "pvr/channels/PVRChannel.h" #include "pvr/channels/PVRRadioRDSInfoTag.h" #include "pvr/recordings/PVRRecording.h" #include "pvr/timers/PVRTimerInfoTag.h" #include "video/VideoInfoTag.h" #include "threads/SingleLock.h" #include "music/tags/MusicInfoTag.h" #include "pictures/PictureInfoTag.h" #include "music/Artist.h" #include "music/Album.h" #include "URL.h" #include "settings/AdvancedSettings.h" #include "settings/Settings.h" #include "utils/RegExp.h" #include "utils/log.h" #include "utils/Variant.h" #include "utils/Mime.h" #include <assert.h> #include <algorithm> using namespace XFILE; using namespace PLAYLIST; using namespace MUSIC_INFO; using namespace PVR; using namespace EPG; CFileItem::CFileItem(const CSong& song) { Initialize(); SetFromSong(song); } CFileItem::CFileItem(const CSong& song, const CMusicInfoTag& music) { Initialize(); SetFromSong(song); *GetMusicInfoTag() = music; } CFileItem::CFileItem(const CURL &url, const CAlbum& album) { Initialize(); m_strPath = url.Get(); URIUtils::AddSlashAtEnd(m_strPath); SetFromAlbum(album); } CFileItem::CFileItem(const std::string &path, const CAlbum& album) { Initialize(); m_strPath = path; URIUtils::AddSlashAtEnd(m_strPath); SetFromAlbum(album); } CFileItem::CFileItem(const CMusicInfoTag& music) { Initialize(); SetLabel(music.GetTitle()); m_strPath = music.GetURL(); m_bIsFolder = URIUtils::HasSlashAtEnd(m_strPath); *GetMusicInfoTag() = music; FillInDefaultIcon(); FillInMimeType(false); } CFileItem::CFileItem(const CVideoInfoTag& movie) { Initialize(); SetFromVideoInfoTag(movie); } CFileItem::CFileItem(const CEpgInfoTagPtr& tag) { assert(tag.get()); Initialize(); m_bIsFolder = false; m_epgInfoTag = tag; m_strPath = tag->Path(); SetLabel(tag->Title()); m_strLabel2 = tag->Plot(); m_dateTime = tag->StartAsLocalTime(); if (!tag->Icon().empty()) SetIconImage(tag->Icon()); else if (tag->HasPVRChannel() && !tag->ChannelTag()->IconPath().empty()) SetIconImage(tag->ChannelTag()->IconPath()); FillInMimeType(false); } CFileItem::CFileItem(const CPVRChannelPtr& channel) { assert(channel.get()); Initialize(); CEpgInfoTagPtr epgNow(channel->GetEPGNow()); m_strPath = channel->Path(); m_bIsFolder = false; m_pvrChannelInfoTag = channel; SetLabel(channel->ChannelName()); m_strLabel2 = epgNow ? epgNow->Title() : CSettings::GetInstance().GetBool(CSettings::SETTING_EPG_HIDENOINFOAVAILABLE) ? "" : g_localizeStrings.Get(19055); // no information available if (channel->IsRadio()) { CMusicInfoTag* musictag = GetMusicInfoTag(); if (musictag) { musictag->SetURL(channel->Path()); musictag->SetTitle(m_strLabel2); musictag->SetArtist(channel->ChannelName()); musictag->SetAlbumArtist(channel->ChannelName()); if (epgNow) musictag->SetGenre(epgNow->Genre()); musictag->SetDuration(epgNow ? epgNow->GetDuration() : 3600); musictag->SetLoaded(true); musictag->SetComment(""); musictag->SetLyrics(""); } } if (!channel->IconPath().empty()) SetIconImage(channel->IconPath()); SetProperty("channelid", channel->ChannelID()); SetProperty("path", channel->Path()); SetArt("thumb", channel->IconPath()); FillInMimeType(false); } CFileItem::CFileItem(const CPVRRecordingPtr& record) { assert(record.get()); Initialize(); m_bIsFolder = false; m_pvrRecordingInfoTag = record; m_strPath = record->m_strFileNameAndPath; SetLabel(record->m_strTitle); m_strLabel2 = record->m_strPlot; FillInMimeType(false); } CFileItem::CFileItem(const CPVRTimerInfoTagPtr& timer) { assert(timer.get()); Initialize(); m_bIsFolder = timer->IsRepeating(); m_pvrTimerInfoTag = timer; m_strPath = timer->Path(); SetLabel(timer->Title()); m_strLabel2 = timer->Summary(); m_dateTime = timer->StartAsLocalTime(); if (!timer->ChannelIcon().empty()) SetIconImage(timer->ChannelIcon()); FillInMimeType(false); } CFileItem::CFileItem(const CArtist& artist) { Initialize(); SetLabel(artist.strArtist); m_strPath = artist.strArtist; m_bIsFolder = true; URIUtils::AddSlashAtEnd(m_strPath); GetMusicInfoTag()->SetArtist(artist); FillInMimeType(false); } CFileItem::CFileItem(const CGenre& genre) { Initialize(); SetLabel(genre.strGenre); m_strPath = genre.strGenre; m_bIsFolder = true; URIUtils::AddSlashAtEnd(m_strPath); GetMusicInfoTag()->SetGenre(genre.strGenre); FillInMimeType(false); } CFileItem::CFileItem(const CFileItem& item) : m_musicInfoTag(NULL), m_videoInfoTag(NULL), m_pictureInfoTag(NULL) { *this = item; } CFileItem::CFileItem(const CGUIListItem& item) { Initialize(); // not particularly pretty, but it gets around the issue of Initialize() defaulting // parameters in the CGUIListItem base class. *((CGUIListItem *)this) = item; FillInMimeType(false); } CFileItem::CFileItem(void) { Initialize(); } CFileItem::CFileItem(const std::string& strLabel) { Initialize(); SetLabel(strLabel); } CFileItem::CFileItem(const char* strLabel) { Initialize(); SetLabel(std::string(strLabel)); } CFileItem::CFileItem(const CURL& path, bool bIsFolder) { Initialize(); m_strPath = path.Get(); m_bIsFolder = bIsFolder; if (m_bIsFolder && !m_strPath.empty() && !IsFileFolder()) URIUtils::AddSlashAtEnd(m_strPath); FillInMimeType(false); } CFileItem::CFileItem(const std::string& strPath, bool bIsFolder) { Initialize(); m_strPath = strPath; m_bIsFolder = bIsFolder; if (m_bIsFolder && !m_strPath.empty() && !IsFileFolder()) URIUtils::AddSlashAtEnd(m_strPath); FillInMimeType(false); } CFileItem::CFileItem(const CMediaSource& share) { Initialize(); m_bIsFolder = true; m_bIsShareOrDrive = true; m_strPath = share.strPath; if (!IsRSS()) // no slash at end for rss feeds URIUtils::AddSlashAtEnd(m_strPath); std::string label = share.strName; if (!share.strStatus.empty()) label = StringUtils::Format("%s (%s)", share.strName.c_str(), share.strStatus.c_str()); SetLabel(label); m_iLockMode = share.m_iLockMode; m_strLockCode = share.m_strLockCode; m_iHasLock = share.m_iHasLock; m_iBadPwdCount = share.m_iBadPwdCount; m_iDriveType = share.m_iDriveType; SetArt("thumb", share.m_strThumbnailImage); SetLabelPreformated(true); if (IsDVD()) GetVideoInfoTag()->m_strFileNameAndPath = share.strDiskUniqueId; // share.strDiskUniqueId contains disc unique id FillInMimeType(false); } CFileItem::~CFileItem(void) { delete m_musicInfoTag; delete m_videoInfoTag; delete m_pictureInfoTag; m_musicInfoTag = NULL; m_videoInfoTag = NULL; m_pictureInfoTag = NULL; } const CFileItem& CFileItem::operator=(const CFileItem& item) { if (this == &item) return *this; CGUIListItem::operator=(item); m_bLabelPreformated=item.m_bLabelPreformated; FreeMemory(); m_strPath = item.GetPath(); m_bIsParentFolder = item.m_bIsParentFolder; m_iDriveType = item.m_iDriveType; m_bIsShareOrDrive = item.m_bIsShareOrDrive; m_dateTime = item.m_dateTime; m_dwSize = item.m_dwSize; if (item.m_musicInfoTag) { if (m_musicInfoTag) *m_musicInfoTag = *item.m_musicInfoTag; else m_musicInfoTag = new MUSIC_INFO::CMusicInfoTag(*item.m_musicInfoTag); } else { delete m_musicInfoTag; m_musicInfoTag = NULL; } if (item.m_videoInfoTag) { if (m_videoInfoTag) *m_videoInfoTag = *item.m_videoInfoTag; else m_videoInfoTag = new CVideoInfoTag(*item.m_videoInfoTag); } else { delete m_videoInfoTag; m_videoInfoTag = NULL; } if (item.m_pictureInfoTag) { if (m_pictureInfoTag) *m_pictureInfoTag = *item.m_pictureInfoTag; else m_pictureInfoTag = new CPictureInfoTag(*item.m_pictureInfoTag); } else { delete m_pictureInfoTag; m_pictureInfoTag = NULL; } m_epgInfoTag = item.m_epgInfoTag; m_pvrChannelInfoTag = item.m_pvrChannelInfoTag; m_pvrRecordingInfoTag = item.m_pvrRecordingInfoTag; m_pvrTimerInfoTag = item.m_pvrTimerInfoTag; m_pvrRadioRDSInfoTag = item.m_pvrRadioRDSInfoTag; m_lStartOffset = item.m_lStartOffset; m_lStartPartNumber = item.m_lStartPartNumber; m_lEndOffset = item.m_lEndOffset; m_strDVDLabel = item.m_strDVDLabel; m_strTitle = item.m_strTitle; m_iprogramCount = item.m_iprogramCount; m_idepth = item.m_idepth; m_iLockMode = item.m_iLockMode; m_strLockCode = item.m_strLockCode; m_iHasLock = item.m_iHasLock; m_iBadPwdCount = item.m_iBadPwdCount; m_bCanQueue=item.m_bCanQueue; m_mimetype = item.m_mimetype; m_extrainfo = item.m_extrainfo; m_specialSort = item.m_specialSort; m_bIsAlbum = item.m_bIsAlbum; m_doContentLookup = item.m_doContentLookup; return *this; } void CFileItem::Initialize() { m_musicInfoTag = NULL; m_videoInfoTag = NULL; m_pictureInfoTag = NULL; m_bLabelPreformated = false; m_bIsAlbum = false; m_dwSize = 0; m_bIsParentFolder = false; m_bIsShareOrDrive = false; m_iDriveType = CMediaSource::SOURCE_TYPE_UNKNOWN; m_lStartOffset = 0; m_lStartPartNumber = 1; m_lEndOffset = 0; m_iprogramCount = 0; m_idepth = 1; m_iLockMode = LOCK_MODE_EVERYONE; m_iBadPwdCount = 0; m_iHasLock = 0; m_bCanQueue = true; m_specialSort = SortSpecialNone; m_doContentLookup = true; } void CFileItem::Reset() { // CGUIListItem members... m_strLabel2.clear(); SetLabel(""); FreeIcons(); m_overlayIcon = ICON_OVERLAY_NONE; m_bSelected = false; m_bIsFolder = false; m_strDVDLabel.clear(); m_strTitle.clear(); m_strPath.clear(); m_dateTime.Reset(); m_strLockCode.clear(); m_mimetype.clear(); delete m_musicInfoTag; m_musicInfoTag=NULL; delete m_videoInfoTag; m_videoInfoTag=NULL; m_epgInfoTag.reset(); m_pvrChannelInfoTag.reset(); m_pvrRecordingInfoTag.reset(); m_pvrTimerInfoTag.reset(); m_pvrRadioRDSInfoTag.reset(); delete m_pictureInfoTag; m_pictureInfoTag=NULL; m_extrainfo.clear(); ClearProperties(); Initialize(); SetInvalid(); } void CFileItem::Archive(CArchive& ar) { CGUIListItem::Archive(ar); if (ar.IsStoring()) { ar << m_bIsParentFolder; ar << m_bLabelPreformated; ar << m_strPath; ar << m_bIsShareOrDrive; ar << m_iDriveType; ar << m_dateTime; ar << m_dwSize; ar << m_strDVDLabel; ar << m_strTitle; ar << m_iprogramCount; ar << m_idepth; ar << m_lStartOffset; ar << m_lStartPartNumber; ar << m_lEndOffset; ar << m_iLockMode; ar << m_strLockCode; ar << m_iBadPwdCount; ar << m_bCanQueue; ar << m_mimetype; ar << m_extrainfo; ar << m_specialSort; ar << m_doContentLookup; if (m_musicInfoTag) { ar << 1; ar << *m_musicInfoTag; } else ar << 0; if (m_videoInfoTag) { ar << 1; ar << *m_videoInfoTag; } else ar << 0; if (m_pvrRadioRDSInfoTag) { ar << 1; ar << *m_pvrRadioRDSInfoTag; } else ar << 0; if (m_pictureInfoTag) { ar << 1; ar << *m_pictureInfoTag; } else ar << 0; } else { ar >> m_bIsParentFolder; ar >> m_bLabelPreformated; ar >> m_strPath; ar >> m_bIsShareOrDrive; ar >> m_iDriveType; ar >> m_dateTime; ar >> m_dwSize; ar >> m_strDVDLabel; ar >> m_strTitle; ar >> m_iprogramCount; ar >> m_idepth; ar >> m_lStartOffset; ar >> m_lStartPartNumber; ar >> m_lEndOffset; int temp; ar >> temp; m_iLockMode = (LockType)temp; ar >> m_strLockCode; ar >> m_iBadPwdCount; ar >> m_bCanQueue; ar >> m_mimetype; ar >> m_extrainfo; ar >> temp; m_specialSort = (SortSpecial)temp; ar >> m_doContentLookup; int iType; ar >> iType; if (iType == 1) ar >> *GetMusicInfoTag(); ar >> iType; if (iType == 1) ar >> *GetVideoInfoTag(); ar >> iType; if (iType == 1) ar >> *m_pvrRadioRDSInfoTag; ar >> iType; if (iType == 1) ar >> *GetPictureInfoTag(); SetInvalid(); } } void CFileItem::Serialize(CVariant& value) const { //CGUIListItem::Serialize(value["CGUIListItem"]); value["strPath"] = m_strPath; value["dateTime"] = (m_dateTime.IsValid()) ? m_dateTime.GetAsRFC1123DateTime() : ""; value["lastmodified"] = m_dateTime.IsValid() ? m_dateTime.GetAsDBDateTime() : ""; value["size"] = m_dwSize; value["DVDLabel"] = m_strDVDLabel; value["title"] = m_strTitle; value["mimetype"] = m_mimetype; value["extrainfo"] = m_extrainfo; if (m_musicInfoTag) (*m_musicInfoTag).Serialize(value["musicInfoTag"]); if (m_videoInfoTag) (*m_videoInfoTag).Serialize(value["videoInfoTag"]); if (m_pvrRadioRDSInfoTag) m_pvrRadioRDSInfoTag->Serialize(value["rdsInfoTag"]); if (m_pictureInfoTag) (*m_pictureInfoTag).Serialize(value["pictureInfoTag"]); } void CFileItem::ToSortable(SortItem &sortable, Field field) const { switch (field) { case FieldPath: sortable[FieldPath] = m_strPath; break; case FieldDate: sortable[FieldDate] = (m_dateTime.IsValid()) ? m_dateTime.GetAsDBDateTime() : ""; break; case FieldSize: sortable[FieldSize] = m_dwSize; break; case FieldDriveType: sortable[FieldDriveType] = m_iDriveType; break; case FieldStartOffset: sortable[FieldStartOffset] = m_lStartOffset; break; case FieldEndOffset: sortable[FieldEndOffset] = m_lEndOffset; break; case FieldProgramCount: sortable[FieldProgramCount] = m_iprogramCount; break; case FieldBitrate: sortable[FieldBitrate] = m_dwSize; break; case FieldTitle: sortable[FieldTitle] = m_strTitle; break; // If there's ever a need to convert more properties from CGUIListItem it might be // worth to make CGUIListItem implement ISortable as well and call it from here default: break; } if (HasMusicInfoTag()) GetMusicInfoTag()->ToSortable(sortable, field); if (HasVideoInfoTag()) GetVideoInfoTag()->ToSortable(sortable, field); if (HasPictureInfoTag()) GetPictureInfoTag()->ToSortable(sortable, field); if (HasPVRChannelInfoTag()) GetPVRChannelInfoTag()->ToSortable(sortable, field); } void CFileItem::ToSortable(SortItem &sortable, const Fields &fields) const { Fields::const_iterator it; for (it = fields.begin(); it != fields.end(); it++) ToSortable(sortable, *it); /* FieldLabel is used as a fallback by all sorters and therefore has to be present as well */ sortable[FieldLabel] = GetLabel(); /* FieldSortSpecial and FieldFolder are required in conjunction with all other sorters as well */ sortable[FieldSortSpecial] = m_specialSort; sortable[FieldFolder] = m_bIsFolder; } bool CFileItem::Exists(bool bUseCache /* = true */) const { if (m_strPath.empty() || IsPath("add") || IsInternetStream() || IsParentFolder() || IsVirtualDirectoryRoot() || IsPlugin()) return true; if (IsVideoDb() && HasVideoInfoTag()) { CFileItem dbItem(m_bIsFolder ? GetVideoInfoTag()->m_strPath : GetVideoInfoTag()->m_strFileNameAndPath, m_bIsFolder); return dbItem.Exists(); } std::string strPath = m_strPath; if (URIUtils::IsMultiPath(strPath)) strPath = CMultiPathDirectory::GetFirstPath(strPath); if (URIUtils::IsStack(strPath)) strPath = CStackDirectory::GetFirstStackedFile(strPath); if (m_bIsFolder) return CDirectory::Exists(strPath, bUseCache); else return CFile::Exists(strPath, bUseCache); return false; } bool CFileItem::IsVideo() const { /* check preset mime type */ if(StringUtils::StartsWithNoCase(m_mimetype, "video/")) return true; if (HasVideoInfoTag()) return true; if (HasMusicInfoTag()) return false; if (HasPictureInfoTag()) return false; if (IsPVRRecording()) return true; if (URIUtils::IsDVD(m_strPath)) return true; std::string extension; if(StringUtils::StartsWithNoCase(m_mimetype, "application/")) { /* check for some standard types */ extension = m_mimetype.substr(12); if( StringUtils::EqualsNoCase(extension, "ogg") || StringUtils::EqualsNoCase(extension, "mp4") || StringUtils::EqualsNoCase(extension, "mxf") ) return true; } return URIUtils::HasExtension(m_strPath, g_advancedSettings.m_videoExtensions); } bool CFileItem::IsEPG() const { return HasEPGInfoTag(); } bool CFileItem::IsPVRChannel() const { return HasPVRChannelInfoTag(); } bool CFileItem::IsPVRRecording() const { return HasPVRRecordingInfoTag(); } bool CFileItem::IsUsablePVRRecording() const { return (m_pvrRecordingInfoTag && !m_pvrRecordingInfoTag->IsDeleted()); } bool CFileItem::IsDeletedPVRRecording() const { return (m_pvrRecordingInfoTag && m_pvrRecordingInfoTag->IsDeleted()); } bool CFileItem::IsPVRTimer() const { return HasPVRTimerInfoTag(); } bool CFileItem::IsPVRRadioRDS() const { return HasPVRRadioRDSInfoTag(); } bool CFileItem::IsDiscStub() const { if (IsVideoDb() && HasVideoInfoTag()) { CFileItem dbItem(m_bIsFolder ? GetVideoInfoTag()->m_strPath : GetVideoInfoTag()->m_strFileNameAndPath, m_bIsFolder); return dbItem.IsDiscStub(); } return URIUtils::HasExtension(m_strPath, g_advancedSettings.m_discStubExtensions); } bool CFileItem::IsAudio() const { /* check preset mime type */ if(StringUtils::StartsWithNoCase(m_mimetype, "audio/")) return true; if (HasMusicInfoTag()) return true; if (HasVideoInfoTag()) return false; if (HasPictureInfoTag()) return false; if (IsCDDA()) return true; if(StringUtils::StartsWithNoCase(m_mimetype, "application/")) { /* check for some standard types */ std::string extension = m_mimetype.substr(12); if( StringUtils::EqualsNoCase(extension, "ogg") || StringUtils::EqualsNoCase(extension, "mp4") || StringUtils::EqualsNoCase(extension, "mxf") ) return true; } return URIUtils::HasExtension(m_strPath, g_advancedSettings.GetMusicExtensions()); } bool CFileItem::IsPicture() const { if(StringUtils::StartsWithNoCase(m_mimetype, "image/")) return true; if (HasPictureInfoTag()) return true; if (HasMusicInfoTag()) return false; if (HasVideoInfoTag()) return false; return CUtil::IsPicture(m_strPath); } bool CFileItem::IsLyrics() const { return URIUtils::HasExtension(m_strPath, ".cdg|.lrc"); } bool CFileItem::IsSubtitle() const { return URIUtils::HasExtension(m_strPath, g_advancedSettings.m_subtitlesExtensions); } bool CFileItem::IsCUESheet() const { return URIUtils::HasExtension(m_strPath, ".cue"); } bool CFileItem::IsInternetStream(const bool bStrictCheck /* = false */) const { if (HasProperty("IsHTTPDirectory")) return false; return URIUtils::IsInternetStream(m_strPath, bStrictCheck); } bool CFileItem::IsFileFolder(EFileFolderType types) const { EFileFolderType always_type = EFILEFOLDER_TYPE_ALWAYS; /* internet streams are not directly expanded */ if(IsInternetStream()) always_type = EFILEFOLDER_TYPE_ONCLICK; if(types & always_type) { if(IsSmartPlayList() || (IsPlayList() && g_advancedSettings.m_playlistAsFolders) || IsAPK() || IsZIP() || IsRAR() || IsRSS() || IsType(".ogg|.oga|.nsf|.sid|.sap|.xbt|.xsp") #if defined(TARGET_ANDROID) || IsType(".apk") #endif ) return true; } if(types & EFILEFOLDER_TYPE_ONBROWSE) { if((IsPlayList() && !g_advancedSettings.m_playlistAsFolders) || IsDiscImage()) return true; } return false; } bool CFileItem::IsSmartPlayList() const { if (HasProperty("library.smartplaylist") && GetProperty("library.smartplaylist").asBoolean()) return true; return URIUtils::HasExtension(m_strPath, ".xsp"); } bool CFileItem::IsLibraryFolder() const { if (HasProperty("library.filter") && GetProperty("library.filter").asBoolean()) return true; return URIUtils::IsLibraryFolder(m_strPath); } bool CFileItem::IsPlayList() const { return CPlayListFactory::IsPlaylist(*this); } bool CFileItem::IsPythonScript() const { return URIUtils::HasExtension(m_strPath, ".py"); } bool CFileItem::IsType(const char *ext) const { return URIUtils::HasExtension(m_strPath, ext); } bool CFileItem::IsNFO() const { return URIUtils::HasExtension(m_strPath, ".nfo"); } bool CFileItem::IsDiscImage() const { return URIUtils::HasExtension(m_strPath, ".img|.iso|.nrg"); } bool CFileItem::IsOpticalMediaFile() const { if (IsDVDFile(false, true)) return true; return IsBDFile(); } bool CFileItem::IsDVDFile(bool bVobs /*= true*/, bool bIfos /*= true*/) const { std::string strFileName = URIUtils::GetFileName(m_strPath); if (bIfos) { if (StringUtils::EqualsNoCase(strFileName, "video_ts.ifo")) return true; if (StringUtils::StartsWithNoCase(strFileName, "vts_") && StringUtils::EndsWithNoCase(strFileName, "_0.ifo") && strFileName.length() == 12) return true; } if (bVobs) { if (StringUtils::EqualsNoCase(strFileName, "video_ts.vob")) return true; if (StringUtils::StartsWithNoCase(strFileName, "vts_") && StringUtils::EndsWithNoCase(strFileName, ".vob")) return true; } return false; } bool CFileItem::IsBDFile() const { std::string strFileName = URIUtils::GetFileName(m_strPath); return (StringUtils::EqualsNoCase(strFileName, "index.bdmv") || StringUtils::EqualsNoCase(strFileName, "MovieObject.bdmv")); } bool CFileItem::IsRAR() const { return URIUtils::IsRAR(m_strPath); } bool CFileItem::IsAPK() const { return URIUtils::IsAPK(m_strPath); } bool CFileItem::IsZIP() const { return URIUtils::IsZIP(m_strPath); } bool CFileItem::IsCBZ() const { return URIUtils::HasExtension(m_strPath, ".cbz"); } bool CFileItem::IsCBR() const { return URIUtils::HasExtension(m_strPath, ".cbr"); } bool CFileItem::IsRSS() const { return StringUtils::StartsWithNoCase(m_strPath, "rss://") || URIUtils::HasExtension(m_strPath, ".rss") || m_mimetype == "application/rss+xml"; } bool CFileItem::IsAndroidApp() const { return URIUtils::IsAndroidApp(m_strPath); } bool CFileItem::IsStack() const { return URIUtils::IsStack(m_strPath); } bool CFileItem::IsPlugin() const { return URIUtils::IsPlugin(m_strPath); } bool CFileItem::IsScript() const { return URIUtils::IsScript(m_strPath); } bool CFileItem::IsAddonsPath() const { return URIUtils::IsAddonsPath(m_strPath); } bool CFileItem::IsSourcesPath() const { return URIUtils::IsSourcesPath(m_strPath); } bool CFileItem::IsMultiPath() const { return URIUtils::IsMultiPath(m_strPath); } bool CFileItem::IsCDDA() const { return URIUtils::IsCDDA(m_strPath); } bool CFileItem::IsDVD() const { return URIUtils::IsDVD(m_strPath) || m_iDriveType == CMediaSource::SOURCE_TYPE_DVD; } bool CFileItem::IsOnDVD() const { return URIUtils::IsOnDVD(m_strPath) || m_iDriveType == CMediaSource::SOURCE_TYPE_DVD; } bool CFileItem::IsNfs() const { return URIUtils::IsNfs(m_strPath); } bool CFileItem::IsOnLAN() const { return URIUtils::IsOnLAN(m_strPath); } bool CFileItem::IsISO9660() const { return URIUtils::IsISO9660(m_strPath); } bool CFileItem::IsRemote() const { return URIUtils::IsRemote(m_strPath); } bool CFileItem::IsSmb() const { return URIUtils::IsSmb(m_strPath); } bool CFileItem::IsURL() const { return URIUtils::IsURL(m_strPath); } bool CFileItem::IsPVR() const { return CUtil::IsPVR(m_strPath); } bool CFileItem::IsLiveTV() const { return URIUtils::IsLiveTV(m_strPath); } bool CFileItem::IsHD() const { return URIUtils::IsHD(m_strPath); } bool CFileItem::IsMusicDb() const { return URIUtils::IsMusicDb(m_strPath); } bool CFileItem::IsVideoDb() const { return URIUtils::IsVideoDb(m_strPath); } bool CFileItem::IsVirtualDirectoryRoot() const { return (m_bIsFolder && m_strPath.empty()); } bool CFileItem::IsRemovable() const { return IsOnDVD() || IsCDDA() || m_iDriveType == CMediaSource::SOURCE_TYPE_REMOVABLE; } bool CFileItem::IsReadOnly() const { if (IsParentFolder()) return true; if (m_bIsShareOrDrive) return true; return !CUtil::SupportsWriteFileOperations(m_strPath); } void CFileItem::FillInDefaultIcon() { //CLog::Log(LOGINFO, "FillInDefaultIcon(%s)", pItem->GetLabel().c_str()); // find the default icon for a file or folder item // for files this can be the (depending on the file type) // default picture for photo's // default picture for songs // default picture for videos // default picture for shortcuts // default picture for playlists // or the icon embedded in an .xbe // // for folders // for .. folders the default picture for parent folder // for other folders the defaultFolder.png if (GetIconImage().empty()) { if (!m_bIsFolder) { /* To reduce the average runtime of this code, this list should * be ordered with most frequently seen types first. Also bear * in mind the complexity of the code behind the check in the * case of IsWhatater() returns false. */ if (IsPVRChannel()) { if (GetPVRChannelInfoTag()->IsRadio()) SetIconImage("DefaultAudio.png"); else SetIconImage("DefaultVideo.png"); } else if ( IsLiveTV() ) { // Live TV Channel SetIconImage("DefaultVideo.png"); } else if ( URIUtils::IsArchive(m_strPath) ) { // archive SetIconImage("DefaultFile.png"); } else if ( IsUsablePVRRecording() ) { // PVR recording SetIconImage("DefaultVideo.png"); } else if ( IsDeletedPVRRecording() ) { // PVR deleted recording SetIconImage("DefaultVideoDeleted.png"); } else if ( IsAudio() ) { // audio SetIconImage("DefaultAudio.png"); } else if ( IsVideo() ) { // video SetIconImage("DefaultVideo.png"); } else if (IsPVRTimer()) { SetIconImage("DefaultVideo.png"); } else if ( IsPicture() ) { // picture SetIconImage("DefaultPicture.png"); } else if ( IsPlayList() ) { SetIconImage("DefaultPlaylist.png"); } else if ( IsPythonScript() ) { SetIconImage("DefaultScript.png"); } else { // default icon for unknown file type SetIconImage("DefaultFile.png"); } } else { if ( IsPlayList() ) { SetIconImage("DefaultPlaylist.png"); } else if (IsParentFolder()) { SetIconImage("DefaultFolderBack.png"); } else { SetIconImage("DefaultFolder.png"); } } } // Set the icon overlays (if applicable) if (!HasOverlay()) { if (URIUtils::IsInRAR(m_strPath)) SetOverlayImage(CGUIListItem::ICON_OVERLAY_RAR); else if (URIUtils::IsInZIP(m_strPath)) SetOverlayImage(CGUIListItem::ICON_OVERLAY_ZIP); } } void CFileItem::RemoveExtension() { if (m_bIsFolder) return; std::string strLabel = GetLabel(); URIUtils::RemoveExtension(strLabel); SetLabel(strLabel); } void CFileItem::CleanString() { if (IsLiveTV()) return; std::string strLabel = GetLabel(); std::string strTitle, strTitleAndYear, strYear; CUtil::CleanString(strLabel, strTitle, strTitleAndYear, strYear, true); SetLabel(strTitleAndYear); } void CFileItem::SetLabel(const std::string &strLabel) { if (strLabel == "..") { m_bIsParentFolder = true; m_bIsFolder = true; m_specialSort = SortSpecialOnTop; SetLabelPreformated(true); } CGUIListItem::SetLabel(strLabel); } void CFileItem::SetFileSizeLabel() { if(m_bIsFolder && m_dwSize == 0) SetLabel2(""); else SetLabel2(StringUtils::SizeToString(m_dwSize)); } bool CFileItem::CanQueue() const { return m_bCanQueue; } void CFileItem::SetCanQueue(bool bYesNo) { m_bCanQueue = bYesNo; } bool CFileItem::IsParentFolder() const { return m_bIsParentFolder; } void CFileItem::FillInMimeType(bool lookup /*= true*/) { // TODO: adapt this to use CMime::GetMimeType() if (m_mimetype.empty()) { if( m_bIsFolder ) m_mimetype = "x-directory/normal"; else if( m_pvrChannelInfoTag ) m_mimetype = m_pvrChannelInfoTag->InputFormat(); else if( StringUtils::StartsWithNoCase(m_strPath, "shout://") || StringUtils::StartsWithNoCase(m_strPath, "http://") || StringUtils::StartsWithNoCase(m_strPath, "https://")) { // If lookup is false, bail out early to leave mime type empty if (!lookup) return; CCurlFile::GetMimeType(GetURL(), m_mimetype); // try to get mime-type again but with an NSPlayer User-Agent // in order for server to provide correct mime-type. Allows us // to properly detect an MMS stream if (StringUtils::StartsWithNoCase(m_mimetype, "video/x-ms-")) CCurlFile::GetMimeType(GetURL(), m_mimetype, "NSPlayer/11.00.6001.7000"); // make sure there are no options set in mime-type // mime-type can look like "video/x-ms-asf ; charset=utf8" size_t i = m_mimetype.find(';'); if(i != std::string::npos) m_mimetype.erase(i, m_mimetype.length() - i); StringUtils::Trim(m_mimetype); } else m_mimetype = CMime::GetMimeType(*this); // if it's still empty set to an unknown type if (m_mimetype.empty()) m_mimetype = "application/octet-stream"; } // change protocol to mms for the following mime-type. Allows us to create proper FileMMS. if( StringUtils::StartsWithNoCase(m_mimetype, "application/vnd.ms.wms-hdr.asfv1") || StringUtils::StartsWithNoCase(m_mimetype, "application/x-mms-framed") ) StringUtils::Replace(m_strPath, "http:", "mms:"); } bool CFileItem::IsSamePath(const CFileItem *item) const { if (!item) return false; if (item->GetPath() == m_strPath) { if (item->HasProperty("item_start") || HasProperty("item_start")) return (item->GetProperty("item_start") == GetProperty("item_start")); return true; } if (HasVideoInfoTag() && item->HasVideoInfoTag()) { if (m_videoInfoTag->m_iDbId != -1 && item->m_videoInfoTag->m_iDbId != -1) return ((m_videoInfoTag->m_iDbId == item->m_videoInfoTag->m_iDbId) && (m_videoInfoTag->m_type == item->m_videoInfoTag->m_type)); } if (IsMusicDb() && HasMusicInfoTag()) { CFileItem dbItem(m_musicInfoTag->GetURL(), false); if (HasProperty("item_start")) dbItem.SetProperty("item_start", GetProperty("item_start")); return dbItem.IsSamePath(item); } if (IsVideoDb() && HasVideoInfoTag()) { CFileItem dbItem(m_videoInfoTag->m_strFileNameAndPath, false); if (HasProperty("item_start")) dbItem.SetProperty("item_start", GetProperty("item_start")); return dbItem.IsSamePath(item); } if (item->IsMusicDb() && item->HasMusicInfoTag()) { CFileItem dbItem(item->m_musicInfoTag->GetURL(), false); if (item->HasProperty("item_start")) dbItem.SetProperty("item_start", item->GetProperty("item_start")); return IsSamePath(&dbItem); } if (item->IsVideoDb() && item->HasVideoInfoTag()) { CFileItem dbItem(item->m_videoInfoTag->m_strFileNameAndPath, false); if (item->HasProperty("item_start")) dbItem.SetProperty("item_start", item->GetProperty("item_start")); return IsSamePath(&dbItem); } if (HasProperty("original_listitem_url")) return (GetProperty("original_listitem_url") == item->GetPath()); return false; } bool CFileItem::IsAlbum() const { return m_bIsAlbum; } void CFileItem::UpdateInfo(const CFileItem &item, bool replaceLabels /*=true*/) { if (item.HasVideoInfoTag()) { // copy info across (TODO: premiered info is normally stored in m_dateTime by the db) *GetVideoInfoTag() = *item.GetVideoInfoTag(); // preferably use some information from PVR info tag if available if (m_pvrRecordingInfoTag) m_pvrRecordingInfoTag->CopyClientInfo(GetVideoInfoTag()); SetOverlayImage(ICON_OVERLAY_UNWATCHED, GetVideoInfoTag()->m_playCount > 0); SetInvalid(); } if (item.HasMusicInfoTag()) { *GetMusicInfoTag() = *item.GetMusicInfoTag(); SetInvalid(); } if (item.HasPVRRadioRDSInfoTag()) { m_pvrRadioRDSInfoTag = item.m_pvrRadioRDSInfoTag; SetInvalid(); } if (item.HasPictureInfoTag()) { *GetPictureInfoTag() = *item.GetPictureInfoTag(); SetInvalid(); } if (replaceLabels && !item.GetLabel().empty()) SetLabel(item.GetLabel()); if (replaceLabels && !item.GetLabel2().empty()) SetLabel2(item.GetLabel2()); if (!item.GetArt("thumb").empty()) SetArt("thumb", item.GetArt("thumb")); if (!item.GetIconImage().empty()) SetIconImage(item.GetIconImage()); AppendProperties(item); } void CFileItem::SetFromVideoInfoTag(const CVideoInfoTag &video) { if (!video.m_strTitle.empty()) SetLabel(video.m_strTitle); if (video.m_strFileNameAndPath.empty()) { m_strPath = video.m_strPath; URIUtils::AddSlashAtEnd(m_strPath); m_bIsFolder = true; } else { m_strPath = video.m_strFileNameAndPath; m_bIsFolder = false; } *GetVideoInfoTag() = video; if (video.m_iSeason == 0) SetProperty("isspecial", "true"); FillInDefaultIcon(); FillInMimeType(false); } void CFileItem::SetFromMusicInfoTag(const MUSIC_INFO::CMusicInfoTag &music) { if (!music.GetTitle().empty()) SetLabel(music.GetTitle()); if (!music.GetURL().empty()) m_strPath = music.GetURL(); m_bIsFolder = URIUtils::HasSlashAtEnd(m_strPath); *GetMusicInfoTag() = music; FillInDefaultIcon(); FillInMimeType(false); } void CFileItem::SetFromAlbum(const CAlbum &album) { if (!album.strAlbum.empty()) SetLabel(album.strAlbum); m_bIsFolder = true; m_strLabel2 = album.GetAlbumArtistString(); GetMusicInfoTag()->SetAlbum(album); SetArt(album.art); m_bIsAlbum = true; CMusicDatabase::SetPropertiesFromAlbum(*this,album); FillInMimeType(false); } void CFileItem::SetFromSong(const CSong &song) { if (!song.strTitle.empty()) SetLabel(song.strTitle); if (!song.strFileName.empty()) m_strPath = song.strFileName; GetMusicInfoTag()->SetSong(song); m_lStartOffset = song.iStartOffset; m_lStartPartNumber = 1; SetProperty("item_start", song.iStartOffset); m_lEndOffset = song.iEndOffset; if (!song.strThumb.empty()) SetArt("thumb", song.strThumb); FillInMimeType(false); } std::string CFileItem::GetOpticalMediaPath() const { std::string path; std::string dvdPath; path = URIUtils::AddFileToFolder(GetPath(), "VIDEO_TS.IFO"); if (CFile::Exists(path)) dvdPath = path; else { dvdPath = URIUtils::AddFileToFolder(GetPath(), "VIDEO_TS"); path = URIUtils::AddFileToFolder(dvdPath, "VIDEO_TS.IFO"); dvdPath.clear(); if (CFile::Exists(path)) dvdPath = path; } #ifdef HAVE_LIBBLURAY if (dvdPath.empty()) { path = URIUtils::AddFileToFolder(GetPath(), "index.bdmv"); if (CFile::Exists(path)) dvdPath = path; else { dvdPath = URIUtils::AddFileToFolder(GetPath(), "BDMV"); path = URIUtils::AddFileToFolder(dvdPath, "index.bdmv"); dvdPath.clear(); if (CFile::Exists(path)) dvdPath = path; } } #endif return dvdPath; } /* TODO: Ideally this (and SetPath) would not be available outside of construction for CFileItem objects, or at least restricted to essentially be equivalent to construction. This would require re-formulating a bunch of CFileItem construction, and also allowing CFileItemList to have it's own (public) SetURL() function, so for now we give direct access. */ void CFileItem::SetURL(const CURL& url) { m_strPath = url.Get(); } const CURL CFileItem::GetURL() const { CURL url(m_strPath); return url; } bool CFileItem::IsURL(const CURL& url) const { return IsPath(url.Get()); } bool CFileItem::IsPath(const std::string& path) const { return URIUtils::PathEquals(m_strPath, path); } void CFileItem::SetCueDocument(const CCueDocumentPtr& cuePtr) { m_cueDocument = cuePtr; } void CFileItem::LoadEmbeddedCue() { CMusicInfoTag& tag = *GetMusicInfoTag(); if (!tag.Loaded()) return; const std::string embeddedCue = tag.GetCueSheet(); if (!embeddedCue.empty()) { CCueDocumentPtr cuesheet(new CCueDocument); if (cuesheet->ParseTag(embeddedCue)) { std::vector<std::string> MediaFileVec; cuesheet->GetMediaFiles(MediaFileVec); for (std::vector<std::string>::iterator itMedia = MediaFileVec.begin(); itMedia != MediaFileVec.end(); itMedia++) cuesheet->UpdateMediaFile(*itMedia, GetPath()); SetCueDocument(cuesheet); } } } bool CFileItem::HasCueDocument() const { return (m_cueDocument.get() != nullptr); } bool CFileItem::LoadTracksFromCueDocument(CFileItemList& scannedItems) { if (!m_cueDocument) return false; CMusicInfoTag& tag = *GetMusicInfoTag(); VECSONGS tracks; m_cueDocument->GetSongs(tracks); bool oneFilePerTrack = m_cueDocument->IsOneFilePerTrack(); m_cueDocument.reset(); int tracksFound = 0; for (VECSONGS::iterator it = tracks.begin(); it != tracks.end(); ++it) { CSong& song = *it; if (song.strFileName == GetPath()) { if (tag.Loaded()) { if (song.strAlbum.empty() && !tag.GetAlbum().empty()) song.strAlbum = tag.GetAlbum(); //Pass album artist to final MusicInfoTag object via setting song album artist vector. if (song.GetAlbumArtist().empty() && !tag.GetAlbumArtist().empty()) song.SetAlbumArtist(tag.GetAlbumArtist()); if (song.genre.empty() && !tag.GetGenre().empty()) song.genre = tag.GetGenre(); //Pass artist to final MusicInfoTag object via setting song artist description string only. //Artist credits not used during loading from cue sheet. if (song.strArtistDesc.empty() && !tag.GetArtistString().empty()) song.strArtistDesc = tag.GetArtistString(); if (tag.GetDiscNumber()) song.iTrack |= (tag.GetDiscNumber() << 16); // see CMusicInfoTag::GetDiscNumber() if (!tag.GetCueSheet().empty()) song.strCueSheet = tag.GetCueSheet(); SYSTEMTIME dateTime; tag.GetReleaseDate(dateTime); if (dateTime.wYear) song.iYear = dateTime.wYear; if (song.embeddedArt.empty() && !tag.GetCoverArtInfo().empty()) song.embeddedArt = tag.GetCoverArtInfo(); } if (!song.iDuration && tag.GetDuration() > 0) { // must be the last song song.iDuration = (tag.GetDuration() * 75 - song.iStartOffset + 37) / 75; } if ( tag.Loaded() && oneFilePerTrack && ! ( tag.GetAlbum().empty() || tag.GetArtist().empty() || tag.GetTitle().empty() ) ) { // If there are multiple files in a cue file, the tags from the files should be prefered if they exist. scannedItems.Add(CFileItemPtr(new CFileItem(song, tag))); } else { scannedItems.Add(CFileItemPtr(new CFileItem(song))); } ++tracksFound; } } return tracksFound != 0; } ///////////////////////////////////////////////////////////////////////////////// ///// ///// CFileItemList ///// ////////////////////////////////////////////////////////////////////////////////// CFileItemList::CFileItemList() : CFileItem("", true), m_fastLookup(false), m_sortIgnoreFolders(false), m_cacheToDisc(CACHE_IF_SLOW), m_replaceListing(false) { } CFileItemList::CFileItemList(const std::string& strPath) : CFileItem(strPath, true), m_fastLookup(false), m_sortIgnoreFolders(false), m_cacheToDisc(CACHE_IF_SLOW), m_replaceListing(false) { } CFileItemList::~CFileItemList() { Clear(); } CFileItemPtr CFileItemList::operator[] (int iItem) { return Get(iItem); } const CFileItemPtr CFileItemList::operator[] (int iItem) const { return Get(iItem); } CFileItemPtr CFileItemList::operator[] (const std::string& strPath) { return Get(strPath); } const CFileItemPtr CFileItemList::operator[] (const std::string& strPath) const { return Get(strPath); } void CFileItemList::SetFastLookup(bool fastLookup) { CSingleLock lock(m_lock); if (fastLookup && !m_fastLookup) { // generate the map m_map.clear(); for (unsigned int i=0; i < m_items.size(); i++) { CFileItemPtr pItem = m_items[i]; m_map.insert(MAPFILEITEMSPAIR(pItem->GetPath(), pItem)); } } if (!fastLookup && m_fastLookup) m_map.clear(); m_fastLookup = fastLookup; } bool CFileItemList::Contains(const std::string& fileName) const { CSingleLock lock(m_lock); if (m_fastLookup) return m_map.find(fileName) != m_map.end(); // slow method... for (unsigned int i = 0; i < m_items.size(); i++) { const CFileItemPtr pItem = m_items[i]; if (pItem->IsPath(fileName)) return true; } return false; } void CFileItemList::Clear() { CSingleLock lock(m_lock); ClearItems(); m_sortDescription.sortBy = SortByNone; m_sortDescription.sortOrder = SortOrderNone; m_sortDescription.sortAttributes = SortAttributeNone; m_sortIgnoreFolders = false; m_cacheToDisc = CACHE_IF_SLOW; m_sortDetails.clear(); m_replaceListing = false; m_content.clear(); } void CFileItemList::ClearItems() { CSingleLock lock(m_lock); // make sure we free the memory of the items (these are GUIControls which may have allocated resources) FreeMemory(); for (unsigned int i = 0; i < m_items.size(); i++) { CFileItemPtr item = m_items[i]; item->FreeMemory(); } m_items.clear(); m_map.clear(); } void CFileItemList::Add(const CFileItemPtr &pItem) { CSingleLock lock(m_lock); m_items.push_back(pItem); if (m_fastLookup) { m_map.insert(MAPFILEITEMSPAIR(pItem->GetPath(), pItem)); } } void CFileItemList::AddFront(const CFileItemPtr &pItem, int itemPosition) { CSingleLock lock(m_lock); if (itemPosition >= 0) { m_items.insert(m_items.begin()+itemPosition, pItem); } else { m_items.insert(m_items.begin()+(m_items.size()+itemPosition), pItem); } if (m_fastLookup) { m_map.insert(MAPFILEITEMSPAIR(pItem->GetPath(), pItem)); } } void CFileItemList::Remove(CFileItem* pItem) { CSingleLock lock(m_lock); for (IVECFILEITEMS it = m_items.begin(); it != m_items.end(); ++it) { if (pItem == it->get()) { m_items.erase(it); if (m_fastLookup) { m_map.erase(pItem->GetPath()); } break; } } } void CFileItemList::Remove(int iItem) { CSingleLock lock(m_lock); if (iItem >= 0 && iItem < (int)Size()) { CFileItemPtr pItem = *(m_items.begin() + iItem); if (m_fastLookup) { m_map.erase(pItem->GetPath()); } m_items.erase(m_items.begin() + iItem); } } void CFileItemList::Append(const CFileItemList& itemlist) { CSingleLock lock(m_lock); for (int i = 0; i < itemlist.Size(); ++i) Add(itemlist[i]); } void CFileItemList::Assign(const CFileItemList& itemlist, bool append) { CSingleLock lock(m_lock); if (!append) Clear(); Append(itemlist); SetPath(itemlist.GetPath()); SetLabel(itemlist.GetLabel()); m_sortDetails = itemlist.m_sortDetails; m_sortDescription = itemlist.m_sortDescription; m_replaceListing = itemlist.m_replaceListing; m_content = itemlist.m_content; m_mapProperties = itemlist.m_mapProperties; m_cacheToDisc = itemlist.m_cacheToDisc; } bool CFileItemList::Copy(const CFileItemList& items, bool copyItems /* = true */) { // assign all CFileItem parts *(CFileItem*)this = *(CFileItem*)&items; // assign the rest of the CFileItemList properties m_replaceListing = items.m_replaceListing; m_content = items.m_content; m_mapProperties = items.m_mapProperties; m_cacheToDisc = items.m_cacheToDisc; m_sortDetails = items.m_sortDetails; m_sortDescription = items.m_sortDescription; m_sortIgnoreFolders = items.m_sortIgnoreFolders; if (copyItems) { // make a copy of each item for (int i = 0; i < items.Size(); i++) { CFileItemPtr newItem(new CFileItem(*items[i])); Add(newItem); } } return true; } CFileItemPtr CFileItemList::Get(int iItem) { CSingleLock lock(m_lock); if (iItem > -1 && iItem < (int)m_items.size()) return m_items[iItem]; return CFileItemPtr(); } const CFileItemPtr CFileItemList::Get(int iItem) const { CSingleLock lock(m_lock); if (iItem > -1 && iItem < (int)m_items.size()) return m_items[iItem]; return CFileItemPtr(); } CFileItemPtr CFileItemList::Get(const std::string& strPath) { CSingleLock lock(m_lock); if (m_fastLookup) { IMAPFILEITEMS it=m_map.find(strPath); if (it != m_map.end()) return it->second; return CFileItemPtr(); } // slow method... for (unsigned int i = 0; i < m_items.size(); i++) { CFileItemPtr pItem = m_items[i]; if (pItem->IsPath(strPath)) return pItem; } return CFileItemPtr(); } const CFileItemPtr CFileItemList::Get(const std::string& strPath) const { CSingleLock lock(m_lock); if (m_fastLookup) { std::map<std::string, CFileItemPtr>::const_iterator it=m_map.find(strPath); if (it != m_map.end()) return it->second; return CFileItemPtr(); } // slow method... for (unsigned int i = 0; i < m_items.size(); i++) { CFileItemPtr pItem = m_items[i]; if (pItem->IsPath(strPath)) return pItem; } return CFileItemPtr(); } int CFileItemList::Size() const { CSingleLock lock(m_lock); return (int)m_items.size(); } bool CFileItemList::IsEmpty() const { CSingleLock lock(m_lock); return m_items.empty(); } void CFileItemList::Reserve(int iCount) { CSingleLock lock(m_lock); m_items.reserve(iCount); } void CFileItemList::Sort(FILEITEMLISTCOMPARISONFUNC func) { CSingleLock lock(m_lock); std::stable_sort(m_items.begin(), m_items.end(), func); } void CFileItemList::FillSortFields(FILEITEMFILLFUNC func) { CSingleLock lock(m_lock); std::for_each(m_items.begin(), m_items.end(), func); } void CFileItemList::Sort(SortBy sortBy, SortOrder sortOrder, SortAttribute sortAttributes /* = SortAttributeNone */) { if (sortBy == SortByNone || (m_sortDescription.sortBy == sortBy && m_sortDescription.sortOrder == sortOrder && m_sortDescription.sortAttributes == sortAttributes)) return; SortDescription sorting; sorting.sortBy = sortBy; sorting.sortOrder = sortOrder; sorting.sortAttributes = sortAttributes; Sort(sorting); m_sortDescription = sorting; } void CFileItemList::Sort(SortDescription sortDescription) { if (sortDescription.sortBy == SortByFile || sortDescription.sortBy == SortBySortTitle || sortDescription.sortBy == SortByDateAdded || sortDescription.sortBy == SortByRating || sortDescription.sortBy == SortByYear || sortDescription.sortBy == SortByPlaylistOrder || sortDescription.sortBy == SortByLastPlayed || sortDescription.sortBy == SortByPlaycount) sortDescription.sortAttributes = (SortAttribute)((int)sortDescription.sortAttributes | SortAttributeIgnoreFolders); if (sortDescription.sortBy == SortByNone || (m_sortDescription.sortBy == sortDescription.sortBy && m_sortDescription.sortOrder == sortDescription.sortOrder && m_sortDescription.sortAttributes == sortDescription.sortAttributes)) return; if (m_sortIgnoreFolders) sortDescription.sortAttributes = (SortAttribute)((int)sortDescription.sortAttributes | SortAttributeIgnoreFolders); const Fields fields = SortUtils::GetFieldsForSorting(sortDescription.sortBy); SortItems sortItems((size_t)Size()); for (int index = 0; index < Size(); index++) { sortItems[index] = std::shared_ptr<SortItem>(new SortItem); m_items[index]->ToSortable(*sortItems[index], fields); (*sortItems[index])[FieldId] = index; } // do the sorting SortUtils::Sort(sortDescription, sortItems); // apply the new order to the existing CFileItems VECFILEITEMS sortedFileItems; sortedFileItems.reserve(Size()); for (SortItems::const_iterator it = sortItems.begin(); it != sortItems.end(); it++) { CFileItemPtr item = m_items[(int)(*it)->at(FieldId).asInteger()]; // Set the sort label in the CFileItem item->SetSortLabel((*it)->at(FieldSort).asWideString()); sortedFileItems.push_back(item); } // replace the current list with the re-ordered one m_items.assign(sortedFileItems.begin(), sortedFileItems.end()); } void CFileItemList::Randomize() { CSingleLock lock(m_lock); std::random_shuffle(m_items.begin(), m_items.end()); } void CFileItemList::Archive(CArchive& ar) { CSingleLock lock(m_lock); if (ar.IsStoring()) { CFileItem::Archive(ar); int i = 0; if (!m_items.empty() && m_items[0]->IsParentFolder()) i = 1; ar << (int)(m_items.size() - i); ar << m_fastLookup; ar << (int)m_sortDescription.sortBy; ar << (int)m_sortDescription.sortOrder; ar << (int)m_sortDescription.sortAttributes; ar << m_sortIgnoreFolders; ar << (int)m_cacheToDisc; ar << (int)m_sortDetails.size(); for (unsigned int j = 0; j < m_sortDetails.size(); ++j) { const GUIViewSortDetails &details = m_sortDetails[j]; ar << (int)details.m_sortDescription.sortBy; ar << (int)details.m_sortDescription.sortOrder; ar << (int)details.m_sortDescription.sortAttributes; ar << details.m_buttonLabel; ar << details.m_labelMasks.m_strLabelFile; ar << details.m_labelMasks.m_strLabelFolder; ar << details.m_labelMasks.m_strLabel2File; ar << details.m_labelMasks.m_strLabel2Folder; } ar << m_content; for (; i < (int)m_items.size(); ++i) { CFileItemPtr pItem = m_items[i]; ar << *pItem; } } else { CFileItemPtr pParent; if (!IsEmpty()) { CFileItemPtr pItem=m_items[0]; if (pItem->IsParentFolder()) pParent.reset(new CFileItem(*pItem)); } SetFastLookup(false); Clear(); CFileItem::Archive(ar); int iSize = 0; ar >> iSize; if (iSize <= 0) return ; if (pParent) { m_items.reserve(iSize + 1); m_items.push_back(pParent); } else m_items.reserve(iSize); bool fastLookup=false; ar >> fastLookup; int tempint; ar >> (int&)tempint; m_sortDescription.sortBy = (SortBy)tempint; ar >> (int&)tempint; m_sortDescription.sortOrder = (SortOrder)tempint; ar >> (int&)tempint; m_sortDescription.sortAttributes = (SortAttribute)tempint; ar >> m_sortIgnoreFolders; ar >> (int&)tempint; m_cacheToDisc = CACHE_TYPE(tempint); unsigned int detailSize = 0; ar >> detailSize; for (unsigned int j = 0; j < detailSize; ++j) { GUIViewSortDetails details; ar >> (int&)tempint; details.m_sortDescription.sortBy = (SortBy)tempint; ar >> (int&)tempint; details.m_sortDescription.sortOrder = (SortOrder)tempint; ar >> (int&)tempint; details.m_sortDescription.sortAttributes = (SortAttribute)tempint; ar >> details.m_buttonLabel; ar >> details.m_labelMasks.m_strLabelFile; ar >> details.m_labelMasks.m_strLabelFolder; ar >> details.m_labelMasks.m_strLabel2File; ar >> details.m_labelMasks.m_strLabel2Folder; m_sortDetails.push_back(details); } ar >> m_content; for (int i = 0; i < iSize; ++i) { CFileItemPtr pItem(new CFileItem); ar >> *pItem; Add(pItem); } SetFastLookup(fastLookup); } } void CFileItemList::FillInDefaultIcons() { CSingleLock lock(m_lock); for (int i = 0; i < (int)m_items.size(); ++i) { CFileItemPtr pItem = m_items[i]; pItem->FillInDefaultIcon(); } } int CFileItemList::GetFolderCount() const { CSingleLock lock(m_lock); int nFolderCount = 0; for (int i = 0; i < (int)m_items.size(); i++) { CFileItemPtr pItem = m_items[i]; if (pItem->m_bIsFolder) nFolderCount++; } return nFolderCount; } int CFileItemList::GetObjectCount() const { CSingleLock lock(m_lock); int numObjects = (int)m_items.size(); if (numObjects && m_items[0]->IsParentFolder()) numObjects--; return numObjects; } int CFileItemList::GetFileCount() const { CSingleLock lock(m_lock); int nFileCount = 0; for (int i = 0; i < (int)m_items.size(); i++) { CFileItemPtr pItem = m_items[i]; if (!pItem->m_bIsFolder) nFileCount++; } return nFileCount; } int CFileItemList::GetSelectedCount() const { CSingleLock lock(m_lock); int count = 0; for (int i = 0; i < (int)m_items.size(); i++) { CFileItemPtr pItem = m_items[i]; if (pItem->IsSelected()) count++; } return count; } void CFileItemList::FilterCueItems() { CSingleLock lock(m_lock); // Handle .CUE sheet files... std::vector<std::string> itemstodelete; for (int i = 0; i < (int)m_items.size(); i++) { CFileItemPtr pItem = m_items[i]; if (!pItem->m_bIsFolder) { // see if it's a .CUE sheet if (pItem->IsCUESheet()) { CCueDocumentPtr cuesheet(new CCueDocument); if (cuesheet->ParseFile(pItem->GetPath())) { std::vector<std::string> MediaFileVec; cuesheet->GetMediaFiles(MediaFileVec); // queue the cue sheet and the underlying media file for deletion for(std::vector<std::string>::iterator itMedia = MediaFileVec.begin(); itMedia != MediaFileVec.end(); itMedia++) { std::string strMediaFile = *itMedia; std::string fileFromCue = strMediaFile; // save the file from the cue we're matching against, // as we're going to search for others here... bool bFoundMediaFile = CFile::Exists(strMediaFile); if (!bFoundMediaFile) { // try file in same dir, not matching case... if (Contains(strMediaFile)) { bFoundMediaFile = true; } else { // try removing the .cue extension... strMediaFile = pItem->GetPath(); URIUtils::RemoveExtension(strMediaFile); CFileItem item(strMediaFile, false); if (item.IsAudio() && Contains(strMediaFile)) { bFoundMediaFile = true; } else { // try replacing the extension with one of our allowed ones. std::vector<std::string> extensions = StringUtils::Split(g_advancedSettings.GetMusicExtensions(), "|"); for (std::vector<std::string>::const_iterator i = extensions.begin(); i != extensions.end(); ++i) { strMediaFile = URIUtils::ReplaceExtension(pItem->GetPath(), *i); CFileItem item(strMediaFile, false); if (!item.IsCUESheet() && !item.IsPlayList() && Contains(strMediaFile)) { bFoundMediaFile = true; break; } } } } } if (bFoundMediaFile) { cuesheet->UpdateMediaFile(fileFromCue, strMediaFile); // apply CUE for later processing for (int j = 0; j < (int)m_items.size(); j++) { CFileItemPtr pItem = m_items[j]; if (stricmp(pItem->GetPath().c_str(), strMediaFile.c_str()) == 0) pItem->SetCueDocument(cuesheet); } } } } itemstodelete.push_back(pItem->GetPath()); } } } // now delete the .CUE files. for (int i = 0; i < (int)itemstodelete.size(); i++) { for (int j = 0; j < (int)m_items.size(); j++) { CFileItemPtr pItem = m_items[j]; if (stricmp(pItem->GetPath().c_str(), itemstodelete[i].c_str()) == 0) { // delete this item m_items.erase(m_items.begin() + j); break; } } } } // Remove the extensions from the filenames void CFileItemList::RemoveExtensions() { CSingleLock lock(m_lock); for (int i = 0; i < Size(); ++i) m_items[i]->RemoveExtension(); } void CFileItemList::Stack(bool stackFiles /* = true */) { CSingleLock lock(m_lock); // not allowed here if (IsVirtualDirectoryRoot() || IsLiveTV() || IsSourcesPath() || IsLibraryFolder()) return; SetProperty("isstacked", true); // items needs to be sorted for stuff below to work properly Sort(SortByLabel, SortOrderAscending); StackFolders(); if (stackFiles) StackFiles(); } void CFileItemList::StackFolders() { // Precompile our REs VECCREGEXP folderRegExps; CRegExp folderRegExp(true, CRegExp::autoUtf8); const std::vector<std::string>& strFolderRegExps = g_advancedSettings.m_folderStackRegExps; std::vector<std::string>::const_iterator strExpression = strFolderRegExps.begin(); while (strExpression != strFolderRegExps.end()) { if (!folderRegExp.RegComp(*strExpression)) CLog::Log(LOGERROR, "%s: Invalid folder stack RegExp:'%s'", __FUNCTION__, strExpression->c_str()); else folderRegExps.push_back(folderRegExp); strExpression++; } if (!folderRegExp.IsCompiled()) { CLog::Log(LOGDEBUG, "%s: No stack expressions available. Skipping folder stacking", __FUNCTION__); return; } // stack folders for (int i = 0; i < Size(); i++) { CFileItemPtr item = Get(i); // combined the folder checks if (item->m_bIsFolder) { // only check known fast sources? // NOTES: // 1. rars and zips may be on slow sources? is this supposed to be allowed? if( !item->IsRemote() || item->IsSmb() || item->IsNfs() || URIUtils::IsInRAR(item->GetPath()) || URIUtils::IsInZIP(item->GetPath()) || URIUtils::IsOnLAN(item->GetPath()) ) { // stack cd# folders if contains only a single video file bool bMatch(false); VECCREGEXP::iterator expr = folderRegExps.begin(); while (!bMatch && expr != folderRegExps.end()) { //CLog::Log(LOGDEBUG,"%s: Running expression %s on %s", __FUNCTION__, expr->GetPattern().c_str(), item->GetLabel().c_str()); bMatch = (expr->RegFind(item->GetLabel().c_str()) != -1); if (bMatch) { CFileItemList items; CDirectory::GetDirectory(item->GetPath(),items,g_advancedSettings.m_videoExtensions); // optimized to only traverse listing once by checking for filecount // and recording last file item for later use int nFiles = 0; int index = -1; for (int j = 0; j < items.Size(); j++) { if (!items[j]->m_bIsFolder) { nFiles++; index = j; } if (nFiles > 1) break; } if (nFiles == 1) *item = *items[index]; } expr++; } // check for dvd folders if (!bMatch) { std::string dvdPath = item->GetOpticalMediaPath(); if (!dvdPath.empty()) { // NOTE: should this be done for the CD# folders too? item->m_bIsFolder = false; item->SetPath(dvdPath); item->SetLabel2(""); item->SetLabelPreformated(true); m_sortDescription.sortBy = SortByNone; /* sorting is now broken */ } } } } } } void CFileItemList::StackFiles() { // Precompile our REs VECCREGEXP stackRegExps; CRegExp tmpRegExp(true, CRegExp::autoUtf8); const std::vector<std::string>& strStackRegExps = g_advancedSettings.m_videoStackRegExps; std::vector<std::string>::const_iterator strRegExp = strStackRegExps.begin(); while (strRegExp != strStackRegExps.end()) { if (tmpRegExp.RegComp(*strRegExp)) { if (tmpRegExp.GetCaptureTotal() == 4) stackRegExps.push_back(tmpRegExp); else CLog::Log(LOGERROR, "Invalid video stack RE (%s). Must have 4 captures.", strRegExp->c_str()); } strRegExp++; } // now stack the files, some of which may be from the previous stack iteration int i = 0; while (i < Size()) { CFileItemPtr item1 = Get(i); // skip folders, nfo files, playlists if (item1->m_bIsFolder || item1->IsParentFolder() || item1->IsNFO() || item1->IsPlayList() ) { // increment index i++; continue; } int64_t size = 0; size_t offset = 0; std::string stackName; std::string file1; std::string filePath; std::vector<int> stack; VECCREGEXP::iterator expr = stackRegExps.begin(); URIUtils::Split(item1->GetPath(), filePath, file1); if (URIUtils::HasEncodedFilename(CURL(filePath))) file1 = CURL::Decode(file1); int j; while (expr != stackRegExps.end()) { if (expr->RegFind(file1, offset) != -1) { std::string Title1 = expr->GetMatch(1), Volume1 = expr->GetMatch(2), Ignore1 = expr->GetMatch(3), Extension1 = expr->GetMatch(4); if (offset) Title1 = file1.substr(0, expr->GetSubStart(2)); j = i + 1; while (j < Size()) { CFileItemPtr item2 = Get(j); // skip folders, nfo files, playlists if (item2->m_bIsFolder || item2->IsParentFolder() || item2->IsNFO() || item2->IsPlayList() ) { // increment index j++; continue; } std::string file2, filePath2; URIUtils::Split(item2->GetPath(), filePath2, file2); if (URIUtils::HasEncodedFilename(CURL(filePath2)) ) file2 = CURL::Decode(file2); if (expr->RegFind(file2, offset) != -1) { std::string Title2 = expr->GetMatch(1), Volume2 = expr->GetMatch(2), Ignore2 = expr->GetMatch(3), Extension2 = expr->GetMatch(4); if (offset) Title2 = file2.substr(0, expr->GetSubStart(2)); if (StringUtils::EqualsNoCase(Title1, Title2)) { if (!StringUtils::EqualsNoCase(Volume1, Volume2)) { if (StringUtils::EqualsNoCase(Ignore1, Ignore2) && StringUtils::EqualsNoCase(Extension1, Extension2)) { if (stack.empty()) { stackName = Title1 + Ignore1 + Extension1; stack.push_back(i); size += item1->m_dwSize; } stack.push_back(j); size += item2->m_dwSize; } else // Sequel { offset = 0; expr++; break; } } else if (!StringUtils::EqualsNoCase(Ignore1, Ignore2)) // False positive, try again with offset { offset = expr->GetSubStart(3); break; } else // Extension mismatch { offset = 0; expr++; break; } } else // Title mismatch { offset = 0; expr++; break; } } else // No match 2, next expression { offset = 0; expr++; break; } j++; } if (j == Size()) expr = stackRegExps.end(); } else // No match 1 { offset = 0; expr++; } if (stack.size() > 1) { // have a stack, remove the items and add the stacked item // dont actually stack a multipart rar set, just remove all items but the first std::string stackPath; if (Get(stack[0])->IsRAR()) stackPath = Get(stack[0])->GetPath(); else { CStackDirectory dir; stackPath = dir.ConstructStackPath(*this, stack); } item1->SetPath(stackPath); // clean up list for (unsigned k = 1; k < stack.size(); k++) Remove(i+1); // item->m_bIsFolder = true; // don't treat stacked files as folders // the label may be in a different char set from the filename (eg over smb // the label is converted from utf8, but the filename is not) if (!CSettings::GetInstance().GetBool(CSettings::SETTING_FILELISTS_SHOWEXTENSIONS)) URIUtils::RemoveExtension(stackName); item1->SetLabel(stackName); item1->m_dwSize = size; break; } } i++; } } bool CFileItemList::Load(int windowID) { CFile file; if (file.Open(GetDiscFileCache(windowID))) { CArchive ar(&file, CArchive::load); ar >> *this; CLog::Log(LOGDEBUG,"Loading items: %i, directory: %s sort method: %i, ascending: %s", Size(), CURL::GetRedacted(GetPath()).c_str(), m_sortDescription.sortBy, m_sortDescription.sortOrder == SortOrderAscending ? "true" : "false"); ar.Close(); file.Close(); return true; } return false; } bool CFileItemList::Save(int windowID) { int iSize = Size(); if (iSize <= 0) return false; CLog::Log(LOGDEBUG,"Saving fileitems [%s]", CURL::GetRedacted(GetPath()).c_str()); CFile file; if (file.OpenForWrite(GetDiscFileCache(windowID), true)) // overwrite always { CArchive ar(&file, CArchive::store); ar << *this; CLog::Log(LOGDEBUG," -- items: %i, sort method: %i, ascending: %s", iSize, m_sortDescription.sortBy, m_sortDescription.sortOrder == SortOrderAscending ? "true" : "false"); ar.Close(); file.Close(); return true; } return false; } void CFileItemList::RemoveDiscCache(int windowID) const { std::string cacheFile(GetDiscFileCache(windowID)); if (CFile::Exists(cacheFile)) { CLog::Log(LOGDEBUG,"Clearing cached fileitems [%s]",GetPath().c_str()); CFile::Delete(cacheFile); } } std::string CFileItemList::GetDiscFileCache(int windowID) const { std::string strPath(GetPath()); URIUtils::RemoveSlashAtEnd(strPath); Crc32 crc; crc.ComputeFromLowerCase(strPath); std::string cacheFile; if (IsCDDA() || IsOnDVD()) cacheFile = StringUtils::Format("special://temp/r-%08x.fi", (unsigned __int32)crc); else if (IsMusicDb()) cacheFile = StringUtils::Format("special://temp/mdb-%08x.fi", (unsigned __int32)crc); else if (IsVideoDb()) cacheFile = StringUtils::Format("special://temp/vdb-%08x.fi", (unsigned __int32)crc); else if (IsSmartPlayList()) cacheFile = StringUtils::Format("special://temp/sp-%08x.fi", (unsigned __int32)crc); else if (windowID) cacheFile = StringUtils::Format("special://temp/%i-%08x.fi", windowID, (unsigned __int32)crc); else cacheFile = StringUtils::Format("special://temp/%08x.fi", (unsigned __int32)crc); return cacheFile; } bool CFileItemList::AlwaysCache() const { // some database folders are always cached if (IsMusicDb()) return CMusicDatabaseDirectory::CanCache(GetPath()); if (IsVideoDb()) return CVideoDatabaseDirectory::CanCache(GetPath()); if (IsEPG()) return true; // always cache return false; } std::string CFileItem::GetUserMusicThumb(bool alwaysCheckRemote /* = false */, bool fallbackToFolder /* = false */) const { if (m_strPath.empty() || StringUtils::StartsWithNoCase(m_strPath, "newsmartplaylist://") || StringUtils::StartsWithNoCase(m_strPath, "newplaylist://") || m_bIsShareOrDrive || IsInternetStream() || URIUtils::IsUPnP(m_strPath) || (URIUtils::IsFTP(m_strPath) && !g_advancedSettings.m_bFTPThumbs) || IsPlugin() || IsAddonsPath() || IsLibraryFolder() || IsParentFolder() || IsMusicDb()) return ""; // we first check for <filename>.tbn or <foldername>.tbn std::string fileThumb(GetTBNFile()); if (CFile::Exists(fileThumb)) return fileThumb; // Fall back to folder thumb, if requested if (!m_bIsFolder && fallbackToFolder) { CFileItem item(URIUtils::GetDirectory(m_strPath), true); return item.GetUserMusicThumb(alwaysCheckRemote); } // if a folder, check for folder.jpg if (m_bIsFolder && !IsFileFolder() && (!IsRemote() || alwaysCheckRemote || CSettings::GetInstance().GetBool(CSettings::SETTING_MUSICFILES_FINDREMOTETHUMBS))) { std::vector<std::string> thumbs = StringUtils::Split(g_advancedSettings.m_musicThumbs, "|"); for (std::vector<std::string>::const_iterator i = thumbs.begin(); i != thumbs.end(); ++i) { std::string folderThumb(GetFolderThumb(*i)); if (CFile::Exists(folderThumb)) { return folderThumb; } } } // No thumb found return ""; } // Gets the .tbn filename from a file or folder name. // <filename>.ext -> <filename>.tbn // <foldername>/ -> <foldername>.tbn std::string CFileItem::GetTBNFile() const { std::string thumbFile; std::string strFile = m_strPath; if (IsStack()) { std::string strPath, strReturn; URIUtils::GetParentPath(m_strPath,strPath); CFileItem item(CStackDirectory::GetFirstStackedFile(strFile),false); std::string strTBNFile = item.GetTBNFile(); strReturn = URIUtils::AddFileToFolder(strPath, URIUtils::GetFileName(strTBNFile)); if (CFile::Exists(strReturn)) return strReturn; strFile = URIUtils::AddFileToFolder(strPath,URIUtils::GetFileName(CStackDirectory::GetStackedTitlePath(strFile))); } if (URIUtils::IsInRAR(strFile) || URIUtils::IsInZIP(strFile)) { std::string strPath = URIUtils::GetDirectory(strFile); std::string strParent; URIUtils::GetParentPath(strPath,strParent); strFile = URIUtils::AddFileToFolder(strParent, URIUtils::GetFileName(m_strPath)); } CURL url(strFile); strFile = url.GetFileName(); if (m_bIsFolder && !IsFileFolder()) URIUtils::RemoveSlashAtEnd(strFile); if (!strFile.empty()) { if (m_bIsFolder && !IsFileFolder()) thumbFile = strFile + ".tbn"; // folder, so just add ".tbn" else thumbFile = URIUtils::ReplaceExtension(strFile, ".tbn"); url.SetFileName(thumbFile); thumbFile = url.Get(); } return thumbFile; } bool CFileItem::SkipLocalArt() const { return (m_strPath.empty() || StringUtils::StartsWithNoCase(m_strPath, "newsmartplaylist://") || StringUtils::StartsWithNoCase(m_strPath, "newplaylist://") || m_bIsShareOrDrive || IsInternetStream() || URIUtils::IsUPnP(m_strPath) || (URIUtils::IsFTP(m_strPath) && !g_advancedSettings.m_bFTPThumbs) || IsPlugin() || IsAddonsPath() || IsLibraryFolder() || IsParentFolder() || IsLiveTV() || IsDVD()); } std::string CFileItem::FindLocalArt(const std::string &artFile, bool useFolder) const { if (SkipLocalArt()) return ""; std::string thumb; if (!m_bIsFolder) { thumb = GetLocalArt(artFile, false); if (!thumb.empty() && CFile::Exists(thumb)) return thumb; } if ((useFolder || (m_bIsFolder && !IsFileFolder())) && !artFile.empty()) { std::string thumb2 = GetLocalArt(artFile, true); if (!thumb2.empty() && thumb2 != thumb && CFile::Exists(thumb2)) return thumb2; } return ""; } std::string CFileItem::GetLocalArt(const std::string &artFile, bool useFolder) const { // no retrieving of empty art files from folders if (useFolder && artFile.empty()) return ""; std::string strFile = m_strPath; if (IsStack()) { /* CFileItem item(CStackDirectory::GetFirstStackedFile(strFile),false); std::string localArt = item.GetLocalArt(artFile); return localArt; */ std::string strPath; URIUtils::GetParentPath(m_strPath,strPath); strFile = URIUtils::AddFileToFolder(strPath, URIUtils::GetFileName(CStackDirectory::GetStackedTitlePath(strFile))); } if (URIUtils::IsInRAR(strFile) || URIUtils::IsInZIP(strFile)) { std::string strPath = URIUtils::GetDirectory(strFile); std::string strParent; URIUtils::GetParentPath(strPath,strParent); strFile = URIUtils::AddFileToFolder(strParent, URIUtils::GetFileName(strFile)); } if (IsMultiPath()) strFile = CMultiPathDirectory::GetFirstPath(m_strPath); if (IsOpticalMediaFile()) { // optical media files should be treated like folders useFolder = true; strFile = GetLocalMetadataPath(); } else if (useFolder && !(m_bIsFolder && !IsFileFolder())) strFile = URIUtils::GetDirectory(strFile); if (strFile.empty()) // empty filepath -> nothing to find return ""; if (useFolder) { if (!artFile.empty()) return URIUtils::AddFileToFolder(strFile, artFile); } else { if (artFile.empty()) // old thumbnail matching return URIUtils::ReplaceExtension(strFile, ".tbn"); else return URIUtils::ReplaceExtension(strFile, "-" + artFile); } return ""; } std::string CFileItem::GetFolderThumb(const std::string &folderJPG /* = "folder.jpg" */) const { std::string strFolder = m_strPath; if (IsStack() || URIUtils::IsInRAR(strFolder) || URIUtils::IsInZIP(strFolder)) { URIUtils::GetParentPath(m_strPath,strFolder); } if (IsMultiPath()) strFolder = CMultiPathDirectory::GetFirstPath(m_strPath); return URIUtils::AddFileToFolder(strFolder, folderJPG); } std::string CFileItem::GetMovieName(bool bUseFolderNames /* = false */) const { if (IsLabelPreformated()) return GetLabel(); if (m_pvrRecordingInfoTag) return m_pvrRecordingInfoTag->m_strTitle; else if (CUtil::IsTVRecording(m_strPath)) { std::string title = CPVRRecording::GetTitleFromURL(m_strPath); if (!title.empty()) return title; } std::string strMovieName = GetBaseMoviePath(bUseFolderNames); if (URIUtils::IsStack(strMovieName)) strMovieName = CStackDirectory::GetStackedTitlePath(strMovieName); URIUtils::RemoveSlashAtEnd(strMovieName); return CURL::Decode(URIUtils::GetFileName(strMovieName)); } std::string CFileItem::GetBaseMoviePath(bool bUseFolderNames) const { std::string strMovieName = m_strPath; if (IsMultiPath()) strMovieName = CMultiPathDirectory::GetFirstPath(m_strPath); if (IsOpticalMediaFile()) return GetLocalMetadataPath(); if (bUseFolderNames && (!m_bIsFolder || URIUtils::IsInArchive(m_strPath) || (HasVideoInfoTag() && GetVideoInfoTag()->m_iDbId > 0 && !MediaTypes::IsContainer(GetVideoInfoTag()->m_type)))) { std::string name2(strMovieName); URIUtils::GetParentPath(name2,strMovieName); if (URIUtils::IsInArchive(m_strPath)) { std::string strArchivePath; URIUtils::GetParentPath(strMovieName, strArchivePath); strMovieName = strArchivePath; } } return strMovieName; } std::string CFileItem::GetLocalFanart() const { if (IsVideoDb()) { if (!HasVideoInfoTag()) return ""; // nothing can be done CFileItem dbItem(m_bIsFolder ? GetVideoInfoTag()->m_strPath : GetVideoInfoTag()->m_strFileNameAndPath, m_bIsFolder); return dbItem.GetLocalFanart(); } std::string strFile2; std::string strFile = m_strPath; if (IsStack()) { std::string strPath; URIUtils::GetParentPath(m_strPath,strPath); CStackDirectory dir; std::string strPath2; strPath2 = dir.GetStackedTitlePath(strFile); strFile = URIUtils::AddFileToFolder(strPath, URIUtils::GetFileName(strPath2)); CFileItem item(dir.GetFirstStackedFile(m_strPath),false); std::string strTBNFile(URIUtils::ReplaceExtension(item.GetTBNFile(), "-fanart")); strFile2 = URIUtils::AddFileToFolder(strPath, URIUtils::GetFileName(strTBNFile)); } if (URIUtils::IsInRAR(strFile) || URIUtils::IsInZIP(strFile)) { std::string strPath = URIUtils::GetDirectory(strFile); std::string strParent; URIUtils::GetParentPath(strPath,strParent); strFile = URIUtils::AddFileToFolder(strParent, URIUtils::GetFileName(m_strPath)); } // no local fanart available for these if (IsInternetStream() || URIUtils::IsUPnP(strFile) || URIUtils::IsBluray(strFile) || IsLiveTV() || IsPlugin() || IsAddonsPath() || IsDVD() || (URIUtils::IsFTP(strFile) && !g_advancedSettings.m_bFTPThumbs) || m_strPath.empty()) return ""; std::string strDir = URIUtils::GetDirectory(strFile); if (strDir.empty()) return ""; CFileItemList items; CDirectory::GetDirectory(strDir, items, g_advancedSettings.m_pictureExtensions, DIR_FLAG_NO_FILE_DIRS | DIR_FLAG_READ_CACHE | DIR_FLAG_NO_FILE_INFO); if (IsOpticalMediaFile()) { // grab from the optical media parent folder as well CFileItemList moreItems; CDirectory::GetDirectory(GetLocalMetadataPath(), moreItems, g_advancedSettings.m_pictureExtensions, DIR_FLAG_NO_FILE_DIRS | DIR_FLAG_READ_CACHE | DIR_FLAG_NO_FILE_INFO); items.Append(moreItems); } std::vector<std::string> fanarts = StringUtils::Split(g_advancedSettings.m_fanartImages, "|"); strFile = URIUtils::ReplaceExtension(strFile, "-fanart"); fanarts.insert(m_bIsFolder ? fanarts.end() : fanarts.begin(), URIUtils::GetFileName(strFile)); if (!strFile2.empty()) fanarts.insert(m_bIsFolder ? fanarts.end() : fanarts.begin(), URIUtils::GetFileName(strFile2)); for (std::vector<std::string>::const_iterator i = fanarts.begin(); i != fanarts.end(); ++i) { for (int j = 0; j < items.Size(); j++) { std::string strCandidate = URIUtils::GetFileName(items[j]->m_strPath); URIUtils::RemoveExtension(strCandidate); std::string strFanart = *i; URIUtils::RemoveExtension(strFanart); if (StringUtils::EqualsNoCase(strCandidate, strFanart)) return items[j]->m_strPath; } } return ""; } std::string CFileItem::GetLocalMetadataPath() const { if (m_bIsFolder && !IsFileFolder()) return m_strPath; std::string parent(URIUtils::GetParentPath(m_strPath)); std::string parentFolder(parent); URIUtils::RemoveSlashAtEnd(parentFolder); parentFolder = URIUtils::GetFileName(parentFolder); if (StringUtils::EqualsNoCase(parentFolder, "VIDEO_TS") || StringUtils::EqualsNoCase(parentFolder, "BDMV")) { // go back up another one parent = URIUtils::GetParentPath(parent); } return parent; } bool CFileItem::LoadMusicTag() { // not audio if (!IsAudio()) return false; // already loaded? if (HasMusicInfoTag() && m_musicInfoTag->Loaded()) return true; // check db CMusicDatabase musicDatabase; if (musicDatabase.Open()) { CSong song; if (musicDatabase.GetSongByFileName(m_strPath, song)) { GetMusicInfoTag()->SetSong(song); SetArt("thumb", song.strThumb); return true; } musicDatabase.Close(); } // load tag from file CLog::Log(LOGDEBUG, "%s: loading tag information for file: %s", __FUNCTION__, m_strPath.c_str()); CMusicInfoTagLoaderFactory factory; std::unique_ptr<IMusicInfoTagLoader> pLoader (factory.CreateLoader(*this)); if (pLoader.get() != NULL) { if (pLoader->Load(m_strPath, *GetMusicInfoTag())) return true; } // no tag - try some other things if (IsCDDA()) { // we have the tracknumber... int iTrack = GetMusicInfoTag()->GetTrackNumber(); if (iTrack >= 1) { std::string strText = g_localizeStrings.Get(554); // "Track" if (!strText.empty() && strText[strText.size() - 1] != ' ') strText += " "; std::string strTrack = StringUtils::Format((strText + "%i").c_str(), iTrack); GetMusicInfoTag()->SetTitle(strTrack); GetMusicInfoTag()->SetLoaded(true); return true; } } else { std::string fileName = URIUtils::GetFileName(m_strPath); URIUtils::RemoveExtension(fileName); for (unsigned int i = 0; i < g_advancedSettings.m_musicTagsFromFileFilters.size(); i++) { CLabelFormatter formatter(g_advancedSettings.m_musicTagsFromFileFilters[i], ""); if (formatter.FillMusicTag(fileName, GetMusicInfoTag())) { GetMusicInfoTag()->SetLoaded(true); return true; } } } return false; } void CFileItemList::Swap(unsigned int item1, unsigned int item2) { if (item1 != item2 && item1 < m_items.size() && item2 < m_items.size()) std::swap(m_items[item1], m_items[item2]); } bool CFileItemList::UpdateItem(const CFileItem *item) { if (!item) return false; CSingleLock lock(m_lock); for (unsigned int i = 0; i < m_items.size(); i++) { CFileItemPtr pItem = m_items[i]; if (pItem->IsSamePath(item)) { pItem->UpdateInfo(*item); return true; } } return false; } void CFileItemList::AddSortMethod(SortBy sortBy, int buttonLabel, const LABEL_MASKS &labelMasks, SortAttribute sortAttributes /* = SortAttributeNone */) { AddSortMethod(sortBy, sortAttributes, buttonLabel, labelMasks); } void CFileItemList::AddSortMethod(SortBy sortBy, SortAttribute sortAttributes, int buttonLabel, const LABEL_MASKS &labelMasks) { SortDescription sorting; sorting.sortBy = sortBy; sorting.sortAttributes = sortAttributes; AddSortMethod(sorting, buttonLabel, labelMasks); } void CFileItemList::AddSortMethod(SortDescription sortDescription, int buttonLabel, const LABEL_MASKS &labelMasks) { GUIViewSortDetails sort; sort.m_sortDescription = sortDescription; sort.m_buttonLabel = buttonLabel; sort.m_labelMasks = labelMasks; m_sortDetails.push_back(sort); } void CFileItemList::SetReplaceListing(bool replace) { m_replaceListing = replace; } void CFileItemList::ClearSortState() { m_sortDescription.sortBy = SortByNone; m_sortDescription.sortOrder = SortOrderNone; m_sortDescription.sortAttributes = SortAttributeNone; } CVideoInfoTag* CFileItem::GetVideoInfoTag() { if (!m_videoInfoTag) m_videoInfoTag = new CVideoInfoTag; return m_videoInfoTag; } CPictureInfoTag* CFileItem::GetPictureInfoTag() { if (!m_pictureInfoTag) m_pictureInfoTag = new CPictureInfoTag; return m_pictureInfoTag; } MUSIC_INFO::CMusicInfoTag* CFileItem::GetMusicInfoTag() { if (!m_musicInfoTag) m_musicInfoTag = new MUSIC_INFO::CMusicInfoTag; return m_musicInfoTag; } std::string CFileItem::FindTrailer() const { std::string strFile2; std::string strFile = m_strPath; if (IsStack()) { std::string strPath; URIUtils::GetParentPath(m_strPath,strPath); CStackDirectory dir; std::string strPath2; strPath2 = dir.GetStackedTitlePath(strFile); strFile = URIUtils::AddFileToFolder(strPath,URIUtils::GetFileName(strPath2)); CFileItem item(dir.GetFirstStackedFile(m_strPath),false); std::string strTBNFile(URIUtils::ReplaceExtension(item.GetTBNFile(), "-trailer")); strFile2 = URIUtils::AddFileToFolder(strPath,URIUtils::GetFileName(strTBNFile)); } if (URIUtils::IsInRAR(strFile) || URIUtils::IsInZIP(strFile)) { std::string strPath = URIUtils::GetDirectory(strFile); std::string strParent; URIUtils::GetParentPath(strPath,strParent); strFile = URIUtils::AddFileToFolder(strParent,URIUtils::GetFileName(m_strPath)); } // no local trailer available for these if (IsInternetStream() || URIUtils::IsUPnP(strFile) || URIUtils::IsBluray(strFile) || IsLiveTV() || IsPlugin() || IsDVD()) return ""; std::string strDir = URIUtils::GetDirectory(strFile); CFileItemList items; CDirectory::GetDirectory(strDir, items, g_advancedSettings.m_videoExtensions, DIR_FLAG_READ_CACHE | DIR_FLAG_NO_FILE_INFO | DIR_FLAG_NO_FILE_DIRS); URIUtils::RemoveExtension(strFile); strFile += "-trailer"; std::string strFile3 = URIUtils::AddFileToFolder(strDir, "movie-trailer"); // Precompile our REs VECCREGEXP matchRegExps; CRegExp tmpRegExp(true, CRegExp::autoUtf8); const std::vector<std::string>& strMatchRegExps = g_advancedSettings.m_trailerMatchRegExps; std::vector<std::string>::const_iterator strRegExp = strMatchRegExps.begin(); while (strRegExp != strMatchRegExps.end()) { if (tmpRegExp.RegComp(*strRegExp)) { matchRegExps.push_back(tmpRegExp); } strRegExp++; } std::string strTrailer; for (int i = 0; i < items.Size(); i++) { std::string strCandidate = items[i]->m_strPath; URIUtils::RemoveExtension(strCandidate); if (StringUtils::EqualsNoCase(strCandidate, strFile) || StringUtils::EqualsNoCase(strCandidate, strFile2) || StringUtils::EqualsNoCase(strCandidate, strFile3)) { strTrailer = items[i]->m_strPath; break; } else { VECCREGEXP::iterator expr = matchRegExps.begin(); while (expr != matchRegExps.end()) { if (expr->RegFind(strCandidate) != -1) { strTrailer = items[i]->m_strPath; i = items.Size(); break; } expr++; } } } return strTrailer; } int CFileItem::GetVideoContentType() const { VIDEODB_CONTENT_TYPE type = VIDEODB_CONTENT_MOVIES; if (HasVideoInfoTag() && GetVideoInfoTag()->m_type == MediaTypeTvShow) type = VIDEODB_CONTENT_TVSHOWS; if (HasVideoInfoTag() && GetVideoInfoTag()->m_type == MediaTypeEpisode) return VIDEODB_CONTENT_EPISODES; if (HasVideoInfoTag() && GetVideoInfoTag()->m_type == MediaTypeMusicVideo) return VIDEODB_CONTENT_MUSICVIDEOS; CVideoDatabaseDirectory dir; VIDEODATABASEDIRECTORY::CQueryParams params; dir.GetQueryParams(m_strPath, params); if (params.GetSetId() != -1 && params.GetMovieId() == -1) // movie set return VIDEODB_CONTENT_MOVIE_SETS; return type; } bool CFileItem::IsResumePointSet() const { return (HasVideoInfoTag() && GetVideoInfoTag()->m_resumePoint.IsSet()) || (m_pvrRecordingInfoTag && m_pvrRecordingInfoTag->GetLastPlayedPosition() > 0); } double CFileItem::GetCurrentResumeTime() const { if (m_pvrRecordingInfoTag) { // This will retrieve 'fresh' resume information from the PVR server int rc = m_pvrRecordingInfoTag->GetLastPlayedPosition(); if (rc > 0) return rc; // Fall through to default value } if (HasVideoInfoTag() && GetVideoInfoTag()->m_resumePoint.IsSet()) { return GetVideoInfoTag()->m_resumePoint.timeInSeconds; } // Resume from start when resume points are invalid or the PVR server returns an error return 0; }
gpl-2.0
CROSP/accordion-categories
example/category-icon/category_add_form_fields.php
752
<?php // Block direct requests if ( !defined('ABSPATH')) { die('-1'); } // Add the field to the Add New Category page add_action( 'category_add_form_fields', 'pt_taxonomy_add_new_meta_field', 10, 2 ); function pt_taxonomy_add_new_meta_field() { // this will add the custom meta field to the add new term page ?> <div class="form-field"> <label for="<?php echo CATEGORY_ICON_FIELD_ID; ?>"><?php _e( 'Category Icon', 'accordion_categories' ); ?></label> <input type="text" name="<?php echo CATEGORY_ICON_FIELD_ID; ?>" id="<?php echo CATEGORY_ICON_FIELD_ID; ?>" value=""> <p class="description"><?php printf(__( 'Choose your category icon from. For example: <b>fa fa-wordpress</b>','pt' )); ?></p> </div> <?php }
gpl-2.0
k0da/yast-packager
src/clients/pkg_finish.rb
5802
# encoding: utf-8 # File: # pkg_finish.ycp # # Module: # Step of base installation finish # # Authors: # Jiri Srain <jsrain@suse.cz> # # $Id$ # module Yast class PkgFinishClient < Client def main Yast.import "Pkg" textdomain "packager" Yast.import "Installation" Yast.import "Mode" Yast.import "Stage" Yast.import "String" Yast.import "FileUtils" Yast.import "Packages" @ret = nil @func = "" @param = {} # Check arguments if Ops.greater_than(Builtins.size(WFM.Args), 0) && Ops.is_string?(WFM.Args(0)) @func = Convert.to_string(WFM.Args(0)) if Ops.greater_than(Builtins.size(WFM.Args), 1) && Ops.is_map?(WFM.Args(1)) @param = Convert.to_map(WFM.Args(1)) end end Builtins.y2milestone("starting pkg_finish") Builtins.y2debug("func=%1", @func) Builtins.y2debug("param=%1", @param) if @func == "Info" return { "steps" => 1, # progress step title "title" => _( "Saving the software manager configuration..." ), "when" => [:installation, :update, :autoinst] } elsif @func == "Write" # File "/openSUSE-release.prod" is no more on the media # but directly in the RPM. Don't create the directory # and don't copy the file manually anymore. # # (since evrsion 2.17.5) # # // Copy information about product (bnc#385868) # // FIXME: this is a temporary hack containing a hardcoded file name # string media_prod = Pkg::SourceProvideOptionalFile ( # Packages::theSources[0]:0, 1, # "/openSUSE-release.prod"); # if (media_prod != nil) # { # WFM::Execute (.local.bash, sformat ("test -d %1%2 || mkdir %1%2", # Installation::destdir, "/etc/zypp/products.d")); # WFM::Execute (.local.bash, sformat ("test -d %3%2 && /bin/cp %1 %3%2", # media_prod, "/etc/zypp/products.d", Installation::destdir)); # } # Remove (backup) all sources not used during the update # BNC #556469: Backup and remove all the old repositories before any Pkg::SourceSaveAll call BackUpAllTargetSources() if Stage.initial && Mode.update # See bnc #384827, #381360 if Mode.update Builtins.y2milestone("Adding default repositories") WFM.call("inst_extrasources") end # save all repositories and finish target Pkg.SourceSaveAll Pkg.TargetFinish # save repository metadata cache to the installed system # (needs to be done _after_ saving repositories, see bnc#700881) Pkg.SourceCacheCopyTo(Installation.destdir) # copy list of failed packages to installed system WFM.Execute( path(".local.bash"), Builtins.sformat( "test -f %1 && /bin/cp -a %1 '%2%1'", "/var/lib/YaST2/failed_packages", String.Quote(Installation.destdir) ) ) else Builtins.y2error("unknown function: %1", @func) @ret = nil end Builtins.y2debug("ret=%1", @ret) Builtins.y2milestone("pkg_finish finished") deep_copy(@ret) end # During upgrade, old sources are reinitialized # either as enabled or disabled. # The old sources from targed should go away. def BackUpAllTargetSources Yast.import "Directory" repos_dir = "/etc/zypp/repos.d" if !FileUtils.Exists(repos_dir) Builtins.y2error("Directory %1 doesn't exist!", repos_dir) return end current_repos = Convert.convert( SCR.Read(path(".target.dir"), repos_dir), :from => "any", :to => "list <string>" ) if current_repos == nil || Builtins.size(current_repos) == 0 Builtins.y2warning( "There are currently no repos in %1 conf dir", repos_dir ) return else Builtins.y2milestone( "These repos currently exist on a target: %1", current_repos ) end cmd = Convert.to_map( WFM.Execute(path(".local.bash_output"), "date +%Y%m%d-%H%M%S") ) a_name_list = Builtins.splitstring( Ops.get_string(cmd, "stdout", "the_latest"), "\n" ) archive_name = Ops.add( Ops.add("repos_", Ops.get(a_name_list, 0, "")), ".tgz" ) shellcommand = Builtins.sformat( "mkdir -p '%1' && cd '%1' && /bin/tar -czf '%2' '%3'", String.Quote(Ops.add(Directory.vardir, "/repos.d_backup/")), String.Quote(archive_name), String.Quote(repos_dir) ) cmd = Convert.to_map( SCR.Execute(path(".target.bash_output"), shellcommand) ) if Ops.get_integer(cmd, "exit", -1) != 0 Builtins.y2error( "Unable to backup current repos; Command >%1< returned: %2", shellcommand, cmd ) end success = nil Builtins.foreach(current_repos) do |one_repo| one_repo = Ops.add(Ops.add(repos_dir, "/"), one_repo) Builtins.y2milestone("Removing target repository %1", one_repo) success = Convert.to_boolean( SCR.Execute(path(".target.remove"), one_repo) ) Builtins.y2error("Cannot remove %1 file", one_repo) if success != true end Builtins.y2milestone("All old repositories were removed from the target") # reload the target to sync the removed repositories with libzypp repomanager Pkg.TargetFinish Pkg.TargetInitialize("/mnt") nil end end end Yast::PkgFinishClient.new.main
gpl-2.0
xiongpf/GoCRM
controllers/hr_employee.go
4271
package controllers import ( "GoCRM/models" "encoding/json" "errors" "strconv" "strings" "github.com/astaxie/beego" ) // oprations for HrEmployee type HrEmployeeController struct { beego.Controller } func (c *HrEmployeeController) URLMapping() { c.Mapping("Post", c.Post) c.Mapping("GetOne", c.GetOne) c.Mapping("GetAll", c.GetAll) c.Mapping("Put", c.Put) c.Mapping("Delete", c.Delete) } // @Title Post // @Description create HrEmployee // @Param body body models.HrEmployee true "body for HrEmployee content" // @Success 200 {int} models.HrEmployee.Id // @Failure 403 body is empty // @router / [post] func (c *HrEmployeeController) Post() { var v models.HrEmployee json.Unmarshal(c.Ctx.Input.RequestBody, &v) if id, err := models.AddHrEmployee(&v); err == nil { c.Data["json"] = map[string]int64{"id": id} } else { c.Data["json"] = err.Error() } c.ServeJson() } // @Title Get // @Description get HrEmployee by id // @Param id path string true "The key for staticblock" // @Success 200 {object} models.HrEmployee // @Failure 403 :id is empty // @router /:id [get] func (c *HrEmployeeController) GetOne() { idStr := c.Ctx.Input.Params[":id"] id, _ := strconv.Atoi(idStr) v, err := models.GetHrEmployeeById(id) if err != nil { c.Data["json"] = err.Error() } else { c.Data["json"] = v } c.ServeJson() } // @Title Get All // @Description get HrEmployee // @Param query query string false "Filter. e.g. col1:v1,col2:v2 ..." // @Param fields query string false "Fields returned. e.g. col1,col2 ..." // @Param sortby query string false "Sorted-by fields. e.g. col1,col2 ..." // @Param order query string false "Order corresponding to each sortby field, if single value, apply to all sortby fields. e.g. desc,asc ..." // @Param limit query string false "Limit the size of result set. Must be an integer" // @Param offset query string false "Start position of result set. Must be an integer" // @Success 200 {object} models.HrEmployee // @Failure 403 // @router / [get] func (c *HrEmployeeController) GetAll() { var fields []string var sortby []string var order []string var query map[string]string = make(map[string]string) var limit int64 = 10 var offset int64 = 0 // fields: col1,col2,entity.col3 if v := c.GetString("fields"); v != "" { fields = strings.Split(v, ",") } // limit: 10 (default is 10) if v, err := c.GetInt64("limit"); err == nil { limit = v } // offset: 0 (default is 0) if v, err := c.GetInt64("offset"); err == nil { offset = v } // sortby: col1,col2 if v := c.GetString("sortby"); v != "" { sortby = strings.Split(v, ",") } // order: desc,asc if v := c.GetString("order"); v != "" { order = strings.Split(v, ",") } // query: k:v,k:v if v := c.GetString("query"); v != "" { for _, cond := range strings.Split(v, ",") { kv := strings.Split(cond, ":") if len(kv) != 2 { c.Data["json"] = errors.New("Error: invalid query key/value pair") c.ServeJson() return } k, v := kv[0], kv[1] query[k] = v } } l, err := models.GetAllHrEmployee(query, fields, sortby, order, offset, limit) if err != nil { c.Data["json"] = err.Error() } else { c.Data["json"] = l } c.ServeJson() } // @Title Update // @Description update the HrEmployee // @Param id path string true "The id you want to update" // @Param body body models.HrEmployee true "body for HrEmployee content" // @Success 200 {object} models.HrEmployee // @Failure 403 :id is not int // @router /:id [put] func (c *HrEmployeeController) Put() { idStr := c.Ctx.Input.Params[":id"] id, _ := strconv.Atoi(idStr) v := models.HrEmployee{Id: id} json.Unmarshal(c.Ctx.Input.RequestBody, &v) if err := models.UpdateHrEmployeeById(&v); err == nil { c.Data["json"] = "OK" } else { c.Data["json"] = err.Error() } c.ServeJson() } // @Title Delete // @Description delete the HrEmployee // @Param id path string true "The id you want to delete" // @Success 200 {string} delete success! // @Failure 403 id is empty // @router /:id [delete] func (c *HrEmployeeController) Delete() { idStr := c.Ctx.Input.Params[":id"] id, _ := strconv.Atoi(idStr) if err := models.DeleteHrEmployee(id); err == nil { c.Data["json"] = "OK" } else { c.Data["json"] = err.Error() } c.ServeJson() }
gpl-2.0
cioban/obdpy
lib/obd.py
7023
#!/usr/bin/env python2 # -*- encoding: utf-8 -*- """ Modulo: """ __author__ = 'Sergio Cioban Filho' __version__ = '1.0' __date__ = '24/08/2014 11:02:34 AM' class OBD: pid_dict = None gasoline_density = 710 # grams/liter def __init__(self, pid_dict=None): self.pid_dict = pid_dict def filter_data(self, data): data = filter(bool, data) ret = data.pop() return ret.split() def pid_suported(self, data_list, pid_base=0): try: data_len = self.pid_dict[pid_base].length if data_len == None or data_len == 0: return except: return data_list = data_list[-data_len:] data = 0 shift_count = 3 for hex_num in data_list: data |= (int(hex_num, 16) << (shift_count * 8)) shift_count = shift_count - 1 pid_base += 1 comp = 0x80000000 while (comp > 0): if data & comp: self.pid_dict[pid_base].enable = 1 pid_base += 1 comp >>= 1 # PID: 0x04 def engine_load(self, data): # A*100/255 in % load_data = int(data.pop(), 16) load = (load_data * 100)/255 return load # PID: 0x05 and PID: 0x46 def get_temp(self, data): # A-40 % Celsius temp_data = int(data.pop(), 16) return temp_data - 40 # PID: 0x0C def engine_rpm(self, data): # ((A*256)+B)/4 rpm_data_b = int(data.pop(), 16) rpm_data_a = int(data.pop(), 16) rpm = ((rpm_data_a * 256) + rpm_data_b) / 4 return rpm # PID: 0x0D def speed(self, data): # A in Km/h return int(data.pop(), 16) def distance(self, data): # (A*256)+B in Km data_b = int(data.pop(), 16) data_a = int(data.pop(), 16) return (data_a * 256) + data_b def maf(sef, data): # ((A*256)+B) / 100 data_b = int(data.pop(), 16) data_a = int(data.pop(), 16) return ((data_a * 256) + data_b) / 100 def runtime(self, data): # (A*256)+B data_b = int(data.pop(), 16) data_a = int(data.pop(), 16) return (data_a * 256) + data_b def trim_fuel(self, data): # (A-128) * 100/128 data_a = int(data.pop(), 16) return (data_a - 128) * 100/128 def throttle_position(self, data): # A*100/255 data_a = int(data.pop(), 16) return (data_a * 100)/255 #PIDs 0x14 and 0x15 def bank_sensor(self, data): # This sensor gives 2 values, but only the oxygen is used in obdpy # 2 values: A/200 in volts and (B-128) * 100/128 in % data_b = int(data.pop(), 16) data_a = int(data.pop(), 16) return data_a/200 def km_per_liter(self, speed, maf): # maf: Mass Air Flow - The mass of Air in grams per second consumed. # speed: the vehicle in Km/h # Links: # http://www.windmill.co.uk/obdii.pdf # http://www.windmill.co.uk/fuel.html # http://www.mp3car.com/engine-management-obd-ii-engine-diagnostics-etc/75138-calculating-mpg-from-vss-and-maf-from-obd2.html # http://www.investidorpetrobras.com.br/pt/servicos/formulas-de-conversao/detalhe-formulas-de-conversao/densidade-e-poderes-calorificos-superiores.htm # http://en.wikipedia.org/wiki/Gasoline # Constants # Air to gasoline ideal ratio: 14.7 grams of air to 1 gram of gasoline # The minimal gasoline density: 710 grams/liter # Steps: # 1 - Divide the MAF by 14.7 to get grams of fuel per second # 2 - Divide result by 710 to get liters of fuel per second # 3 - Multiply result by 3600 to get liters per hour # 4 - To get Km per liter, divide speed by liters per hour if speed == 0 or maf == 0: return 0 liters_per_hour = ( (maf / 14.7) / self.gasoline_density ) * 3600 km_per_liter = speed / liters_per_hour return km_per_liter def maf_liters(self, maf): return (maf / 14.7) / (self.gasoline_density) ''' PID:[1] STR_PID:['01'] LEN:[4] DESC:[Monitor status since DTCs cleared. (Includes malfunction indicator lamp (MIL) status and number of DTCs.)] PID:[3] STR_PID:['03'] LEN:[2] DESC:[Fuel system status] PID:[4] STR_PID:['04'] LEN:[1] DESC:[Calculated engine load value] PID:[5] STR_PID:['05'] LEN:[1] DESC:[Engine coolant temperature] PID:[6] STR_PID:['06'] LEN:[1] DESC:[Short term fuel % trim—Bank 1] PID:[7] STR_PID:['07'] LEN:[1] DESC:[Long term fuel % trim—Bank 1] PID:[12] STR_PID:['0C'] LEN:[2] DESC:[Engine RPM] PID:[13] STR_PID:['0D'] LEN:[1] DESC:[Vehicle speed] PID:[14] STR_PID:['0E'] LEN:[1] DESC:[Timing advance] PID:[15] STR_PID:['0F'] LEN:[1] DESC:[Intake air temperature] PID:[16] STR_PID:['10'] LEN:[2] DESC:[MAF air flow rate] PID:[17] STR_PID:['11'] LEN:[1] DESC:[Throttle position] PID:[19] STR_PID:['13'] LEN:[1] DESC:[Oxygen sensors present] PID:[20] STR_PID:['14'] LEN:[2] DESC:[Bank 1, Sensor 1: - Oxygen sensor voltage, - Short term fuel trim] PID:[21] STR_PID:['15'] LEN:[2] DESC:[Bank 1, Sensor 2: - Oxygen sensor voltage, - Short term fuel trim] PID:[28] STR_PID:['1C'] LEN:[1] DESC:[OBD standards this vehicle conforms to] PID:[31] STR_PID:['1F'] LEN:[2] DESC:[Run time since engine start] PID:[33] STR_PID:['21'] LEN:[2] DESC:[Distance traveled with malfunction indicator lamp (MIL) on] PID:[46] STR_PID:['2E'] LEN:[1] DESC:[Commanded evaporative purge] PID:[48] STR_PID:['30'] LEN:[1] DESC:[# of warm-ups since codes cleared] PID:[49] STR_PID:['31'] LEN:[2] DESC:[Distance traveled since codes cleared] PID:[64] STR_PID:['40'] LEN:[4] DESC:[PIDs supported [41 - 60]] PID:[66] STR_PID:['42'] LEN:[2] DESC:[Control module voltage] PID:[67] STR_PID:['43'] LEN:[2] DESC:[Absolute load value] PID:[68] STR_PID:['44'] LEN:[2] DESC:[Command equivalence ratio] PID:[69] STR_PID:['45'] LEN:[1] DESC:[Relative throttle position] PID:[70] STR_PID:['46'] LEN:[1] DESC:[Ambient air temperature] PID:[71] STR_PID:['47'] LEN:[1] DESC:[Absolute throttle position B] PID:[76] STR_PID:['4C'] LEN:[1] DESC:[Commanded throttle actuator] ''' ''' SEND: 30 31 30 30 ['0100', '41 00 BE 1F B8 13 '] SEND: 30 31 32 30 ['0120', '41 20 80 05 80 01 '] SEND: 30 31 34 30 ['0140', '41 40 7E 10 00 00 '] SEND: 30 31 33 31 ['0131', '41 31 11 00 '] SEND: 30 31 34 36 ['0146', '41 46 3A '] ''' if __name__ == '__main__': from obd_pids import PIDS obd = OBD(PIDS) #my_data = ['0100', '41 00 BE 1F B8 13 ', '', ''] #my_data = ['0120', '41 20 80 05 80 01 '] my_data = ['0140', '41 40 7E 10 00 00 '] data = obd.filter_data(my_data) obd.pid_suported(data, 0x40) for pid, pid_obj in obd.pid_dict.iteritems(): if pid_obj.enable: print(pid_obj) #print obd.engine_load(['AA']) #print obd.get_temp(['AA']) #print obd.engine_rpm(['AA', 'AA']) #print obd.speed(['AA']) print obd.distance(['11', '00'])
gpl-2.0
Zolli/BuildR
tests/buildr/http/Response/ContentType/JsonContentTypeTest.php
1412
<?php namespace buildr\tests\http\Response\ContentType; use buildr\Http\Response\ContentType\JsonContentType; use buildr\Http\Response\ContentType\Encoder\JsonContentEncoder; use buildr\Http\Header\Writer\JsonHeaderWriter; use buildr\tests\http\Response\ContentType\AbstractHttpContentTypeTest; /** * Json content type test * * BuildR PHP Framework * * @author Zoltán Borsos <zolli07@gmail.com> * @package buildr * @subpackage Tests\Http\Response\ContentType * * @copyright Copyright 2015, Zoltán Borsos. * @license https://github.com/Zolli/BuildR/blob/master/LICENSE.md * @link https://github.com/Zolli/BuildR */ class JsonContentTypeTest extends AbstractHttpContentTypeTest { /** * Return a new instance from the tested encoder class * * @return \buildr\Http\Response\ContentType\HttpContentTypeInterface */ public function getClassInstance() { return new JsonContentType(); } /** * Returns the current content type unique encoder class anem, or NULL * if the content type has no specific encoder * * @return string|NULL */ public function getEncoderName() { return JsonContentEncoder::class; } /** * Return the associated header writer FQ class name. * * @return string|null */ function getHeaderWriterName() { return JsonHeaderWriter::class; } }
gpl-2.0
karianna/jdk8_tl
jdk/src/share/classes/sun/text/resources/es/FormatData_es_HN.java
3446
/* * Copyright (c) 1997, 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. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ /* * (C) Copyright Taligent, Inc. 1996, 1997 - All Rights Reserved * (C) Copyright IBM Corp. 1996 - 1998 - All Rights Reserved * * The original version of this source code and documentation * is copyrighted and owned by Taligent, Inc., a wholly-owned * subsidiary of IBM. These materials are provided under terms * of a License Agreement between Taligent and Sun. This technology * is protected by multiple US and International patents. * * This notice and attribution to Taligent may not be removed. * Taligent is a registered trademark of Taligent, Inc. * */ package sun.text.resources.es; import java.util.ListResourceBundle; public class FormatData_es_HN extends ListResourceBundle { /** * Overrides ListResourceBundle */ protected final Object[][] getContents() { return new Object[][] { { "NumberElements", new String[] { ".", // decimal separator ",", // group (thousands) separator ";", // list separator "%", // percent sign "0", // native 0 digit "#", // pattern digit "-", // minus sign "E", // exponential "\u2030", // per mille "\u221e", // infinity "\ufffd" // NaN } }, { "TimePatterns", new String[] { "hh:mm:ss a z", // full time pattern "hh:mm:ss a z", // long time pattern "hh:mm:ss a", // medium time pattern "hh:mm a", // short time pattern } }, { "DatePatterns", new String[] { "EEEE dd' de 'MMMM' de 'yyyy", // full date pattern "dd' de 'MMMM' de 'yyyy", // long date pattern "MM-dd-yyyy", // medium date pattern "MM-dd-yy", // short date pattern } }, { "DateTimePatterns", new String[] { "{1} {0}" // date-time pattern } }, }; } }
gpl-2.0
azharu53/kuwithome
components/com_wishlist/controller.php
2005
<?php /** * @version CVS: 1.0.0 * @package Com_Wishlist * @author azharuddin <azharuddin.shaikh53@gmail.com> * @copyright 2017 azharuddin * @license GNU General Public License version 2 or later; see LICENSE.txt */ // No direct access defined('_JEXEC') or die; jimport('joomla.application.component.controller'); /** * Class WishlistController * * @since 1.6 */ class WishlistController extends JControllerLegacy { /** * Method to display a view. * * @param boolean $cachable If true, the view output will be cached * @param mixed $urlparams An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}. * * @return JController This object to support chaining. * * @since 1.5 */ public function display($cachable = false, $urlparams = false) { $app = JFactory::getApplication(); $view = $app->input->getCmd('view', 'wishlist'); $app->input->set('view', $view); parent::display($cachable, $urlparams); return $this; } /********** Ajax Save *************/ function ajaxsave() { // Get a db connection. $db = JFactory::getDbo(); // Create a new query object. $query = $db->getQuery(true); $query ="SELECT MAX(ordering) FROM #__wishlist WHERE userid ='".$_GET['uid']."'"; $db->setQuery($query); $count = $db->loadResult(); $query = "INSERT INTO #__wishlist (`ordering`, `state`, `created_by`, `modified_by`, `userid`, `property_id`) VALUES ( '".($count + 1)."', '1', '".$_GET['uid']."', '".$_GET['uid']."', '".$_GET['uid']."', '".$_GET['pid']."')"; $db->setQuery($query); $db->execute(); die(); } function ajaxdelete() { // Get a db connection. $db = JFactory::getDbo(); // Create a new query object. $query = $db->getQuery(true); echo $query = "DELETE FROM #__wishlist WHERE property_id ='".$_GET['pid']."'"; $db->setQuery($query); $db->execute(); die(); } /********** Ajax Save *************/ }
gpl-2.0
botswana-harvard/edc-base
edc_base/modelform_mixins/audit_fields_mixin.py
658
from ..utils import get_utcnow class AuditFieldsMixin: """Updates audit fields with username /datetime on create and modify. """ def update_system_fields(self, request, instance, change): if not change: instance.user_created = request.user.username instance.created = get_utcnow() instance.user_modified = request.user.username instance.date_modified = get_utcnow() return instance def form_valid(self, form): form.instance = self.update_system_fields( self.request, form.instance, change=True) return super(AuditFieldsMixin, self).form_valid(form)
gpl-2.0
rero/reroils-app
rero_ils/modules/documents/serializers.py
3560
# -*- coding: utf-8 -*- # # This file is part of RERO ILS. # Copyright (C) 2017 RERO. # # RERO ILS 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. # # RERO ILS 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 RERO ILS; if not, write to the # Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307, USA. # # In applying this license, RERO 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. """Record serialization.""" from flask import current_app, json from invenio_records_rest.schemas import RecordSchemaJSONV1 from invenio_records_rest.serializers.response import search_responsify from ..libraries.api import Library from ..serializers import ReroIlsSerializer class ReroIlsSerializer(ReroIlsSerializer): """Mixin serializing records as JSON.""" def serialize_search(self, pid_fetcher, search_result, links=None, item_links_factory=None, **kwargs): """Serialize a search result. :param pid_fetcher: Persistent identifier fetcher. :param search_result: Elasticsearch search result. :param links: Dictionary of links to add to response. """ results = dict( hits=dict( hits=[self.transform_search_hit( pid_fetcher(hit['_id'], hit['_source']), hit, links_factory=item_links_factory, **kwargs ) for hit in search_result['hits']['hits']], total=search_result['hits']['total'], ), links=links or {}, aggregations=search_result.get('aggregations', dict()), ) with current_app.app_context(): facet_config = current_app.config.get( 'RERO_ILS_APP_CONFIG_FACETS', {} ) try: type = search_result['hits']['hits'][0]['_index'].split('-')[0] for aggregation in results.get('aggregations'): facet_config_type = facet_config.get(type, {}) facet_config_type_expand = facet_config_type.get( 'expand', '' ) results['aggregations'][aggregation]['expand'] = False if aggregation in facet_config_type_expand: results['aggregations'][aggregation]['expand'] = True for lib_term in results.get('aggregations', {}).get( 'library', {}).get('buckets', []): pid = lib_term.get('key') name = Library.get_record_by_pid(pid).get('name') lib_term['name'] = name except Exception: pass return json.dumps(results, **self._format_args()) json_doc = ReroIlsSerializer(RecordSchemaJSONV1) """JSON v1 serializer.""" json_doc_search = search_responsify(json_doc, 'application/rero+json') # json_v1_response = record_responsify(json_v1, 'application/rero+json')
gpl-2.0
kosmosby/medicine-prof
components/com_judownload/templates/default/modpendingcomments/default.php
4353
<?php /** * ------------------------------------------------------------------------ * JUDownload for Joomla 2.5, 3.x * ------------------------------------------------------------------------ * * @copyright Copyright (C) 2010-2015 JoomUltra Co., Ltd. All Rights Reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt * @author JoomUltra Co., Ltd * @website http://www.joomultra.com * @----------------------------------------------------------------------@ */ // No direct access to this file defined('_JEXEC') or die('Restricted access'); ?> <div id="judl-container" class="jubootstrap component judl-container view-modpendingcomments"> <h2 class="judl-view-title"><?php echo JText::_('COM_JUDOWNLOAD_PENDING_COMMENTS'); ?></h2> <?php if (!count($this->items)) { ?> <div class="alert alert-block"> <button type="button" class="close" data-dismiss="alert">&times;</button> <?php echo JText::_('COM_JUDOWNLOAD_NO_PENDING_COMMENT'); ?> </div> <?php } ?> <form name="judl-form-comments" id="judl-form-comments" class="judl-form" method="post" action="#"> <?php echo $this->loadTemplate('header'); ?> <table class="table table-striped table-bordered"> <thead> <tr> <th style="width:5%"> <input type="checkbox" name="judl-cbAll" id="judl-cbAll" value=""/> </th> <th> <?php echo JText::_('COM_JUDOWNLOAD_FIELD_TITLE'); ?> </th> <th style="width:30%"> <?php echo JText::_('COM_JUDOWNLOAD_FIELD_PARENT'); ?> </th> <th style="width:15%"> <?php echo JText::_('COM_JUDOWNLOAD_FIELD_GUEST_NAME'); ?> </th> <th style="width:15%"> <?php echo JText::_('COM_JUDOWNLOAD_FIELD_CREATED'); ?> </th> <th style="width:5%"> <?php echo JText::_('COM_JUDOWNLOAD_FIELD_ID'); ?> </th> </tr> </thead> <tbody> <?php if (count($this->items)) { ?> <?php foreach ($this->items AS $i => $item) { ?> <tr> <td> <input type="checkbox" class="judl-cb" name="cid[]" value="<?php echo $item->id; ?>" id="judl-cb-<?php echo $item->id; ?>"/> </td> <td> <?php if ($item->checked_out) { if ($item->checkout_link) { $checkedOutUser = JFactory::getUser($item->checked_out); $checkedOutTime = JHtml::_('date', $item->checked_out_time); $tooltip = JText::_('COM_JUDOWNLOAD_EDIT_COMMENT'); $tooltip .= '<br/>'; $tooltip .= JText::sprintf('COM_JUDOWNLOAD_CHECKED_OUT_BY', $checkedOutUser->name) . ' <br /> ' . $checkedOutTime; echo '<a class="hasTooltip btn btn-default btn-xs" title="' . $tooltip . '" href="' . $item->checkout_link . '"><i class="fa fa-lock"></i></a>'; } else { echo '<a class="btn btn-default btn-xs"><i class="fa fa-lock"></i></a>'; } } ?> <a href="<?php echo JRoute::_('index.php?option=com_judownload&task=modpendingcomment.edit&id=' . $item->id); ?>"> <?php echo $item->title; ?> </a> </td> <td> <a href="<?php echo JRoute::_(JUDownloadHelperRoute::getDocumentRoute($item->doc_id)); ?>"> <?php echo $item->document_title; ?></a> <?php if ($item->level > 1) { ?> <span class="divider"> > </span> <a target="_blank" href="<?php echo JRoute::_(JUDownloadHelperRoute::getDocumentRoute($item->doc_id)) . "#comment-item-" . $item->parent_id; ?>"> <?php echo $item->parent_title; ?></a> <?php } ?> </td> <td> <?php if ($item->user_id > 0) { $userComment = JFactory::getUser($item->user_id); echo $userComment->get('name'); } else { echo $item->guest_name; } ?> </td> <td> <?php echo $item->created; ?> </td> <td> <?php echo $item->id; ?> </td> </tr> <?php } } ?> </tbody> </table> <?php echo $this->loadTemplate('footer'); ?> <div> <input type="hidden" name="task" value=""/> <?php echo JHtml::_('form.token'); ?> </div> </form> </div>
gpl-2.0
naka211/daekcenter_old
modules/mod_dfi_adv/mod_dfi_adv.php
459
<?php //no direct access defined('_JEXEC') or die('Direct Access to this location is not allowed.'); $template_dir = JURI::root().'templates/'.$mainframe->getTemplate().'/assets/'; // include the helper file require_once(dirname(__FILE__).DS.'helper.php'); // get a parameter from the module's configuration $moduleclass_sfx = $params->get('moduleclass_sfx'); // include the template for display require(JModuleHelper::getLayoutPath('mod_dfi_adv')); ?>
gpl-2.0
pascavi/espabilapijo
web/themes/custom/espabilapijo/js/glide.js
37831
/*! * Glide.js * Version: 2.0.6 * Simple, lightweight and fast jQuery slider * Author: @jedrzejchalubek * Site: http://http://glide.jedrzejchalubek.com/ * Licensed under the MIT license */ ;(function($, window, document, undefined){ /** * -------------------------------- * Glide Animation * -------------------------------- * Animation functions * @return {Animation} */ var Animation = function(Glide, Core) { var offset; function Module() {} /** * Make specifed animation type * @param {Number} offset Offset from current position * @return {Module} */ Module.prototype.make = function(displacement) { offset = (typeof displacement !== 'undefined') ? parseInt(displacement) : 0; // Animation actual translate animation this[Glide.options.type](); return this; }; /** * After transition callback * @param {Function} callback * @return {Int} */ Module.prototype.after = function(callback) { return setTimeout(function(){ callback(); }, Glide.options.animationDuration + 20); }; /** * Animation slider animation type * @param {string} direction */ Module.prototype.slider = function() { var translate = Glide[Glide.size] * (Glide.current - 1); var shift = Core.Clones.shift - Glide.paddings; // If on first slide if (Core.Run.isStart()) { if (Glide.options.centered) shift = Math.abs(shift); // Shift is zero else shift = 0; // Hide prev arrow Core.Arrows.disable('prev'); } // If on last slide else if (Core.Run.isEnd()) { if (Glide.options.centered) shift = Math.abs(shift); // Double and absolute shift else shift = Math.abs(shift * 2); // Hide next arrow Core.Arrows.disable('next'); } // Otherwise else { // Absolute shift shift = Math.abs(shift); // Show arrows Core.Arrows.enable(); } // Apply translate Glide.track.css({ 'transition': Core.Transition.get('all'), 'transform': Core.Translate.set(Glide.axis, translate - shift - offset) }); }; /** * Animation carousel animation type * @param {string} direction */ Module.prototype.carousel = function() { // Translate container var translate = Glide[Glide.size] * Glide.current; // Calculate addtional shift var shift; if (Glide.options.centered) shift = Core.Clones.shift - Glide.paddings; else shift = Core.Clones.shift; /** * The flag is set and direction is prev, * so we're on the first slide * and need to make offset translate */ if (Core.Run.isOffset('<')) { // Translate is 0 (left edge of wrapper) translate = 0; // Reset flag Core.Run.flag = false; // After offset animation is done this.after(function() { // clear transition and jump to last slide Glide.track.css({ 'transition': Core.Transition.clear('all'), 'transform': Core.Translate.set(Glide.axis, Glide[Glide.size] * Glide.length + shift) }); }); } /** * The flag is set and direction is next, * so we're on the last slide * and need to make offset translate */ if (Core.Run.isOffset('>')) { // Translate is slides width * length with addtional offset (right edge of wrapper) translate = (Glide[Glide.size] * Glide.length) + Glide[Glide.size]; // Reset flag Core.Run.flag = false; // After offset animation is done this.after(function() { // Clear transition and jump to first slide Glide.track.css({ 'transition': Core.Transition.clear('all'), 'transform': Core.Translate.set(Glide.axis, Glide[Glide.size] + shift) }); }); } /** * Actual translate apply to wrapper * overwrite transition (can be pre-cleared) */ Glide.track.css({ 'transition': Core.Transition.get('all'), 'transform': Core.Translate.set(Glide.axis, translate + shift - offset) }); }; /** * Animation slideshow animation type * @param {string} direction */ Module.prototype.slideshow = function() { Glide.slides.css('transition', Core.Transition.get('opacity')) .eq(Glide.current - 1).css('opacity', 1) .siblings().css('opacity', 0); }; return new Module(); }; ;/** * -------------------------------- * Glide Api * -------------------------------- * Plugin api module * @return {Api} */ var Api = function(Glide, Core) { /** * Api Module Constructor */ function Module() {} /** * Api instance * @return {object} */ Module.prototype.instance = function() { return { /** * Get current slide index * @return {int} */ current: function() { return Glide.current; }, /** * Go to specifed slide * @param {String} distance * @param {Function} callback * @return {Core.Run} */ go: function(distance, callback) { return Core.Run.make(distance, callback); }, /** * Jump without animation to specifed slide * @param {String} distance * @param {Function} callback * @return {Core.Run} */ jump: function(distance, callback) { // Let know that we want jumping Core.Transition.jumping = true; Core.Animation.after(function() { // Jumping done, take down flag Core.Transition.jumping = false; }); return Core.Run.make(distance, callback); }, animate: function(offset) { Core.Transition.jumping = true; Core.Animation.make(offset); Core.Transition.jumping = false; }, /** * Start autoplay * @return {Core.Run} */ start: function(interval) { // We want running Core.Run.running = true; Glide.options.autoplay = parseInt(interval); return Core.Run.play(); }, /** * Play autoplay * @return {Core.Run} */ play: function(){ return Core.Run.play(); }, /** * Pause autoplay * @return {Core.Run} */ pause: function() { return Core.Run.pause(); }, /** * Destroy * @return {Glide.slider} */ destroy: function() { Core.Run.pause(); Core.Clones.remove(); Core.Helper.removeStyles([Glide.track, Glide.slides]); Core.Bullets.remove(); Glide.slider.removeData('glide_api'); Core.Events.unbind(); Core.Touch.unbind(); Core.Arrows.unbind(); Core.Bullets.unbind(); delete Glide.slider; delete Glide.track; delete Glide.slides; delete Glide.width; delete Glide.length; }, /** * Refresh slider * @return {Core.Run} */ refresh: function() { Core.Run.pause(); Glide.collect(); Glide.setup(); Core.Clones.remove().init(); Core.Bullets.remove().init(); Core.Build.init(); Core.Run.make('=' + parseInt(Glide.options.startAt), Core.Run.play()); }, }; }; // @return Module return new Module(); }; ;/** * -------------------------------- * Glide Arrows * -------------------------------- * Arrows navigation module * @return {Arrows} */ var Arrows = function(Glide, Core) { /** * Arrows Module Constructor */ function Module() { this.build(); this.bind(); } /** * Build * arrows DOM */ Module.prototype.build = function() { this.wrapper = Glide.slider.find('.' + Glide.options.classes.arrows); this.items = this.wrapper.children(); }; /** * Disable arrow */ Module.prototype.disable = function(type) { var classes = Glide.options.classes; return this.items.filter('.' + classes['arrow' + Core.Helper.capitalise(type)]) .unbind('click.glide touchstart.glide') .addClass(classes.disabled) .siblings() .bind('click.glide touchstart.glide', this.click) .removeClass(classes.disabled); }; /** * Show arrows */ Module.prototype.enable = function() { this.bind(); return this.items.removeClass(Glide.options.classes.disabled); }; /** * Click arrow method * @param {Object} event */ Module.prototype.click = function(event) { event.preventDefault(); if (!Core.Events.disabled) { Core.Run.pause(); Core.Run.make($(this).data('glide-dir')); Core.Animation.after(function() { Core.Run.play(); }); } }; /** * Bind * arrows events */ Module.prototype.bind = function() { return this.items.on('click.glide touchstart.glide', this.click); }; /** * Unbind * arrows events */ Module.prototype.unbind = function() { return this.items.off('click.glide touchstart.glide'); }; // @return Module return new Module(); }; ;/** * -------------------------------- * Glide Build * -------------------------------- * Build slider DOM * @return {Build} */ var Build = function(Glide, Core) { // Build Module Constructor function Module() { this.init(); } /** * Init slider build * @return {[type]} [description] */ Module.prototype.init = function() { // Build proper slider type this[Glide.options.type](); // Set slide active class this.active(); // Set slides height Core.Height.set(); }; /** * Check if slider type is * @param {string} name Type name to check * @return {boolean} */ Module.prototype.isType = function(name) { return Glide.options.type === name; }; /** * Check if slider type is * @param {string} name Type name to check * @return {boolean} */ Module.prototype.isMode = function(name) { return Glide.options.mode === name; }; /** * Build Slider type */ Module.prototype.slider = function() { // Turn on jumping flag Core.Transition.jumping = true; // Apply slides width Glide.slides[Glide.size](Glide[Glide.size]); // Apply translate Glide.track.css(Glide.size, Glide[Glide.size] * Glide.length); // If mode is vertical apply height if(this.isMode('vertical')) Core.Height.set(true); // Go to startup position Core.Animation.make(); // Turn off jumping flag Core.Transition.jumping = false; }; /** * Build Carousel type * @return {[type]} [description] */ Module.prototype.carousel = function() { // Turn on jumping flag Core.Transition.jumping = true; // Update shift for carusel type Core.Clones.shift = (Glide[Glide.size] * Core.Clones.items.length/2) - Glide[Glide.size]; // Apply slides width Glide.slides[Glide.size](Glide[Glide.size]); // Apply translate Glide.track.css(Glide.size, (Glide[Glide.size] * Glide.length) + Core.Clones.getGrowth()); // If mode is vertical apply height if(this.isMode('vertical')) Core.Height.set(true); // Go to startup position Core.Animation.make(); // Append clones Core.Clones.append(); // Turn off jumping flag Core.Transition.jumping = false; }; /** * Build Slideshow type * @return {[type]} [description] */ Module.prototype.slideshow = function() { // Turn on jumping flag Core.Transition.jumping = true; // Go to startup position Core.Animation.make(); // Turn off jumping flag Core.Transition.jumping = false; }; /** * Set active class * to current slide */ Module.prototype.active = function() { Glide.slides .eq(Glide.current - 1).addClass(Glide.options.classes.active) .siblings().removeClass(Glide.options.classes.active); }; // @return Module return new Module(); }; ;/** * -------------------------------- * Glide Bullets * -------------------------------- * Bullets navigation module * @return {Bullets} */ var Bullets = function(Glide, Core) { /** * Bullets Module Constructor */ function Module() { this.init(); this.bind(); } Module.prototype.init = function() { this.build(); this.active(); return this; }; /** * Build * bullets DOM */ Module.prototype.build = function() { this.wrapper = Glide.slider.children('.' + Glide.options.classes.bullets); for(var i = 1; i <= Glide.length; i++) { $('<button>', { 'class': Glide.options.classes.bullet, 'data-glide-dir': '=' + i }).appendTo(this.wrapper); } this.items = this.wrapper.children(); }; /** * Handle active class * Adding and removing active class */ Module.prototype.active = function() { return this.items .eq(Glide.current - 1).addClass('active') .siblings().removeClass('active'); }; /** * Delete all bullets */ Module.prototype.remove = function() { this.items.remove(); return this; }; /** * Bullet click * @param {Object} event */ Module.prototype.click = function(event) { event.preventDefault(); if (!Core.Events.disabled) { Core.Run.pause(); Core.Run.make($(this).data('glide-dir')); Core.Animation.after(function() { Core.Run.play(); }); } }; /** * Bind * bullets events */ Module.prototype.bind = function() { return this.wrapper.on('click.glide touchstart.glide', 'button', this.click); }; /** * Unbind * bullets events */ Module.prototype.unbind = function() { return this.wrapper.on('click.glide touchstart.glide', 'button'); }; // @return Module return new Module(); }; ;/** * -------------------------------- * Glide Clones * -------------------------------- * Clones module * @return {Clones} */ var Clones = function(Glide, Core) { var map = [0,1]; var pattern; /** * Clones Module Constructor */ function Module() { this.init(); } Module.prototype.init = function() { this.items = []; this.map(); this.collect(); this.shift = 0; return this; }; /** * Map clones length * to pattern */ Module.prototype.map = function() { var i; pattern = []; for (i = 0; i < map.length; i++) { pattern.push(-1-i, i); } }; /** * Collect clones * with maped pattern */ Module.prototype.collect = function() { var item; var i; for(i = 0; i < pattern.length; i++) { item = Glide.slides.eq(pattern[i]) .clone().addClass(Glide.options.classes.clone); this.items.push(item); } }; /** * Append cloned slides before * and after real slides */ Module.prototype.append = function() { var item; var i; for (i = 0; i < this.items.length; i++) { item = this.items[i][Glide.size](Glide[Glide.size]); if (pattern[i] >= 0) item.appendTo(Glide.track); else item.prependTo(Glide.track); } }; /** * Remove cloned slides */ Module.prototype.remove = function() { var i; for (i = 0; i < this.items.length; i++) { this.items[i].remove(); } return this; }; /** * Get width width of all the clones */ Module.prototype.getGrowth = function () { return Glide.width * this.items.length; }; // @return Module return new Module(); }; ;/** * -------------------------------- * Glide Core * -------------------------------- * @param {Glide} Glide Slider Class * @param {array} Modules Modules list to construct * @return {Core} */ var Core = function (Glide, Modules) { /** * Core Module Constructor * Construct modules and inject Glide and Core as dependency */ function Module() { for(var module in Modules) { this[module] = new Modules[module](Glide, this); } } // @return Module return new Module(); }; ;/** * -------------------------------- * Glide Events * -------------------------------- * Events functions * @return {Events} */ var Events = function(Glide, Core) { var triggers = $('[data-glide-trigger]'); /** * Events Module Constructor */ function Module() { this.disabled = false; this.keyboard(); this.hoverpause(); this.resize(); this.bindTriggers(); } /** * Keyboard events */ Module.prototype.keyboard = function() { if (Glide.options.keyboard) { $(window).on('keyup.glide', function(event){ if (event.keyCode === 39) Core.Run.make('>'); if (event.keyCode === 37) Core.Run.make('<'); }); } }; /** * Hover pause event */ Module.prototype.hoverpause = function() { if (Glide.options.hoverpause) { Glide.track .on('mouseover.glide', function() { Core.Run.pause(); Core.Events.trigger('mouseOver'); }) .on('mouseout.glide', function() { Core.Run.play(); Core.Events.trigger('mouseOut'); }); } }; /** * Resize window event */ Module.prototype.resize = function() { $(window).on('resize.glide', Core.Helper.throttle(function() { Core.Transition.jumping = true; Glide.setup(); Core.Build.init(); Core.Run.make('=' + Glide.current, false); Core.Run.play(); Core.Transition.jumping = false; }, Glide.options.throttle)); }; /** * Bind triggers events */ Module.prototype.bindTriggers = function() { if (triggers.length) { triggers .off('click.glide touchstart.glide') .on('click.glide touchstart.glide', this.handleTrigger); } }; /** * Hande trigger event * @param {Object} event */ Module.prototype.handleTrigger = function(event) { event.preventDefault(); var targets = $(this).data('glide-trigger').split(" "); if (!this.disabled) { for (var el in targets) { var target = $(targets[el]).data('glide_api'); target.pause(); target.go($(this).data('glide-dir'), this.activeTrigger); target.play(); } } }; /** * Disable all events * @return {Glide.Events} */ Module.prototype.disable = function() { this.disabled = true; return this; }; /** * Enable all events * @return {Glide.Events} */ Module.prototype.enable = function() { this.disabled = false; return this; }; /** * Detach anchors clicks * inside slider track */ Module.prototype.detachClicks = function() { Glide.track.find('a').each(function(i, a) { $(a).attr('data-href', $(a).attr('href')).removeAttr('href'); }); return this; }; /** * Attach anchors clicks * inside slider track */ Module.prototype.attachClicks = function() { Glide.track.find('a').each(function(i, a) { $(a).attr('href', $(a).attr('data-href')); }); return this; }; /** * Prevent anchors clicks * inside slider track */ Module.prototype.preventClicks = function(event) { if (event.type === 'mousemove') { Glide.track.one('click', 'a', function(e) { e.preventDefault(); }); } return this; }; /* * Call function * @param {Function} func * @return {Glide.Events} */ Module.prototype.call = function (func) { if ( (func !== 'undefined') && (typeof func === 'function') ) func(this.getParams()); return this; }; Module.prototype.trigger = function(name) { Glide.slider.trigger(name + ".glide", [this.getParams()]); return this; }; /** * Get events params * @return {Object} */ Module.prototype.getParams = function() { return { index: Glide.current, length: Glide.slides.length, current: Glide.slides.eq(Glide.current - 1), slider: Glide.slider, swipe: { distance: (Core.Touch.distance || 0) } }; }; /* * Call function * @param {Function} func * @return {Glide.Events} */ Module.prototype.unbind = function() { Glide.track .off('keyup.glide') .off('mouseover.glide') .off('mouseout.glide'); triggers .off('click.glide touchstart.glide'); $(window) .off('keyup.glide') .off('resize.glide'); }; // @return Module return new Module(); }; ;/** * -------------------------------- * Glide Height * -------------------------------- * Height module * @return {Height} */ var Height = function(Glide, Core) { /** * Height Module Constructor */ function Module() { if (Glide.options.autoheight) { Glide.wrapper.css({ 'transition': Core.Transition.get('height'), }); } } /** * Get current slide height * @return {Number} */ Module.prototype.get = function() { var offset = (Glide.axis === 'y') ? Glide.paddings * 2 : 0; return Glide.slides.eq(Glide.current - 1).height() + offset; }; /** * Set slider height * @param {Boolean} force Force height setting even if option is turn off * @return {Boolean} */ Module.prototype.set = function (force) { return (Glide.options.autoheight || force) ? Glide.wrapper.height(this.get()) : false; }; // @return Module return new Module(); }; ;/** * -------------------------------- * Glide Helper * -------------------------------- * Helper functions * @return {Helper} */ var Helper = function(Glide, Core) { /** * Helper Module Constructor */ function Module() {} /** * If slider axis is vertical (y axis) return vertical value * else axis is horizontal (x axis) so return horizontal value * @param {Mixed} hValue * @param {Mixed} vValue * @return {Mixed} */ Module.prototype.byAxis = function(hValue, vValue) { if (Glide.axis === 'y') return vValue; else return hValue; }; /** * Capitalise string * @param {string} s * @return {string} */ Module.prototype.capitalise = function (s) { return s.charAt(0).toUpperCase() + s.slice(1); }; /** * Get time * @version Underscore.js 1.8.3 * @source http://underscorejs.org/ * @copyright (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors. Underscore may be freely distributed under the MIT license. */ Module.prototype.now = Date.now || function() { return new Date().getTime(); }; /** * Throttle * @version Underscore.js 1.8.3 * @source http://underscorejs.org/ * @copyright (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors. Underscore may be freely distributed under the MIT license. */ Module.prototype.throttle = function(func, wait, options) { var that = this; var context, args, result; var timeout = null; var previous = 0; if (!options) options = {}; var later = function() { previous = options.leading === false ? 0 : that.now(); timeout = null; result = func.apply(context, args); if (!timeout) context = args = null; }; return function() { var now = that.now(); if (!previous && options.leading === false) previous = now; var remaining = wait - (now - previous); context = this; args = arguments; if (remaining <= 0 || remaining > wait) { if (timeout) { clearTimeout(timeout); timeout = null; } previous = now; result = func.apply(context, args); if (!timeout) context = args = null; } else if (!timeout && options.trailing !== false) { timeout = setTimeout(later, remaining); } return result; }; }; /** * Remove transition */ Module.prototype.removeStyles = function(elements) { for (var i = 0; i < elements.length; i++) { elements[i].removeAttr('style'); } }; // @return Module return new Module(); }; ;/** * -------------------------------- * Glide Run * -------------------------------- * Run logic module * @return {Run} */ var Run = function(Glide, Core) { /** * Run Module * Constructor */ function Module() { // Running flag // It's in use when autoplay is disabled via options, // but we want start autoplay via api this.running = false; // Flag for offcanvas animation to cloned slides this.flag = false; this.play(); } /** * Start autoplay animation * Setup interval * @return {Int/Undefined} */ Module.prototype.play = function() { var that = this; if (Glide.options.autoplay || this.running) { if (typeof this.interval === 'undefined') { this.interval = setInterval(function() { that.pause(); that.make('>'); that.play(); }, this.getInterval()); } } return this.interval; }; Module.prototype.getInterval = function() { return Glide.slides.eq(Glide.current - 1).data('glide-autoplay') || Glide.options.autoplay; }; /** * Pasue autoplay animation * Clear interval * @return {Int/Undefined} */ Module.prototype.pause = function() { if (Glide.options.autoplay || this.running) { if (this.interval >= 0) this.interval = clearInterval(this.interval); } return this.interval; }; /** * Check if we are on first slide * @return {boolean} */ Module.prototype.isStart = function() { return Glide.current === 1; }; /** * Check if we are on last slide * @return {boolean} */ Module.prototype.isEnd = function() { return Glide.current === Glide.length; }; /** * Check if we are making offset run * @return {boolean} */ Module.prototype.isOffset = function(direction) { return this.flag && this.direction === direction; }; /** * Run move animation * @param {string} move Code in pattern {direction}{steps} eq. "=3" */ Module.prototype.make = function (move, callback) { // Cache var that = this; // Extract move direction this.direction = move.substr(0, 1); // Extract move steps this.steps = (move.substr(1)) ? move.substr(1) : 0; // Stop autoplay until hoverpause is not set if(!Glide.options.hoverpause) this.pause(); // Disable events and call before transition callback if(callback !== false) { Core.Events.disable() .call(Glide.options.beforeTransition) .trigger('beforeTransition'); } // Based on direction switch(this.direction) { case '>': // When we at last slide and move forward and steps are number // Set flag and current slide to first if (this.isEnd()) Glide.current = 1, this.flag = true; // When steps is not number, but '>' // scroll slider to end else if (this.steps === '>') Glide.current = Glide.length; // Otherwise change normally else Glide.current = Glide.current + 1; break; case '<': // When we at first slide and move backward and steps are number // Set flag and current slide to last if(this.isStart()) Glide.current = Glide.length, this.flag = true; // When steps is not number, but '<' // scroll slider to start else if (this.steps === '<') Glide.current = 1; // Otherwise change normally else Glide.current = Glide.current - 1; break; case '=': // Jump to specifed slide Glide.current = parseInt(this.steps); break; } // Set slides height Core.Height.set(); // Set active bullet Core.Bullets.active(); // Run actual translate animation Core.Animation.make().after(function(){ // Set active flags Core.Build.active(); // Enable events and call callbacks if(callback !== false) { Core.Events.enable() .call(callback) .call(Glide.options.afterTransition) .trigger('afterTransition'); } // Start autoplay until hoverpause is not set if(!Glide.options.hoverpause) that.play(); }); Core.Events .call(Glide.options.duringTransition) .trigger('duringTransition'); }; return new Module(); }; ;/** * -------------------------------- * Glide Touch * -------------------------------- * Touch module * @return {Touch} */ var Touch = function(Glide, Core) { var touch; /** * Touch Module Constructor */ function Module() { this.dragging = false; if (Glide.options.touchDistance) Glide.track.on({ 'touchstart.glide': $.proxy(this.start, this) }); if (Glide.options.dragDistance) Glide.track.on({ 'mousedown.glide': $.proxy(this.start, this) }); } /** * Unbind touch events */ Module.prototype.unbind = function() { Glide.track .off('touchstart.glide mousedown.glide') .off('touchmove.glide mousemove.glide') .off('touchend.glide touchcancel.glide mouseup.glide mouseleave.glide'); }; /** * Start touch event * @param {Object} event */ Module.prototype.start = function(event) { // Escape if events disabled // or already dragging if (!Core.Events.disabled && !this.dragging) { // Cache event if (event.type === 'mousedown') touch = event.originalEvent; else touch = event.originalEvent.touches[0] || event.originalEvent.changedTouches[0]; // Turn off jumping flag Core.Transition.jumping = true; // Get touch start points this.touchStartX = parseInt(touch.pageX); this.touchStartY = parseInt(touch.pageY); this.touchSin = null; this.dragging = true; Glide.track.on({ 'touchmove.glide mousemove.glide': Core.Helper.throttle($.proxy(this.move, this), Glide.options.throttle), 'touchend.glide touchcancel.glide mouseup.glide mouseleave.glide': $.proxy(this.end, this) }); // Detach clicks inside track Core.Events.detachClicks() .call(Glide.options.swipeStart) .trigger('swipeStart'); // Pause if autoplay Core.Run.pause(); } }; /** * Touch move event * @param {Object} event */ Module.prototype.move = function(event) { // Escape if events not disabled // or not dragging if (!Core.Events.disabled && this.dragging) { // Cache event if (event.type === 'mousemove') touch = event.originalEvent; else touch = event.originalEvent.touches[0] || event.originalEvent.changedTouches[0]; // Calculate start, end points var subExSx = parseInt(touch.pageX) - this.touchStartX; var subEySy = parseInt(touch.pageY) - this.touchStartY; // Bitwise subExSx pow var powEX = Math.abs( subExSx << 2 ); // Bitwise subEySy pow var powEY = Math.abs( subEySy << 2 ); // Calculate the length of the hypotenuse segment var touchHypotenuse = Math.sqrt( powEX + powEY ); // Calculate the length of the cathetus segment var touchCathetus = Math.sqrt( Core.Helper.byAxis(powEY, powEX) ); // Calculate the sine of the angle this.touchSin = Math.asin( touchCathetus/touchHypotenuse ); // Save distance this.distance = Core.Helper.byAxis( (touch.pageX - this.touchStartX), (touch.pageY - this.touchStartY) ); // Make offset animation Core.Animation.make( Core.Helper.byAxis(subExSx, subEySy) ); // Prevent clicks inside track Core.Events.preventClicks(event) .call(Glide.options.swipeMove) .trigger('swipeMove'); // While mode is vertical, we don't want to block scroll when we reach start or end of slider // In that case we need to escape before preventing default event if (Core.Build.isMode('vertical')) { if (Core.Run.isStart() && subEySy > 0) return; if (Core.Run.isEnd() && subEySy < 0) return; } // While angle is lower than 45 degree if ( (this.touchSin * 180 / Math.PI) < 45 ) { // Prevent propagation event.stopPropagation(); // Prevent scrolling event.preventDefault(); // Add dragging class Glide.track.addClass(Glide.options.classes.dragging); // Else escape from event, we don't want move slider } else { return; } } }; /** * Touch end event * @todo Check edge cases for slider type * @param {Onject} event */ Module.prototype.end = function(event) { // Escape if events not disabled // or not dragging if (!Core.Events.disabled && this.dragging) { // Cache event if (event.type === 'mouseup' || event.type === 'mouseleave') touch = event.originalEvent; else touch = event.originalEvent.touches[0] || event.originalEvent.changedTouches[0]; // Calculate touch distance var touchDistance = Core.Helper.byAxis( (touch.pageX - this.touchStartX), (touch.pageY - this.touchStartY) ); // Calculate degree var touchDeg = this.touchSin * 180 / Math.PI; // Turn off jumping flag Core.Transition.jumping = false; // If slider type is slider if (Core.Build.isType('slider')) { // Prevent slide to right on first item (prev) if (Core.Run.isStart()) { if ( touchDistance > 0 ) touchDistance = 0; } // Prevent slide to left on last item (next) if (Core.Run.isEnd()) { if ( touchDistance < 0 ) touchDistance = 0; } } // While touch is positive and greater than distance set in options // move backward if (touchDistance > Glide.options.touchDistance && touchDeg < 45) Core.Run.make('<'); // While touch is negative and lower than negative distance set in options // move forward else if (touchDistance < -Glide.options.touchDistance && touchDeg < 45) Core.Run.make('>'); // While swipe don't reach distance apply previous transform else Core.Animation.make(); // After animation Core.Animation.after(function(){ // Enable events Core.Events.enable(); // If autoplay start auto run Core.Run.play(); }); // Unset dragging flag this.dragging = false; // Disable other events Core.Events.attachClicks() .disable() .call(Glide.options.swipeEnd) .trigger('swipeEnd'); // Remove dragging class // Unbind events Glide.track .removeClass(Glide.options.classes.dragging) .off('touchmove.glide mousemove.glide') .off('touchend.glide touchcancel.glide mouseup.glide mouseleave.glide'); } }; // @return Module return new Module(); }; ;/** * -------------------------------- * Glide Transition * -------------------------------- * Transition module * @return {Transition} */ var Transition = function(Glide, Core) { /** * Transition Module Constructor */ function Module() { this.jumping = false; } /** * Get transition settings * @param {string} property * @return {string} */ Module.prototype.get = function(property) { if (!this.jumping) return property + ' ' + Glide.options.animationDuration + 'ms ' + Glide.options.animationTimingFunc; else return this.clear('all'); }; /** * Clear transition settings * @param {string} property * @return {string} */ Module.prototype.clear = function(property) { return property + ' 0ms ' + Glide.options.animationTimingFunc; }; // @return Module return new Module(); }; ;/** * -------------------------------- * Glide Translate * -------------------------------- * Translate module * @return {Translate} */ var Translate = function(Glide, Core) { // Translate axes map var axes = { x: 0, y: 0, z: 0 }; /** * Translate Module Constructor */ function Module() {} /** * Set translate * @param {string} axis * @param {int} value * @return {string} */ Module.prototype.set = function(axis, value) { axes[axis] = parseInt(value); return 'translate3d(' + (-1 * axes.x) + 'px, ' + (-1 * axes.y) + 'px, ' + (-1 * axes.z) + 'px)'; }; // @return Module return new Module(); }; ;/** * -------------------------------- * Glide Main * -------------------------------- * Responsible for slider initiation, * extending defaults, returning public api * @param {jQuery} element Root element * @param {Object} options Plugin init options * @return {Glide} */ var Glide = function (element, options) { /** * Default options * @type {Object} */ var defaults = { autoplay: 4000, type: 'carousel', mode: 'horizontal', startAt: 1, hoverpause: true, keyboard: true, touchDistance: 80, dragDistance: 120, animationDuration: 400, animationTimingFunc: 'cubic-bezier(0.165, 0.840, 0.440, 1.000)', throttle: 16, autoheight: false, paddings: 0, centered: true, classes: { base: 'glide', wrapper: 'glide__wrapper', track: 'glide__track', slide: 'glide__slide', arrows: 'glide__arrows', arrow: 'glide__arrow', arrowNext: 'next', arrowPrev: 'prev', bullets: 'glide__bullets', bullet: 'glide__bullet', clone: 'clone', active: 'active', dragging: 'dragging', disabled: 'disabled' }, beforeInit: function(event) {}, afterInit: function(event) {}, beforeTransition: function(event) {}, duringTransition: function(event) {}, afterTransition: function(event) {}, swipeStart: function(event) {}, swipeEnd: function(event) {}, swipeMove: function(event) {}, }; // Extend options this.options = $.extend({}, defaults, options); this.current = parseInt(this.options.startAt); this.element = element; // Collect DOM this.collect(); // Init values this.setup(); // Call before init callback this.options.beforeInit({ index: this.current, length: this.slides.length, current: this.slides.eq(this.current - 1), slider: this.slider }); /** * Construct Core with modules * @type {Core} */ var Engine = new Core(this, { Helper: Helper, Translate: Translate, Transition: Transition, Run: Run, Animation: Animation, Clones: Clones, Arrows: Arrows, Bullets: Bullets, Height: Height, Build: Build, Events: Events, Touch: Touch, Api: Api }); // Call after init callback Engine.Events.call(this.options.afterInit); // api return return Engine.Api.instance(); }; /** * Collect DOM * and set classes */ Glide.prototype.collect = function() { var options = this.options; var classes = options.classes; this.slider = this.element.addClass(classes.base + '--' + options.type).addClass(classes.base + '--' + options.mode); this.track = this.slider.find('.' + classes.track); this.wrapper = this.slider.find('.' + classes.wrapper); this.slides = this.track.find('.' + classes.slide).not('.' + classes.clone); }; /** * Setup properties and values */ Glide.prototype.setup = function() { var modeMap = { horizontal: ['width', 'x'], vertical: ['height', 'y'], }; this.size = modeMap[this.options.mode][0]; this.axis = modeMap[this.options.mode][1]; this.length = this.slides.length; this.paddings = this.getPaddings(); this[this.size] = this.getSize(); }; /** * Normalize paddings option value * Parsing string (%, px) and numbers * @return {Number} normalized value */ Glide.prototype.getPaddings = function() { var option = this.options.paddings; if(typeof option === 'string') { var normalized = parseInt(option, 10); var isPercentage = option.indexOf('%') >= 0; if (isPercentage) return parseInt(this.slider[this.size]() * (normalized/100)); else return normalized; } return option; }; /** * Get slider width updated by addtional options * @return {Number} width value */ Glide.prototype.getSize = function() { return this.slider[this.size]() - (this.paddings * 2); };;/** * Wire Glide to jQuery * @param {object} options Plugin options * @return {object} */ $.fn.glide = function (options) { return this.each(function () { if ( !$.data(this, 'glide_api') ) { $.data(this, 'glide_api', new Glide($(this), options) ); } }); }; })(jQuery, window, document);
gpl-2.0
dannydes/DPLL-BS
com/daniel/dpll/algo/ds/Variable.java
2789
package com.daniel.dpll.algo.ds; /** * Class representing a variable * @author Daniel */ public class Variable { /** * Variable letter */ private final char variable; /** * Value assigned. Always false for unassigned. */ private boolean value; /** * Whether variable is assigned */ private boolean assigned; /** * Whether variable always occurs with same polarity */ private boolean pure; /** * Whether variable always occurs with a not. Should be set only in case variable is pure. */ private boolean not; /** * Constructor * @param variable string containing variable name */ public Variable(String variable) { this.variable = variable.charAt(0); assigned = false; } /** * Constructor that pre-assigns value * @param variable string containing variable name * @param value value to be assigned */ public Variable(String variable, boolean value) { this.variable = variable.charAt(0); this.value = value; assigned = true; } /** * Getter for variable letter * @return variable letter */ public char getVariable() { return variable; } /** * Setter for value * @param value value to be assigned */ public void setValue(boolean value) { this.value = value; assigned = true; } /** * Getter for value * @return value assigned */ public boolean getValue() { return value; } /** * Marks variable as pure */ public void markPure() { pure = true; } /** * Getter for pure * @return whether variable always occurs with same polarity */ public boolean isPure() { return pure; } /** * Setter for not, requiring purity check to be done outside * @param not whether variable always occurs with a not */ public void setNot(boolean not) { this.not = not; } /** * Getter for not * @return whether variable always occurs with a not */ public boolean isNot() { return not; } /** * Reports whether unassigned * @return inverted value of assigned */ public boolean isUnassigned() { return !assigned; } /** * Getter for assigned * @return whether variable is assigned */ public boolean isAssigned() { return assigned; } /** * Gives a string representation to variable * @return string representation */ @Override public String toString() { return Character.toString(variable) + ": " + Boolean.toString(value); } }
gpl-2.0
nixone/ds-sem
src/sk/nixone/ds/agent/sem3/assistants/VehicleInitPlanner.java
1595
package sk.nixone.ds.agent.sem3.assistants; import OSPABA.CommonAgent; import OSPABA.Simulation; import sk.nixone.ds.agent.ContinualAssistant; import sk.nixone.ds.agent.annotation.HandleMessage; import sk.nixone.ds.agent.sem3.Components; import sk.nixone.ds.agent.sem3.Message; import sk.nixone.ds.agent.sem3.Messages; import sk.nixone.ds.agent.sem3.SimulationRun; import sk.nixone.ds.agent.sem3.agents.MovementAgent; import sk.nixone.ds.agent.sem3.model.Line; import sk.nixone.ds.agent.sem3.model.Schedule; import sk.nixone.ds.agent.sem3.model.Vehicle; import sk.nixone.ds.agent.sem3.model.VehicleType; public class VehicleInitPlanner extends ContinualAssistant<SimulationRun, MovementAgent> { public VehicleInitPlanner(Simulation mySim, CommonAgent myAgent) { super(Components.VEHICLE_INIT_PLANNER, mySim, myAgent); } @HandleMessage(code=Messages.start) public void onStart(Message message) { Line line = message.getLine(); for(VehicleType vehicleType : getAgent().getModel().getVehicleTypes()) { Schedule schedule = getAgent().getModel().findSchedule(line, vehicleType); for(double time : schedule) { Vehicle vehicle = new Vehicle(vehicleType); vehicle.setLine(line); getAgent().getModel().getVehicles().add(vehicle); message = message.createCopy(); message.setVehicle(vehicle); message.setStation(line.getFirstStation()); message.setCode(Messages.VEHICLE_INIT_FINISHED); hold(time, message); } } } @HandleMessage(code=Messages.VEHICLE_INIT_FINISHED) public void onEnd(Message message) { assistantFinished(message); } }
gpl-2.0
JacquesBonet/UCLG
administrator/components/com_iyosismaps/views/map/view.html.php
1717
<?php /** * @package Iyosis Maps for Joomla! * @author Remzi Degirmencioglu * @copyright (C) 2011 www.iyosis.com * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html **/ // no direct access defined( '_JEXEC' ) or die( 'Restricted access' ); jimport( 'joomla.application.component.view'); class IyosisMapsViewMap extends JView { function display($tpl = null) { $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); // Set the document $this->setDocument(); } /** * Setting the toolbar */ protected function addToolBar() { JRequest::setVar('hidemainmenu', true); $isNew = ($this->item->id == 0); $text = $isNew ? JText::_( 'JTOOLBAR_NEW' ) : JText::_( 'JTOOLBAR_EDIT' ); JToolBarHelper::title( JText::_( 'COM_IYOSISMAPS_MAP' ).': <small><small>[ ' . $text.' ]</small></small>', 'maps.png' ); JToolBarHelper::apply('map.apply', 'JTOOLBAR_APPLY'); JToolBarHelper::save('map.save', 'JTOOLBAR_SAVE'); JToolBarHelper::custom('map.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); JToolBarHelper::custom('map.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); JToolBarHelper::cancel('map.cancel', 'JTOOLBAR_CLOSE'); } /** * Method to set up the document properties * * @return void */ protected function setDocument() { $document = JFactory::getDocument(); $document->setTitle(JText::_('COM_IYOSISMAPS_ADMINISTRATION')); } }
gpl-2.0
lamsfoundation/lams
lams_common/src/java/org/lamsfoundation/lams/rating/dto/RatingDTO.java
1516
/**************************************************************** * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) * ============================================================= * License Information: http://lamsfoundation.org/licensing/lams/2.0/ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2.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 * * http://www.gnu.org/licenses/gpl.txt * **************************************************************** */ package org.lamsfoundation.lams.rating.dto; import org.lamsfoundation.lams.usermanagement.User; public class RatingDTO { private User learner; private String rating; /** */ public User getLearner() { return learner; } public void setLearner(User learner) { this.learner = learner; } /** */ public void setRating(String rating) { this.rating = rating; } public String getRating() { return this.rating; } }
gpl-2.0
pikoro/phpswapmeet
templates/housing/search.php
11513
<? include_once('classes/search.php'); echo '<div id="listingwrap">'; if($_POST['action']=='search'){ $keyword = $_POST[keyword]; $search = new search(); $results = $search->do_search($_POST['type'],$_POST['min_price'],$_POST['max_price'],$_POST['base'],$_POST['bed'],$_POST['bath']); if(!empty($results)){ echo '<div id="sidebar"> <h1>Search Results</h1> </div>'; //echo '<h2>Search Results</h2>'; //$listings->pager($results); foreach($results as $result){ //print_r($result); echo '<div class="searchresult"> <a href="?p=detail&item='.$result[id].'"/><img class="left" width="281" height="195" src="'.$config[site][url].'/images/'.$items->get_main_picture($result[id]).'" /></a> <div class="listinginfo"> <div class="address"> <h3><a href="?p=detail&item='.$result[id].'">'.$result[name].'</a></h3> <p class="location">Near '.$listings->get_base_name($result[base]).'</p> </div> <p class="price">&yen;'.number_format($result[price]).' <p class="bedbathsqft">'.$result[bed].' Bed, '.$result[bath].', '.$result[squarefeet].' Sq Ft</p> <p class="propertytype">Property Type: '.$listings->get_category_name($result[category]).'</p> </div> </div> '; /*$listings->show_item_listing($result[id]); echo '<div class="sidebarlt" style="height:60px; text-align:left; width:auto;">'; echo '<div style="float:left"><a href="?p=detail&item='.$result[id].'"><img class="list_image" src="/'.$result[image].'" alt="'.$result[name].'" width="50" height="50"/></a></div>'; echo '<div style="margin-left:70px; width: auto;"><b>'.$result[name].'</b></div>'; echo '<div style="margin-left:70px; width: auto;">'.$result[description].'</div>'; echo '<div style="margin-left:70px; width: auto;">Posted:'.$result[list_date].'</div>'; echo '</div>'; //print_r($item); */ } } else { echo '<h2>Your search returned 0 results</h2>'; echo '<h1>Start your search</h1> <form method="post" name="search" action="?p=search"> <input type="hidden" name="action" value="search" /> <table border="0" cellspacing="0" class="search"> <tr><th>Type: </th><td><select name="type"> <option value="0" selected="selected">Any</option> <option value="1" >Single Home</option> <option value="2" >Apartment</option> <option value="3" >Duplex</option> </select></td></tr> <tr><th>Price Range: </th><td> <select name="min_price"> <option value="0" selected="selected">Any</option> <option value="0">0</option> <option value="140000">140,000</option> <option value="150000">150,000</option> <option value="155000">155,000</option> <option value="160000">160,000</option> <option value="165000">165,000</option> <option value="180000">180,000</option> <option value="190000">190,000</option> <option value="200000">200,000</option> <option value="210000">210,000</option> <option value="225000">225,000</option> <option value="235000">235,000</option> <option value="240000">240,000</option> <option value="250000">250,000</option> <option value="280000">280,000</option> <option value="300000">300,000</option> <option value="320000">320,000</option> </select>~<select name="max_price"> <option value="0" selected="selected">Any</option> <option value="0">0</option> <option value="140000">140,000</option> <option value="150000">150,000</option> <option value="155000">155,000</option> <option value="160000">160,000</option> <option value="165000">165,000</option> <option value="180000">180,000</option> <option value="190000">190,000</option> <option value="200000">200,000</option> <option value="210000">210,000</option> <option value="225000">225,000</option> <option value="235000">235,000</option> <option value="240000">240,000</option> <option value="250000">250,000</option> <option value="280000">280,000</option> <option value="300000">300,000</option> <option value="320000">320,000+</option> </select></td></tr> <tr><th>Nearest Base: </th><td><select name="base"><option value="0" selected="selected">Any</option><option value="1" >Kinser</option><option value="2" >Futenma</option><option value="3" >Foster</option><option value="4" >Lester</option><option value="5" >Kadena</option><option value="6" >Torii Station</option><option value="7" >McTureous</option><option value="8" >Courtney</option><option value="9" >Schwab</option><option value="10" >Hansen</option></select></td></tr> <tr><th>Bedrooms: </th><td><select id="bed" name="bed"> <option value="0" selected="selected">Any</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6+</option> </select></td> </tr> <tr> <th>Bathrooms: </th> <td><select id="bath" name="bath"> <option value="0">Any</option> <option value="1">1</option> <option value="1.5">1.5</option> <option value="2">2</option> <option value="2.5">2.5</option> <option value="3">3</option> <option value="3.5">3.5</option> <option value="4">4+</option> </select></td> </tr> <tr> <th><input type="submit" value="Search" /></th> <th style="text-align:left;">&nbsp;</th> </tr> </table> </form>'; } } elseif($_POST[email]) { $search = new search(); $search->add_notification($_POST[email],$_POST[search_term]); echo '<h1>Notification Added!</h1>'; } else { echo '<!-- Search Box --> <h1>Start your search</h1> <form method="post" name="search" action="?p=search"> <input type="hidden" name="action" value="search" /> <table border="0" cellspacing="0" class="search"> <tr><th>Type: </th><td><select name="type"> <option value="0" selected="selected">Any</option> <option value="1" >Single Home</option> <option value="2" >Apartment</option> <option value="3" >Duplex</option> </select></td></tr> <tr><th>Price Range: </th><td> <select name="min_price"> <option value="0" selected="selected">Any</option> <option value="0">0</option> <option value="140000">140,000</option> <option value="150000">150,000</option> <option value="155000">155,000</option> <option value="160000">160,000</option> <option value="165000">165,000</option> <option value="180000">180,000</option> <option value="190000">190,000</option> <option value="200000">200,000</option> <option value="210000">210,000</option> <option value="225000">225,000</option> <option value="235000">235,000</option> <option value="240000">240,000</option> <option value="250000">250,000</option> <option value="280000">280,000</option> <option value="300000">300,000</option> <option value="320000">320,000</option> </select>~<select name="max_price"> <option value="0" selected="selected">Any</option> <option value="0">0</option> <option value="140000">140,000</option> <option value="150000">150,000</option> <option value="155000">155,000</option> <option value="160000">160,000</option> <option value="165000">165,000</option> <option value="180000">180,000</option> <option value="190000">190,000</option> <option value="200000">200,000</option> <option value="210000">210,000</option> <option value="225000">225,000</option> <option value="235000">235,000</option> <option value="240000">240,000</option> <option value="250000">250,000</option> <option value="280000">280,000</option> <option value="300000">300,000</option> <option value="320000">320,000+</option> </select></td></tr> <tr><th>Nearest Base: </th><td><select name="base"><option value="0" selected="selected">Any</option><option value="1" >Kinser</option><option value="2" >Futenma</option><option value="3" >Foster</option><option value="4" >Lester</option><option value="5" >Kadena</option><option value="6" >Torii Station</option><option value="7" >McTureous</option><option value="8" >Courtney</option><option value="9" >Schwab</option><option value="10" >Hansen</option></select></td></tr> <tr><th>Bedrooms: </th><td><select id="bed" name="bed"> <option value="0" selected="selected">Any</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6+</option> </select></td> </tr> <tr> <th>Bathrooms: </th> <td><select id="bath" name="bath"> <option value="0">Any</option> <option value="1">1</option> <option value="1.5">1.5</option> <option value="2">2</option> <option value="2.5">2.5</option> <option value="3">3</option> <option value="3.5">3.5</option> <option value="4">4+</option> </select></td> </tr> <tr> <th><input type="submit" value="Search" /></th> <th style="text-align:left;">&nbsp;</th> </tr> </table> </form>'; } echo '</div>'; ?>
gpl-2.0
R-Typ/LintPlug
config.cpp
1847
/** * @file config.cpp * @author Roman Nikiforov * @brief * * Change History * ------------------------------------------------------------------- * @date 29.01.2015 header created * * */ #include "config.h" #include "ui_config.h" #include "lintplugconstants.h" #include <QFileDialog> #include <coreplugin/icore.h> using namespace LintPlug::Internal; Config::Config(QWidget *parent) : QWidget(parent) , ui(new Ui::Config) , m_settings(Core::ICore::settings()) { ui->setupUi(this); connect(ui->btnOpen, SIGNAL(clicked()), SLOT(openFileDlg())); ui->edLint->setText(m_settings->value(QLatin1String(Constants::SETTINGS_LINT_EXE), QLatin1String("")).toString()); ui->edArgs->setText(m_settings->value(QLatin1String(Constants::SETTINGS_LINT_ARGS), QLatin1String("")).toString()); ui->chkPDir->setChecked(m_settings->value(QLatin1String(Constants::SETTINGS_LINT_PDIR), true).toBool()); ui->chkDefines->setChecked(m_settings->value(QLatin1String(Constants::SETTINGS_LINT_DEFS), false).toBool()); } Config::~Config() { delete ui; } QSettings *Config::settings() { apply(); return m_settings; } void Config::apply() { if (m_settings) { m_settings->setValue(QLatin1String(Constants::SETTINGS_LINT_EXE), ui->edLint->text()); m_settings->setValue(QLatin1String(Constants::SETTINGS_LINT_ARGS), ui->edArgs->text()); m_settings->setValue(QLatin1String(Constants::SETTINGS_LINT_PDIR), ui->chkPDir->isChecked()); m_settings->setValue(QLatin1String(Constants::SETTINGS_LINT_DEFS), ui->chkDefines->isChecked()); } } void Config::openFileDlg() { QString fileName = QFileDialog::getOpenFileName(this, tr("Select PC Lint executable"), QLatin1String("."), tr("Exe Files (*.exe)")); if (!fileName.isNull()) { ui->edLint->setText(fileName); } }
gpl-2.0
DB-SE/isp2014.manh.nguyen
Zeitplaner_Antenna/src/Main.java
1771
import java.util.*; public class Main{ private static Kalender kalender = new Kalender(); //#ifdef Notizen //@ private static Notizen notizen = new Notizen(); //#endif public static void main(String[] args) throws Exception { System.out.println("------- Zeitplaner Antenna -------"); System.out.println(); System.out.println("-- Bitte Optionen auswaehlen--"); ArrayList<String> optionen = new ArrayList<String>(); int i = 0; optionen.add("Kalender"); kalender.setKID(i); i++; //#ifdef Notizen //@ optionen.add("Notizen"); //@ notizen.setNID(i); //@ i++; //#endif runFeature(createOptionen(optionen)); } private static int createOptionen(ArrayList<String> optionen){ for (int i= 0; i < optionen.size();i++){ System.out.println("'" + i + "'" + " fuer " + optionen.get(i)); } System.out.println(); System.out.println("Auswahl der Optionen:"); if(kalender.selKalender() == true){ kalender.kalenderOption(eingabeO()); } //#ifdef Notizen //@ if(notizen.selNotizen() == true){ //@ notizen.notizenOption(eingabeO()); //@ } //#endif return eingabeO(); } public static int eingabeO(){ Scanner sEingabe = new Scanner(System.in); int iEingabe = sEingabe.nextInt(); sEingabe.reset(); return iEingabe; } private static void runFeature(int eingabe){ if(eingabe == kalender.getKID()){ createOptionen(kalender.createKOptionen()); } //#ifdef Notizen //@ else if(eingabe == notizen.getNID()){ //@ //@ createOptionen(notizen.createNOptionen()); //@ //@ } //#endif else{ System.err.println("Falsche Eingabe !!!"); System.exit(0); } } }
gpl-2.0
iammyr/Benchmark
src/main/java/org/owasp/benchmark/testcode/BenchmarkTest15185.java
2528
/** * OWASP Benchmark Project v1.1 * * This file is part of the Open Web Application Security Project (OWASP) * Benchmark Project. For details, please see * <a href="https://www.owasp.org/index.php/Benchmark">https://www.owasp.org/index.php/Benchmark</a>. * * The Benchmark 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. * * The Benchmark 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 * * @author Nick Sanidas <a href="https://www.aspectsecurity.com">Aspect Security</a> * @created 2015 */ package org.owasp.benchmark.testcode; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet("/BenchmarkTest15185") public class BenchmarkTest15185 extends HttpServlet { private static final long serialVersionUID = 1L; @Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); } @Override public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String param = request.getHeader("foo"); String bar = doSomething(param); String cmd = org.owasp.benchmark.helpers.Utils.getOSCommandString("echo") + bar; String[] argsEnv = { "Foo=bar" }; Runtime r = Runtime.getRuntime(); try { Process p = r.exec(cmd, argsEnv); org.owasp.benchmark.helpers.Utils.printOSCommandResults(p); } catch (IOException e) { System.out.println("Problem executing cmdi - TestCase"); throw new ServletException(e); } } // end doPost private static String doSomething(String param) throws ServletException, IOException { String bar = "safe!"; java.util.HashMap<String,Object> map16838 = new java.util.HashMap<String,Object>(); map16838.put("keyA-16838", "a Value"); // put some stuff in the collection map16838.put("keyB-16838", param.toString()); // put it in a collection map16838.put("keyC", "another Value"); // put some stuff in the collection bar = (String)map16838.get("keyB-16838"); // get it back out return bar; } }
gpl-2.0
ua2004/Millionaire-3D
Assets/Scripts/UIManager.cs
38514
using UnityEngine; using UnityEngine.UI; using UnityEngine.SceneManagement; using System.Collections; using System.Collections.Generic; using DG.Tweening; public class UIManager : MonoBehaviour { public static UIManager instance; // static variable which is used to get reference to UIManager instance from every script public List<Sprite> lozengeSprites; // list of all sprites used at logenze panel | left(inact, act, final, correct) then right (inact, act, final, correct) public List<Sprite> moneyTreeSprites; // list of all sprites used at money tree panel | 5050act, 5050av, 5050unav, aud_act, aud_av, aud_unav, ph_act, ph_av, ph_unav [Header("Panel references")] public GameObject startPanel; // public GameObject chooseModePanel; // public GameObject gamePanel; // public GameObject settingsPanel; // public GameObject chooseCharacterPanel; // public GameObject pausePanel; // a references for canvas UI panels public GameObject lozengePanel; // public GameObject currentPrizePanel; // public GameObject moneyTreePanel; // public GameObject phonePanel; // public GameObject audiencePanel; // public GameObject millionWinPanel; // [Header("Text references")] public Text phoneDialogText; [Header("Sprite references")] public Sprite currentPrizeSprite; public Sprite totalPrizeSprite; [Header("Other references")] public GameObject confetti; public Language language; //current game language chosen by user public Animator moneyTreeAnimator; // a reference for money tree animator public int currentlyHighlightedAnswer = 0; // equals to number of currently HL answer, 0 if there is no HL answers private bool canCloseAudiencePanel = false; private bool[] panelsStates = new bool[11]; [HideInInspector] public bool allAnswersAreDisplayed = false; void Awake() { /* this.language = new Language("uk-UA"); Debug.Log(this.language.T("game_title")); */ if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); } else if (instance != this) { Destroy(gameObject); } OnLevelWasLoaded(); moneyTreeAnimator = moneyTreePanel.GetComponent<Animator>(); } void OnLevelWasLoaded() { //closing and opening appropriate panels depend on loaded scene //if loaded scene is "Start" scene if (Application.loadedLevel == 0) { startPanel.SetActive(true); chooseModePanel.SetActive(false); gamePanel.SetActive(false); settingsPanel.SetActive(false); chooseCharacterPanel.SetActive(false); pausePanel.SetActive(false); //making first button highlighted GameObject.Find("StartGameButton").GetComponent<Button>().Select(); } //if loaded scene is "Game" scene else { startPanel.SetActive(false); chooseModePanel.SetActive(false); gamePanel.SetActive(true); settingsPanel.SetActive(false); chooseCharacterPanel.SetActive(false); pausePanel.SetActive(false); } } void Update() { if (Input.GetKeyDown(KeyCode.Escape)) { if (Application.loadedLevel == 0) { Back(); } else { pausePanel.SetActive(!pausePanel.activeSelf); } } if (Input.GetKeyDown(KeyCode.M) && GameProcess.instance.state != State.GAME_IS_NOT_STARTED) { //opening/closing Money Tree Panel if (moneyTreePanel.activeSelf) { StartCoroutine(CloseMoneyTreePanel()); } else { StartCoroutine(ShowMoneyTreePanel()); } } else if (Input.GetKeyDown(KeyCode.Keypad1)) { LightAnimation.SmallCircleUp(); } else if (Input.GetKeyDown(KeyCode.Keypad2)) { LightAnimation.SmallCircleDown(); } else if (Input.GetKeyDown(KeyCode.Keypad3)) { LightAnimation.BigCircleUp(); } else if (Input.GetKeyDown(KeyCode.Keypad4)) { LightAnimation.BigCircleDown(); } } // // MENU FUNCTIONS // public void StartGame() { startPanel.SetActive(false); chooseModePanel.SetActive(true); GameObject.Find("ClassicModeButton").GetComponent<Button>().Select(); } public void ClassicModeChosed() { SceneManager.LoadScene(1); } public void SuperMModeChosed() { } public void Settings() { startPanel.SetActive(false); settingsPanel.SetActive(true); } public void chooseCharacter() { settingsPanel.SetActive(false); chooseCharacterPanel.SetActive(true); } //get's id of chosed character public void Choose(int characterId) { //making interactable ChooseButton of old character Button button = GameObject.Find("CharacterPropertiesPanelId=" + GameManager.instance.chosedCharacterId).GetComponentInChildren<Button>(); button.interactable = true; button.GetComponentInChildren<Text>().text = "Choose"; GameManager.instance.chosedCharacterId = characterId; GameManager.instance.updatePlayerObject = true; //making not interactable ChooseButton of current character button = GameObject.Find("CharacterPropertiesPanelId=" + GameManager.instance.chosedCharacterId).GetComponentInChildren<Button>(); button.interactable = false; button.GetComponentInChildren<Text>().text = "Chosed"; } public void Exit() { Application.Quit(); } public void Back() { OnLevelWasLoaded(); } public void Menu() { SceneManager.LoadScene(0); pausePanel.SetActive(false); } public void AnswerButton(int numberOfAnswer) { //if there is no highlighted answers if (currentlyHighlightedAnswer == 0) { HighLightAnswer(numberOfAnswer); currentlyHighlightedAnswer = numberOfAnswer; } //if current answer is already highlighted else if (currentlyHighlightedAnswer == numberOfAnswer) { currentlyHighlightedAnswer = 0; SetFinalAnswer(numberOfAnswer); GameProcess.instance.AnswerSelected(numberOfAnswer); } //if highlighted other answer else if (GameProcess.instance.state != State.FINAL_ANSWER_GIVEN) { UnhighLightAnswer(currentlyHighlightedAnswer); HighLightAnswer(numberOfAnswer); currentlyHighlightedAnswer = numberOfAnswer; } } //////////////////////////////////////////////////////////////////////////////////////////// // GAME FUNCTIONS //////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Shows question /// </summary> /// <param name="questionText">text of question</param> public void ShowQuestion(string questionText, string[] answers) { //setting question text lozengePanel.transform.GetChild(2).GetChild(0).GetComponent<Text>().text = questionText; lozengePanel.SetActive(true); //setting answers texts for (int i = 0; i < 4; i++) { lozengePanel.transform.GetChild(i + 3).GetChild(1).GetComponent<Text>().text = answers[i]; } } /* /// <summary> /// Makes logenze panel active and creating start animation /// </summary> /// <returns></returns> public IEnumerator LozengeShowAnswers() { //seting apropriate sprite at answer A and making text visible lozengePanel.transform.GetChild(3).GetComponent<Image>().sprite = lozengeSprites[0]; lozengePanel.transform.GetChild(3).GetChild(0).gameObject.SetActive(true); lozengePanel.transform.GetChild(3).GetChild(1).gameObject.SetActive(true); yield return new WaitForSeconds(1.5f); //seting apropriate sprite at answer B and making text visible lozengePanel.transform.GetChild(4).GetComponent<Image>().sprite = lozengeSprites[4]; lozengePanel.transform.GetChild(4).GetChild(0).gameObject.SetActive(true); lozengePanel.transform.GetChild(4).GetChild(1).gameObject.SetActive(true); yield return new WaitForSeconds(1.5f); //seting apropriate sprite at answer C and making text visible lozengePanel.transform.GetChild(5).GetComponent<Image>().sprite = lozengeSprites[0]; lozengePanel.transform.GetChild(5).GetChild(0).gameObject.SetActive(true); lozengePanel.transform.GetChild(5).GetChild(1).gameObject.SetActive(true); yield return new WaitForSeconds(1.5f); //seting apropriate sprite at answer D and making text visible lozengePanel.transform.GetChild(6).GetComponent<Image>().sprite = lozengeSprites[4]; lozengePanel.transform.GetChild(6).GetChild(0).gameObject.SetActive(true); lozengePanel.transform.GetChild(6).GetChild(1).gameObject.SetActive(true); } */ /// <summary> /// Highlights chosed answer at logenze panel /// </summary> /// <param name="answerNumber">number of chosed answer(from 1 to 4)</param> public void SetFinalAnswer(int answerNumber) { lozengePanel.GetComponent<Animator>().enabled = false; // animator doesn't allow to set buttons not interactable allAnswersAreDisplayed = false; if (answerNumber == 1 || answerNumber == 3) { lozengePanel.transform.GetChild(answerNumber + 2).GetComponent<Image>().sprite = lozengeSprites[2]; lozengePanel.transform.GetChild(answerNumber + 2).GetChild(0).GetComponent<Text>().color = new Color32(255, 255, 255, 255); lozengePanel.transform.GetChild(answerNumber + 2).GetChild(1).GetComponent<Text>().color = new Color32(0, 0, 0, 255); } else { lozengePanel.transform.GetChild(answerNumber + 2).GetComponent<Image>().sprite = lozengeSprites[6]; lozengePanel.transform.GetChild(answerNumber + 2).GetChild(0).GetComponent<Text>().color = new Color32(255, 255, 255, 255); lozengePanel.transform.GetChild(answerNumber + 2).GetChild(1).GetComponent<Text>().color = new Color32(0, 0, 0, 255); } //making each button not interactable for (int i = 0; i < 4; i++) { lozengePanel.transform.GetChild(i + 3).GetChild(2).GetComponent<Button>().interactable = false; } } /// <summary> /// Highlights chosed answer at logenze panel /// </summary> /// <param name="answerNumber">number of chosed answer(from 1 to 4)</param> public void HighLightAnswer(int answerNumber) { if (answerNumber == 1 || answerNumber == 3) { lozengePanel.transform.GetChild(answerNumber + 2).GetComponent<Image>().sprite = lozengeSprites[1]; lozengePanel.transform.GetChild(answerNumber + 2).GetChild(1).GetComponent<Text>().color = new Color32(255, 255, 255, 255); } else { lozengePanel.transform.GetChild(answerNumber + 2).GetComponent<Image>().sprite = lozengeSprites[5]; lozengePanel.transform.GetChild(answerNumber + 2).GetChild(1).GetComponent<Text>().color = new Color32(255, 255, 255, 255); } } /// <summary> /// Unhighlights chosed answer at logenze panel /// </summary> /// <param name="answerNumber">number of chosed answer(from 1 to 4)</param> public void UnhighLightAnswer(int answerNumber) { if (answerNumber == 1 || answerNumber == 3) { lozengePanel.transform.GetChild(answerNumber + 2).GetComponent<Image>().sprite = lozengeSprites[0]; lozengePanel.transform.GetChild(answerNumber + 2).GetChild(1).GetComponent<Text>().color = new Color32(255, 255, 255, 255); } else { lozengePanel.transform.GetChild(answerNumber + 2).GetComponent<Image>().sprite = lozengeSprites[4]; lozengePanel.transform.GetChild(answerNumber + 2).GetChild(1).GetComponent<Text>().color = new Color32(255, 255, 255, 255); } } /// <summary> /// Highlights correct answer when player chosed it /// </summary> /// <param name="numberOfCorrectAnswer">number of correct answer (from 1 to 4)</param> /// <param name="profit">money that player get</param> public IEnumerator CorrectAnswer(int numberOfCorrectAnswer, string profit) { int i = 0; while (i < 3) { //setting correct answer sprite and black color of text if (numberOfCorrectAnswer == 1 || numberOfCorrectAnswer == 3) { lozengePanel.transform.GetChild(numberOfCorrectAnswer + 2).GetComponent<Image>().sprite = lozengeSprites[3]; lozengePanel.transform.GetChild(numberOfCorrectAnswer + 2).GetChild(1).GetComponent<Text>().color = new Color32(0, 0, 0, 255); } else { lozengePanel.transform.GetChild(numberOfCorrectAnswer + 2).GetComponent<Image>().sprite = lozengeSprites[7]; lozengePanel.transform.GetChild(numberOfCorrectAnswer + 2).GetChild(1).GetComponent<Text>().color = new Color32(0, 0, 0, 255); } yield return new WaitForSeconds(0.2f); //setting final answer sprite and black color of text if (numberOfCorrectAnswer == 1 || numberOfCorrectAnswer == 3) { lozengePanel.transform.GetChild(numberOfCorrectAnswer + 2).GetComponent<Image>().sprite = lozengeSprites[2]; lozengePanel.transform.GetChild(numberOfCorrectAnswer + 2).GetChild(1).GetComponent<Text>().color = new Color32(255, 255, 255, 255); } else { lozengePanel.transform.GetChild(numberOfCorrectAnswer + 2).GetComponent<Image>().sprite = lozengeSprites[6]; lozengePanel.transform.GetChild(numberOfCorrectAnswer + 2).GetChild(1).GetComponent<Text>().color = new Color32(255, 255, 255, 255); } yield return new WaitForSeconds(0.2f); i++; } CloseLozengePanel(); StartCoroutine(ShowCurrentPrizePanel(profit, false)); } /// <summary> /// Highlights correct answer when player chosed wrong one /// </summary> /// <param name="numberOfCorrectAnswer">number of correct answer (from 1 to 4)</param> /// <returns></returns> public IEnumerator WrondAnswer(int numberOfCorrectAnswer, string totalWining) { int countdown = 9; while (countdown > 0) { if (numberOfCorrectAnswer == 1 || numberOfCorrectAnswer == 3) { lozengePanel.transform.GetChild(numberOfCorrectAnswer + 2).GetComponent<Image>().sprite = lozengeSprites[3]; lozengePanel.transform.GetChild(numberOfCorrectAnswer + 2).GetChild(0).GetComponent<Text>().color = new Color32(255, 255, 255, 255); lozengePanel.transform.GetChild(numberOfCorrectAnswer + 2).GetChild(1).GetComponent<Text>().color = new Color32(0, 0, 0, 255); } else { lozengePanel.transform.GetChild(numberOfCorrectAnswer + 2).GetComponent<Image>().sprite = lozengeSprites[7]; lozengePanel.transform.GetChild(numberOfCorrectAnswer + 2).GetChild(0).GetComponent<Text>().color = new Color32(255, 255, 255, 255); lozengePanel.transform.GetChild(numberOfCorrectAnswer + 2).GetChild(1).GetComponent<Text>().color = new Color32(0, 0, 0, 255); } countdown--; yield return new WaitForSeconds(0.2f); if (numberOfCorrectAnswer == 1 || numberOfCorrectAnswer == 3) { lozengePanel.transform.GetChild(numberOfCorrectAnswer + 2).GetComponent<Image>().sprite = lozengeSprites[0]; lozengePanel.transform.GetChild(numberOfCorrectAnswer + 2).GetChild(1).GetComponent<Text>().color = new Color32(255, 255, 255, 255); } else { lozengePanel.transform.GetChild(numberOfCorrectAnswer + 2).GetComponent<Image>().sprite = lozengeSprites[4]; lozengePanel.transform.GetChild(numberOfCorrectAnswer + 2).GetChild(1).GetComponent<Text>().color = new Color32(255, 255, 255, 255); } countdown--; yield return new WaitForSeconds(0.2f); } if (numberOfCorrectAnswer == 1 || numberOfCorrectAnswer == 3) { lozengePanel.transform.GetChild(numberOfCorrectAnswer + 2).GetComponent<Image>().sprite = lozengeSprites[3]; lozengePanel.transform.GetChild(numberOfCorrectAnswer + 2).GetChild(1).GetComponent<Text>().color = new Color32(0, 0, 0, 255); } else { lozengePanel.transform.GetChild(numberOfCorrectAnswer + 2).GetComponent<Image>().sprite = lozengeSprites[7]; lozengePanel.transform.GetChild(numberOfCorrectAnswer + 2).GetChild(1).GetComponent<Text>().color = new Color32(0, 0, 0, 255); } yield return new WaitForSeconds(1.5f); CloseLozengePanel(); StartCoroutine(ShowCurrentPrizePanel(totalWining, true)); } /// <summary> /// Closes logenze panel /// </summary> public void CloseLozengePanel() { lozengePanel.GetComponent<Animator>().enabled = true; allAnswersAreDisplayed = false; // making logenze panel invisible lozengePanel.SetActive(false); // making visible question text lozengePanel.transform.GetChild(2).GetChild(0).gameObject.SetActive(true); //seting apropriate sprite at answer A and making text invisible and white lozengePanel.transform.GetChild(3).GetComponent<Image>().sprite = lozengeSprites[0]; lozengePanel.transform.GetChild(3).GetChild(0).gameObject.SetActive(true); lozengePanel.transform.GetChild(3).GetChild(1).gameObject.SetActive(true); lozengePanel.transform.GetChild(3).GetChild(0).GetComponent<Text>().color = new Color32(246, 162, 0, 255); lozengePanel.transform.GetChild(3).GetChild(1).GetComponent<Text>().color = new Color32(255, 255, 255, 255); //seting apropriate sprite at answer B and making text invisible and white lozengePanel.transform.GetChild(4).GetComponent<Image>().sprite = lozengeSprites[4]; lozengePanel.transform.GetChild(4).GetChild(0).gameObject.SetActive(true); lozengePanel.transform.GetChild(4).GetChild(1).gameObject.SetActive(true); lozengePanel.transform.GetChild(4).GetChild(0).GetComponent<Text>().color = new Color32(246, 162, 0, 255); lozengePanel.transform.GetChild(4).GetChild(1).GetComponent<Text>().color = new Color32(255, 255, 255, 255); //seting apropriate sprite at answer C and making text invisible and white lozengePanel.transform.GetChild(5).GetComponent<Image>().sprite = lozengeSprites[0]; lozengePanel.transform.GetChild(5).GetChild(0).gameObject.SetActive(true); lozengePanel.transform.GetChild(5).GetChild(1).gameObject.SetActive(true); lozengePanel.transform.GetChild(5).GetChild(0).GetComponent<Text>().color = new Color32(246, 162, 0, 255); lozengePanel.transform.GetChild(5).GetChild(1).GetComponent<Text>().color = new Color32(255, 255, 255, 255); //seting apropriate sprite at answer D and making text invisible and white lozengePanel.transform.GetChild(6).GetComponent<Image>().sprite = lozengeSprites[4]; lozengePanel.transform.GetChild(6).GetChild(0).gameObject.SetActive(true); lozengePanel.transform.GetChild(6).GetChild(1).gameObject.SetActive(true); lozengePanel.transform.GetChild(6).GetChild(0).GetComponent<Text>().color = new Color32(246, 162, 0, 255); lozengePanel.transform.GetChild(6).GetChild(1).GetComponent<Text>().color = new Color32(255, 255, 255, 255); } /// <summary> /// Dispays current prize /// </summary> /// <param name="profit">money that player get</param> /// <returns></returns> public IEnumerator ShowCurrentPrizePanel(string profit, bool isGameOver) { currentPrizePanel.transform.GetChild(2).GetComponent<Text>().text = profit; // if we win million if (GameProcess.instance.state == State.MILLION_WON) { millionWinPanel.SetActive(true); LightAnimation.TurnOnBigCircle(); confetti.SetActive(true); yield return new WaitForSeconds(4f); millionWinPanel.SetActive(false); GameProcess.instance.state = State.GAME_IS_NOT_STARTED; GameProcess.instance.currentQuestionNumber = 0; PlayerControll.instance.StandUp(); } // if game over else if (isGameOver) { LightAnimation.TurnOnBigCircle(); currentPrizePanel.transform.GetChild(3).gameObject.SetActive(true); currentPrizePanel.transform.GetChild(0).gameObject.SetActive(true); currentPrizePanel.transform.GetChild(1).gameObject.GetComponent<Image>().sprite = totalPrizeSprite; currentPrizePanel.SetActive(true); yield return new WaitForSeconds(4f); currentPrizePanel.transform.GetChild(3).gameObject.SetActive(false); currentPrizePanel.transform.GetChild(0).gameObject.SetActive(false); currentPrizePanel.transform.GetChild(1).gameObject.GetComponent<Image>().sprite = currentPrizeSprite; currentPrizePanel.SetActive(false); PlayerControll.instance.StandUp(); } // if it's just correct answer else { currentPrizePanel.SetActive(true); yield return new WaitForSeconds(4f); currentPrizePanel.SetActive(false); StartCoroutine(ShowMoneyTreePanel()); } } /// <summary> /// Hides all diamonds (if they are active after previous game) /// </summary> public void ResetMoneyTreePanel() { for (int i = 3; i < 18; i++) { //hiding all diamonds moneyTreePanel.transform.GetChild(i).GetChild(2).gameObject.SetActive(false); if (GameManager.itIsUkrainianVersion) { moneyTreePanel.transform.GetChild(i).GetChild(1).GetComponent<Text>().text = GameFormat.moneyTreeUa[i - 3]; } else if (GameManager.itIsEnglishVersion) { moneyTreePanel.transform.GetChild(i).GetChild(1).GetComponent<Text>().text = GameFormat.moneyTreeUK[i - 3]; } } } /// <summary> /// Makes money tree panel active and creating start animation /// </summary> /// <returns></returns> public IEnumerator MoneyTreeStartAnimation() { moneyTreePanel.SetActive(true); yield return new WaitForSeconds(0.5f); //geting each question prize panel for (int i = 15; i > 0; i--) { //highlighting and changing text color to black moneyTreePanel.transform.GetChild(i + 2).GetChild(0).gameObject.SetActive(true); moneyTreePanel.transform.GetChild(i + 2).GetChild(1).GetComponent<Text>().color = new Color32(0, 0, 0, 255); yield return new WaitForSeconds(0.3f); //disablling highlight and turning text color back //if its not last(15) question then disable highlight if (i != 1) { moneyTreePanel.transform.GetChild(i + 2).GetChild(0).gameObject.SetActive(false); } //if its question number 5, 10 or 15 make them white if (i == 11 || i == 6 || i == 1) moneyTreePanel.transform.GetChild(i + 2).GetChild(1).GetComponent<Text>().color = new Color32(255, 255, 255, 255); //...else make them orange else moneyTreePanel.transform.GetChild(i + 2).GetChild(1).GetComponent<Text>().color = new Color32(246, 162, 0, 255); } //making last(15) question prize text white moneyTreePanel.transform.GetChild(3).GetChild(1).GetComponent<Text>().color = new Color32(255, 255, 255, 255); yield return new WaitForSeconds(0.5f); //making last(15) question prize panel normal moneyTreePanel.transform.GetChild(3).GetChild(0).gameObject.SetActive(false); moneyTreePanel.transform.GetChild(3).GetChild(1).GetComponent<Text>().color = new Color32(255, 255, 255, 255); //highlighting lifelines for (int i = 0; i < 3; i++) { StartCoroutine(HighlightLifeline(i + 1)); yield return new WaitForSeconds(0.5f); //starting coroutine that will unhighlight StartCoroutine(UnhighlightLifeline(i + 1)); } } /// <summary> /// Highlights lifeline at money tree panel /// </summary> /// <param name="lifelineNumber">number of lifeline which should be highlighted (from 1 to 3)</param> public IEnumerator HighlightLifeline(int lifelineNumber) { //child index of lifeline at MT panel is less by one than lifelineNumber lifelineNumber--; float currentScale = 1; byte currentTransparency = 0; //at begining is invizible (its last(4) value at RGB color of sprite) GameObject lifelineObject = moneyTreePanel.transform.GetChild(lifelineNumber).gameObject; //seting highlighted sprite lifelineObject.GetComponent<Image>().sprite = moneyTreeSprites[lifelineNumber * 3]; while (currentScale < 1.35f) { currentScale += 0.1f; float calculatedTransparency = ((currentScale * 255) / 1.35f);//grows proportionally to current scale //preventing value biger than 255 if (calculatedTransparency > 255) currentTransparency = 255; else currentTransparency = (byte)calculatedTransparency; lifelineObject.GetComponent<Image>().color = new Color32(255, 255, 255, currentTransparency); lifelineObject.transform.localScale = new Vector3(currentScale, currentScale, currentScale); yield return new WaitForSeconds(0.05f); } lifelineObject.GetComponent<Image>().color = new Color32(255, 255, 255, 255); lifelineObject.transform.localScale = new Vector3(1.35f, 1.35f, 1.35f); } /// <summary> /// Unhighlights lifeline at money tree panel /// </summary> /// <param name="lifelineNumber">number of lifeline which should be highlighted (from 1 to 3)</param> public IEnumerator UnhighlightLifeline(int lifelineNumber) { //child index of lifeline at MT panel is less by one than lifelineNumber lifelineNumber--; float currentScale = 1.35f; byte currentTransparency = 255; //at begining is vizible (its last(4) value at RGB color of sprite) GameObject lifelineObject = moneyTreePanel.transform.GetChild(lifelineNumber).gameObject; while (currentScale > 1) { currentScale -= 0.1f; currentTransparency = (byte)((currentScale * 200) / 1f);//grows proportionally to current scale lifelineObject.GetComponent<Image>().color = new Color32(255, 255, 255, currentTransparency); lifelineObject.transform.localScale = new Vector3(currentScale, currentScale, currentScale); yield return new WaitForSeconds(0.05f); } //seting normal sprite lifelineObject.GetComponent<Image>().sprite = moneyTreeSprites[lifelineNumber * 3 + 1]; lifelineObject.GetComponent<Image>().color = new Color32(255, 255, 255, 255); lifelineObject.transform.localScale = new Vector3(1f, 1f, 1f); } /// <summary> /// Males money tree panel active /// </summary> public IEnumerator ShowMoneyTreePanel() { //refreshing money tree panel HighlightQuestiontPrize(GameProcess.instance.currentQuestionNumber); moneyTreePanel.SetActive(true); if (GameProcess.instance.state == State.CORRECT_ANSWER) { yield return new WaitForSeconds(3f); StartCoroutine(CloseMoneyTreePanel()); } } /// <summary> /// Highlights question prize at money tree panel /// </summary> /// <param name="questionNumber">number of question which should be highlighted (from 1 to 15)</param> public void HighlightQuestiontPrize(int questionNumber) { //highlighting and changing text color to black moneyTreePanel.transform.GetChild(18 - questionNumber).GetChild(0).gameObject.SetActive(true); moneyTreePanel.transform.GetChild(18 - questionNumber).GetChild(1).GetComponent<Text>().color = new Color32(0, 0, 0, 255); moneyTreePanel.transform.GetChild(18 - questionNumber).GetChild(2).gameObject.SetActive(true); } /// <summary> /// Sets lifeline at money tree panel as unavaliable /// </summary> /// <param name="lifelineNumber"></param> public void SetUnavaliableLifeline(int lifelineNumber) { //child index of lifeline at MT panel is less by one than lifelineNumber lifelineNumber--; moneyTreePanel.transform.GetChild(lifelineNumber).GetComponent<Image>().sprite = moneyTreeSprites[lifelineNumber * 3 + 2]; moneyTreePanel.transform.GetChild(lifelineNumber).transform.localScale = new Vector3(1f, 1f, 1f); } /// <summary> /// Closes money tree panel and sets all question prizes not highlighted /// </summary> public IEnumerator CloseMoneyTreePanel() { moneyTreeAnimator.Play("MoneyTreeClose"); yield return new WaitForSeconds(1f); // geting each question prize panel for (int i = 15; i > 0; i--) { moneyTreePanel.transform.GetChild(i + 2).GetChild(0).gameObject.SetActive(false); if (i == 11 || i == 6 || i == 1) moneyTreePanel.transform.GetChild(i + 2).GetChild(1).GetComponent<Text>().color = new Color32(255, 255, 255, 255); else moneyTreePanel.transform.GetChild(i + 2).GetChild(1).GetComponent<Text>().color = new Color32(246, 162, 0, 255); } //making lifelines not highlighted for (int i = 0; i < 3; i++) { //if lifeline is currently highlighted if (moneyTreePanel.transform.GetChild(i).transform.localScale == new Vector3(1.35f, 1.35f, 1.35f)) { moneyTreePanel.transform.GetChild(i).transform.localScale = new Vector3(1f, 1f, 1f); moneyTreePanel.transform.GetChild(i).GetComponent<Image>().sprite = moneyTreeSprites[i * 3 + 1]; } } moneyTreePanel.SetActive(false); if (GameProcess.instance.state == State.CORRECT_ANSWER && GameProcess.instance.currentQuestionNumber < 5) { if (GameProcess.isPaused) { GameProcess.instance.continuePoint = GameProcess.instance.LoadQuestion; } else { GameProcess.instance.LoadQuestion(); } } } public void Lifeline5050() { if (allAnswersAreDisplayed) { Lifeline50x50 lifeline5050 = new Lifeline50x50(); int[] wrongAnswers = lifeline5050.Use(); lozengePanel.GetComponent<Animator>().enabled = false; //hiding wrong answer 1 lozengePanel.transform.GetChild(wrongAnswers[0] + 2).GetChild(0).GetComponent<Text>().color = new Color32(255, 255, 255, 0); lozengePanel.transform.GetChild(wrongAnswers[0] + 2).GetChild(1).GetComponent<Text>().color = new Color32(255, 255, 255, 0); lozengePanel.transform.GetChild(wrongAnswers[0] + 2).GetChild(2).gameObject.SetActive(false); //hiding wrong answer 2 lozengePanel.transform.GetChild(wrongAnswers[1] + 2).GetChild(0).GetComponent<Text>().color = new Color32(255, 255, 255, 0); lozengePanel.transform.GetChild(wrongAnswers[1] + 2).GetChild(1).GetComponent<Text>().color = new Color32(255, 255, 255, 0); lozengePanel.transform.GetChild(wrongAnswers[1] + 2).GetChild(2).gameObject.SetActive(false); GameProcess.instance.PlayLifeline5050Sound(); //making lifeline5050 button not interactable moneyTreePanel.transform.GetChild(0).GetComponent<Image>().sprite = moneyTreeSprites[2]; moneyTreePanel.transform.GetChild(0).GetComponent<Button>().interactable = false; } } public void LifelineAudiense() { if (allAnswersAreDisplayed) { GameProcess.instance.PlayLifelineAudienceMusic(); LifelineAudience lifelineAudience = new LifelineAudience(); int[] result = lifelineAudience.Use(); StartCoroutine(CloseMoneyTreePanel()); audiencePanel.SetActive(true); StartCoroutine(LifelineAudienceAnimaton(result)); Debug.Log("A: " + result[0] + " B: " + result[1] + " C: " + result[2] + " D: " + result[3]); //making lifelineAudience button not interactable moneyTreePanel.transform.GetChild(1).GetComponent<Image>().sprite = moneyTreeSprites[5]; moneyTreePanel.transform.GetChild(1).GetComponent<Button>().interactable = false; } } IEnumerator LifelineAudienceAnimaton(int[] result) { yield return new WaitForSeconds(32f); int percents = 0; Text ansAText = audiencePanel.transform.GetChild(3).GetComponent<Text>(); Text ansBText = audiencePanel.transform.GetChild(4).GetComponent<Text>(); Text ansCText = audiencePanel.transform.GetChild(5).GetComponent<Text>(); Text ansDText = audiencePanel.transform.GetChild(6).GetComponent<Text>(); Image ansA = audiencePanel.transform.GetChild(7).GetComponent<Image>(); Image ansB = audiencePanel.transform.GetChild(8).GetComponent<Image>(); Image ansC = audiencePanel.transform.GetChild(9).GetComponent<Image>(); Image ansD = audiencePanel.transform.GetChild(10).GetComponent<Image>(); ansA.fillAmount = 0; ansB.fillAmount = 0; ansC.fillAmount = 0; ansD.fillAmount = 0; while (percents <= 100) { if (percents <= result[0]) { ansAText.text = percents + "%"; ansA.fillAmount = (float)percents / 100f; } if (percents <= result[1]) { ansBText.text = percents + "%"; ansB.fillAmount = (float)percents / 100f; } if (percents <= result[2]) { ansCText.text = percents + "%"; ansC.fillAmount = (float)percents / 100f; } if (percents <= result[3]) { ansDText.text = percents + "%"; ansD.fillAmount = (float)percents / 100f; } percents++; yield return new WaitForSeconds(0.04f); } canCloseAudiencePanel = true; } public void LifelinePhone() { if (allAnswersAreDisplayed) { LifelinePhone lifelinePhone = new LifelinePhone(); lifelinePhone.Use(); } } public void AudiencePanelClose() { if (canCloseAudiencePanel) { audiencePanel.GetComponent<Animator>().SetBool("ClosePanel", true); DOVirtual.DelayedCall(1.5f, delegate { audiencePanel.SetActive(false); }); } } public void LifelinePhoneClose() { phonePanel.SetActive(false); } public void PauseGameUI() { Debug.Log("PauseGameUI"); SavePanelsStates(); } public void LoadGameUI() { Debug.Log("LoadGameUI"); LoadSavedPanelsStates(); } private void SavePanelsStates() { panelsStates[0] = startPanel.activeSelf; panelsStates[1] = chooseModePanel.activeSelf; panelsStates[2] = gamePanel.activeSelf; panelsStates[3] = settingsPanel.activeSelf; panelsStates[4] = chooseCharacterPanel.activeSelf; panelsStates[5] = pausePanel.activeSelf; panelsStates[6] = lozengePanel.activeSelf; panelsStates[7] = currentPrizePanel.activeSelf; panelsStates[8] = moneyTreePanel.activeSelf; panelsStates[9] = phonePanel.activeSelf; panelsStates[10] = audiencePanel.activeSelf; CloseAllPanels(); gamePanel.SetActive(true); } private void LoadSavedPanelsStates() { startPanel.SetActive(panelsStates[0]); chooseModePanel.SetActive(panelsStates[1]); gamePanel.SetActive(panelsStates[2]); settingsPanel.SetActive(panelsStates[3]); chooseCharacterPanel.SetActive(panelsStates[4]); pausePanel.SetActive(panelsStates[5]); lozengePanel.SetActive(panelsStates[6]); currentPrizePanel.SetActive(panelsStates[7]); moneyTreePanel.SetActive(panelsStates[8]); phonePanel.SetActive(panelsStates[9]); audiencePanel.SetActive(panelsStates[10]); } private void CloseAllPanels() { startPanel.SetActive(false); chooseModePanel.SetActive(false); gamePanel.SetActive(false); settingsPanel.SetActive(false); chooseCharacterPanel.SetActive(false); pausePanel.SetActive(false); lozengePanel.SetActive(false); currentPrizePanel.SetActive(false); moneyTreePanel.SetActive(false); phonePanel.SetActive(false); audiencePanel.SetActive(false); } }
gpl-2.0
adriweb/spasm-ng
CZ80AssemblerTest.cpp
6410
#include "stdafx.h" #include "spasm.h" #include "storage.h" #include "errors.h" #include "parser.h" #include "CTextStream.h" #include "CIncludeDirectoryCollection.h" #include "hash.h" #include "Module.h" class ATL_NO_VTABLE CZ80Assembler : public CComObjectRootEx<CComObjectThreadModel>, public CComCoClass<CZ80Assembler, &__uuidof(Z80Assembler)>, public IDispatchImpl<IZ80Assembler, &__uuidof(IZ80Assembler), &LIBID_SPASM, 1, 2> { public: DECLARE_REGISTRY_RESOURCEID(IDR_Z80ASSEMBLER) //DECLARE_CLASSFACTORY_SINGLETON(CZ80Assembler) BEGIN_COM_MAP(CZ80Assembler) COM_INTERFACE_ENTRY(IZ80Assembler) COM_INTERFACE_ENTRY(IDispatch) END_COM_MAP() HRESULT FinalConstruct() { HRESULT hr = m_dict.CreateInstance(__uuidof(Dictionary)); CComObject<CTextStream> *pObj = NULL; CComObject<CTextStream>::CreateInstance(&pObj); pObj->AddRef(); m_pStdOut = pObj; pObj->Release(); CComObject<CIncludeDirectoryCollection> *pDirObj = NULL; CComObject<CIncludeDirectoryCollection>::CreateInstance(&pDirObj); pDirObj->AddRef(); m_pDirectories = pDirObj; pDirObj->Release(); m_fFirstAssembly = TRUE; m_dwOptions = 0; AtlComModuleRevokeClassObjects(&_AtlComModule); return hr; } void FinalRelease() { if (!m_fFirstAssembly) { free_storage(); } } STDMETHOD(get_Defines)(IDictionary **ppDictionary) { return m_dict->QueryInterface(ppDictionary); } static void label_enum_callback(void *rawlabel, void *arg) { IDictionary *pDict = (IDictionary *) arg; label_t *label = (label_t *) rawlabel; CComVariant name(label->name); CComVariant value((unsigned int) label->value, VT_UI4); pDict->Add(&name, &value); } STDMETHOD(get_Labels)(IDictionary **ppLabels) { IDictionaryPtr labels(__uuidof(Dictionary)); if (label_table != NULL) { hash_enum(label_table, label_enum_callback, labels.GetInterfacePtr()); } return labels->QueryInterface(ppLabels); } STDMETHOD(get_StdOut)(ITextStream **ppStream) { return m_pStdOut->QueryInterface(ppStream); } STDMETHOD(get_InputFile)(LPBSTR lpbstrInputFile) { *lpbstrInputFile = SysAllocString(m_bstrInputFile); return S_OK; } STDMETHOD(put_InputFile)(BSTR bstrInputFile) { m_bstrInputFile = bstrInputFile; return S_OK; } STDMETHODIMP put_OutputFile(BSTR bstrOutputFile) { m_bstrOutputFile = bstrOutputFile; return S_OK; } STDMETHODIMP get_OutputFile(LPBSTR lpbstrOutputFile) { *lpbstrOutputFile = SysAllocString(m_bstrOutputFile); return S_OK; } STDMETHODIMP put_CurrentDirectory(BSTR bstrDirectory) { SetCurrentDirectory(_bstr_t(bstrDirectory)); return S_OK; } STDMETHODIMP get_CurrentDirectory(LPBSTR lpbstrDirectory) { TCHAR szBuffer[MAX_PATH]; GetCurrentDirectory(ARRAYSIZE(szBuffer), szBuffer); *lpbstrDirectory = SysAllocString(_bstr_t(szBuffer)); return S_OK; } STDMETHOD(get_Options)(LPDWORD lpdwOptions) { *lpdwOptions = m_dwOptions; return S_OK; } STDMETHOD(put_Options)(DWORD dwOptions) { m_dwOptions = dwOptions; return S_OK; } STDMETHOD(get_CaseSensitive)(VARIANT_BOOL *lpCaseSensitive) { *lpCaseSensitive = get_case_sensitive() ? VARIANT_TRUE : VARIANT_FALSE; return S_OK; } STDMETHOD(put_CaseSensitive)(VARIANT_BOOL caseSensitive) { set_case_sensitive(caseSensitive == VARIANT_TRUE ? TRUE : FALSE); return S_OK; } STDMETHOD(get_IncludeDirectories)(IIncludeDirectoryCollection **ppDirectories) { return m_pDirectories->QueryInterface(ppDirectories); } STDMETHOD(Assemble)(VARIANT varInput, IStream **ppOutput) { HGLOBAL hGlobal = GlobalAlloc(GMEM_MOVEABLE, output_buf_size); output_contents = (unsigned char *) GlobalLock(hGlobal); mode = m_dwOptions; if (V_VT(&varInput) == VT_BSTR) { mode |= MODE_NORMAL | MODE_COMMANDLINE; mode &= ~MODE_LIST; if (m_fFirstAssembly) { init_storage(); } CW2CT szInput(V_BSTR(&varInput)); input_contents = strdup(szInput); curr_input_file = strdup("COM Interface"); } else { mode &= ~MODE_COMMANDLINE; mode |= MODE_NORMAL; curr_input_file = strdup(m_bstrInputFile); output_filename = strdup(m_bstrOutputFile); if (!m_fFirstAssembly) { free_storage(); } init_storage(); } // Set up the include directories CComPtr<IUnknown> pEnumUnk; HRESULT hr = m_pDirectories->get__NewEnum(&pEnumUnk); CComQIPtr<IEnumVARIANT> pEnum = pEnumUnk; CComVariant varItem; ULONG ulFetched; while (pEnum->Next(1, &varItem, &ulFetched) == S_OK) { include_dirs = list_prepend(include_dirs, (char *) strdup(_bstr_t(V_BSTR(&varItem)))); } AddDefines(); int error = run_assembly(); list_free(include_dirs, true, NULL); include_dirs = NULL; ClearSPASMErrorSessions(); GlobalUnlock(hGlobal); CComPtr<IStream> pStream; hr = CreateStreamOnHGlobal(hGlobal, TRUE, &pStream); ULARGE_INTEGER ul; ul.QuadPart = out_ptr - output_contents; pStream->SetSize(ul); m_fFirstAssembly = FALSE; if (output_filename != NULL) { free(output_filename); output_filename = NULL; } if (curr_input_file) { free(curr_input_file); curr_input_file = NULL; } if (mode & MODE_COMMANDLINE) { free(input_contents); input_contents = NULL; } return pStream->QueryInterface(ppOutput); } STDMETHOD(Parse)(BSTR bstrInput, LPBSTR lpbstrOutput) { return E_NOTIMPL; } private: void AddDefines() { CComPtr<IUnknown> pEnumUnk; HRESULT hr = m_dict->_NewEnum(&pEnumUnk); CComQIPtr<IEnumVARIANT> pEnum = pEnumUnk; CComVariant varItem; ULONG ulFetched; while (pEnum->Next(1, &varItem, &ulFetched) == S_OK) { _bstr_t key = V_BSTR(&varItem); _variant_t varValue; m_dict->get_Item(&varItem, &varValue); _bstr_t val = varValue; bool redefined; define_t *define = add_define(strdup(key), &redefined); set_define(define, val, -1, redefined); } } BOOL m_fFirstAssembly; DWORD m_dwOptions; IDictionaryPtr m_dict; CComPtr<ITextStream> m_pStdOut; CComPtr<IIncludeDirectoryCollection> m_pDirectories; _bstr_t m_bstrInputFile; _bstr_t m_bstrOutputFile; }; OBJECT_ENTRY_AUTO(__uuidof(Z80Assembler), CZ80Assembler)
gpl-2.0
Hemisphere-Project/JDJ-Android
app/src/main/java/com/hmsphr/jdj/Activities/TextActivity.java
881
package com.hmsphr.jdj.Activities; import android.os.Bundle; import android.webkit.WebView; import android.widget.FrameLayout; import android.widget.TextView; import com.hmsphr.jdj.Class.MediaActivity; import com.hmsphr.jdj.Components.Players.TextPlayer; import com.hmsphr.jdj.Components.Players.WebPlayer; import com.hmsphr.jdj.R; public class TextActivity extends MediaActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.view_textview); // Configure WebView TextView txtArea = (TextView) findViewById(R.id.playerTEXT); txtArea.setTypeface(this.defaultFont); player = new TextPlayer(this, txtArea, (FrameLayout) findViewById(R.id.loadShutter)); // Transfer first intent onNewIntent(getIntent()); // // } }
gpl-2.0