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


PHP fs_director::CheckForEmptyValue方法代码示例

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


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

示例1: Template

 public static function Template()
 {
     $currentuser = ctrl_users::GetUserDetail();
     $bandwidthquota = $currentuser['bandwidthquota'];
     $bandwidth = ctrl_users::GetQuotaUsages('bandwidth', $currentuser['userid']);
     if ($bandwidthquota == 0) {
         return '<div class="progress progress-striped"><div class="progress-bar progress-bar-success" style="width: 0%"></div></div>';
     } else {
         if (fs_director::CheckForEmptyValue($bandwidth)) {
             $bandwidth = 0;
         }
         $percent = round($bandwidth / $bandwidthquota * 100, 0);
         if ($percent >= 75) {
             $bar = 'danger';
         } else {
             $bar = 'success';
         }
         if ($percent >= 10) {
             $showpercent = $percent . '%';
         } else {
             $showpercent = '';
         }
         return '<div class="progress progress-striped"><div class="progress-bar progress-bar-' . $bar . '" style="width: ' . $percent . '%">' . $showpercent . '</div></div>';
     }
 }
开发者ID:TGates71,项目名称:Sentora-Windows-Upgrade,代码行数:25,代码来源:progbarbandwidth.class.php

示例2: translate

 /**
  * Used to translate a text string into the language preference of the user.
  * @author Russell Skinner (rskinner@zpanelcp.com)
  * @global db_driver $zdbh The ZPX database handle.
  * @param $message The string to translate.
  * @return string The transalated string.
  */
 static function translate($message)
 {
     global $zdbh;
     $message = addslashes($message);
     $currentuser = ctrl_users::GetUserDetail();
     $lang = $currentuser['language'];
     $column_names = self::GetColumnNames('x_translations');
     foreach ($column_names as $column_name) {
         $columnNameClean = $zdbh->mysqlRealEscapeString($column_name);
         $sql = $zdbh->prepare("SELECT * FROM x_translations WHERE " . $columnNameClean . " LIKE :message");
         $sql->bindParam(':message', $message);
         $sql->execute();
         $result = $sql->fetch();
         if ($result) {
             if (!fs_director::CheckForEmptyValue($result['tr_' . $lang . '_tx'])) {
                 return $result['tr_' . $lang . '_tx'];
             } else {
                 return stripslashes($message);
             }
         }
     }
     if (!fs_director::CheckForEmptyValue($message) && $lang == "en") {
         $sql = $zdbh->prepare("INSERT INTO x_translations (tr_en_tx) VALUES (:message)");
         $sql->bindParam(':message', $message);
         $sql->execute();
     }
     return stripslashes($message);
 }
开发者ID:TGates71,项目名称:Sentora-Windows-Upgrade,代码行数:35,代码来源:language.class-orig.php

示例3: Template

 public static function Template()
 {
     if (!fs_director::CheckForEmptyValue(ctrl_options::GetSystemOption('server_ip'))) {
         return ctrl_options::GetSystemOption('server_ip');
     } else {
         return sys_monitoring::ServerIPAddress();
     }
 }
开发者ID:Boter,项目名称:madmin-core,代码行数:8,代码来源:serveripaddress.class.php

示例4: Template

 public static function Template()
 {
     $user = ctrl_users::GetUserDetail();
     if (!fs_director::CheckForEmptyValue(fs_director::CheckForEmptyValue($user['usercss']))) {
         $retval = "etc/styles/" . ui_template::GetUserTemplate() . "/css/default.css";
     } else {
         $retval = "etc/styles/" . ui_template::GetUserTemplate() . "/css/" . $user['usercss'] . ".css";
     }
     return $retval;
 }
开发者ID:Boter,项目名称:madmin-core,代码行数:10,代码来源:csspath.class.php

示例5: getDomains

 static function getDomains()
 {
     $currentuser = ctrl_users::GetUserDetail();
     $clientlist = self::ListDomains($currentuser['userid']);
     if (!fs_director::CheckForEmptyValue($clientlist)) {
         return $clientlist;
     } else {
         return false;
     }
 }
开发者ID:TGates71,项目名称:Sentora-Windows-Upgrade,代码行数:10,代码来源:controller.ext.php

示例6: GetUserTemplate

 /**
  * Returns the name (folder name) of the template that should be used for the current user.
  * @author Bobby Allen (ballen@bobbyallen.me)
  * @return string The template name.
  */
 static function GetUserTemplate()
 {
     $user = ctrl_users::GetUserDetail();
     if (fs_director::CheckForEmptyValue($user['usertheme'])) {
         # Lets use the reseller's theme they have setup!
         $reseller = ctrl_users::GetUserDetail($user['resellerid']);
         return $reseller['usertheme'];
     } else {
         return $user['usertheme'];
     }
 }
开发者ID:Boter,项目名称:madmin-core,代码行数:16,代码来源:template.class.php

示例7: GetDomainsForUser

 /**
  * Gets a list of all the domains that a user has configured on their hosting account (the user id needs to be sent in the <content> tag).
  * @global type $zdbh
  * @return type 
  */
 public function GetDomainsForUser()
 {
     global $zdbh;
     $request_data = $this->RawXMWSToArray($this->wsdata);
     $response_xml = "\n";
     $alldomains = module_controller::ListDomains($request_data['content']);
     if (!fs_director::CheckForEmptyValue($alldomains)) {
         foreach ($alldomains as $domain) {
             $response_xml = $response_xml . ws_xmws::NewXMLContentSection('domain', array('id' => $domain['id'], 'uid' => $domain['uid'], 'domain' => $domain['name'], 'homedirectory' => $domain['directory'], 'active' => $domain['active']));
         }
     }
     $dataobject = new runtime_dataobject();
     $dataobject->addItemValue('response', '');
     $dataobject->addItemValue('content', $response_xml);
     return $dataobject->getDataObject();
 }
开发者ID:TGates71,项目名称:Sentora-Windows-Upgrade,代码行数:21,代码来源:webservice.ext.php

示例8: getServices

 public static function getServices()
 {
     global $controller;
     if (file_exists(ui_tpl_assetfolderpath::Template() . 'img/modules/' . $controller->GetControllerRequest('URL', 'module') . '/assets/up.gif') && file_exists(ui_tpl_assetfolderpath::Template() . 'img/modules/' . $controller->GetControllerRequest('URL', 'module') . '/assets/down.gif')) {
         $iconpath = '<img src="' . ui_tpl_assetfolderpath::Template() . 'img/modules/' . $controller->GetControllerRequest('URL', 'module') . '/assets/';
     } else {
         $iconpath = '<img src="modules/' . $controller->GetControllerRequest('URL', 'module') . '/assets/';
     }
     $line = "<h2>" . ui_language::translate("Checking status of services...") . "</h2>";
     $line .= "<table>";
     $status = fs_director::CheckForEmptyValue(sys_monitoring::PortStatus($PortNum));
     $line .= '<tr><th>HTTP</th><td>' . module_controller::status_port(80, $iconpath) . '</td></tr>';
     $line .= '<tr><th>FTP</th><td>' . module_controller::status_port(21, $iconpath) . '</td></tr>';
     $line .= '<tr><th>SMTP</th><td>' . module_controller::status_port(25, $iconpath) . '</td></tr>';
     $line .= '<tr><th>POP3</th><td>' . module_controller::status_port(110, $iconpath) . '</td></tr>';
     $line .= '<tr><th>IMAP</th><td>' . module_controller::status_port(143, $iconpath) . '</td></tr>';
     $line .= '<tr><th>MySQL</th><td>' . module_controller::status_port(3306, $iconpath) . '</td></tr>';
     $line .= '<tr><th>DNS</th><td>' . module_controller::status_port(53, $iconpath) . '</td></tr>';
     $line .= '</table>';
     $line .= '<br><h2>' . ui_language::translate('Server Uptime') . '</h2>';
     $line .= ui_language::translate('Uptime') . ": " . sys_monitoring::ServerUptime();
     return $line;
 }
开发者ID:bbspike,项目名称:sentora-core,代码行数:23,代码来源:controller.ext.php

示例9: translate

 /**
  * Used to translate a text string into the language preference of the user.
  * @author Pascal Peyremorte (p.peyremorte@wanadoo.fr)
  * @global db_driver $zdbh The ZPX database handle.
  * @param $message The string to translate.
  * @return string The transalated string.
  */
 static function translate($message)
 {
     global $zdbh;
     if (empty(self::$LangCol)) {
         $uid = ctrl_auth::CurrentUserID();
         $sql = $zdbh->prepare('SELECT ud_language_vc FROM x_profiles WHERE ud_user_fk=' . $uid);
         $sql->execute();
         $lang = $sql->fetch();
         self::$LangCol = 'tr_' . $lang['ud_language_vc'] . '_tx';
     }
     if (self::$LangCol == 'tr_en_tx') {
         return $message;
     }
     //no translation required, english used
     $SlashedMessage = addslashes($message);
     //protect special chars
     $sql = $zdbh->prepare('SELECT ' . self::$LangCol . ' FROM x_translations WHERE tr_en_tx =:message');
     $sql->bindParam(':message', $SlashedMessage);
     $sql->execute();
     $result = $sql->fetch();
     if ($result) {
         if (!fs_director::CheckForEmptyValue($result[self::$LangCol])) {
             return $result[self::$LangCol];
         } else {
             return $message;
         }
         //translated message empty
     } else {
         //message not found in the table
         //add unfound message to the table with empties translations
         $sql = $zdbh->prepare('INSERT INTO x_translations SET tr_en_tx=:message');
         $sql->bindParam(':message', $SlashedMessage);
         $sql->execute();
         return $message;
     }
 }
开发者ID:BIGGANI,项目名称:zpanelx,代码行数:43,代码来源:language.class.php

示例10: getResult

 static function getResult()
 {
     if (!fs_director::CheckForEmptyValue(self::$ResultOk)) {
         return ui_sysmessage::shout(ui_language::translate(self::$ResultOk), 'zannouncesuccess', 'SUCCESS DNS SAVED');
     } elseif (!fs_director::CheckForEmptyValue(self::$ResultErr)) {
         return ui_sysmessage::shout(ui_language::translate(self::$ResultErr), 'zannounceerror', 'ERROR DNS NOT SAVED');
     }
     return;
 }
开发者ID:caglaroflazoglu,项目名称:sentora-core,代码行数:9,代码来源:controller.ext.php

示例11: getResult

 static function getResult()
 {
     if (!fs_director::CheckForEmptyValue(self::$filenotexist)) {
         return ui_sysmessage::shout("There was an error saving your backup!", "zannounceerror");
     }
     if (!fs_director::CheckForEmptyValue(self::$deleteok)) {
         return ui_sysmessage::shout("Backup deleted successfully!", "zannounceok");
     }
     if (!fs_director::CheckForEmptyValue(self::$backupok)) {
         return ui_sysmessage::shout("Backup completed successfully!", "zannounceok");
     }
     return;
 }
开发者ID:bbspike,项目名称:sentora-core,代码行数:13,代码来源:controller.ext.php

示例12: getResult

 static function getResult()
 {
     if (!fs_director::CheckForEmptyValue(self::$blank)) {
         return ui_sysmessage::shout(ui_language::translate("You must enter a valid username and password to create your FTP account."), "zannounceerror");
     }
     if (!fs_director::CheckForEmptyValue(self::$alreadyexists)) {
         return ui_sysmessage::shout(ui_language::translate("An FTP account with that name already exists."), "zannounceerror");
     }
     if (!fs_director::CheckForEmptyValue(self::$error)) {
         return ui_sysmessage::shout(ui_language::translate("There was an error updating your FTP accounts."), "zannounceerror");
     }
     if (!fs_director::CheckForEmptyValue(self::$badname)) {
         return ui_sysmessage::shout(ui_language::translate("Your ftp account name is not valid. Please enter a valid ftp account name."), "zannounceerror");
     }
     if (!fs_director::CheckForEmptyValue(self::$invalidPath)) {
         return ui_sysmessage::shout(ui_language::translate("Invalid Folder."), "zannounceok");
     }
     if (!fs_director::CheckForEmptyValue(self::$ok)) {
         return ui_sysmessage::shout(ui_language::translate("FTP accounts updated successfully."), "zannounceok");
     }
     return;
 }
开发者ID:Boter,项目名称:madmin-core,代码行数:22,代码来源:controller.ext.php

示例13: getResult

 static function getResult()
 {
     if (!fs_director::CheckForEmptyValue(self::$ok)) {
         return ui_sysmessage::shout(ui_language::translate("Changes to your settings have been saved successfully!"));
     }
     return;
 }
开发者ID:bbspike,项目名称:sentora-core,代码行数:7,代码来源:controller.ext.php

示例14: WriteVhostConfigFile

function WriteVhostConfigFile()
{
    global $zdbh;
    //Get email for server admin of zpanel
    $getserveremail = $zdbh->query("SELECT ac_email_vc FROM x_accounts where ac_id_pk=1")->fetch();
    if ($getserveremail['ac_email_vc'] != "") {
        $serveremail = $getserveremail['ac_email_vc'];
    } else {
        $serveremail = "postmaster@" . ctrl_options::GetSystemOption('zpanel_domain');
    }
    $customPorts = array();
    $portQuery = $zdbh->prepare("SELECT vh_custom_port_in, vh_deleted_ts FROM zpanel_core.x_vhosts WHERE vh_custom_port_in IS NOT NULL AND vh_deleted_ts IS NULL");
    $portQuery->execute();
    while ($rowport = $portQuery->fetch()) {
        $customPorts[] = $rowport['vh_custom_port_in'];
    }
    $customPortList = array_unique($customPorts);
    /*
     * ###########################################################################​###################################
     * #
     * # Default Virtual Host Container
     * #
     * ###########################################################################​###################################
     */
    $line = "################################################################" . fs_filehandler::NewLine();
    $line .= "# Apache VHOST configuration file" . fs_filehandler::NewLine();
    $line .= "# Automatically generated by ZPanel " . sys_versions::ShowZpanelVersion() . fs_filehandler::NewLine();
    $line .= "# Generated on: " . date(ctrl_options::GetSystemOption('zpanel_df'), time()) . fs_filehandler::NewLine();
    $line .= "################################################################" . fs_filehandler::NewLine();
    $line .= "" . fs_filehandler::NewLine();
    /**
     * NameVirtualHost is still needed for Apache 2.2
     * @todo conditionally run this for apache version > 2.2
     * warning apache verion not available in php functions when running over cli
     */
    $line .= "NameVirtualHost *:" . ctrl_options::GetSystemOption('apache_port') . "" . fs_filehandler::NewLine();
    foreach ($customPortList as $port) {
        $line .= "NameVirtualHost *:" . $port . "" . fs_filehandler::NewLine();
    }
    $line .= "" . fs_filehandler::NewLine();
    $line .= "# Configuration for ZPanel control panel." . fs_filehandler::NewLine();
    $line .= "<VirtualHost *:" . ctrl_options::GetSystemOption('sentora_port') . ">" . fs_filehandler::NewLine();
    $line .= "ServerAdmin " . $serveremail . fs_filehandler::NewLine();
    $line .= "DocumentRoot \"" . ctrl_options::GetSystemOption('zpanel_root') . "\"" . fs_filehandler::NewLine();
    $line .= "ServerName " . ctrl_options::GetSystemOption('zpanel_domain') . "" . fs_filehandler::NewLine();
    $line .= "AddType application/x-httpd-php .php" . fs_filehandler::NewLine();
    $line .= "<Directory \"" . ctrl_options::GetSystemOption('zpanel_root') . "\">" . fs_filehandler::NewLine();
    $line .= "Options +FollowSymLinks -Indexes" . fs_filehandler::NewLine();
    $line .= "    AllowOverride All" . fs_filehandler::NewLine();
    $line .= "    Order allow,deny" . fs_filehandler::NewLine();
    $line .= "    Allow from all" . fs_filehandler::NewLine();
    $line .= "</Directory>" . fs_filehandler::NewLine();
    $line .= "" . fs_filehandler::NewLine();
    $line .= "# Custom settings are loaded below this line (if any exist)" . fs_filehandler::NewLine();
    // Global custom zpanel entry
    $line .= ctrl_options::GetSystemOption('global_zpcustom') . fs_filehandler::NewLine();
    $line .= "</VirtualHost>" . fs_filehandler::NewLine();
    $line .= "" . fs_filehandler::NewLine();
    $line .= "################################################################" . fs_filehandler::NewLine();
    $line .= "# ZPanel generated VHOST configurations below....." . fs_filehandler::NewLine();
    $line .= "################################################################" . fs_filehandler::NewLine();
    $line .= "" . fs_filehandler::NewLine();
    /*
     * ##############################################################################################################
     * #
     * # All Virtual Host Containers
     * #
     * ##############################################################################################################
     */
    // Zpanel virtual host container configuration
    $sql = $zdbh->prepare("SELECT * FROM x_vhosts WHERE vh_deleted_ts IS NULL");
    $sql->execute();
    while ($rowvhost = $sql->fetch()) {
        // Grab some variables we will use for later...
        $vhostuser = ctrl_users::GetUserDetail($rowvhost['vh_acc_fk']);
        $bandwidth = ctrl_users::GetQuotaUsages('bandwidth', $vhostuser['userid']);
        $diskspace = ctrl_users::GetQuotaUsages('diskspace', $vhostuser['userid']);
        // Set the vhosts to "LIVE"
        $vsql = $zdbh->prepare("UPDATE x_vhosts SET vh_active_in=1 WHERE vh_id_pk=:id");
        $vsql->bindParam(':id', $rowvhost['vh_id_pk']);
        $vsql->execute();
        // Add a default email if no email found for client.
        if (fs_director::CheckForEmptyValue($vhostuser['email'])) {
            $useremail = "postmaster@" . $rowvhost['vh_name_vc'];
        } else {
            $useremail = $vhostuser['email'];
        }
        // Check if domain or subdomain to see if we add an alias with 'www'
        if ($rowvhost['vh_type_in'] == 2) {
            $serveralias = $rowvhost['vh_name_vc'];
        } else {
            $serveralias = $rowvhost['vh_name_vc'] . " www." . $rowvhost['vh_name_vc'];
        }
        if (fs_director::CheckForEmptyValue($rowvhost['vh_custom_port_in'])) {
            $vhostPort = ctrl_options::GetSystemOption('apache_port');
        } else {
            $vhostPort = $rowvhost['vh_custom_port_in'];
        }
        if (fs_director::CheckForEmptyValue($rowvhost['vh_custom_ip_vc'])) {
            $vhostIp = "*";
//.........这里部分代码省略.........
开发者ID:caglaroflazoglu,项目名称:sentora-core,代码行数:101,代码来源:OnDaemonRun.hook.php

示例15: getResult

 static function getResult()
 {
     if (!fs_director::CheckForEmptyValue(self::$error_message)) {
         return ui_sysmessage::shout(ui_language::translate(self::$error_message), 'zannounceerror', 'zannounce');
     }
     if (!fs_director::CheckForEmptyValue(self::$ok)) {
         return ui_sysmessage::shout(ui_language::translate("Changes to your module options have been saved successfully!"));
     } else {
         return ui_language::translate(ui_module::GetModuleDescription());
     }
     return;
 }
开发者ID:bbspike,项目名称:sentora-core,代码行数:12,代码来源:controller.ext.php


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