Ejemplo n.º 1
0
    function display_content()
    {
        $updates = getProductUpdates();
        $update_count = count($updates);
        if ($updates === FALSE) {
            // Update error occured
            printf('<center style="color:red;font-weight:bold">%s</center>', _T('An error occured while fetching updates'));
        } else {
            $view_updates_text = _T('View updates', 'update');
            $install_updates_text = _T('Install updates', 'update');
            print '<center>';
            if ($update_count == 0) {
                printf('<p><strong>%s</strong></p>', _T('No updates available.', 'update'));
            } else {
                printf('<p><strong>%d %s</strong></p>', $update_count, _T('updates available.', 'update'));
                print <<<EOS
                <a title="View updates" class="btnSecondary"
                    href="javascript:;"
                    onclick="PopupWindow(event,'main.php?module=update&amp;submod=update&amp;action=viewProductUpdates', 300); return false;"
                    >{$view_updates_text}</a><br/><br/>
                    <a title="Install updates" class="btnSecondary"
                    href="main.php?module=update&amp;submod=update&amp;action=installProductUpdates"
                    >{$install_updates_text}</a>
                </center>
EOS;
            }
        }
    }
Ejemplo n.º 2
0
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * MMC is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with MMC; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
print "<h1>" . _T('Available updates', 'update') . "</h1>";
require_once "includes/xmlrpc.inc.php";
require_once "modules/update/includes/xmlrpc.inc.php";
$updates = getProductUpdates();
$update_titles = array();
foreach ($updates as $update) {
    $update_titles[] = $update['title'];
}
$n = new OptimizedListInfos($update_titles, _T("Update", "update"));
$n->setItemCount(count($updates));
$n->setNavBar(new AjaxNavBar($count, $filter1));
$n->start = 0;
$n->end = 50;
ob_start();
$n->display();
$list = ob_get_clean();
//print "<pre>";
//print ;
$text = "<h1>" . _T('Available updates', 'backuppc') . "</h1>";