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


PHP zig函数代码示例

本文整理汇总了PHP中zig函数的典型用法代码示例。如果您正苦于以下问题:PHP zig函数的具体用法?PHP zig怎么用?PHP zig使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: updateCodes

 function updateCodes($parameters, $arg1 = '', $arg2 = '', $arg3 = '')
 {
     $mode = "pull";
     $shellResult = "";
     if ($arg1 or $arg2 or $arg3) {
         $mode = $arg1 ? $arg1 : $mode;
     }
     if (is_array($parameters)) {
         $mode = array_key_exists("mode", $parameters) ? $parameters['mode'] : $mode;
     }
     switch ($mode) {
         case "push":
             break;
         default:
             set_time_limit(60);
             $shellResult .= shell_exec("svn up ../");
             $directories = zig("dbTableApplications", "getApplicationDirectories");
             foreach ($directories as $directory) {
                 switch (substr($directory, 0, 4) != "zig-") {
                     case true:
                         set_time_limit(60);
                         $shellResult .= shell_exec("cd ../{$directory}");
                         $shellResult .= shell_exec("git {$mode}");
                 }
             }
     }
     $zigReturn['value'] = $shellResult;
     return $zigReturn;
 }
开发者ID:BGCX261,项目名称:zigbin-svn-to-git,代码行数:29,代码来源:updateCodes.lib.php

示例2: editRecord

 function editRecord($parameters, $arg1 = '', $arg2 = '', $arg3 = '')
 {
     $uniqueString = uniqid();
     if ($arg1 or $arg2 or $arg3) {
         $table = $arg1;
         $parentTable = $arg2;
         $parentId = $arg3;
     }
     if (is_array($parameters)) {
         $table = array_key_exists("table", $parameters) ? $parameters['table'] : $arg1;
         $parentTable = array_key_exists("parentTable", $parameters) ? $parameters['parentTable'] : $arg2;
         $parentId = array_key_exists("parentId", $parameters) ? $parameters['parentId'] : $arg3;
         $sql = array_key_exists("sql", $parameters) ? $parameters['sql'] : NULL;
         $uniqueString = array_key_exists("uniqueString", $parameters) ? $parameters['uniqueString'] : $uniqueString;
         $id = array_key_exists("id", $parameters) ? $parameters['id'] : 0;
     }
     $saveParameters = array("function" => "save", "table" => $table, "parent_table" => $parentTable, "parent_id" => $parentId, "mode" => "edit", "id" => $id, "uniqueString" => $uniqueString);
     $returnArray['data'] = zig($saveParameters);
     switch ($sql != "") {
         case true:
             $listingParameters = array("function" => "listing", "sql" => $sql, "table" => $table, "uniqueString" => $uniqueString, "zigjax" => 1);
             $returnArray['html'] = zig($listingParameters);
     }
     $zig_result['value'] = json_encode($returnArray);
     $zig_result['return'] = 1;
     return $zig_result;
 }
开发者ID:BGCX261,项目名称:zigbin-svn-to-git,代码行数:27,代码来源:editRecord.lib.php

示例3: get_file

 function get_file($parameters, $arg1 = '', $arg2 = '', $arg3 = '')
 {
     if ($arg1 or $arg2 or $arg3) {
         $filename = $arg1;
         $new_filename = $arg2 ? $arg2 : $arg1;
         $method = $arg3;
     } else {
         if (is_array($parameters)) {
             $filename = array_key_exists("filename", $parameters) ? $parameters['filename'] : NULL;
             $new_filename = array_key_exists("new_filename", $parameters) ? $parameters['new_filename'] : $filename;
             $method = array_key_exists("method", $parameters) ? $parameters['method'] : NULL;
         }
     }
     if ($method == "download") {
         header('Content-Disposition: attachment; filename="' . $new_filename . '"');
     } else {
         if ($method == "view") {
             $contentType = $this->mime_content_type($filename);
             header("Content-type: {$contentType}");
             switch (substr($contentType, 0, 5)) {
                 case "image":
                     break;
                 default:
                     header('Content-Disposition: filename="' . $new_filename . '"');
             }
         }
     }
     if (zig("cache", "file_exists", $filename)) {
         $buffer = readfile($filename);
         print $buffer;
         exit;
     }
 }
开发者ID:BGCX261,项目名称:zigbin-svn-to-git,代码行数:33,代码来源:get_file.lib.php

示例4: reportsLoadFilters

 function reportsLoadFilters($reportName)
 {
     $html = "";
     $mode = "add";
     $selectParameters = array("function" => "select", "table" => "zig_report_filters", "where" => "`report_name`='{$reportName}'");
     $result = zig($selectParameters);
     while ($fetch = $result->fetchRow()) {
         $fieldResult = zig("show_columns", $fetch['table']);
         while ($dbDefinedField = $fieldResult->fetchRow()) {
             if ($dbDefinedField['Field'] == $fetch['field']) {
                 break;
             }
         }
         $customFieldParameters = array("function" => "customField", "module" => $fetch['zig_user'], "table" => $fetch['table'], "method" => $fetch['field'], "mode" => $mode);
         $field_info = zig($customFieldParameters);
         $fieldElementParameters = array("function" => "field_element", "mode" => "add", "table" => $fetch['table'], "dbDefinedField" => $dbDefinedField, "userDefinedField" => $field_info);
         $filterName = str_replace(" ", "_", $fetch['filter_name']);
         $filterElement = zig($fieldElementParameters);
         $filterElement = str_replace("{current_field_name}", $filterName, $filterElement);
         $filterElement = str_replace("{uniqueString}", uniqid(), $filterElement);
         $filterElement = str_replace("{tableName}", $fetch['table'], $filterElement);
         $filterElement = str_replace("{fieldValue}", zig("checkArray", $field_info, "defaultValue"), $filterElement);
         $html .= zig("template", "block", "reports", "filter row");
         $html = str_replace("{filterName}", $fetch['filter_name'], $html);
         $html = str_replace("{filterElement}", $filterElement, $html);
     }
     $selectParameters = array("function" => "select", "fields" => "file", "table" => "zig_reports", "where" => "`report_name`='{$reportName}'", "limit" => 1);
     $result = zig($selectParameters);
     $fetch = $result->fetchRow();
     $html = $html != "" ? zig("template", "block", "reports", "filter header") . $html . zig("template", "block", "reports", "filter footer") : "";
     $html = str_replace("{filters}", $html, zig("template", "block", "reports", "filters"));
     return str_replace("{file}", $fetch['file'], $html);
 }
开发者ID:BGCX261,项目名称:zigbin-svn-to-git,代码行数:33,代码来源:reports.lib.php

示例5: mailer

 function mailer($parameters, $arg1, $arg2, $arg3)
 {
     if ($arg1 or $arg2 or $arg3) {
         $to = $arg1;
         $subject = $arg2;
         $message = $arg3;
     } else {
         if (is_array($parameters)) {
             $to = array_key_exists("to", $parameters) ? $parameters['to'] : NULL;
             $subject = array_key_exists("subject", $parameters) ? $parameters['subject'] : NULL;
             $message = array_key_exists("message", $parameters) ? $parameters['message'] : NULL;
             $headers = array_key_exists("headers", $parameters) ? $parameters['headers'] : NULL;
             $from = array_key_exists("from", $parameters) ? $parameters['from'] : NULL;
             $reply_to = array_key_exists("reply_to", $parameters) ? $parameters['reply_to'] : NULL;
         }
     }
     if (!$headers) {
         $headers = "MIME-Version: 1.0\r\n";
         $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
         $headers .= $from ? "From: " . $from . "\r\n" : "From: " . zig("info", "user") . " <" . zig("info", "user_email") . "> \r\n";
         $headers .= $reply_to ? "Reply-To: " . $reply_to . "\r\n" : NULL;
         $headers .= "X-Mailer: PHP/" . phpversion();
     }
     $zig_result['value'] = mail($to, $subject, $message, $headers);
     $zig_result['return'] = 1;
     return $zig_result;
 }
开发者ID:BGCX261,项目名称:zigbin-svn-to-git,代码行数:27,代码来源:mailer.lib.php

示例6: messenger

 function messenger($parameters, $arg1 = '', $arg2 = '', $arg3 = '')
 {
     if ($arg1 or $arg2 or $arg3) {
         $error = $arg1;
         $warning = $arg2;
         $system = $arg3;
     } else {
         if (is_array($parameters)) {
             $error = array_key_exists("error", $parameters) ? $parameters['error'] : NULL;
             $warning = array_key_exists("warning", $parameters) ? $parameters['warning'] : NULL;
             $system = array_key_exists("system", $parameters) ? $parameters['system'] : NULL;
             $application = array_key_exists("message", $parameters) ? $parameters['message'] : NULL;
         }
     }
     $messages = $error ? $error : "";
     $messages = ($messages and $warning) ? "<br />" : $messages;
     $messages = $warning ? $messages . $warning : $messages;
     $messages = ($messages and $system) ? "<br />" : $messages;
     $messages = $system ? $messages . $system : $messages;
     $messages = ($messages and $application) ? "<br />" : $messages;
     $messages = $application ? $messages . $application : $messages;
     $buffer = zig("template", "file", "messenger");
     $buffer = str_replace("{message}", $messages, $buffer);
     $zig_result['value'] = $buffer;
     $zig_result['return'] = 1;
     return $zig_result;
 }
开发者ID:BGCX261,项目名称:zigbin-svn-to-git,代码行数:27,代码来源:messenger.lib.php

示例7: getReportName

 function getReportName($applicationName)
 {
     $sql = "SELECT `report_name` FROM `zig_reports` WHERE `application`='{$applicationName}' LIMIT 1";
     $result = zig("query", $sql);
     $fetch = $result->fetchRow();
     return $fetch['report_name'];
 }
开发者ID:BGCX261,项目名称:zigbin-svn-to-git,代码行数:7,代码来源:reportsSql.sql.php

示例8: select_count

 function select_count($parameters, $arg1, $arg2, $arg3)
 {
     $where = "";
     if ($arg1 or $arg2 or $arg3) {
         $table = $arg1;
         $field = $arg2 ? $arg2 : "*";
         $distinct = $arg3;
     }
     if (is_array($parameters)) {
         $table = array_key_exists("table", $parameters) ? $parameters['table'] : NULL;
         $field = array_key_exists("field", $parameters) ? $parameters['field'] : "*";
         $distinct = array_key_exists("distinct", $parameters) ? $parameters['distinct'] : false;
         $where = array_key_exists("where", $parameters) ? "WHERE " . $parameters['where'] : $where;
     }
     switch ($distinct) {
         case true:
             $sql = "SELECT COUNT({$field}) AS `count` FROM {$table} {$where} GROUP BY ({$field})";
         default:
             $sql = "SELECT COUNT({$field}) AS `count` FROM {$table} {$where}";
     }
     $zig_return['return'] = 1;
     $result = zig("query", $sql);
     $fetch = $result->fetchRow();
     $zig_return['value'] = $fetch['count'];
     return $zig_return;
 }
开发者ID:BGCX261,项目名称:zigbin-svn-to-git,代码行数:26,代码来源:select_count.sql.php

示例9: display_flags

 function display_flags($parameters, $arg1 = '', $arg2 = '', $arg3 = '')
 {
     if ($arg1 or $arg2 or $arg3) {
         $zig_result = $arg1;
         $parameters = $arg2;
     } else {
         if (is_array($parameters)) {
             $zig_result = array_key_exists("zig_result", $parameters) ? $parameters['zig_result'] : NULL;
             $parameters = array_key_exists("parameters", $parameters) ? $parameters['parameters'] : NULL;
         }
     }
     $zig_gui_flags[] = "topmenu";
     $zig_gui_flags[] = "header";
     $zig_gui_flags[] = "applications";
     $zig_gui_flags[] = "actions";
     $zig_gui_flags[] = "tabs";
     $zig_gui_flags[] = "messenger";
     $zig_gui_flags[] = "side_dock";
     $zig_gui_flags[] = "trigger";
     $zig_gui_flags[] = "footer";
     $zig_gui_flags[] = "print_view";
     $zig_gui_flags[] = "print_header";
     $zig_gui_flags[] = "print_sub_header";
     $zig_gui_flags[] = "print_sub_footer";
     $zig_gui_flags[] = "print_footer";
     foreach ($zig_gui_flags as $flag) {
         if (!isset($zig_result[$flag]) and is_array($zig_result)) {
             $module_config = zig("config", $flag, $GLOBALS['zig']['current']['module']);
             $zig_result[$flag] = (isset($parameters[$flag]) and is_array($parameters)) ? $parameters[$flag] : ($module_config != NULL ? $module_config : zig("config", $flag));
         }
     }
     $zig_return['return'] = 1;
     $zig_return['value'] = $zig_result;
     return $zig_return;
 }
开发者ID:BGCX261,项目名称:zigbin-svn-to-git,代码行数:35,代码来源:display_flags.lib.php

示例10: content

 function content($parameters, $arg1, $arg2, $arg3)
 {
     if ($arg1 or $arg2 or $arg3) {
         $zig_return['buffer'] = $arg1;
         $zig_return['message'] = $arg2;
         $security = $arg3 != "" ? $arg3 : true;
     }
     if (is_array($parameters)) {
         $zig_return['buffer'] = array_key_exists("content", $parameters) ? $parameters['content'] : $arg1;
         $zig_return['message'] = array_key_exists("message", $parameters) ? $parameters['message'] : $arg2;
         $security = array_key_exists("security", $parameters) ? $parameters['security'] : $security;
         if (array_key_exists("topmenu", $parameters)) {
             $zig_return['topmenu'] = $parameters['topmenu'];
         }
         if (array_key_exists("applications", $parameters)) {
             $zig_return['applications'] = $parameters['applications'];
         }
     }
     if ($security) {
         zig("security");
     }
     $zig_return['messenger'] = $zig_return['message'];
     $zig_return['actions'] = false;
     return $zig_return;
 }
开发者ID:BGCX261,项目名称:zigbin-svn-to-git,代码行数:25,代码来源:content.gui.php

示例11: permissions

 function permissions($parameters, $arg1 = '', $arg2 = '', $arg3 = '')
 {
     if ($arg1 or $arg2 or $arg3) {
         $module = $arg1 ? $arg1 : $GLOBALS['zig']['current']['module'];
         $script = $arg2 ? $arg2 : $GLOBALS['zig']['current']['script'];
         $action = $arg3 ? $arg3 : $GLOBALS['zig']['current']['action'];
         $field_name = "all";
         $field_value = "all";
     } else {
         if (is_array($parameters)) {
             $module = array_key_exists("module", $parameters) ? $parameters['module'] : $GLOBALS['zig']['current']['module'];
             $script = array_key_exists("script", $parameters) ? $parameters['script'] : $GLOBALS['zig']['current']['script'];
             $action = array_key_exists("action", $parameters) ? $parameters['action'] : $GLOBALS['zig']['current']['action'];
             $tab = array_key_exists("tab", $parameters) ? $parameters['tab'] : NULL;
             $field_name = array_key_exists("field_name", $parameters) ? $parameters['field_name'] : "all";
             $field_value = array_key_exists("field_value", $parameters) ? $parameters['field_value'] : "all";
         }
     }
     $module = $module == "{any}" ? NULL : $module;
     $directory = $module;
     $script = $script == "{any}" ? NULL : $script;
     $action = $action == "{any}" ? NULL : $action;
     $zig_info_obj = new zig_info();
     $user = zig("info", "user");
     $user_id = zig("info", "user_id");
     $group = $zig_info_obj->group();
     $pre = zig("config", "pre");
     $zig_global_database = zig("config", "global_database");
     $script = $script ? $script : $GLOBALS['zig']['current']['script'];
     $script = addslashes($script);
     $sql = "SELECT `{$pre}applications`.`name` AS module,`{$pre}tabs`.`name` AS tab \n\t\t\t\t\tFROM `{$zig_global_database}`.`{$pre}tabs`,`{$zig_global_database}`.`{$pre}applications` \n\t\t\t\t\tWHERE \n\t\t\t\t\t\t`directory`='{$directory}' \n\t\t\t\t\tAND `{$pre}tabs`.`module`=`{$pre}applications`.`name` \n\t\t\t\t\tAND `{$pre}tabs`.`link`='{$script}' LIMIT 1";
     $result = zig("query", $sql);
     $fetch = $result->fetchRow();
     $module = $fetch['module'];
     $tab = $fetch['tab'];
     $where_tab = $tab ? " AND (tab='{$tab}' OR tab='all') " : NULL;
     $where_action = $tab ? " AND (action='{$action}' OR action='all') " : NULL;
     $sql = "SELECT users \n\t\t\t\tFROM `{$zig_global_database}`.`{$pre}permissions` \n\t\t\t\tWHERE \n\t\t\t\t\t(zig_parent_id='{$user_id}' OR users='{$user}' OR users='{$group}' OR users='all') \n\t\t\t\tAND (module='{$module}' OR module='all') {$where_tab} {$where_action} \n\t\t\t\tAND (field_name='{$field_name}' OR field_name='all') \n\t\t\t\tAND (field_value='{$field_value}' OR field_value='all') \n\t\t\t\tAND permission='allow' LIMIT 1";
     $result = zig("query", $sql, "permissions.lib.php", false);
     $permission = $result->RecordCount();
     if ($permission == 1) {
         $sql = "SELECT users \n\t\t\t\t\tFROM {$zig_global_database}.{$pre}permissions \n\t\t\t\t\tWHERE \n\t\t\t\t\t\t(zig_parent_id='{$user_id}' OR users='{$user}' OR users='{$group}' OR users='all') \n\t\t\t\t\tAND (module='{$module}' OR module='all')  {$where_tab} {$where_action} \n\t\t\t\t\tAND (field_name='{$field_name}' OR field_name='all') \n\t\t\t\t\tAND (field_value='{$field_value}' OR field_value='all') \n\t\t\t\t\tAND permission='deny' LIMIT 1";
         $result = zig("query", $sql);
         $permission = $result->RecordCount() ? false : true;
         /*			if($module=="zig-helpdesk")
         			{
         				print " m=".$module ;
         				print " t=".$tab ;
         				print " a=".$action ;
         				print " u=".$user ;
         				print " p=".$permission ;
         				print " sql=".$sql ;
         				print "<br /><br />" ;
         //				exit() ;
         			}*/
     }
     $zig_return['value'] = $permission;
     $zig_return['return'] = 1;
     return $zig_return;
 }
开发者ID:BGCX261,项目名称:zigbin-svn-to-git,代码行数:60,代码来源:permissions.lib.php

示例12: trash

 function trash($parameters, $arg1 = NULL, $arg2 = NULL, $arg3 = NULL)
 {
     $global_database = zig("config", "global database");
     $pre = zig("config", "pre");
     $sql = "DELETE FROM `{$zig_global_database}`.`{$pre}trash`";
     zig("query", $sql);
     print "Trash Emptied";
 }
开发者ID:BGCX261,项目名称:zigbin-svn-to-git,代码行数:8,代码来源:trash.sql.php

示例13: print_footer

 function print_footer($file, $method)
 {
     $buffer = zig("template", "file", $file);
     $buffer = $buffer ? $buffer : zig("template", "file", "footer");
     $footer .= "Powered by zigbin";
     $buffer = str_replace("{footer}", $footer, $buffer);
     //return $buffer ;
 }
开发者ID:BGCX261,项目名称:zigbin-svn-to-git,代码行数:8,代码来源:print_view.gui.php

示例14: fieldset

 function fieldset($parameters, $arg1 = '', $arg2 = '', $arg3 = '')
 {
     $collapsed = true;
     $collapsible = true;
     $description = NULL;
     $callback = NULL;
     if ($arg1 or $arg2 or $arg3) {
         $content = $arg1;
         $name = $arg2;
         $collapsed = $arg3 === false ? $arg3 : $collapsed;
     }
     if (is_array($parameters)) {
         $content = array_key_exists("content", $parameters) ? $parameters['content'] : NULL;
         $name = array_key_exists("name", $parameters) ? $parameters['name'] : NULL;
         $collapsed = array_key_exists("collapsed", $parameters) ? $parameters['collapsed'] : true;
         $collapsible = array_key_exists("collapsible", $parameters) ? $parameters['collapsible'] : true;
         $description = array_key_exists("description", $parameters) ? $parameters['description'] : NULL;
         $callback = array_key_exists("callback", $parameters) ? $parameters['callback'] ? ",'" . addslashes($parameters['callback']) . "'" : NULL : NULL;
     }
     $name = str_replace("'", "", $name);
     $name = str_replace('"', "", $name);
     $unique_name = $name . "_" . uniqid();
     $template_block = $collapsible ? "collapsible" : "uncollapsible";
     if (!$collapsed) {
         $zig_fieldset_class = "zig_fieldset_displayed";
         $zig_fieldset_title_class = "zig_fieldset_title_displayed_class";
         $zig_div_fieldset_class = "zig_visible";
     } else {
         $zig_fieldset_class = "zig_fieldset_collapsed";
         $zig_fieldset_title_class = "zig_fieldset_title_collapsed_class";
         $zig_div_fieldset_class = "zig_invisible";
     }
     $title = str_replace("_", " ", $name);
     $title = ucwords(trim($title));
     $title = htmlspecialchars($title, ENT_QUOTES);
     $title = str_replace(" ", "&nbsp;", $title);
     $description_buffer = NULL;
     switch ($description) {
         case "":
         case NULL:
             break;
         default:
             $description_buffer = zig("template", "block", "fieldset", "description");
             $description_buffer = str_replace("{description}", $description, $description_buffer);
             break;
     }
     $buffer = zig("template", "block", "fieldset", $template_block);
     $buffer = str_replace("{unique_name}", $unique_name, $buffer);
     $buffer = str_replace("{zig_fieldset_class}", $zig_fieldset_class, $buffer);
     $buffer = str_replace("{title}", $title, $buffer);
     $buffer = str_replace("{zig_div_fieldset_class}", $zig_div_fieldset_class, $buffer);
     $buffer = str_replace("{zig_fieldset_title_class}", $zig_fieldset_title_class, $buffer);
     $buffer = str_replace("{description}", $description_buffer, $buffer);
     $buffer = str_replace("{content}", $content, $buffer);
     $buffer = str_replace("{callback}", $callback, $buffer);
     $zig_result['value'] = $zig_result['html'] = $buffer;
     return $zig_result;
 }
开发者ID:BGCX261,项目名称:zigbin-svn-to-git,代码行数:58,代码来源:fieldset.lib.php

示例15: getVariablesByParentId

 function getVariablesByParentId($parentId)
 {
     $records = array();
     $sql = "SELECT \r\n\t\t\t\t\t`variable`, \r\n\t\t\t\t\t`hash` \r\n\t\t\t\tFROM \r\n\t\t\t\t\t`zig_field_hashed_variables` \r\n\t\t\t\tWHERE \r\n\t\t\t\t\t`zig_parent_id` = '{$parentId}'";
     $result = zig("query", $sql);
     while ($fetch = $result->fetchRow()) {
         $records[] = $fetch;
     }
     return $records;
 }
开发者ID:BGCX261,项目名称:zigbin-svn-to-git,代码行数:10,代码来源:dbTableFieldHashedVariables.sql.php


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