当前位置: 首页>>代码示例>>PHP>>正文


PHP Theme::img方法代码示例

本文整理汇总了PHP中Theme::img方法的典型用法代码示例。如果您正苦于以下问题:PHP Theme::img方法的具体用法?PHP Theme::img怎么用?PHP Theme::img使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Theme的用法示例。


在下文中一共展示了Theme::img方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: renderMenuItem

 protected function renderMenuItem($item)
 {
     if (isset($item['icon'])) {
         $item['label'] .= Theme::img('icons/' . $item['icon'] . '.png');
     }
     return parent::renderMenuItem($item);
 }
开发者ID:Jmainguy,项目名称:multicraft_install,代码行数:7,代码来源:Menu.php

示例2: form

            echo CHtml::encode(@$info->version) . ')';
            echo '<br/><br/>';
            form($plugin->name, Yii::t('mc', 'Enable'), 'enable', $d);
            form($plugin->name, Yii::t('mc', 'Remove'), 'remove', $d);
        } else {
            echo Yii::t('mc', 'Not installed');
            echo '<br/><br/>';
            form($plugin->name, Yii::t('mc', 'Install'), 'install', $d);
        }
    }
}
echo '</div>';
echo '<div id="pending"' . ($i == $show ? ' style="display: none"' : '') . '>';
?>
<div class="pluginActionPending"><?php 
echo Theme::img('gridview/loading.gif');
?>
</div>
&nbsp;&nbsp;
<?php 
echo Yii::t('mc', 'Please wait for the action to complete.');
?>
</div>
<?php 
if ($i != $show) {
    echo CHtml::script('
    function refresh()
    {
        ' . CHtml::ajax(array('type' => 'POST', 'dataType' => 'json', 'success' => 'js:set_status', 'data' => array('ajax' => 'get_status', Yii::app()->request->csrfTokenName => Yii::app()->request->csrfToken))) . '
    }
    function set_status(data)
开发者ID:Jmainguy,项目名称:multicraft_install,代码行数:31,代码来源:bgPlugin.php

示例3: array

">
        <?php 
        $img = Theme::img('installer/' . $s . '.png', '', array('class' => 'step'));
        if ($step == 'welcome') {
            echo $img . '<br/><br/><center style="font-size: 11px">' . preg_replace('/&nbsp;/', '', $labels[$s]) . '</center>';
        } else {
            echo CHtml::link($img, array('index', 'step' => $s));
        }
        ?>
    </div>
    <?php 
        if ($s != end($steps)) {
            ?>
    <div class="nextbox">
        <?php 
            echo CHtml::link(Theme::img('installer/next.png'), array('index', 'step' => $s));
            ?>
    </div>
    <?php 
        }
        ?>
    <?php 
    }
    ?>
<div style="clear: both"></div>
</div>
<br/>
<?php 
}
if (count($p['actions'])) {
    ?>
开发者ID:Jmainguy,项目名称:multicraft_install,代码行数:31,代码来源:index.php

示例4: foreach

?>
</td>
</tr>
<?php 
echo CHtml::css('.adv { display: none; }');
$i = 0;
$adv = false;
foreach ($settings as $name => $setting) {
    if (@$setting['adv'] && !$adv) {
        ?>
<tr class="<?php 
        echo $i++ % 2 ? 'even' : 'odd';
        ?>
"style="height: 32px" >
    <td><?php 
        echo Theme::img('icons/closed.png', '', array('id' => 'advImg', 'onclick' => 'return checkAdv()'));
        ?>
</td>
    <td><?php 
        echo CHtml::link(Yii::t('admin', 'Show Advanced Options'), '#', array('id' => 'advTxt', 'onclick' => 'return checkAdv()'));
        ?>
</td>
    <td></td>
</tr>
<?php 
        $adv = true;
    }
    ?>
<tr class="<?php 
    echo $i++ % 2 ? 'even' : 'odd';
    echo @$setting['adv'] ? ' adv' : '';
开发者ID:Jmainguy,项目名称:multicraft_install,代码行数:31,代码来源:index.php

示例5: array

<body>

<div id="frame">
<div id="border-left"></div>
<div id="border-right"></div>
<div class="container" id="page">

    <div id="header">
        <div id="logo">
            <div id="logo_icon"><?php 
echo Theme::img('multicraft.png');
?>
</div>
            <div id="logo_text"><?php 
echo Theme::img('logo.png');
?>
</div>
            <div id="header_text"> <?php 
echo CHtml::encode(Yii::app()->name);
?>
<br/><span style="font-size: 12px"><?php 
echo Yii::t('mc', 'Minecraft Server Manager');
?>
</span></div>
        </div>
    </div><!-- header -->

    <div id="mainmenu">
        <?php 
$items = array();
开发者ID:Jmainguy,项目名称:multicraft_install,代码行数:30,代码来源:main.php

示例6: run

 /**
  * Renders the detail view.
  * This is the main entry of the whole detail view rendering.
  */
 public function run()
 {
     $formatter = $this->getFormatter();
     if ($this->tagName !== null) {
         echo CHtml::openTag($this->tagName, $this->htmlOptions);
     }
     $i = 0;
     $n = is_array($this->itemCssClass) ? count($this->itemCssClass) : 0;
     foreach ($this->attributes as $attribute) {
         if (is_string($attribute)) {
             if (!preg_match('/^([\\w\\.]+)(:(\\w*))?(:(.*))?$/', $attribute, $matches)) {
                 throw new CException(Yii::t('zii', 'The attribute must be specified in the format of "Name:Type:Label", where "Type" and "Label" are optional.'));
             }
             $attribute = array('name' => $matches[1], 'type' => isset($matches[3]) ? $matches[3] : 'text');
             if (isset($matches[5])) {
                 $attribute['label'] = $matches[5];
             }
         }
         if (isset($attribute['visible']) && !$attribute['visible']) {
             continue;
         }
         $tr = array('{label}' => '', '{class}' => $n ? $this->itemCssClass[$i % $n] : '');
         if (isset($attribute['cssClass'])) {
             $tr['{class}'] = $attribute['cssClass'] . ' ' . ($n ? $tr['{class}'] : '');
         }
         if (isset($attribute['label'])) {
             $tr['{label}'] = $attribute['label'];
         } else {
             if (isset($attribute['name'])) {
                 if ($this->data instanceof CModel) {
                     $tr['{label}'] = $this->data->getAttributeLabel($attribute['name']);
                 } else {
                     $tr['{label}'] = ucwords(trim(strtolower(str_replace(array('-', '_', '.'), ' ', preg_replace('/(?<![A-Z])[A-Z]/', ' \\0', $attribute['name'])))));
                 }
             }
         }
         if (!isset($attribute['type'])) {
             $attribute['type'] = 'text';
         }
         if (isset($attribute['value'])) {
             $value = $attribute['value'];
         } else {
             if (isset($attribute['name'])) {
                 $value = CHtml::value($this->data, $attribute['name']);
             } else {
                 $value = null;
             }
         }
         $tr['{value}'] = $value === null ? $this->nullDisplay : $formatter->format($value, $attribute['type']);
         if (strlen(@$attribute['hint'])) {
             $tr['{hint}'] = '<div class="hint">' . Theme::img('icons/hint.png', '', array('class' => 'hintIcon')) . '<span class="hintText">' . $attribute['hint'] . '</span></div>';
         } else {
             $tr['{hint}'] = '';
         }
         $this->renderItem($attribute, $tr);
         $i++;
     }
     if ($this->tagName !== null) {
         echo CHtml::closeTag($this->tagName);
     }
 }
开发者ID:Jmainguy,项目名称:multicraft_install,代码行数:65,代码来源:CDetailView.php

示例7: ajaxRefresh


//.........这里部分代码省略.........
                if (!McBridge::get()->serverCmd($server->id, 'get chat', $chat)) {
                    $error = McBridge::get()->lastError();
                }
            }
            if (strlen($error)) {
                echo Yii::t('mc', 'Couldn\'t get chat: ') . $this->errStr($error);
            } else {
                for ($i = count($chat) - 1; $i >= 0; $i--) {
                    echo @strftime('%H:%M:%S', $chat[$i]['time']) . ' ' . str_pad('<' . $chat[$i]['name'] . '>', 25) . $chat[$i]['text'] . "\n";
                }
                echo "\n";
            }
            $ret['chat'] = ob_get_clean();
        }
        if ($all || in_array('status', $type) || in_array('statusdetail', $type) || in_array('statusicon', $type)) {
            $error = false;
            ob_start();
            if (!Yii::app()->user->can($server->id, 'get status')) {
                $error = Yii::t('mc', 'Permission denied.');
            } else {
                if (!McBridge::get()->serverCmd($server->id, 'get status', $status)) {
                    $ret['status'] = McBridge::get()->lastError();
                }
            }
            if (strlen($error)) {
                echo Yii::t('mc', 'Error getting server status: ') . $this->errStr($error);
            } else {
                $ret['statusdetail'] = Yii::t('mc', 'Offline');
                $st = @$status[0];
                switch (@$st['status']) {
                    case 'running':
                        echo Yii::t('mc', 'The server is online!');
                        $ret['statusdetail'] = Yii::t('mc', 'Online') . ', ' . @$st['players'] . '/' . @$st['maxPlayers'] . ' ' . Yii::t('mc', 'players');
                        $ret['statusicon'] = Theme::img('online.png');
                        break;
                    case 'stopped':
                        echo Yii::t('mc', 'The server is offline.');
                        $ret['statusicon'] = Theme::img('offline.png');
                        break;
                    default:
                        echo Yii::t('mc', 'The server status is currently changing.');
                        $ret['statusicon'] = Theme::img('changing.png');
                }
                if (@$st['pid'] && Yii::app()->user->isSuperuser()) {
                    $ret['statusdetail'] .= ' (' . Yii::t('mc', 'PID') . ': ' . @$st['pid'] . ')';
                }
            }
            $ret['status'] = ob_get_clean();
        }
        if ($all || in_array('resources', $type)) {
            $error = false;
            ob_start();
            if (!Yii::app()->user->can($server->id, 'get log')) {
                $error = Yii::t('mc', 'Permission denied.');
            } else {
                if (!McBridge::get()->serverCmd($server->id, 'get resources', $res)) {
                    $error = McBridge::get()->lastError();
                }
            }
            if (!strlen($error)) {
                $st = @$res[0];
                $this->renderPartial('resources', array('cpu' => @$st['cpu'], 'memory' => @$st['memory']));
            }
            $ret['resources'] = ob_get_clean();
        }
        if ($all || in_array('log', $type)) {
开发者ID:Jmainguy,项目名称:multicraft_install,代码行数:67,代码来源:ServerController.php

示例8: array

 }
 if (Yii::app()->user->isSuperuser() || $settings->user_jar && in_array($model->jardir, array('server', 'server_base'))) {
     if ($jars) {
         $attribs[] = array('label' => '', 'type' => 'raw', 'value' => CHtml::dropDownList('jar-select', $model->jarfile, $jars), 'hint' => Yii::t('mc', 'JAR file selection'));
     }
     $attribs[] = array('label' => $form->labelEx($model, 'jarfile'), 'type' => 'raw', 'value' => $form->textField($model, 'jarfile') . ' ' . $form->error($model, 'jarfile'), 'hint' => Yii::t('mc', 'Empty for default file.'));
 } else {
     if ($jars && $settings->user_jar) {
         $attribs[] = array('label' => Yii::t('mc', 'Server JAR'), 'type' => 'raw', 'value' => CHtml::dropDownList('jar-select', $model->jarfile, $jars));
     }
 }
 if (Yii::app()->user->isSuperuser()) {
     $attribs[] = array('label' => $form->labelEx($settings, 'user_jar'), 'type' => 'raw', 'value' => $form->checkBox($settings, 'user_jar') . ' ' . $form->error($settings, 'user_jar'));
     $attribs[] = array('label' => $form->labelEx($settings, 'user_name'), 'type' => 'raw', 'value' => $form->checkBox($settings, 'user_name') . ' ' . $form->error($settings, 'user_name'));
 }
 $attribs[] = array('label' => Theme::img('icons/closed.png', '', array('id' => 'advImg')), 'type' => 'raw', 'value' => CHtml::link(Yii::t('mc', 'Show Advanced Options'), '#', array('id' => 'advTxt', 'onclick' => 'return checkAdv()')));
 if (Yii::app()->user->isSuperuser()) {
     $attribs[] = array('label' => $form->labelEx($model, 'world'), 'type' => 'raw', 'cssClass' => 'adv', 'value' => $form->textField($model, 'world') . ' ' . $form->error($model, 'world'), 'hint' => Yii::t('mc', 'Leave empty for "world"'));
     $attribs[] = array('label' => $form->labelEx($model, 'dir'), 'type' => 'raw', 'cssClass' => 'adv', 'value' => $form->textField($model, 'dir') . ' ' . $form->error($model, 'dir'), 'hint' => Yii::t('mc', 'Contains all files for this server'));
     $attribs[] = array('label' => $form->labelEx($model, 'start_memory'), 'type' => 'raw', 'cssClass' => 'adv', 'value' => $form->textField($model, 'start_memory') . ' ' . $form->error($model, 'start_memory'), 'hint' => Yii::t('mc', 'In MB. Empty for same as Max. Memory'));
     $attribs[] = array('label' => $form->labelEx($model, 'autostart'), 'type' => 'raw', 'cssClass' => 'adv', 'value' => $form->checkBox($model, 'autostart') . ' ' . $form->error($model, 'autostart'), 'hint' => Yii::t('mc', 'Start this server automatically when Multicraft restarts'));
     $attribs[] = array('label' => $form->labelEx($settings, 'user_schedule'), 'type' => 'raw', 'cssClass' => 'adv', 'value' => $form->checkBox($settings, 'user_schedule') . ' ' . $form->error($settings, 'user_schedule'), 'hint' => Yii::t('mc', 'Owner can create scheduled tasks and change the autosave setting'));
     $attribs[] = array('label' => $form->labelEx($settings, 'user_ftp'), 'type' => 'raw', 'cssClass' => 'adv', 'value' => $form->checkBox($settings, 'user_ftp') . ' ' . $form->error($settings, 'user_ftp'), 'hint' => Yii::t('mc', 'Owner can give FTP access to other users'));
     $attribs[] = array('label' => $form->labelEx($settings, 'user_visibility'), 'type' => 'raw', 'cssClass' => 'adv', 'value' => $form->checkBox($settings, 'user_visibility') . ' ' . $form->error($settings, 'user_visibility'), 'hint' => Yii::t('mc', 'Owner can change the server visibility and Default Role'));
     $attribs[] = array('label' => $form->labelEx($settings, 'user_players'), 'type' => 'raw', 'cssClass' => 'adv', 'value' => $form->checkBox($settings, 'user_players') . ' ' . $form->error($settings, 'user_players'));
     if (Yii::app()->params['user_mysql']) {
         $attribs[] = array('label' => $form->labelEx($settings, 'user_mysql'), 'type' => 'raw', 'cssClass' => 'adv', 'value' => $form->checkBox($settings, 'user_mysql') . ' ' . $form->error($settings, 'user_mysql'));
     }
     $attribs[] = array('label' => $form->labelEx($model, 'jardir'), 'type' => 'raw', 'cssClass' => 'adv', 'value' => $form->dropDownList($model, 'jardir', Server::getJardirs()) . ' ' . $form->error($model, 'jardir'), 'hint' => Yii::t('mc', '(* Warning: Be sure to run Multicraft in "multiuser" mode with this!)'));
 } else {
     if (Yii::app()->params['show_memory']) {
开发者ID:Jmainguy,项目名称:multicraft_install,代码行数:31,代码来源:view.php

示例9: array

$pl = $data->getOnlinePlayers();
$img = $pl >= 0 ? 'online.png' : 'offline.png';
?>
    <table style="height: 100%; table-layout: fixed">
    <colgroup>
        <col style="width: 35px"/>
        <col/>
        <col/>
    </colgroup>
    <tr>
        <td style="padding-left: 10px" id="sv_icon_<?php 
echo $data->id;
?>
">
            <?php 
echo Theme::img($img);
?>
        </td>
        <td style="width: 50%; max-width: 330px; overflow: hidden; vertical-align: middle">
            <?php 
echo CHtml::link(CHtml::encode($data->name), array('server/view', 'id' => $data->id), array('style' => 'display: block; max-height: 28px'));
?>
</a>
        </td>
        <td>
            <span id="sv_status_<?php 
echo $data->id;
?>
">
            <?php 
if ($data->suspended) {
开发者ID:Jmainguy,项目名称:multicraft_install,代码行数:31,代码来源:_server.php

示例10: get_status

        $("#"+name+"_main").children("img").attr("src", !menuShown[name] ? imgClosed : imgOpen);
        $("#"+name).stop(true, true).slideToggle(menuShown[name]);
    }
');
if (!!Yii::app()->params['ajax_serverlist']) {
    echo CHtml::script('
    function get_status(server)
    {
        ' . CHtml::ajax(array('type' => 'POST', 'dataType' => 'json', 'data' => array('ajax' => 'get_status', 'server' => 'js:server', Yii::app()->request->csrfTokenName => Yii::app()->request->csrfToken), 'success' => 'status_response')) . '
    }

    function status_response(data)
    {
        id = parseInt(data["id"]);
        pl = parseInt(data["pl"]);
        img = pl >= 0 ? \'' . Theme::img('online.png') . '\' : \'' . Theme::img('offline.png') . '\';
        $("#sv_icon_"+id).html(img);
        if (pl >= 0)
        {
            str = pl;
            $("#sv_maxplr_"+id).show();
            $("#sv_chatlink_"+id).show();
        }
        else
        {
            str = "' . Yii::t('mc', 'Offline') . '" + (pl == -2 ? " (' . Yii::t('mc', 'error') . ')" : "");
        }
        $("#sv_status_"+id).html(str);
    }
');
}
开发者ID:Jmainguy,项目名称:multicraft_install,代码行数:31,代码来源:index.php

示例11:

</tr>
<tr>
    <td class="left">
        <?php 
echo CHtml::link(Theme::img('about/net2ftp.png'), 'http://www.net2ftp.com/');
?>
    </td>
    <td>
        <?php 
echo CHtml::link(Theme::img('about/oil.png'), 'http://openiconlibrary.sourceforge.net');
?>
    </td>
</tr>
<tr>
    <td colspan="2">
        <?php 
echo CHtml::link(Theme::img('about/xhost.png'), 'http://www.xhost.ch/');
?>
    </td>
</tr>
<tr>
    <td colspan="2"> 
        <?php 
echo CHtml::link(Theme::img('about/multicraft.png'), 'http://www.multicraft.org/');
?>
    </td>
</tr>
</table>
<br/>
<br/>
开发者ID:Jmainguy,项目名称:multicraft_install,代码行数:30,代码来源:about.php

示例12:

</td>
</tr>
</table>
<span style="float:right; font-size: 10px"><?php 
echo Yii::t('admin', 'Values in brackets include suspended servers.');
?>
</span>
<br/>
<table class="detail-view">
<tr class="titlerow">
    <td><?php 
echo Yii::t('admin', 'Live Statistics');
?>
</td>
    <td width="200" height="30" id="status"><?php 
echo Theme::img('changing.png');
?>
 pending</td>
</tr>
<tr class="<?php 
trclass(true);
?>
">
    <td><?php 
echo Yii::t('admin', 'Online servers');
?>
</td>
    <td id="servers"></td>
</tr>
<tr class="<?php 
trclass();
开发者ID:Jmainguy,项目名称:multicraft_install,代码行数:31,代码来源:statistics.php


注:本文中的Theme::img方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。