1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-05 19:42:38 +02:00

Allow change position labels

This commit is contained in:
Daniel 2022-01-11 14:40:49 -03:00
parent e1e2796243
commit f415f2aafc
2 changed files with 144 additions and 133 deletions

View file

@ -77,6 +77,8 @@ class ADs extends PluginAbstract
eval("\$obj->$value[0]Width = {$width};"); eval("\$obj->$value[0]Width = {$width};");
eval("\$obj->$value[0]Height = {$height};"); eval("\$obj->$value[0]Height = {$height};");
eval("\$obj->$value[0]Label = '{$value[0]}';");
} }
$obj->tags3rdParty = "<script> window.abkw = '{ChannelName},{Category}'; </script>"; $obj->tags3rdParty = "<script> window.abkw = '{ChannelName},{Category}'; </script>";
@ -217,8 +219,7 @@ class ADs extends PluginAbstract
return $return; return $return;
} }
public static function getSize($type) public static function getSize($type) {
{
$obj = AVideoPlugin::getObjectData("ADs"); $obj = AVideoPlugin::getObjectData("ADs");
foreach (ADs::$AdsPositions as $key => $value) { foreach (ADs::$AdsPositions as $key => $value) {
if ($type == $value[0]) { if ($type == $value[0]) {
@ -230,6 +231,16 @@ class ADs extends PluginAbstract
return ['width' => null, 'height' => null]; return ['width' => null, 'height' => null];
} }
public static function getLabel($type) {
$obj = AVideoPlugin::getObjectData("ADs");
eval("\$label = \$obj->{$type}Label;");
if(empty($label)){
return $type;
}else{
return $label;
}
}
public static function getAdsHTML($type) public static function getAdsHTML($type)
{ {
global $global; global $global;

View file

@ -45,7 +45,7 @@ if (empty($obj)) {
$active = 'active'; $active = 'active';
foreach (ADs::$AdsPositions as $key => $value) { foreach (ADs::$AdsPositions as $key => $value) {
echo '<li class="' . $active . '">' echo '<li class="' . $active . '">'
. '<a onclick="restartForm' . $value[0] . '()" data-toggle="tab" href="#adsTabs' . $key . '">' . $value[0] . '</a>' . '<a onclick="restartForm' . $value[0] . '()" data-toggle="tab" href="#adsTabs' . $key . '">' . ADs::getLabel($value[0]) . '</a>'
. '</li>'; . '</li>';
$active = ''; $active = '';
} }