function scanFile($directory) { $arr = array(); $mydir = dir($directory); while ($file = $mydir->read()) { if (in_array($file, array('phptemplate'))) { continue; } if (is_dir("{$directory}/{$file}") && $file != "." && $file != ".." && $file != "smarty" && $file != "Public" && $file != "project_tools" && $file != ".svn" && $file != 'Include') { $res = scanFile("{$directory}/{$file}"); $arr = array_merge($arr, $res); } else { if ($file != "." && $file != "..") { $file_path = $directory . "/" . $file; $file_info = pathinfo($file_path); if (isset($file_info['extension']) && $file_info['extension'] == 'php') { $classes = getClassName($file_path); foreach ($classes as $class) { $arr[$class] = $file_info['dirname'] . '/' . $file_info['basename']; } } } } } $mydir->close(); return $arr; }
/** * Returns snippet for Class of the current file * * @param string $filename returns file name * @param string $filepath returns file path * @return string snippet * @author Konstantin Kudryashov <*****@*****.**> */ function getSnippet() { $baseClass = sfBundle::getBaseClassForCurrentFile(); $packageName = getPackageName($baseClass); $snippet = sprintf(<<<SNIPPET /* * This file is part of the \$1. * (c) \${2:%s} \${3:\${TM_ORGANIZATION_NAME}} * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * \${4:%s} \${5:does things}. * * @package \${6:\$1} * @subpackage \${7:%s} * @author \$3 * @version \${8:1.0.0} */ class \$4%s { \$0 } SNIPPET , date('Y', time()), getClassName(TextMate::getEnv('filename'), TextMate::getEnv('filepath')), $packageName ? $packageName : 'custom', $baseClass ? sprintf(" extends \${9:%s}", $baseClass) : ''); return $snippet; }
/** * Construct an abstract element with the given options * Sets the url property to the current url for convenience * @param array $options Array of key => value options to use with this element */ public function __construct(array $options = array()) { // Set the name of this button $this->name = strtolower(substr(get_called_class(), strrpos(get_called_class(), '\\') + 1)); // Most buttons take a url, add it for convenience $options = array_merge(array('url' => getCurrentUrl()), $options); foreach ($options as $name => $value) { $this->{$name} = $value; } $this->templateDir = __DIR__ . '/../../../templates/' . strtolower(getClassName($this)); }
/** * 验证登录 */ public function login($params = array()) { $db = Yii::$app->db; // validate if (!$this->load($params) && !$this->validate()) { return false; } $model_name = getClassName(get_class($this)); $data = $params[$model_name]; if (!$data['captcha'] || $data['captcha'] != getSession('__captcha/login/captcha')) { //showMessage('验证码错误!'); return false; } $sql = 'select username from forum_account where username="******" and password = "******" limit 1'; $command = $db->createCommand($sql); $data = $command->queryOne(); if ($data) { setSession('username', $data['username']); return true; } else { return false; } }
function scanFile($directory) { $arr = array(); $mydir = dir($directory); while ($file = $mydir->read()) { if (is_dir("{$directory}/{$file}") && $file != "." && $file != ".." && $file != "smarty" && $file != "myinclude" && $file != ".svn") { $res = scanFile("{$directory}/{$file}"); $arr = array_merge($arr, $res); } else { if ($file != "." && $file != "..") { $file_path = $directory . "/" . $file; $file_info = pathinfo($file_path); if ($file_info['extension'] == 'php') { $classes = getClassName($file_path); foreach ($classes as $class) { $arr[$class] = $file_info['dirname'] . '/' . $file_info['basename']; } } } } } $mydir->close(); return $arr; }
if ($class->isTrait()) { $title = 'trait ' . $className; } else { if ($class->isInterface()) { $title = 'interface ' . $className; } else { $modifiers = Reflection::getModifierNames($class->getModifiers()); $title = trim(join(' ', $modifiers) . ' class ' . $className); $parentClass = $class->getParentClass(); if ($parentClass && !$parentClass->isInterface()) { $title .= ' extends ' . getClassName($parentClass->getName(), $ns); } $implements = $class->getInterfaceNames(); if (!empty($implements)) { $title .= ' implements ' . join(', ', array_map(function ($implement) use($ns) { return getClassName($implement, $ns); }, $implements)); } } } $line[] = $title . " {"; $constants = $class->getConstants(); foreach ($constants as $name => $value) { $line[] = "\t" . getConstantStr($name, $value); } $defaultProperties = $class->getDefaultProperties(); foreach ($class->getProperties(ReflectionProperty::IS_PUBLIC | ReflectionProperty::IS_PROTECTED) as $property) { if (!isInheritProperty($property, $parentClass)) { $line[] = "\t" . getPropertyStr($property, $defaultProperties); } }
public function renderTitle() { return getClassName(get_class($this)); }
<?php include_once "include/functions.php"; include_once "include/map_data.php"; // Нужно соединиться с базой (часть менюшек требует названий оттуда include_once "include/DbSimple/Generic.php"; $wDB = DbSimple_Generic::connect("mysql://{$config['wusername']}:{$config['wpassword']}@{$config['whostname']}/{$config['wdbName']}"); $wDB->query("SET NAMES ?s", $config['client_charset']); $menu = array(array('ico' => 'icon-news', 'name' => $lang['find'], 'show' => true, 'sub' => array(array('link' => 'index.php', 'text' => $lang['main']), array('link' => '?s=i', 'text' => $lang['item_lookup'], 'sub' => array(array('link' => '?s=i&class=0', 'text' => getClassName(0, 0), 'sub' => array(array('link' => '?s=i&class=0.0', 'text' => getSubclassName(0, 0, 0)), array('link' => '?s=i&class=0.1', 'text' => getSubclassName(0, 1, 0)), array('link' => '?s=i&class=0.2', 'text' => getSubclassName(0, 2, 0)), array('link' => '?s=i&class=0.3', 'text' => getSubclassName(0, 3, 0)), array('link' => '?s=i&class=0.4', 'text' => getSubclassName(0, 4, 0)), array('link' => '?s=i&class=0.5', 'text' => getSubclassName(0, 5, 0)), array('link' => '?s=i&class=0.6', 'text' => getSubclassName(0, 6, 0)), array('link' => '?s=i&class=0.7', 'text' => getSubclassName(0, 7, 0)), array('link' => '?s=i&class=0.8', 'text' => getSubclassName(0, 8, 0)))), array('link' => '?s=i&class=1', 'text' => getClassName(1, 0), 'sub' => array(array('link' => '?s=i&class=1.0', 'text' => getSubclassName(1, 0, 0)), array('link' => '?s=i&class=1.1', 'text' => getSubclassName(1, 1, 0)), array('link' => '?s=i&class=1.2', 'text' => getSubclassName(1, 2, 0)), array('link' => '?s=i&class=1.3', 'text' => getSubclassName(1, 3, 0)), array('link' => '?s=i&class=1.4', 'text' => getSubclassName(1, 4, 0)), array('link' => '?s=i&class=1.5', 'text' => getSubclassName(1, 5, 0)), array('link' => '?s=i&class=1.6', 'text' => getSubclassName(1, 6, 0)), array('link' => '?s=i&class=1.7', 'text' => getSubclassName(1, 7, 0)), array('link' => '?s=i&class=1.8', 'text' => getSubclassName(1, 8, 0)))), array('link' => '?s=i&class=2', 'text' => getClassName(2, 0), 'sub' => array(array('link' => '?s=i&class=2.0', 'text' => getSubclassName(2, 0, 0)), array('link' => '?s=i&class=2.1', 'text' => getSubclassName(2, 1, 0)), array('link' => '?s=i&class=2.2', 'text' => getSubclassName(2, 2, 0)), array('link' => '?s=i&class=2.3', 'text' => getSubclassName(2, 3, 0)), array('link' => '?s=i&class=2.4', 'text' => getSubclassName(2, 4, 0)), array('link' => '?s=i&class=2.5', 'text' => getSubclassName(2, 5, 0)), array('link' => '?s=i&class=2.6', 'text' => getSubclassName(2, 6, 0)), array('link' => '?s=i&class=2.7', 'text' => getSubclassName(2, 7, 0)), array('link' => '?s=i&class=2.8', 'text' => getSubclassName(2, 8, 0)), array('link' => '?s=i&class=2.9', 'text' => getSubclassName(2, 9, 0)), array('link' => '?s=i&class=2.10', 'text' => getSubclassName(2, 10, 0)), array('link' => '?s=i&class=2.11', 'text' => getSubclassName(2, 11, 0)), array('link' => '?s=i&class=2.12', 'text' => getSubclassName(2, 12, 0)), array('link' => '?s=i&class=2.13', 'text' => getSubclassName(2, 13, 0)), array('link' => '?s=i&class=2.14', 'text' => getSubclassName(2, 14, 0)), array('link' => '?s=i&class=2.15', 'text' => getSubclassName(2, 15, 0)), array('link' => '?s=i&class=2.16', 'text' => getSubclassName(2, 16, 0)), array('link' => '?s=i&class=2.17', 'text' => getSubclassName(2, 17, 0)), array('link' => '?s=i&class=2.18', 'text' => getSubclassName(2, 18, 0)), array('link' => '?s=i&class=2.19', 'text' => getSubclassName(2, 19, 0)), array('link' => '?s=i&class=2.20', 'text' => getSubclassName(2, 20, 0)))), array('link' => '?s=i&class=3', 'text' => getClassName(3, 0), 'sub' => array(array('link' => '?s=i&class=3.0', 'text' => getSubclassName(3, 0, 0)), array('link' => '?s=i&class=3.1', 'text' => getSubclassName(3, 1, 0)), array('link' => '?s=i&class=3.2', 'text' => getSubclassName(3, 2, 0)), array('link' => '?s=i&class=3.3', 'text' => getSubclassName(3, 3, 0)), array('link' => '?s=i&class=3.4', 'text' => getSubclassName(3, 4, 0)), array('link' => '?s=i&class=3.5', 'text' => getSubclassName(3, 5, 0)), array('link' => '?s=i&class=3.6', 'text' => getSubclassName(3, 6, 0)), array('link' => '?s=i&class=3.7', 'text' => getSubclassName(3, 7, 0)), array('link' => '?s=i&class=3.8', 'text' => getSubclassName(3, 8, 0)))), array('link' => '?s=i&class=4', 'text' => getClassName(4, 0), 'sub' => array(array('link' => '?s=i&class=4.0', 'text' => getSubclassName(4, 0, 0)), array('link' => '?s=i&class=4.1', 'text' => getSubclassName(4, 1, 0)), array('link' => '?s=i&class=4.2', 'text' => getSubclassName(4, 2, 0)), array('link' => '?s=i&class=4.3', 'text' => getSubclassName(4, 3, 0)), array('link' => '?s=i&class=4.4', 'text' => getSubclassName(4, 4, 0)), array('link' => '?s=i&class=4.5', 'text' => getSubclassName(4, 5, 0)), array('link' => '?s=i&class=4.6', 'text' => getSubclassName(4, 6, 0)), array('link' => '?s=i&class=4.7', 'text' => getSubclassName(4, 7, 0)), array('link' => '?s=i&class=4.8', 'text' => getSubclassName(4, 8, 0)), array('link' => '?s=i&class=4.9', 'text' => getSubclassName(4, 9, 0)), array('link' => '?s=i&class=4.10', 'text' => getSubclassName(4, 10, 0)))), array('link' => '?s=i&class=5', 'text' => getClassName(5, 0)), array('link' => '?s=i&class=6', 'text' => getClassName(6, 0), 'sub' => array(array('link' => '?s=i&class=6.2', 'text' => getSubclassName(6, 2, 0)), array('link' => '?s=i&class=6.3', 'text' => getSubclassName(6, 3, 0)))), array('link' => '?s=i&class=7', 'text' => getClassName(7, 0), 'sub' => array(array('link' => '?s=i&class=7.0', 'text' => getSubclassName(7, 0, 0)), array('link' => '?s=i&class=7.1', 'text' => getSubclassName(7, 1, 0)), array('link' => '?s=i&class=7.2', 'text' => getSubclassName(7, 2, 0)), array('link' => '?s=i&class=7.3', 'text' => getSubclassName(7, 3, 0)), array('link' => '?s=i&class=7.4', 'text' => getSubclassName(7, 4, 0)), array('link' => '?s=i&class=7.5', 'text' => getSubclassName(7, 5, 0)), array('link' => '?s=i&class=7.6', 'text' => getSubclassName(7, 6, 0)), array('link' => '?s=i&class=7.7', 'text' => getSubclassName(7, 7, 0)), array('link' => '?s=i&class=7.8', 'text' => getSubclassName(7, 8, 0)), array('link' => '?s=i&class=7.9', 'text' => getSubclassName(7, 9, 0)), array('link' => '?s=i&class=7.10', 'text' => getSubclassName(7, 10, 0)), array('link' => '?s=i&class=7.11', 'text' => getSubclassName(7, 11, 0)), array('link' => '?s=i&class=7.12', 'text' => getSubclassName(7, 12, 0)), array('link' => '?s=i&class=7.13', 'text' => getSubclassName(7, 13, 0)), array('link' => '?s=i&class=7.14', 'text' => getSubclassName(7, 14, 0)), array('link' => '?s=i&class=7.15', 'text' => getSubclassName(7, 15, 0)))), array('link' => '?s=i&class=9', 'text' => getClassName(9, 0), 'sub' => array(array('link' => '?s=i&class=9.0', 'text' => getSubclassName(9, 0, 0)), array('link' => '?s=i&class=9.1', 'text' => getSubclassName(9, 1, 0)), array('link' => '?s=i&class=9.2', 'text' => getSubclassName(9, 2, 0)), array('link' => '?s=i&class=9.3', 'text' => getSubclassName(9, 3, 0)), array('link' => '?s=i&class=9.4', 'text' => getSubclassName(9, 4, 0)), array('link' => '?s=i&class=9.5', 'text' => getSubclassName(9, 5, 0)), array('link' => '?s=i&class=9.6', 'text' => getSubclassName(9, 6, 0)), array('link' => '?s=i&class=9.7', 'text' => getSubclassName(9, 7, 0)), array('link' => '?s=i&class=9.8', 'text' => getSubclassName(9, 8, 0)), array('link' => '?s=i&class=9.9', 'text' => getSubclassName(9, 9, 0)), array('link' => '?s=i&class=9.10', 'text' => getSubclassName(9, 10, 0)))), array('link' => '?s=i&class=11', 'text' => getClassName(11, 0), 'sub' => array(array('link' => '?s=i&class=11.2', 'text' => getSubclassName(11, 2, 0)), array('link' => '?s=i&class=11.3', 'text' => getSubclassName(11, 3, 0)))), array('link' => '?s=i&class=12', 'text' => getClassName(12, 0)), array('link' => '?s=i&class=13', 'text' => getClassName(13, 0), 'sub' => array(array('link' => '?s=i&class=13.0', 'text' => getSubclassName(13, 0, 0)), array('link' => '?s=i&class=13.1', 'text' => getSubclassName(13, 1, 0)))), array('link' => '?s=i&class=15', 'text' => getClassName(15, 0), 'sub' => array(array('link' => '?s=i&class=15.0', 'text' => getSubclassName(15, 0, 0)), array('link' => '?s=i&class=15.1', 'text' => getSubclassName(15, 1, 0)), array('link' => '?s=i&class=15.2', 'text' => getSubclassName(15, 2, 0)), array('link' => '?s=i&class=15.3', 'text' => getSubclassName(15, 3, 0)), array('link' => '?s=i&class=15.4', 'text' => getSubclassName(15, 4, 0)), array('link' => '?s=i&class=15.5', 'text' => getSubclassName(15, 5, 0)))), array('link' => '?s=i&class=16', 'text' => getClassName(16, 0), 'sub' => array(array('link' => '?s=i&class=16.1', 'text' => getSubclassName(16, 1, 0)), array('link' => '?s=i&class=16.2', 'text' => getSubclassName(16, 2, 0)), array('link' => '?s=i&class=16.3', 'text' => getSubclassName(16, 3, 0)), array('link' => '?s=i&class=16.4', 'text' => getSubclassName(16, 4, 0)), array('link' => '?s=i&class=16.5', 'text' => getSubclassName(16, 5, 0)), array('link' => '?s=i&class=16.6', 'text' => getSubclassName(16, 6, 0)), array('link' => '?s=i&class=16.7', 'text' => getSubclassName(16, 7, 0)), array('link' => '?s=i&class=16.8', 'text' => getSubclassName(16, 8, 0)), array('link' => '?s=i&class=16.9', 'text' => getSubclassName(16, 9, 0)), array('link' => '?s=i&class=16.11', 'text' => getSubclassName(16, 11, 0)))))), array('link' => '?s=q', 'text' => $lang['quest_lookup']), array('link' => '?s=s', 'text' => $lang['spell_lookup']), array('link' => '?s=n', 'text' => $lang['creature_lookup'], 'sub' => array(array('text' => $lang['creature_by_type'], 'sub' => array(array('link' => '?s=n&type=1', 'text' => getCreatureType(1, 0)), array('link' => '?s=n&type=2', 'text' => getCreatureType(2, 0)), array('link' => '?s=n&type=3', 'text' => getCreatureType(3, 0)), array('link' => '?s=n&type=4', 'text' => getCreatureType(4, 0)), array('link' => '?s=n&type=5', 'text' => getCreatureType(5, 0)), array('link' => '?s=n&type=6', 'text' => getCreatureType(6, 0)), array('link' => '?s=n&type=7', 'text' => getCreatureType(7, 0)), array('link' => '?s=n&type=8', 'text' => getCreatureType(8, 0)), array('link' => '?s=n&type=9', 'text' => getCreatureType(9, 0)), array('link' => '?s=n&type=10', 'text' => getCreatureType(10, 0)), array('link' => '?s=n&type=11', 'text' => getCreatureType(11, 0)), array('link' => '?s=n&type=12', 'text' => getCreatureType(12, 0)), array('link' => '?s=n&type=13', 'text' => getCreatureType(13, 0)))), array('text' => $lang['creature_by_family'], 'sub' => array(array('link' => '?s=n&family=1', 'text' => getCreatureFamily(1, 0)), array('link' => '?s=n&family=2', 'text' => getCreatureFamily(2, 0)), array('link' => '?s=n&family=3', 'text' => getCreatureFamily(3, 0)), array('link' => '?s=n&family=4', 'text' => getCreatureFamily(4, 0)), array('link' => '?s=n&family=5', 'text' => getCreatureFamily(5, 0)), array('link' => '?s=n&family=6', 'text' => getCreatureFamily(6, 0)), array('link' => '?s=n&family=7', 'text' => getCreatureFamily(7, 0)), array('link' => '?s=n&family=8', 'text' => getCreatureFamily(8, 0)), array('link' => '?s=n&family=9', 'text' => getCreatureFamily(9, 0)), array('link' => '?s=n&family=11', 'text' => getCreatureFamily(11, 0)), array('link' => '?s=n&family=12', 'text' => getCreatureFamily(12, 0)), array('link' => '?s=n&family=15', 'text' => getCreatureFamily(15, 0)), array('link' => '?s=n&family=16', 'text' => getCreatureFamily(16, 0)), array('link' => '?s=n&family=17', 'text' => getCreatureFamily(17, 0)), array('link' => '?s=n&family=19', 'text' => getCreatureFamily(19, 0)), array('link' => '?s=n&family=20', 'text' => getCreatureFamily(20, 0)), array('link' => '?s=n&family=21', 'text' => getCreatureFamily(21, 0)), array('link' => '?s=n&family=23', 'text' => getCreatureFamily(23, 0)), array('link' => '?s=n&family=24', 'text' => getCreatureFamily(24, 0)), array('link' => '?s=n&family=25', 'text' => getCreatureFamily(25, 0)), array('link' => '?s=n&family=26', 'text' => getCreatureFamily(26, 0)), array('link' => '?s=n&family=27', 'text' => getCreatureFamily(27, 0)), array('link' => '?s=n&family=28', 'text' => getCreatureFamily(28, 0)), array('link' => '?s=n&family=29', 'text' => getCreatureFamily(29, 0)), array('link' => '?s=n&family=30', 'text' => getCreatureFamily(30, 0)), array('link' => '?s=n&family=31', 'text' => getCreatureFamily(31, 0)), array('link' => '?s=n&family=32', 'text' => getCreatureFamily(32, 0)), array('link' => '?s=n&family=33', 'text' => getCreatureFamily(33, 0)), array('link' => '?s=n&family=34', 'text' => getCreatureFamily(34, 0)), array('link' => '?s=n&family=35', 'text' => getCreatureFamily(35, 0)), array('link' => '?s=n&family=37', 'text' => getCreatureFamily(37, 0)), array('link' => '?s=n&family=38', 'text' => getCreatureFamily(38, 0)), array('link' => '?s=n&family=39', 'text' => getCreatureFamily(39, 0)), array('link' => '?s=n&family=40', 'text' => getCreatureFamily(40, 0)), array('link' => '?s=n&family=41', 'text' => getCreatureFamily(41, 0)), array('link' => '?s=n&family=42', 'text' => getCreatureFamily(42, 0)), array('link' => '?s=n&family=43', 'text' => getCreatureFamily(43, 0)), array('link' => '?s=n&family=44', 'text' => getCreatureFamily(44, 0)), array('link' => '?s=n&family=45', 'text' => getCreatureFamily(45, 0)), array('link' => '?s=n&family=46', 'text' => getCreatureFamily(46, 0)))), array('text' => $lang['creature_by_role'], 'sub' => array(array('link' => '?s=n&flag=4', 'text' => getCreatureFlagName(4, 0)), array('link' => '?s=n&flag=7', 'text' => getCreatureFlagName(7, 0)), array('link' => '?s=n&flag=13', 'text' => getCreatureFlagName(13, 0)), array('link' => '?s=n&flag=16', 'text' => getCreatureFlagName(16, 0)), array('link' => '?s=n&flag=17', 'text' => getCreatureFlagName(17, 0)), array('link' => '?s=n&flag=20', 'text' => getCreatureFlagName(20, 0)), array('link' => '?s=n&flag=21', 'text' => getCreatureFlagName(21, 0)), array('link' => '?s=n&flag=22', 'text' => getCreatureFlagName(22, 0)))))), array('link' => '?s=o', 'text' => $lang['object_lookup'], 'sub' => array(array('link' => '?s=o&name=&type=2', 'text' => getGameobjectType(2, 0)), array('link' => '?s=o&name=&type=3', 'text' => getGameobjectType(3, 0)), array('link' => '?s=o&name=&type=9', 'text' => getGameobjectType(9, 0)), array('link' => '?s=o&name=&type=25', 'text' => getGameobjectType(25, 0)))), array('link' => '?s=f', 'text' => $lang['faction_lookup']), array('link' => '?s=a', 'text' => $lang['area_lookup']), array('link' => '?s=set', 'text' => $lang['item_set']), array('link' => '?s=p', 'text' => $lang['player_lookup']), array('link' => '', 'text' => $lang['achievement'], 'sub' => array(array('link' => '?achievement&faction=1', 'text' => $lang['Alliance']), array('link' => '?achievement&faction=0', 'text' => $lang['Horde']))), array('link' => '?auction', 'text' => $lang['auction'], 'sub' => array(array('link' => '?auction=Alliance', 'text' => $lang['Alliance']), array('link' => '?auction=Horde', 'text' => $lang['Horde']), array('link' => '?auction=Blackwater', 'text' => $lang['Blackwater']))), array('link' => '?guild', 'text' => $lang['guild']), array('link' => '?location', 'text' => $lang['zone'], 'sub' => array(array('link' => '?location=a14', 'text' => getAreaNameFromId(14)), array('link' => '?location=a13', 'text' => getAreaNameFromId(13)), array('link' => '?location=a466', 'text' => getAreaNameFromId(466)), array('link' => '?location=a485', 'text' => getAreaNameFromId(485)))), array('link' => '?instance', 'text' => $lang['instance']), array('link' => '?talent', 'text' => $lang['talent_calc'], 'sub' => array(array('link' => '?talent=warrior', 'text' => getClass(1)), array('link' => '?talent=paladin', 'text' => getClass(2)), array('link' => '?talent=hunter', 'text' => getClass(3)), array('link' => '?talent=rogue', 'text' => getClass(4)), array('link' => '?talent=priest', 'text' => getClass(5)), array('link' => '?talent=death_knight', 'text' => getClass(6)), array('link' => '?talent=shaman', 'text' => getClass(7)), array('link' => '?talent=mage', 'text' => getClass(8)), array('link' => '?talent=warlock', 'text' => getClass(9)), array('link' => '?talent=druid', 'text' => getClass(11)))))), array('ico' => 'icon-community', 'name' => $lang['top_lookup'], 'show' => false, 'sub' => array(array('link' => '?top=money', 'text' => $lang['top_money']), array('link' => '?top=honor', 'text' => $lang['top_honor']), array('link' => '?top=arena2', 'text' => $lang['top_arena2']), array('link' => '?top=arena3', 'text' => $lang['top_arena3']), array('link' => '?top=arena5', 'text' => $lang['top_arena5']))), array('ico' => 'icon-interactive', 'name' => $lang['skills_main'], 'show' => false, 'sub' => array(array('text' => $lang['prof_primary'], 'sub' => array(array('link' => '?skill=Alchemy', 'text' => $lang['prof_alchemy']), array('link' => '?skill=Blacksmithing', 'text' => $lang['prof_blacksmith']), array('link' => '?skill=Enchanting', 'text' => $lang['prof_enchant']), array('link' => '?skill=Engineering', 'text' => $lang['prof_engineer']), array('link' => '?skill=Herbalism', 'text' => $lang['prof_herbalism']), array('link' => '?skill=Jewelcrafting', 'text' => $lang['prof_jevelcraft']), array('link' => '?skill=Leatherworking', 'text' => $lang['prof_leathwork']), array('link' => '?skill=Mining', 'text' => $lang['prof_mining']), array('link' => '?skill=Skinning', 'text' => $lang['prof_skinning']), array('link' => '?skill=Tailoring', 'text' => $lang['prof_taloring']), array('link' => '?skill=Inscription', 'text' => $lang['prof_inscription']))), array('text' => $lang['prof_secondary'], 'sub' => array(array('link' => '?skill=Cooking', 'text' => $lang['prof_cooking']), array('link' => '?skill=First Aid', 'text' => $lang['prof_first_aid']), array('link' => '?skill=Fishing', 'text' => $lang['prof_fishing']))), array('text' => $lang['class skills'], 'sub' => array(array('text' => getClass(1), 'sub' => array(array('link' => '?skill=26', 'text' => getSkillName(26, 0)), array('link' => '?skill=256', 'text' => getSkillName(256, 0)), array('link' => '?skill=257', 'text' => getSkillName(257, 0)))), array('text' => getClass(2), 'sub' => array(array('link' => '?skill=267', 'text' => getSkillName(267, 0)), array('link' => '?skill=184', 'text' => getSkillName(184, 0)), array('link' => '?skill=594', 'text' => getSkillName(594, 0)))), array('text' => getClass(3), 'sub' => array(array('link' => '?skill=50', 'text' => getSkillName(50, 0)), array('link' => '?skill=51', 'text' => getSkillName(51, 0)), array('link' => '?skill=163', 'text' => getSkillName(163, 0)), array('link' => '?skill=261', 'text' => getSkillName(261, 0)))), array('text' => getClass(4), 'sub' => array(array('link' => '?skill=253', 'text' => getSkillName(253, 0)), array('link' => '?skill=38', 'text' => getSkillName(38, 0)), array('link' => '?skill=39', 'text' => getSkillName(39, 0)), array('link' => '?skill=40', 'text' => getSkillName(40, 0)), array('link' => '?skill=633', 'text' => getSkillName(633, 0)))), array('text' => getClass(5), 'sub' => array(array('link' => '?skill=56', 'text' => getSkillName(56, 0)), array('link' => '?skill=78', 'text' => getSkillName(78, 0)), array('link' => '?skill=613', 'text' => getSkillName(613, 0)))), array('text' => getClass(6), 'sub' => array(array('link' => '?skill=770', 'text' => getSkillName(770, 0)), array('link' => '?skill=771', 'text' => getSkillName(771, 0)), array('link' => '?skill=772', 'text' => getSkillName(772, 0)))), array('text' => getClass(7), 'sub' => array(array('link' => '?skill=373', 'text' => getSkillName(373, 0)), array('link' => '?skill=375', 'text' => getSkillName(375, 0)), array('link' => '?skill=374', 'text' => getSkillName(374, 0)))), array('text' => getClass(8), 'sub' => array(array('link' => '?skill=237', 'text' => getSkillName(237, 0)), array('link' => '?skill=6', 'text' => getSkillName(6, 0)), array('link' => '?skill=8', 'text' => getSkillName(8, 0)))), array('text' => getClass(9), 'sub' => array(array('link' => '?skill=355', 'text' => getSkillName(355, 0)), array('link' => '?skill=354', 'text' => getSkillName(354, 0)), array('link' => '?skill=593', 'text' => getSkillName(593, 0)))), array('text' => getClass(11), 'sub' => array(array('link' => '?skill=134', 'text' => getSkillName(134, 0)), array('link' => '?skill=573', 'text' => getSkillName(573, 0)), array('link' => '?skill=574', 'text' => getSkillName(574, 0)))))))), array('ico' => 'icon-gameguide', 'name' => $lang['menu_faq'], 'show' => false, 'sub' => array(array('link' => '?faq=list', 'text' => $lang['faq_list']), array('link' => '?faq=classes', 'text' => $lang['faq_classes'], 'sub' => array(array('link' => '?faq=class-warrior', 'text' => getClass(1)), array('link' => '?faq=class-paladin', 'text' => getClass(2)), array('link' => '?faq=class-hunter', 'text' => getClass(3)), array('link' => '?faq=class-rogue', 'text' => getClass(4)), array('link' => '?faq=class-priest', 'text' => getClass(5)), array('link' => '?faq=class-death_knight', 'text' => getClass(6)), array('link' => '?faq=class-shaman', 'text' => getClass(7)), array('link' => '?faq=class-mage', 'text' => getClass(8)), array('link' => '?faq=class-warlock', 'text' => getClass(9)), array('link' => '?faq=class-druid', 'text' => getClass(11)))), array('text' => $lang['faq_races'], 'sub' => array(array('link' => '?faq=race-humans', 'text' => getRace(1)), array('link' => '?faq=race-orcs', 'text' => getRace(2)), array('link' => '?faq=race-dwarves', 'text' => getRace(3)), array('link' => '?faq=race-night_elves', 'text' => getRace(4)), array('link' => '?faq=race-undeads', 'text' => getRace(5)), array('link' => '?faq=race-taurens', 'text' => getRace(6)), array('link' => '?faq=race-gnomes', 'text' => getRace(7)), array('link' => '?faq=race-trolls', 'text' => getRace(8)), array('link' => '?faq=race-blood_elves', 'text' => getRace(10)), array('link' => '?faq=race-draenei', 'text' => getRace(11)))), array('link' => '?faq=professions', 'text' => $lang['faq_professions'], 'sub' => array(array('text' => $lang['prof_primary']), array('link' => '?faq=prof-alchemy', 'text' => $lang['prof_alchemy']), array('link' => '?faq=prof-blacksmithing', 'text' => $lang['prof_blacksmith']), array('link' => '?faq=prof-enchanting', 'text' => $lang['prof_enchant']), array('link' => '?faq=prof-engineering', 'text' => $lang['prof_engineer']), array('link' => '?faq=prof-herbalism', 'text' => $lang['prof_herbalism']), array('link' => '?faq=prof-jewelcrafting', 'text' => $lang['prof_jevelcraft']), array('link' => '?faq=prof-leatherworking', 'text' => $lang['prof_leathwork']), array('link' => '?faq=prof-mining', 'text' => $lang['prof_mining']), array('link' => '?faq=prof-skinning', 'text' => $lang['prof_skinning']), array('link' => '?faq=prof-tailoring', 'text' => $lang['prof_taloring']), array('link' => '?faq=prof-inscription', 'text' => $lang['prof_inscription']), array('text' => $lang['prof_secondary']), array('link' => '?faq=prof-cooking', 'text' => $lang['prof_cooking']), array('link' => '?faq=prof-first_aid', 'text' => $lang['prof_first_aid']), array('link' => '?faq=prof-fishing', 'text' => $lang['prof_fishing']))), array('link' => '?faq=slang', 'text' => $lang['faq_slang']), array('link' => '?faq=step1', 'text' => $lang['step_1']), array('link' => '?faq=aggro', 'text' => $lang['about_aggro']), array('link' => '?faq=city', 'text' => $lang['about_city']), array('link' => '?faq=guild', 'text' => $lang['about_guild']), array('link' => '?faq=socket', 'text' => $lang['about_socket']), array('link' => '?faq=macro', 'text' => $lang['about_macro']), array('link' => '?faq=raidhill', 'text' => $lang['about_raid_hill']))), array('ico' => 'icon-account', 'name' => $lang['menu_5'], 'show' => false, 'sub' => array(array('link' => '?register', 'text' => $lang['register']), array('link' => '?open_search', 'text' => $lang['open_search']))), array('ico' => 'icon-support', 'name' => $lang['menu_6'], 'show' => false, 'sub' => array(array('link' => '?stat', 'text' => $lang['statistic']), array('link' => 'map/index.html', 'text' => $lang['cartograph'], 'target' => '_blank'))));
} } } // layouts $classType = 'Block'; $layouts = $utilityFiles->getLayoutFiles([], false); foreach ($layouts as $file) { $xml = simplexml_load_file($file); $classes = \Magento\Framework\App\Utility\Classes::collectLayoutClasses($xml); $factoryNames = array_filter($classes, 'isFactoryName'); if (!$factoryNames) { continue; } foreach ($factoryNames as $factoryName) { list($module, $name) = getModuleName($factoryName, $compositeModules); $map[$classType][$factoryName] = getClassName($module, $classType, $name); } } echo Zend_Json::prettyPrint(Zend_Json::encode($map)); /** * Get combined array from similar files by pattern * * @param string $dirPath * @param string $filePattern * @return array */ function getFilesCombinedArray($dirPath, $filePattern) { $result = []; $directoryIterator = new DirectoryIterator($dirPath); $patternIterator = new RegexIterator($directoryIterator, $filePattern);
$tpl = file_get_contents(CLASS_TPL); while ($resultSet = DBCore::bindResults($stmt)) { $tableName = $resultSet['TABLE_NAMES']['Tables_in_' . conf\Config::getDBConfigParam('DBNAME')]; OutputStream::msg(OutputStream::MSG_INFO, "Reading structure for table '" . $tableName . "'..."); $idFieldName = 'id'; $fieldsListStr = ""; $fieldsList = DBCore::getTableFieldsList($tableName); if (!empty($fieldsList)) { foreach ($fieldsList as $field => $attributes) { if ($attributes['key'] === 'PRI') { $idFieldName = $field; } $fieldsListStr .= " " . DBCore::getPrintableFieldString($field, $attributes); } $fieldsListStr = substr($fieldsListStr, 0, strlen($fieldsListStr) - 1); $className = getClassName($tableName); $content = str_replace(array('{{CLASS_NAME}}', '{{TABLE_NAME}}', '{{PRIMARY_KEY}}', '{{FIELDS_LIST}}', '{{YEAR}}', '{{AUTHOR}}', '{{EMAIL}}'), array($className, $tableName, $idFieldName, $fieldsListStr, date("Y"), AUTHOR, EMAIL), $tpl); file_put_contents(RESULTS_PATH . $className . ".php", $content); OutputStream::msg(OutputStream::MSG_SUCCESS, "Class '" . RESULTS_PATH . $className . ".php' generated."); } else { OutputStream::msg(OutputStream::MSG_ERROR, "Can't read structure for table '" . $tableName . "'."); } } $stmt->close(); } else { OutputStream::msg(OutputStream::MSG_ERROR, "Can't read tables list."); } OutputStream::close(); function getClassName($tableName) { $underlinesReplaced = preg_replace_callback("/_([a-zA-Z]{1})/", function ($matches) {
function _moveFiles(&$man, &$input) { $result = new Moxiecode_ResultSet("status,fromfile,tofile,message"); $config = $man->getConfig(); if (!$man->isToolEnabled("rename", $config) && !$man->isToolEnabled("cut", $config)) { trigger_error("{#error.no_access}", FATAL); die; } for ($i = 0; isset($input["frompath" . $i]); $i++) { $fromFile =& $man->getFile($input["frompath" . $i]); $fromType = $fromFile->isFile() ? MC_IS_FILE : MC_IS_DIRECTORY; if (isset($input["toname" . $i])) { $toFile =& $man->getFile($fromFile->getParent(), $input["toname" . $i], $fromType); } else { if (isset($input["topath" . $i])) { $toFile =& $man->getFile($input["topath" . $i], "", $fromType); } else { $toFile =& $man->getFile($input["topath"], $fromFile->getName(), $fromType); } } // User tried to change extension if ($fromFile->isFile() && getFileExt($fromFile->getName()) != getFileExt($toFile->getName())) { $result->add("FAILED", $man->encryptPath($fromFile->getAbsolutePath()), $man->encryptPath($toFile->getAbsolutePath()), "{#error.move_failed}"); continue; } if (!$fromFile->exists()) { $result->add("FAILED", $man->encryptPath($fromFile->getAbsolutePath()), $man->encryptPath($toFile->getAbsolutePath()), "{#error.no_from_file}"); continue; } if ($toFile->exists()) { $result->add("FAILED", $man->encryptPath($fromFile->getAbsolutePath()), $man->encryptPath($toFile->getAbsolutePath()), "{#error.tofile_exists}"); continue; } $toConfig = $toFile->getConfig(); if (checkBool($toConfig['general.demo'])) { $result->add("FAILED", $man->encryptPath($fromFile->getAbsolutePath()), $man->encryptPath($toFile->getAbsolutePath()), "{#error.demo}"); continue; } if ($man->verifyFile($toFile, "rename") < 0) { $result->add("FAILED", $man->encryptPath($fromFile->getAbsolutePath()), $man->encryptPath($toFile->getAbsolutePath()), $man->getInvalidFileMsg()); continue; } if (!$toFile->canWrite()) { $result->add("FAILED", $man->encryptPath($fromFile->getAbsolutePath()), $man->encryptPath($toFile->getAbsolutePath()), "{#error.no_write_access}"); continue; } if (!checkBool($toConfig["filesystem.writable"])) { $result->add("FAILED", $man->encryptPath($fromFile->getAbsolutePath()), $man->encryptPath($toFile->getAbsolutePath()), "{#error.no_write_access}"); continue; } // Check if file can be zipped if (getClassName($toFile) == 'moxiecode_zipfileimpl') { if ($man->verifyFile($fromFile, "zip") < 0) { $result->add("FAILED", $man->encryptPath($fromFile->getAbsolutePath()), $man->encryptPath($toFile->getAbsolutePath()), $man->getInvalidFileMsg()); continue; } } // Check if file can be unzipped if (getClassName($fromFile) == 'moxiecode_zipfileimpl') { if ($man->verifyFile($toFile, "unzip") < 0) { $result->add("FAILED", $man->encryptPath($fromFile->getAbsolutePath()), $man->encryptPath($toFile->getAbsolutePath()), $man->getInvalidFileMsg()); continue; } } if ($fromFile->renameTo($toFile)) { $result->add("OK", $man->encryptPath($fromFile->getAbsolutePath()), $man->encryptPath($toFile->getAbsolutePath()), "{#message.move_success}"); } else { $result->add("FAILED", $man->encryptPath($fromFile->getAbsolutePath()), $man->encryptPath($toFile->getAbsolutePath()), "{#error.move_failed}"); } } return $result->toArray(); }
echo "you have to specify a directory: 'A', 'B', 'C' ...\n"; exit; } $indexFileName = "./index/{$class}/_result_{$class}.log"; $totalClass = getTotalClass($indexFileName); $curClass = 1; if (!file_exists($indexFileName)) { echo "file {$indexFileName} not exists \n"; exit; } $fp = fopen($indexFileName, "r"); while ($line = readLine($fp)) { if (strlen(trim($line)) == 0) { continue; } $className = getClassName($line); $code = getClassCode($line); if (!$code || !$className) { echo "{$className} code empty\n"; continue; } $indexURL = getIndexURL($code); //首页地址 $cookieURL = getCookieURL($code); //初始化cookie,防止被识破 $indexURL = cleanIndexURL($indexURL); //exit; if (!$className || !$indexURL || !$cookieURL) { echo "Usage: \$php main.php"; exit; }
/** * Renames/Moves this file to the specified file instance. * * @param File $dest File to rename/move to. * @return boolean true- success, false - failure */ function renameTo(&$dest) { // If move within the same zip if (getClassName($dest) == 'moxiecode_zipfileimpl' && $this->_zipPath == $dest->_zipPath) { $zip =& $this->_getZip(); $zip->open(); $zip->moveEntry($this->_innerPath, $dest->_innerPath); $zip->commit(); $zip->close(); } else { // Copy and delete $this->copyTo($dest); $this->delete(true); } return true; }
if (empty($className)) { $className = 'unknown'; } trigger_error('Object not found: ' . $objectid . ' (' . $className . ')', E_USER_ERROR); } else { $object = new smdoc_error($foowd, ERROR_TITLE); $foowd->template->assign_by_ref('objectList', $objects); $result = $foowd->method($object, 'bad_workspace'); $methodName = 'object_bad_workspace'; $className = 'smdoc_error'; } } } else { $foowd->debug('msg', 'fetch and call class method'); if (!isset($className)) { $className = getClassName($classid); } if (!isset($method)) { $method = $foowd->config_settings['site']['default_class_method']; } $result = $foowd->method($className, $method); $methodName = 'class_' . $method; } /* * Display results using appropriate template */ if ($result === TRUE) { $tplName = $foowd->getTemplateName($className, $methodName); $foowd->debug('msg', 'display result using template: ' . $tplName); $foowd->template->display($tplName); } else {
function createSpellDetails($spell) { global $lang; echo '<table class=details width=600><tbody>'; echo '<tr><td colspan=4 class=head>' . $lang['detail_info'] . '</td></tr>'; echo '<tr><th>Name</th><td colspan=2>' . $spell['SpellName'] . '</td><td align=right>' . $spell['Rank'] . '</td></tr>'; if ($spell['Description']) { echo '<tr><th width=60>Info:</th><td colspan=3>' . getSpellDesc($spell) . '</td></tr>'; } if ($spell['ToolTip']) { echo '<tr><th>Buff:</th><td colspan=3>' . getSpellBuff($spell) . '</td></tr>'; } // Стоимость и длительность $cost = getSpellCostText($spell); $duration = getSpellDurationText($spell); if ($cost or $duration) { echo '<tr><th>Cost</th><td>' . ($cost ? $cost : 'No Cost') . '</td><th>Duration</th><td>' . $duration . '</td></tr>'; } echo '<tr>'; echo '<th width=13%>Level</th>'; echo '<td width=37%>Base ' . $spell['baseLevel'] . ', Max ' . $spell['maxLevel'] . ', Spell ' . $spell['spellLevel'] . '</td>'; echo '<th width=20%>Range</th>'; echo '<td width=30%>' . getRangeText($spell['rangeIndex']) . '</td>'; echo '</tr>'; // Время квста и школа (выводятся всегда) echo '<tr><th>Cast time</th><td>' . getCastTimeText($spell) . '</td><th>School</th><td>' . getSpellSchool($spell['SchoolMask']) . '</td></tr>'; $skillAbility = getSkillLineAbility($spell['id']); if ($skillAbility or $spell['Category']) { echo '<tr>'; echo '<th>Skill</th>'; if ($skillAbility) { echo '<td>' . getSkillName($skillAbility['skillId']) . '</td>'; } else { echo '<td>n/a</td>'; } echo '<th>Category</th>'; if ($spell['Category']) { echo '<td>' . getCategoryName($spell['Category']) . '</td>'; } else { echo '<td>n/a</td>'; } echo '</tr>'; } // Вывод механики и диспелла if ($spell['Mechanic'] or $spell['Dispel']) { echo '<tr>'; echo '<th>Mechanic</th><td>' . getMechanicName($spell['Mechanic']) . '</td>'; echo '<th>Dispel type</th><td>' . getDispelName($spell['Dispel']) . '</td>'; echo '</tr>'; } // Вывод кулдаунов $cooldown = getSpellCooldown($spell); if ($cooldown or $spell['StartRecoveryCategory'] or $spell['StartRecoveryTime']) { echo '<tr>'; echo '<th>Cooldown</th>'; if ($cooldown) { echo '<td>' . getTimeText($cooldown / 1000) . '</td>'; } else { echo '<td>No cooldown</td>'; } echo '<th>Global cooldown</th>'; if ($spell['StartRecoveryCategory'] or $spell['StartRecoveryTime']) { echo '<td>'; echo 'Affected'; if ($spell['StartRecoveryTime']) { echo ', ' . getTimeText($spell['StartRecoveryTime'] / 1000); } else { echo ', Not start'; } echo '</td>'; } else { echo '<td>n/a</td>'; } echo '</tr>'; } // Вывод требований форм $stances = $spell['Stances']; $stancesNot = $spell['StancesNot']; if ($stances or $stancesNot) { echo '<tr>'; echo '<th>Req form</th>'; if ($stances) { echo '<td>' . getAllowableForm($stances) . '</td>'; } else { echo '<td>n/a</td>'; } echo '<th>Not in form</th>'; if ($stancesNot) { echo '<td>' . getAllowableForm($stancesNot) . '</td>'; } else { echo '<td>n/a</td>'; } echo '</tr>'; } // Вывод требований одетого снаряжения $itemClass = $spell['EquippedItemClass']; $itemSubClass = $spell['EquippedItemSubClassMask']; $inventoryTypeMask = $spell['EquippedItemInventoryTypeMask']; if ($itemClass >= 0 or $inventoryTypeMask) { echo '<tr>'; echo '<th>Req item</th>'; if ($itemClass >= 0) { echo '<td>'; if ($itemSubClass) { echo getClassName($itemClass, 0) . ': ' . getSubclassList($itemClass, $itemSubClass); } else { echo getClassName($itemClass); } echo '</td>'; } else { echo '<td>n/a</td>'; } echo '<th>Inv type</th>'; if ($inventoryTypeMask) { echo '<td>' . getInventoryTypeList($inventoryTypeMask) . '</td>'; } else { echo '<td>n/a</td>'; } echo '</tr>'; } // Вывод тотм категорий и спеллфокуса $totem1 = $spell['TotemCategory_1']; $totem2 = $spell['TotemCategory_2']; $focus = $spell['RequiresSpellFocus']; if ($totem1 or $totem2 or $focus) { echo '<tr>'; echo '<th>Tools</th>'; if ($totem1 or $totem2) { echo '<td>'; if ($totem1) { echo getTotemCategory($totem1); } if ($totem2) { echo ', ' . getTotemCategory($totem2); } echo '</td>'; } else { echo '<td>n/a</td>'; } echo '<th>Spell Focus</th>'; if ($focus) { echo '<td>' . getSpellFocusName($focus, 2) . '</td>'; } else { echo '<td>n/a</td>'; } echo '</tr>'; } $area = $spell['AreaGroupId']; if ($area) { echo '<tr>'; echo '<th>Area</th>'; if ($area) { echo '<td>' . $area . '</td>'; } else { echo '<td>n/a</td>'; } echo '</tr>'; } // Вывод требований целей $targets = $spell['Targets']; $targetCreature = $spell['TargetCreatureType']; if ($targets or $targetCreature) { echo '<tr>'; echo '<th>Targets</th>'; if ($targets) { echo '<td>' . getTargetsList($targets) . '</td>'; } else { echo '<td>n/a</td>'; } echo '<th>Creature type</th>'; if ($targetCreature) { echo '<td>' . getCreatureTypeList($targetCreature) . '</td>'; } else { echo '<td>n/a</td>'; } echo '</tr>'; } if ($spell['Reagent_1'] or $spell['Reagent_2'] or $spell['Reagent_3'] or $spell['Reagent_4'] or $spell['Reagent_5'] or $spell['Reagent_6'] or $spell['Reagent_7'] or $spell['Reagent_8']) { echo '<tr>'; echo '<th>Reagents</th>'; echo '<td colspan=3>'; r_spellReagents($spell); echo '</td>'; echo '</tr>'; } // Вывод эффектов showEffectData($spell, 1); showEffectData($spell, 2); showEffectData($spell, 3); echo '</tbody></table>'; }
echo getClassName($assistanceIdsFilter); ?> "> <strong><?php echo CHtml::encode(CvList::model()->getAttributeLabel('assistanceIds')); ?> </strong><br /> <input type="text" name="assistanceFilter" class="filter" size="10" /> <div class="div-overflow narrow"> <?php echo CHtml::checkBoxList('assistanceIds', $assistanceIdsFilter, CHtml::listData(AssistanceTypes::model()->findAll(array('order' => getOrder($assistanceIdsFilter) . 'name ASC')), 'id', 'name'), array('template' => '{beginLabel}{input} {labelTitle}{endLabel}', 'separator' => '')); ?> </div> </td> <td class="<?php echo getClassName($licensesIdsFilter); ?> "> <strong><?php echo CHtml::encode(CvList::model()->getAttributeLabel('driverLicensesIds')); ?> </strong><br /> <input type="text" name="licensesFilter" class="filter" size="10" /> <div class="div-overflow narrow"> <?php echo CHtml::checkBoxList('licensesIds', $licensesIdsFilter, CHtml::listData(DriverLicenses::model()->findAll(array('order' => getOrder($licensesIdsFilter) . 'name ASC')), 'id', 'name'), array('template' => '{beginLabel}{input} {labelTitle}{endLabel}', 'separator' => '')); ?> </div> </td> </tr> </table>
function getShortSubclassName($class, $subclass, $as_ref = 1) { global $itemClassSubclass; if ($subclass >= 0) { $names = explode(":", $itemClassSubclass["{$class}" . "." . "{$subclass}"]); $name = $names[0]; if ($as_ref) { return "<a href=\"?s=i&class={$class}.{$subclass}\">" . $name . "</a>"; } else { return $name; } } return getClassName($class, $as_ref); }
$indices = array($objid, 'classid', 'title', 'workspaceid', 'updated', 'permissions'); /* * standard doc information: additional indices, no special source table * where and orderby clauses from above, no limit (all), want only array, not * actual objects, and set the workspaceid based on full index or not (above). */ $objects =& $foowd->getObjList($indices, NULL, $where, $orderby, NULL, FALSE, $currentWorkspace); $list_objects = array(); $i = 0; if (count($objects) > 0) { foreach ($objects as $object) { if (!empty($object['permissions'])) { $object['permissions'] = unserialize($object['permissions']); } // If viewer does not have permission to view this kind of object, skip it if (!$foowd->hasPermission(getClassName($object['classid']), 'view', 'OBJECT', $object['permissions'])) { continue; } $list_objects[$i] = $object; $uri_arr['objectid'] = $object['objectid']; $uri_arr['classid'] = $object['classid']; $list_objects[$i]['url'] = getURI($uri_arr); if ($object['workspaceid'] != 0) { $list_objects[$i]['langid'] = smdoc_translation::getLink($foowd, $object['workspaceid']); } else { $list_objects[$i]['langid'] = ' '; } $list_objects[$i]['updated'] = date(DATETIME_FORMAT, strtotime($object['updated'])); $list_objects[$i]['desc'] = getClassDescription($object['classid']); $i++; }
echo '<tr><td colspan=6 class=top>'; echo '<table class=findtop><tr><td class=topleft> </td><td class=top>' . $lang['find_item'] . '</td><td class=topright> </td></tr></table>'; echo '</td></tr>'; echo '<tr><td>' . $lang['item_name'] . ':</td>'; echo '<td colSpan=5><input class=ls_search alt=i name="name" style="width: 100%;" value="' . $name . '"></td></tr>'; echo '<tr><td>' . $lang['item_class'] . ':</td><td colspan=5>'; echo '<select name="class" style="width: 100%;">\\n'; echo "\n<option value=''>" . getClassName(-1) . "</option>\n"; $key = array_keys($ItemClass_list); for ($i = 0; $i < count($ItemClass_list); $i++) { $text = ""; $value = $key[$i]; mergeStrByPoint($value, $s_class, $s_subclass); $style = ""; if ($s_subclass < 0) { $text = getClassName($s_class); $style = 'style = "FONT-WEIGHT: 800;"'; } else { $text = " * " . getSubclassName($s_class, $s_subclass); } if ($s_class == $class and $s_subclass == $subclass) { echo $style .= ' selected = "selected"'; } echo "<option {$style} value='{$value}'>{$text}</option>\n"; } echo '</select></td></tr>'; echo '<tr><td>' . $lang['item_min_level'] . ':</td>'; echo '<td><input name="level_min" value="' . $level_min . '" style="WIDTH: 30px"></td>'; echo '<td width=90>' . $lang['item_max_level'] . ':</td>'; echo '<td><input name="level_max" value="' . $level_max . '" style="WIDTH: 30px"></td>'; echo '<td>' . $lang['item_type'] . ':</td><td><select name="type">\\n';
/** * Copies this file to the specified file instance. * * @param File $dest File to copy to. * @return boolean true - success, false - failure */ function copyTo(&$dest) { $this->_clearCache(); if ($dest->exists()) { return false; } // Copy in to your self? if (strpos($dest->getAbsolutePath(), $this->getAbsolutePath()) === 0) { return false; } // Different file system then import if (getClassName($dest) != 'moxiecode_localfileimpl') { return $dest->importFile($this->getAbsolutePath()); } $dest->_clearCache(); if ($this->isDirectory()) { $handle_as_add_event = true; $treeHandler = new _LocalCopyDirTreeHandler($this->_manager, $this, $dest, $handle_as_add_event); $this->listTree($treeHandler); return true; } else { if ($this->_events) { $this->_manager->dispatchEvent("onBeforeFileAction", array(COPY_ACTION, &$this, &$dest)); } $status = $this->_absPath == $dest->_absPath || copy($this->_manager->toOSPath($this->_absPath), $this->_manager->toOSPath($dest->_absPath)); // Chmod the file if (($mask = $dest->_getConfigValue("filesystem.local.file_mask", false)) !== false) { @chmod($this->_manager->toOSPath($dest->_absPath), intval($mask, 8)); } // Chown the file if (($owner = $dest->_getConfigValue("filesystem.local.file_owner", false)) !== false) { $this->_chown($this->_manager->toOSPath($dest->_absPath), $owner); } if ($status && $this->_events) { $this->_manager->dispatchEvent("onFileAction", array(COPY_ACTION, &$this, &$dest)); } return $status; } }
echo getClassName($licensesIdsFilter); ?> "> <strong><?php echo CHtml::encode(CvList::model()->getAttributeLabel('driverLicensesIds')); ?> </strong><br /> <input type="text" name="licensesFilter" class="filter" size="10" /> <div class="div-overflow narrow"> <?php echo CHtml::checkBoxList('licensesIds', $licensesIdsFilter, CHtml::listData(DriverLicenses::model()->findAll(array('order' => getOrder($licensesIdsFilter) . 'name ASC')), 'id', 'name'), array('template' => '{beginLabel}{input} {labelTitle}{endLabel}', 'separator' => '')); ?> </div> </td> <td class="<?php echo getClassName($applicantTypeIdsFilter); ?> "> <strong><?php echo CHtml::encode(CvList::model()->getAttributeLabel('applicantTypeIds')); ?> </strong><br /> <input type="text" name="applicantTypesFilter" class="filter" size="10" /> <div class="div-overflow narrow"> <?php echo CHtml::checkBoxList('applicantTypeIds', $applicantTypeIdsFilter, CHtml::listData(CvApplicantTypes::model()->findAll(array('order' => getOrder($applicantTypeIdsFilter) . 'name ASC')), 'id', 'name'), array('template' => '{beginLabel}{input} {labelTitle}{endLabel}', 'separator' => '')); ?> </div> </td> </tr> </table>
function noBorderSpellTable($spell) { echo "<table class=spell><tbody>"; $name = $spell['SpellName']; if ($spell['Rank']) { echo "<tr><td class=Name>" . $name . "</td><td class=Rank align=right>" . $spell['Rank'] . "</td></tr>"; } else { echo "<tr><td class=Name colspan=2>" . $name . "</td></tr>"; } $cost = getSpellCostText($spell); if ($cost or $spell['rangeIndex'] > 1) { echo "<tr><td>"; if ($cost) { echo $cost . "</td><td align=right>"; } if ($spell['rangeIndex'] > 0 and $range = getRange($spell['rangeIndex']) and $range != 0) { echo $range . " yds range"; } echo "</td></tr>"; } // Заполняем поле времени каста $cast_time = ""; if (($spell['Attributes'] & 0x404) == 0x404) { $cast_time = "Next melee"; } else { if ($spell['AttributesEx'] & 0x44) { $cast_time = "Chanelled"; } else { $cast_time = getCastTimeText($spell); } } // Заполняем поле кулдауна $cooldown = getSpellCooldown($spell); if ($cooldown) { $cooldown = getTimeText($cooldown / 1000) . " cooldown"; } else { $cooldown = ""; } if ($cast_time or $cooldown) { echo "<tr><td>" . $cast_time . "</td><td align=right>" . $cooldown . "</td></tr>"; } // Тотем категория if ($spell['TotemCategory_1'] or $spell['TotemCategory_2']) { echo "<tr><td colspan=2 class=tool> Tools: "; if ($spell['TotemCategory_1']) { echo getTotemCategory($spell['TotemCategory_1']); } if ($spell['TotemCategory_2']) { echo ", " . getTotemCategory($spell['TotemCategory_2']); } echo "</td></tr>"; } $itemClass = $spell['EquippedItemClass']; // Требования мили или рангед оружия if ($spell['Attributes'] & 0x2) { echo "<tr><td colspan=2>Requires Ranged Weapon</td></tr>"; } else { if ($spell['Attributes'] & 0x4) { echo "<tr><td colspan=2>Requires Melee Weapon</td></tr>"; } else { if ($itemClass == 2) { echo "<tr><td colSpan=2 class=req>"; if ($itemSubClass = $spell['EquippedItemSubClassMask']) { echo getSubclassList($itemClass, $itemSubClass); } else { echo getClassName($itemClass); } echo "</td></tr>"; } } } $reqForm = getAllowableForm($spell['Stances'], 0); if ($reqForm) { echo "<tr><td colspan=2>Requires: " . $reqForm . "</td></tr>"; } $notreqForm = getAllowableForm($spell['StancesNot'], 0); if ($notreqForm) { echo "<tr><td class=SpellErr colspan=2>Not cast in: " . $notreqForm . "</td></tr>"; } echo "<tr><td colspan=2 class=SpellDesc><a href=\"?spell={$spell['id']}\">" . getSpellDesc($spell) . "</a></td></tr>"; echo "</tbody></table>"; }
/** * Creates an array with all test cases in a test file. * It uses reflection class and getMethods. * Problems: this method is slow. Also it returns an emtpy array if there are parsing errors. * * @param string test file path * @return array test cases found in file */ public static function getTestsWithReflection($file, $testCasePrefix = 'test') { global $config; $className = getClassName($file); // We will get the tests name with the reflection class. // But we should not require the reflected class because of memory limitations. // Instead will run a script that generates all test method names based on TEST_CASE_PREFIX. $script = 'require_once("' . $file . '"); $reflectionClass = new ReflectionClass("' . $className . '"); $methods = $reflectionClass->getMethods(); foreach($methods as $method) { echo $method->getName() . "\\n"; }'; $command = '/usr/bin/php -r \'' . $script . '\' | grep \'' . $testCasePrefix . '\''; $tests = shell_exec($command); return split("\n", trim($tests)); }
function _listDefault(&$man, $file, $input, &$result, $filter_root_path) { $config = $man->getConfig(); // If file doesn't exists use default path if (!$file->exists()) { $file = $man->getFile($config['filesystem.path']); $result->setHeader("path", $man->encryptPath($file->getAbsolutePath())); $result->setHeader("visual_path", checkBool($config['general.user_friendly_paths']) ? $man->toVisualPath($file->getAbsolutePath()) : $man->encryptPath($file->getAbsolutePath())); } // List files $config = $file->getConfig(); if ($file->isDirectory()) { // Setup file filter $fileFilter = new Moxiecode_BasicFileFilter(); //$fileFilter->setDebugMode(true); $fileFilter->setIncludeDirectoryPattern($config['filesystem.include_directory_pattern']); $fileFilter->setExcludeDirectoryPattern($config['filesystem.exclude_directory_pattern']); $fileFilter->setIncludeFilePattern($config['filesystem.include_file_pattern']); $fileFilter->setExcludeFilePattern($config['filesystem.exclude_file_pattern']); $fileFilter->setIncludeExtensions($config['filesystem.extensions']); if (isset($input["filter"]) && $input["filter"] != null) { $fileFilter->setIncludeWildcardPattern($input["filter"]); } if (isset($input["only_dirs"]) && checkBool($input["only_dirs"])) { $fileFilter->setOnlyDirs(true); } else { if (!checkBool($config["filesystem.list_directories"], true) || isset($input["only_files"]) && checkBool($input["only_files"])) { $fileFilter->setOnlyFiles(true); } } // List files $files =& $file->listFilesFiltered($fileFilter); $showparent = isset($input["no_parent"]) ? checkBool($input["no_parent"]) : true; $showparent = $showparent && $man->verifyPath($file->getParent()); if (!isset($input["only_dirs"])) { $showparent = $showparent && checkBool($config["filesystem.list_directories"], true); } // Add parent if ($showparent && !isset($input["only_files"])) { // Remove files below root if ($filter_root_path && getClassName($file) == 'moxiecode_localfileimpl') { if (!$man->isChildPath($filter_root_path, $file->getParent())) { return $files; } } if ($file->getAbsolutePath() != $filter_root_path) { $result->add("..", $man->encryptPath($file->getParent()), 0, "parent", "", "", "", array()); } } } else { trigger_error("Not a directory.", FATAL); } return $files; }
function renderItemData($item, $item_data = 0) { global $gBonding, $Quality, $UseorEquip, $game_text; $colorname = $item['Quality']; $bonding = $item['bonding']; $invtype = $item['InventoryType']; $class = $item['class']; $subclass = $item['subclass']; $speed = $item['delay'] / 1000.0; $ssd = 0; $level = 80; $creator = 0; $giftCreator = 0; $random_suffix = 0; $random_prop = 0; $char_data = 0; $stack_count = 1; if ($item_data) { if ($item['ScalingStatValue'] || $item['ScalingStatDistribution']) { $level = getCharacterLevel($item_data[ITEM_FIELD_OWNER]); } if (intval(-$item_data[ITEM_FIELD_RANDOM_PROPERTIES_ID]) > 0) { $random_suffix = getRandomSuffix(intval(-$item_data[ITEM_FIELD_RANDOM_PROPERTIES_ID])); } if (intval($item_data[ITEM_FIELD_RANDOM_PROPERTIES_ID]) > 0) { $random_prop = getRandomProperty(intval($item_data[ITEM_FIELD_RANDOM_PROPERTIES_ID])); } if ($item_data[ITEM_FIELD_CREATOR]) { $creator = getCharacterName($item_data[ITEM_FIELD_CREATOR]); } if ($item_data[ITEM_FIELD_GIFTCREATOR]) { $giftCreator = getCharacterName($item_data[ITEM_FIELD_GIFTCREATOR]); } if ($item_data[ITEM_FIELD_STACK_COUNT]) { $stack_count = $item_data[ITEM_FIELD_STACK_COUNT]; } if ($random_suffix) { $item['name'] = $item['name'] . ' ' . $random_suffix['name']; } else { if ($random_prop) { $item['name'] = $item['name'] . ' ' . $random_prop['name']; } } if ($item_data[ITEM_FIELD_FLAGS] & ITEM_FLAGS_BINDED) { $bonding = -1; } } if ($item['ScalingStatDistribution'] && ($ssd = getScalingStatDistribution($item['ScalingStatDistribution']))) { if ($ssd['maxlevel'] && $level > $ssd['maxlevel']) { $level = $ssd['maxlevel']; } $mask = $item['ScalingStatValue']; $ssv = getScalingStatValues($level); $stat_multi = 0; // Stat multiplier if ($mask & 0x1f) { if ($mask & 1 << 0) { $stat_multi = $ssv['multiplier_1']; } if ($mask & 1 << 1) { $stat_multi = $ssv['multiplier_2']; } if ($mask & 1 << 2) { $stat_multi = $ssv['multiplier_3']; } if ($mask & 1 << 3) { $stat_multi = $ssv['multiplier_4']; } if ($mask & 1 << 4) { $stat_multi = $ssv['multiplier_5']; } } // Armor mod if ($mask & 0x1e0) { if ($mask & 1 << 5) { $item['armor'] = $ssv['multiplier_6']; } if ($mask & 1 << 6) { $item['armor'] = $ssv['multiplier_7']; } if ($mask & 1 << 7) { $item['armor'] = $ssv['multiplier_8']; } if ($mask & 1 << 8) { $item['armor'] = $ssv['multiplier_9']; } } // DPS mod (min = 70% from averange max = 130%) if ($mask & 0x7e00) { if ($mask & 1 << 9) { $dps = $ssv['multiplier_10']; } if ($mask & 1 << 10) { $dps = $ssv['multiplier_11']; } if ($mask & 1 << 11) { $dps = $ssv['multiplier_12']; } if ($mask & 1 << 12) { $dps = $ssv['multiplier_13']; } if ($mask & 1 << 13) { $dps = $ssv['multiplier_14']; } if ($mask & 1 << 14) { $dps = $ssv['multiplier_15']; } $averange = $speed * $dps; $item['dmg_min1'] = floor(0.7 * $averange); $item['dmg_max1'] = floor(1.3 * $averange); } // if ($mask & 0x08000) // spell power // ???=$ssv['multiplier_16']; // if ($mask & 0x10000) // feral AP // ???=$ssv['multiplier_17']; } // Вывод имени echo '<tr><td class=name><SPAN class=' . $Quality[$colorname] . '>' . $item['name'] . '</SPAN></td></tr>'; // Heroic item (green) if ($item['Flags'] & ITEM_FLAGS_HEROIC) { echo '<tr><td class=SpellStat>' . $game_text['item_heroic'] . '</td></tr>'; } if ($item['area']) { echo '<tr><td>' . getAreaName($item['area']) . '</td></tr>'; } if ($item['Map']) { echo '<tr><td>' . getMapName($item['Map']) . '</td></tr>'; } if ($item['Flags'] & ITEM_FLAGS_CONJURED) { echo '<tr><td>' . $game_text['conjured_item'] . '</td></tr>'; } // Вывод привязки вещи if ($bonding) { echo '<tr><td>' . $gBonding[$bonding] . '</td></tr>'; } // Вывод того что вещь содержит чтото if ($item['Flags'] & ITEM_FLAGS_OPENABLE) { echo '<tr><td class=SpellStat>' . $game_text['right_click'] . '</td></tr>'; } // <Right Click to Read> // Вывод уникальности вещи if ($item['maxcount'] == 1) { echo '<tr><td class=Unique>' . $game_text['unique'] . '</td></tr>'; } if ($item['maxcount'] > 1) { echo '<tr><td class=Unique>' . $game_text['unique'] . '(' . $item['maxcount'] . ')</td></tr>'; } $className = getClassName($class, 0); $subClassName = getShortSubclassName($class, $subclass, 0); // Зависимые от класса вещи параметры switch ($class) { // case 0:// Consumable // break; case 1: // Container echo "<tr><td>" . sprintf($game_text['slot'], $item['ContainerSlots'], $subClassName) . "</td></tr>"; break; case 2: // Weapon echo '<tr><td>' . '<div class=right>' . $subClassName . '</div>' . getInventoryType($invtype, 0) . '</td></tr>'; break; //case 3:// Gem //break; //case 3:// Gem //break; case 4: // Armor if ($invtype == 14) { $invtype = 22; } $sub = ''; if ($invtype != 16 && $subclass > 0) { $sub = '<div class=right>' . $subClassName . '</div>'; } echo '<tr><td>' . $sub . getInventoryType($invtype, 0) . '</td></tr>'; break; // case 5:// Reagent // break; // case 5:// Reagent // break; case 6: // Projectile echo '<tr><td><div class=right>' . $subClassName . '</div>' . $className . '</td></tr>'; $dps = ($item['dmg_min1'] + $item['dmg_max1']) / 2; echo '<tr><td>' . sprintf($game_text['ammo_dps'], $dps) . '</td></tr>'; break; // case 7:// Trade Goods // break; // case 8:// Generic // break; // case 9:// Recipe // break; // case 10:// Money // break; // case 7:// Trade Goods // break; // case 8:// Generic // break; // case 9:// Recipe // break; // case 10:// Money // break; case 11: //Quiver echo '<tr><td>' . sprintf($game_text['slot'], $item['ContainerSlots'], $subClassName) . '</td></tr>'; break; // case 12: //Quest // break; // case 13: //Key // break; // case 14: //Permanent // break; // case 15: //Misc // break; // case 12: //Quest // break; // case 13: //Key // break; // case 14: //Permanent // break; // case 15: //Misc // break; default: break; } // Вывод урона наносимого оружием но не боеприпасами if ($item['dmg_min1'] > 0 and $class != 6) { if ($speed == 0) { $speed = 1; } $dps = ($item['dmg_min1'] + $item['dmg_max1']) / (2 * $speed); $sub = '<div class=right>' . sprintf($game_text['weapon_speed'], $speed) . '</div>'; echo '<tr><td>' . $sub . sprintf($game_text['weapon_damage'], $item['dmg_min1'], $item['dmg_max1']) . '</td></tr>'; if ($class == 2) { echo '<tr><td>' . sprintf($game_text['weapon_dps'], $dps) . '</td></tr>'; } } // вывод брони if ($item['armor']) { echo '<tr><td>' . sprintf($game_text['iarmor'], $item['armor']) . '</td></tr>'; } // вывод блока if ($item['block']) { echo '<tr><td>' . sprintf($game_text['iblock'], $item['block']) . '</td></tr>'; } // Вывод статов на силу, ловкость, стамину, интелект, стамину if ($ssd) { for ($i = 1; $i <= 10; $i++) { renderPrimalStat($ssd['statmod_' . $i], $stat_multi * $ssd['modifier_' . $i] / 10000); } } else { for ($i = 1; $i <= $item['StatsCount']; $i++) { renderPrimalStat($item['stat_type' . $i], $item['stat_value' . $i]); } } // Вывод резистов if ($item['holy_res']) { echo "<tr><td>" . getResistanceText(1, $item['holy_res']) . "</td></tr>"; } if ($item['fire_res']) { echo "<tr><td>" . getResistanceText(2, $item['fire_res']) . "</td></tr>"; } if ($item['nature_res']) { echo "<tr><td>" . getResistanceText(3, $item['nature_res']) . "</td></tr>"; } if ($item['frost_res']) { echo "<tr><td>" . getResistanceText(4, $item['frost_res']) . "</td></tr>"; } if ($item['shadow_res']) { echo "<tr><td>" . getResistanceText(5, $item['shadow_res']) . "</td></tr>"; } if ($item['arcane_res']) { echo "<tr><td>" . getResistanceText(6, $item['arcane_res']) . "</td></tr>"; } // Описание камней if ($item['GemProperties']) { $GemProperties = getGemProperties($item['GemProperties']); echo "<tr><td class=SpellStat>{$GemProperties}</td></tr>"; } // Вывод сокетов if ($item_data) { renderSocketed($item['socketColor_1'], $item_data[SOCK_ENCHANTMENT_SLOT]); renderSocketed($item['socketColor_2'], $item_data[SOCK_ENCHANTMENT_SLOT_2]); renderSocketed($item['socketColor_3'], $item_data[SOCK_ENCHANTMENT_SLOT_3]); } else { renderSocket($item['socketColor_1']); renderSocket($item['socketColor_2']); renderSocket($item['socketColor_3']); } // Вывод бонуса сокетов (если есть доп инфо выводим данные из нее) if ($item_data) { // Вывод активного бонуса if ($item_data[BONUS_ENCHANTMENT_SLOT]) { echo '<tr><td class=SpellStat>' . sprintf($game_text['socket_bonus'], getEnchantmentDesc($item_data[BONUS_ENCHANTMENT_SLOT])) . '</td></tr>'; } else { if ($item['socketBonus']) { echo '<tr><td class=disBonus>' . sprintf($game_text['socket_bonus'], getEnchantmentDesc($item['socketBonus'])) . '</td></tr>'; } } } else { if ($item['socketBonus']) { echo '<tr><td class=SpellStat>' . sprintf($game_text['socket_bonus'], getEnchantmentDesc($item['socketBonus'])) . '</td></tr>'; } } // Вывод энчантов вещи if ($item_data) { renderEnchant($item_data, PERM_ENCHANTMENT_SLOT, $random_suffix); renderEnchant($item_data, TEMP_ENCHANTMENT_SLOT, $random_suffix); renderEnchant($item_data, WOTLK_ENCHANTMENT_SLOT, $random_suffix); renderEnchant($item_data, PROP_ENCHANTMENT_SLOT_0, $random_suffix); renderEnchant($item_data, PROP_ENCHANTMENT_SLOT_1, $random_suffix); renderEnchant($item_data, PROP_ENCHANTMENT_SLOT_2, $random_suffix); renderEnchant($item_data, PROP_ENCHANTMENT_SLOT_3, $random_suffix); renderEnchant($item_data, PROP_ENCHANTMENT_SLOT_4, $random_suffix); } else { if ($item['RandomProperty'] or $item['RandomSuffix']) { echo '<tr><td class=SpellStat>' . $game_text['random_enchant'] . '</td></tr>'; } } // Вывод крепкости if ($item_data && $item_data[ITEM_FIELD_MAXDURABILITY] > 0) { echo '<tr><td>' . sprintf($game_text['durability'], $item_data[ITEM_FIELD_DURABILITY], $item_data[ITEM_FIELD_MAXDURABILITY]) . '</td></tr>'; } else { if ($item['MaxDurability'] > 0) { echo '<tr><td>' . sprintf($game_text['durability'], $item['MaxDurability'], $item['MaxDurability']) . '</td></tr>'; } } // Вывод требования расы if ($text = getAllowableRace($item['AllowableRace'])) { echo '<tr><td>' . $game_text['allowable_race'] . ' ' . $text . '</td></tr>'; } // Вывод требований классов if ($text = getAllowableClass($item['AllowableClass'])) { echo '<tr><td>' . $game_text['allowable_class'] . ' ' . $text . '</td></tr>'; } // Вывод времени продолжительности if ($item['Duration']) { if ($item['ExtraFlags'] & 2) { echo '<tr><td>' . sprintf($game_text['idurationr'], getTimeText($item['Duration'])) . '</td></tr>'; } else { echo '<tr><td>' . sprintf($game_text['iduration'], getTimeText($item['Duration'])) . '</td></tr>'; } } // Вывод требования уровня if ($item['RequiredLevel'] > 1) { echo '<tr><td class=req>' . sprintf($game_text['req_level'], $item['RequiredLevel']) . '</td></tr>'; } // Уровень предмета if ($item['ItemLevel']) { echo '<tr><td>' . sprintf($game_text['ilevel'], $item['ItemLevel']) . '</td></tr>'; } // Вывод prospectable если надо 0x40000 if ($item['Flags'] & ITEM_FLAGS_PROSPECTABLE) { echo '<tr><td>' . $game_text['prospectable'] . '</td></tr>'; } // Вывод Millable если надо 0x20000000 if ($item['Flags'] & ITEM_FLAGS_MILLABLE) { echo '<tr><td>' . $game_text['millable'] . '</td></tr>'; } // Вывод требования скила if ($item['RequiredSkill']) { echo '<tr><td class=req>' . sprintf($game_text['req_skill'], getSkillName($item['RequiredSkill']), $item['RequiredSkillRank']) . '</td></tr>'; } // Требование знать спелл if ($item['requiredspell']) { echo '<tr><td class=req>' . $game_text['req_spell'] . ' ' . getSpellName(getSpell($item['requiredspell'])) . '</td></tr>'; } // Требования арена рейтинга "Requires personal arena rating of %d"; -- %d is the rating number required // $item['RequiredCityRank'] ?? // PVP_MEDAL1 = "Protector of Stormwind"; // PVP_MEDAL2 = "Overlord of Orgrimmar"; // PVP_MEDAL3 = "Thane of Ironforge"; // PVP_MEDAL4 = "High Sentinel of Darnassus"; // PVP_MEDAL5 = "Deathlord of the Undercity"; // PVP_MEDAL6 = "Chieftain of Thunderbluff"; // PVP_MEDAL7 = "Avenger of Gnomeregan"; // PVP_MEDAL8 = "Voodoo Boss of Sen'jin"; // Требования репутации -- Required faction reputation to use the item if ($item['RequiredReputationFaction']) { $faction = getFactionName($item['RequiredReputationFaction']); $rank = getReputationRankName($item['RequiredReputationRank']); echo '<tr><td class=faction>' . sprintf($game_text['req_reputation'], $faction, $rank) . '</td></tr>'; } if ($ssd) { echo '<tr><td>' . sprintf($game_text['ssd_req_level'], $ssd['maxlevel'], $level) . '</td></tr>'; } // Вывод статов на силу, ловкость, стамину, интелект, стамину if ($ssd) { for ($i = 1; $i <= 10; $i++) { renderSpellStat($ssd['statmod_' . $i], $stat_multi * $ssd['modifier_' . $i] / 10000); } } else { for ($i = 1; $i <= $item['StatsCount']; $i++) { renderSpellStat($item['stat_type' . $i], $item['stat_value' . $i]); } } if ($item['spellid_1'] != 483 and $item['spellid_1'] != 55884) { renderSpell($item['spellid_1'], $item['spelltrigger_1'], $item_data ? $item_data[ITEM_FIELD_SPELL_CHARGES + 0] : $item['spellcharges_1'], $item['spellcooldown_1'], $item['spellcategory_1'], $item['spellcategorycooldown_1']); renderSpell($item['spellid_2'], $item['spelltrigger_2'], $item_data ? $item_data[ITEM_FIELD_SPELL_CHARGES + 1] : $item['spellcharges_2'], $item['spellcooldown_2'], $item['spellcategory_2'], $item['spellcategorycooldown_2']); renderSpell($item['spellid_3'], $item['spelltrigger_3'], $item_data ? $item_data[ITEM_FIELD_SPELL_CHARGES + 2] : $item['spellcharges_3'], $item['spellcooldown_3'], $item['spellcategory_3'], $item['spellcategorycooldown_3']); renderSpell($item['spellid_4'], $item['spelltrigger_4'], $item_data ? $item_data[ITEM_FIELD_SPELL_CHARGES + 3] : $item['spellcharges_4'], $item['spellcooldown_4'], $item['spellcategory_4'], $item['spellcategorycooldown_4']); renderSpell($item['spellid_5'], $item['spelltrigger_5'], $item_data ? $item_data[ITEM_FIELD_SPELL_CHARGES + 4] : $item['spellcharges_5'], $item['spellcooldown_5'], $item['spellcategory_5'], $item['spellcategorycooldown_5']); } if ($item['itemset']) { $set = getItemSet($item['itemset']); if ($set == 0) { echo '<tr><td class=itemsetname> Unknown set - ' . $item['itemset'] . '</td></tr>'; } else { // Получаем игрока чтобы вывести инфу о сете if ($item_data && ($char = getCharacter($item_data[ITEM_FIELD_OWNER]))) { $char_data = explode(' ', $char['data']); } $text = ""; $count = 0; $itemnum = 0; // Подсчитываем всего вещей в сете (а также если на игроке то сколько из вещей сета на нём) // Одновременно составяем список for ($i = 1; $i < 18; $i++) { if ($setitem = $set['item_' . $i]) { $count++; $name = getItemName($setitem); if (isItemOnPlayer($setitem, $char_data)) { $itemnum++; $text = $text . '<tr><td class=enSetName><a href="?item=' . $setitem . '">' . $name . '</a></td></tr>'; } else { $text = $text . '<tr><td class=disSetName><a href="?item=' . $setitem . '">' . $name . '</a></td></tr>'; } } } echo '<tr><td class=itemsetname><a href="?itemset=' . $set['id'] . '">' . $set['name'] . "</a> ({$itemnum}/{$count})</td></tr>"; if ($set['req_skill']) { echo '<tr><td class=req>' . sprintf($game_text['req_skill'], getSkillName($set['req_skill']), $set['req_skill_value']) . '</td></tr>'; } echo $text; // Выводим бонусы сета (если на игроке - то активны ион или нет) for ($i = 1; $i < 9; $i++) { if ($setSpell = $set['spell_' . $i]) { $name = get_spell_details($setSpell); $num = $set['count_' . $i]; if ($char_data) { $iclass = $num <= $itemnum ? 'enSpell' : 'disSpell'; echo '<tr><td class=' . $iclass . '><a href="?spell=' . $setSpell . '">(' . $num . ') ' . $name . '</a></td></tr>'; } else { echo '<tr><td><a href="?spell=' . $setSpell . '">(' . $num . ') ' . $name . '</a></td></tr>'; } } } } } if ($item['description'] != "") { if ($item['spellid_1'] == 483 or $item['spellid_1'] == 55884) { echo '<tr><td><a href="?spell=' . $item['spellid_2'] . '">' . $UseorEquip[$item['spelltrigger_2']] . ' ' . $item['description'] . '</a></td></tr>'; if ($spell = getSpell($item['spellid_2'])) { if ($ritem = getItem($spell['EffectItemType_1'])) { echo '<tr><td> </td></tr>'; renderItemData($ritem); } if ($req = getRecipeReqString($spell)) { echo '<tr><td> </td></tr>'; echo '<tr><td>' . $game_text['req_ingridients'] . ' ' . $req . '</td></tr>'; } } } else { echo '<tr><td class=itemdesc>"' . $item['description'] . '"</td></tr>'; } } // Written by %s if ($creator) { echo '<tr><td class=enSpell><' . sprintf($game_text['made_by'], $creator) . '></td></tr>'; } if ($item['startquest']) { echo '<tr><td>' . $game_text['start_quest'] . '</td></tr>'; } }
$runSuites = $_REQUEST['runSuites']; } if (isset($_REQUEST['keepOpen'])) { $keepOpen = trim($_REQUEST['keepOpen']); } else { $keepOpen = ''; } $keepOpen = explode(' ', $keepOpen); // if is set code coverage if (isset($_REQUEST['coverage']) && 'true' === $_REQUEST['coverage']) { // get the group name and the file name $suite = $runSuites[0]; // set the file name $file = $folderParser->getSuitePath($suite); // set the class name $className = getClassName($file); // set the output dir for the code coverage $relativePath = str_replace(ROOT_DIR . '/', '', $file); $codeCoveragePath = str_replace(TEST_SUFFIX . '.php', '', $relativePath); $codeCoverageTarget = str_replace(TEST_SUFFIX, '', $className) . '.php.html'; $codeCoverageDir = CODE_COVERAGE_DIR . '/' . $codeCoveragePath; $command = PHPUNIT . " --coverage-html {$codeCoverageDir} {$className} {$file}"; //echo $command; die(); // run the code coverage exec($command); // redirect to the code coverage dir if (isAjax()) { echo file_get_contents(basename(CODE_COVERAGE_DIR) . "/{$codeCoveragePath}/" . PRECEDE_TESTS . $codeCoverageTarget); } else { header(sprintf("Location: " . basename(CODE_COVERAGE_DIR) . "/{$codeCoveragePath}/" . PRECEDE_TESTS . $codeCoverageTarget)); }
/** * Get selection items for fill selection box. * * @param array objects Array of objects returned from {@link foowd_workspace::getFillObjects}. * @return array An array of items for a selection box. */ function getFillSelectionItems(&$objects) { $items = array(); if (is_array($objects)) { foreach ($objects as $object) { $key = $object->objectid . '_' . $object->classid; if (isset($object->version)) { $key .= '_' . $object->version; } $value = $object->getTitle() . ' (' . getClassName($object->classid); if (isset($object->version)) { $value .= ' v' . $object->version; } $value .= ')'; $items[$key] = $value; } } return $items; }