implemented type areatrigger
* staff only
This commit is contained in:
parent
56ccc592a6
commit
e0150feda6
45 changed files with 1193 additions and 160 deletions
|
|
@ -1,6 +1,9 @@
|
|||
<?php
|
||||
if (!empty($this->infobox) || !empty($this->contributions) || !empty($this->series) || $this->hasComContent):
|
||||
?>
|
||||
<table class="infobox">
|
||||
<?php
|
||||
if (!empty($this->infobox)):
|
||||
if (!empty($this->infobox)):
|
||||
?>
|
||||
<tr><th id="infobox-quick-facts"><?php echo Lang::main('quickFacts'); ?></th></tr>
|
||||
<tr><td>
|
||||
|
|
@ -11,9 +14,9 @@ if (!empty($this->infobox)):
|
|||
</script>
|
||||
</td></tr>
|
||||
<?php
|
||||
endif;
|
||||
endif;
|
||||
|
||||
if (!empty($this->contributions)):
|
||||
if (!empty($this->contributions)):
|
||||
?>
|
||||
<tr><th id="infobox-contributions"><?php echo Lang::user('contributions'); ?></th></tr>
|
||||
<tr><td>
|
||||
|
|
@ -24,36 +27,37 @@ if (!empty($this->contributions)):
|
|||
</script>
|
||||
</td></tr>
|
||||
<?php
|
||||
endif;
|
||||
endif;
|
||||
|
||||
if (!empty($this->series)):
|
||||
foreach ($this->series as $s):
|
||||
$this->brick('series', ['list' => $s[0], 'listTitle' => $s[1]]);
|
||||
endforeach;
|
||||
endif;
|
||||
if (!empty($this->series)):
|
||||
foreach ($this->series as $s):
|
||||
$this->brick('series', ['list' => $s[0], 'listTitle' => $s[1]]);
|
||||
endforeach;
|
||||
endif;
|
||||
|
||||
if (!empty($this->type) && !empty($this->typeId)):
|
||||
if ($this->hasComContent):
|
||||
?>
|
||||
<tr><th id="infobox-screenshots"><?php echo Lang::main('screenshots'); ?></th></tr>
|
||||
<tr><td><div class="infobox-spacer"></div><div id="infobox-sticky-ss"></div></td></tr>
|
||||
<?php
|
||||
if (User::isInGroup(U_GROUP_ADMIN | U_GROUP_BUREAU | U_GROUP_VIDEO) || !empty($this->community['vi'])):
|
||||
if (User::isInGroup(U_GROUP_ADMIN | U_GROUP_BUREAU | U_GROUP_VIDEO) || !empty($this->community['vi'])):
|
||||
?>
|
||||
<tr><th id="infobox-videos"><?php echo Lang::main('videos'); ?></th></tr>
|
||||
<tr><td><div class="infobox-spacer"></div><div id="infobox-sticky-vi"></div></td></tr>
|
||||
<?php
|
||||
endif;
|
||||
endif;
|
||||
?>
|
||||
</table>
|
||||
<script type="text/javascript">ss_appendSticky()</script>
|
||||
<?php
|
||||
if (User::isInGroup(U_GROUP_ADMIN | U_GROUP_BUREAU | U_GROUP_VIDEO) || !empty($this->community['vi'])):
|
||||
if (User::isInGroup(U_GROUP_ADMIN | U_GROUP_BUREAU | U_GROUP_VIDEO) || !empty($this->community['vi'])):
|
||||
?>
|
||||
<script type="text/javascript">vi_appendSticky()</script>
|
||||
<?php
|
||||
endif;
|
||||
else:
|
||||
echo " </table>\n";
|
||||
endif;
|
||||
else:
|
||||
echo " </table>\n";
|
||||
endif;
|
||||
|
||||
?>
|
||||
|
|
@ -1,82 +1,85 @@
|
|||
<?php
|
||||
$relTabs = !empty($relTabs);
|
||||
$tabVar = $relTabs || !empty($this->user) ? 'tabsRelated' : 'myTabs';
|
||||
$isTabbed = !empty($this->forceTabs) || $relTabs || count($this->lvTabs) > 1;
|
||||
if (!empty($this->lvTabs) || !empty($this->user['characterData']) || !empty($this->user['profileData']) || $this->contribute):
|
||||
$relTabs = !empty($relTabs);
|
||||
$tabVar = $relTabs || !empty($this->user) ? 'tabsRelated' : 'myTabs';
|
||||
$isTabbed = !empty($this->forceTabs) || $relTabs || count($this->lvTabs) > 1;
|
||||
|
||||
// lvTab: [file, data, extraInclude]
|
||||
// lvTab: [file, data, extraInclude]
|
||||
|
||||
if ($isTabbed):
|
||||
if ($isTabbed):
|
||||
?>
|
||||
<div class="clear"></div>
|
||||
<div id="tabs-generic"></div>
|
||||
<?php endif; ?>
|
||||
<div id="lv-generic" class="listview"><?php
|
||||
foreach ($this->lvTabs as $lv):
|
||||
if ($lv[0]):
|
||||
continue;
|
||||
endif;
|
||||
foreach ($this->lvTabs as $lv):
|
||||
if ($lv[0]):
|
||||
continue;
|
||||
endif;
|
||||
|
||||
echo '<div class="text tabbed-contents" id="tab-'.$lv[1]['id'].'" style="display:none;">'.$lv[1]['data'].'</div>';
|
||||
endforeach;
|
||||
echo '<div class="text tabbed-contents" id="tab-'.$lv[1]['id'].'" style="display:none;">'.$lv[1]['data'].'</div>';
|
||||
endforeach;
|
||||
?></div>
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
<?php
|
||||
if (!empty($this->gemScores)): // inherited from items.tpl.php
|
||||
echo " var fi_gemScores = ".Util::toJSON($this->gemScores).";\n";
|
||||
endif;
|
||||
if (!empty($this->gemScores)): // inherited from items.tpl.php
|
||||
echo " var fi_gemScores = ".Util::toJSON($this->gemScores).";\n";
|
||||
endif;
|
||||
|
||||
if ($isTabbed):
|
||||
echo " var ".$tabVar." = new Tabs({parent: \$WH.ge('tabs-generic')".(isset($this->type) ? ", trackable: '".ucfirst(Util::$typeStrings[$this->type]."'") : null)."});\n";
|
||||
endif;
|
||||
if ($isTabbed):
|
||||
echo " var ".$tabVar." = new Tabs({parent: \$WH.ge('tabs-generic')".(isset($this->type) ? ", trackable: '".ucfirst(Util::$typeStrings[$this->type]."'") : null)."});\n";
|
||||
endif;
|
||||
|
||||
foreach ($this->lvTabs as $lv):
|
||||
if (!empty($lv[1]['data']) || (count($this->lvTabs) == 1 && !$relTabs)):
|
||||
if ($isTabbed):
|
||||
$lv[1]['tabs'] = '$'.$tabVar;
|
||||
endif;
|
||||
|
||||
if ($lv[0]):
|
||||
// extra functions on top of lv
|
||||
if (isset($lv[2])):
|
||||
$this->lvBrick($lv[2]);
|
||||
foreach ($this->lvTabs as $lv):
|
||||
if (!empty($lv[1]['data']) || (count($this->lvTabs) == 1 && !$relTabs)):
|
||||
if ($isTabbed):
|
||||
$lv[1]['tabs'] = '$'.$tabVar;
|
||||
endif;
|
||||
|
||||
if (isset($this->lvTemplates[$lv[0]])):
|
||||
echo "new Listview(".Util::toJSON(array_merge($this->lvTemplates[$lv[0]], $lv[1])).");\n";
|
||||
else:
|
||||
// does not appear as announcement, those have already been handled at this point
|
||||
trigger_error('requested undefined listview: '.$lv[0], E_USER_ERROR);
|
||||
if ($lv[0]):
|
||||
// extra functions on top of lv
|
||||
if (isset($lv[2])):
|
||||
$this->lvBrick($lv[2]);
|
||||
endif;
|
||||
|
||||
if (isset($this->lvTemplates[$lv[0]])):
|
||||
echo "new Listview(".Util::toJSON(array_merge($this->lvTemplates[$lv[0]], $lv[1])).");\n";
|
||||
else:
|
||||
// does not appear as announcement, those have already been handled at this point
|
||||
trigger_error('requested undefined listview: '.$lv[0], E_USER_ERROR);
|
||||
endif;
|
||||
elseif ($isTabbed):
|
||||
$n = $lv[1]['name'][0] == '$' ? substr($lv[1]['name'], 1) : "'".$lv[1]['name']."'";
|
||||
echo $tabVar.".add(".$n.", { id: '".$lv[1]['id']."' });\n";
|
||||
endif;
|
||||
elseif ($isTabbed):
|
||||
$n = $lv[1]['name'][0] == '$' ? substr($lv[1]['name'], 1) : "'".$lv[1]['name']."'";
|
||||
echo $tabVar.".add(".$n.", { id: '".$lv[1]['id']."' });\n";
|
||||
endif;
|
||||
endforeach;
|
||||
|
||||
if (!empty($this->user)):
|
||||
if (!empty($this->user['characterData'])):
|
||||
echo ' us_addCharactersTab('.Util::toJSON($this->user['characterData']).");\n";
|
||||
endif;
|
||||
if (!empty($this->user['profileData'])):
|
||||
echo ' us_addProfilesTab('.Util::toJSON($this->user['profileData']).");\n";
|
||||
endif;
|
||||
elseif ($relTabs):
|
||||
if ($this->contribute & CONTRIBUTE_CO):
|
||||
echo " new Listview({template: 'comment', id: 'comments', name: LANG.tab_comments, tabs: ".$tabVar.", parent: 'lv-generic', data: lv_comments});\n";
|
||||
endif;
|
||||
if ($this->contribute & CONTRIBUTE_SS):
|
||||
echo " new Listview({template: 'screenshot', id: 'screenshots', name: LANG.tab_screenshots, tabs: ".$tabVar.", parent: 'lv-generic', data: lv_screenshots});\n";
|
||||
endif;
|
||||
if ($this->contribute & CONTRIBUTE_VI):
|
||||
echo " if (lv_videos.length || (g_user && g_user.roles & (U_GROUP_ADMIN | U_GROUP_BUREAU | U_GROUP_VIDEO)))\n";
|
||||
echo " new Listview({template: 'video', id: 'videos', name: LANG.tab_videos, tabs: ".$tabVar.", parent: 'lv-generic', data: lv_videos});\n";
|
||||
endif;
|
||||
endif;
|
||||
endforeach;
|
||||
|
||||
if (!empty($this->user)):
|
||||
if (!empty($this->user['characterData'])):
|
||||
echo ' us_addCharactersTab('.Util::toJSON($this->user['characterData']).");\n";
|
||||
if ($isTabbed):
|
||||
echo " ".$tabVar.".flush();\n";
|
||||
endif;
|
||||
if (!empty($this->user['profileData'])):
|
||||
echo ' us_addProfilesTab('.Util::toJSON($this->user['profileData']).");\n";
|
||||
endif;
|
||||
elseif ($relTabs):
|
||||
if ($this->contribute & CONTRIBUTE_CO):
|
||||
echo " new Listview({template: 'comment', id: 'comments', name: LANG.tab_comments, tabs: ".$tabVar.", parent: 'lv-generic', data: lv_comments});\n";
|
||||
endif;
|
||||
if ($this->contribute & CONTRIBUTE_SS):
|
||||
echo " new Listview({template: 'screenshot', id: 'screenshots', name: LANG.tab_screenshots, tabs: ".$tabVar.", parent: 'lv-generic', data: lv_screenshots});\n";
|
||||
endif;
|
||||
if ($this->contribute & CONTRIBUTE_VI):
|
||||
echo " if (lv_videos.length || (g_user && g_user.roles & (U_GROUP_ADMIN | U_GROUP_BUREAU | U_GROUP_VIDEO)))\n";
|
||||
echo " new Listview({template: 'video', id: 'videos', name: LANG.tab_videos, tabs: ".$tabVar.", parent: 'lv-generic', data: lv_videos});\n";
|
||||
endif;
|
||||
endif;
|
||||
|
||||
if ($isTabbed):
|
||||
echo " ".$tabVar.".flush();\n";
|
||||
endif;
|
||||
?>
|
||||
//]]></script>
|
||||
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,21 @@ elseif (!empty($this->map['data'])):
|
|||
if ($this->type == TYPE_QUEST) :
|
||||
echo " <div id=\"mapper-zone-generic\"></div>\n";
|
||||
elseif ($this->type != TYPE_ZONE):
|
||||
echo ' <div>'.($this->type == TYPE_OBJECT ? Lang::gameObject('foundIn') : ($this->type == TYPE_SOUND ? Lang::sound('foundIn') : Lang::npc('foundIn'))).' <span id="mapper-zone-generic">';
|
||||
echo ' <div>';
|
||||
|
||||
if ($this->type == TYPE_OBJECT):
|
||||
echo Lang::gameObject('foundIn');
|
||||
elseif ($this->type == TYPE_SOUND):
|
||||
echo Lang::sound('foundIn');
|
||||
elseif ($this->type == TYPE_NPC):
|
||||
echo Lang::npc('foundIn');
|
||||
elseif ($this->type == TYPE_AREATRIGGER):
|
||||
echo Lang::areatrigger('foundIn');
|
||||
else:
|
||||
echo "UNKNOWN TYPE";
|
||||
endif;
|
||||
|
||||
echo ' <span id="mapper-zone-generic">';
|
||||
|
||||
$extra = $this->map['extra'];
|
||||
echo Lang::concat($this->map['mapperData'], true, function ($areaData, $areaId) use ($extra) {
|
||||
|
|
|
|||
83
template/listviews/areatrigger.tpl.php
Normal file
83
template/listviews/areatrigger.tpl.php
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
Listview.templates.areatrigger = {
|
||||
sort: [1],
|
||||
searchable: 1,
|
||||
filtrable: 1,
|
||||
|
||||
columns: [
|
||||
{
|
||||
id: 'id',
|
||||
name: 'ID',
|
||||
width: '5%',
|
||||
value: 'id',
|
||||
compute: function(data, td) {
|
||||
if (data.id) {
|
||||
$WH.ae(td, $WH.ct(data.id));
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 'name',
|
||||
name: LANG.name,
|
||||
type: 'text',
|
||||
align: 'left',
|
||||
value: 'name',
|
||||
compute: function(areatrigger, td, tr) {
|
||||
var wrapper = $WH.ce('div');
|
||||
|
||||
var a = $WH.ce('a');
|
||||
a.style.fontFamily = 'Verdana, sans-serif';
|
||||
a.href = this.getItemLink(areatrigger);
|
||||
if (!areatrigger.name){
|
||||
areatrigger.name = 'Unnamed'
|
||||
a.className = 'q0';
|
||||
}
|
||||
|
||||
$WH.ae(a, $WH.ct(areatrigger.name));
|
||||
$WH.ae(wrapper, a);
|
||||
$WH.ae(td, wrapper);
|
||||
},
|
||||
sortFunc: function(a, b, col) {
|
||||
return $WH.strcmp(a.name, b.name);
|
||||
},
|
||||
getVisibleText: function(areatrigger) {
|
||||
return areatrigger.name;
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 'location',
|
||||
name: LANG.location,
|
||||
type: 'text',
|
||||
compute: function(areatrigger, td) {
|
||||
return Listview.funcBox.location(areatrigger, td);
|
||||
},
|
||||
getVisibleText: function(areatrigger) {
|
||||
return Listview.funcBox.arrayText(areatrigger.location, g_zones);
|
||||
},
|
||||
sortFunc: function(a, b, col) {
|
||||
return Listview.funcBox.assocArrCmp(a.location, b.location, g_zones);
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 'type',
|
||||
name: LANG.type,
|
||||
type: 'text',
|
||||
value: 'type',
|
||||
width: '12%',
|
||||
compute: function(areatrigger, td, tr) {
|
||||
if (g_trigger_types[areatrigger.type])
|
||||
$WH.ae(td, $WH.ct(g_trigger_types[areatrigger.type]))
|
||||
else
|
||||
$WH.ae(td, $WH.ct(g_trigger_types[0]));
|
||||
},
|
||||
sortFunc: function(a, b, col) {
|
||||
return $WH.strcmp(this.getVisibleText(a), this.getVisibleText(b));
|
||||
},
|
||||
getVisibleText: function(areatrigger) {
|
||||
return g_trigger_types[areatrigger.type];
|
||||
}
|
||||
}
|
||||
],
|
||||
getItemLink: function(areatrigger) {
|
||||
return '?areatrigger=' + areatrigger.id;
|
||||
}
|
||||
}
|
||||
66
template/pages/areatriggers.tpl.php
Normal file
66
template/pages/areatriggers.tpl.php
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
<?php
|
||||
$this->brick('header');
|
||||
$f = $this->filter; // shorthand
|
||||
?>
|
||||
|
||||
<div class="main" id="main">
|
||||
<div class="main-precontents" id="main-precontents"></div>
|
||||
<div class="main-contents" id="main-contents">
|
||||
|
||||
<?php
|
||||
$this->brick('announcement');
|
||||
|
||||
$this->brick('pageTemplate', ['fi' => empty($f['query']) ? null : ['query' => $f['query'], 'menuItem' => 101]]);
|
||||
?>
|
||||
<div class="text"><h1><?=$this->name; ?> <?=$this->brick('redButtons'); ?></h1></div>
|
||||
<div id="fi" style="display: <?=(empty($f['query']) ? 'none' : 'block'); ?>;">
|
||||
<form action="?filter=areatriggers" method="post" name="fi" onsubmit="return fi_submit(this)" onreset="return fi_reset(this)">
|
||||
<div class="rightpanel">
|
||||
<div style="float: left"><?=Util::ucFirst(Lang::game('type')).Lang::main('colon'); ?></div>
|
||||
<small><a href="javascript:;" onclick="document.forms['fi'].elements['ty[]'].selectedIndex = -1; return false" onmousedown="return false"><?=Lang::main('clear'); ?></a></small>
|
||||
<div class="clear"></div>
|
||||
<select name="ty[]" size="6" multiple="multiple" class="rightselect">
|
||||
<?php
|
||||
foreach (Lang::areatrigger('types') as $i => $str):
|
||||
echo ' <option value="'.$i.'"'.(isset($f['ty']) && in_array($i, (array)$f['ty']) ? ' selected' : null).' >'.$str."</option>\n";
|
||||
endforeach;
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
<table>
|
||||
<tr>
|
||||
<td><?=Util::ucFirst(Lang::main('name')).Lang::main('colon'); ?></td>
|
||||
<td colspan="2">
|
||||
<table><tr>
|
||||
<td> <input type="text" name="na" size="30" <?=(isset($f['na']) ? 'value="'.Util::htmlEscape($f['na']).'" ' : null); ?>/></td>
|
||||
</tr></table>
|
||||
</td>
|
||||
</tr><tr>
|
||||
</table>
|
||||
|
||||
<div id="fi_criteria" class="padded criteria"><div></div></div><div><a href="javascript:;" id="fi_addcriteria" onclick="fi_addCriterion(this); return false"><?=Lang::main('addFilter'); ?></a></div>
|
||||
|
||||
<div class="padded2">
|
||||
<?=Lang::main('match').Lang::main('colon'); ?><input type="radio" name="ma" value="" id="ma-0" <?=(!isset($f['ma']) ? 'checked="checked" ' : null); ?>/><label for="ma-0"><?=Lang::main('allFilter'); ?></label><input type="radio" name="ma" value="1" id="ma-1" <?=(isset($f['ma']) ? 'checked="checked" ' : null); ?> /><label for="ma-1"><?=Lang::main('oneFilter'); ?></label>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<div class="padded">
|
||||
<input type="submit" value="<?=Lang::main('applyFilter'); ?>" />
|
||||
<input type="reset" value="<?=Lang::main('resetForm'); ?>" />
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="pad clear"></div>
|
||||
|
||||
<?php $this->brick('filter', ['fi' => $f['initData']]); ?>
|
||||
|
||||
<?php $this->brick('lvTabs'); ?>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div><!-- main-contents -->
|
||||
</div><!-- main -->
|
||||
|
||||
<?php $this->brick('footer'); ?>
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
$this->brick('redButtons');
|
||||
?>
|
||||
|
||||
<h1<?php echo isset($this->expansion) ? ' class="h1-icon"><span class="icon-'.$this->expansion.'-right">'.$this->name.'</span>' : '>'.$this->name; ?></h1>
|
||||
<h1<?=(isset($this->expansion) ? ' class="h1-icon"><span class="icon-'.$this->expansion.'-right">'.$this->name.'</span>' : '>'.$this->name); ?></h1>
|
||||
|
||||
<?php
|
||||
$this->brick('article');
|
||||
|
|
@ -30,7 +30,7 @@ if (isset($this->extraText)):
|
|||
?>
|
||||
<div id="text-generic" class="left"></div>
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
Markup.printHtml("<?php echo $this->extraText; ?>", "text-generic", {
|
||||
Markup.printHtml("<?=$this->extraText; ?>", "text-generic", {
|
||||
allow: Markup.CLASS_ADMIN,
|
||||
dbpage: true
|
||||
});
|
||||
|
|
@ -85,7 +85,7 @@ if (!empty($this->zoneMusic)):
|
|||
<?php
|
||||
endif;
|
||||
?>
|
||||
<h2 class="clear"><?php echo Lang::main('related'); ?></h2>
|
||||
<h2 class="clear"><?=Lang::main('related'); ?></h2>
|
||||
</div>
|
||||
<?php
|
||||
$this->brick('lvTabs', ['relTabs' => true]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue