示例#1
0
文件: cookie.php 项目: rigidus/ea
 function remove($cookie_name, $value, $time = 'year', $separator = ',')
 {
     $array = explode($separator, $_COOKIE[$cookie_name]);
     $array = arrays::unsetValue($array, $value);
     $str = implode($separator, $array);
     self::set($cookie_name, $str, $time);
 }
示例#2
0
 function testArraySearch()
 {
     $this->assertTrue(arrays::searchArray(array(1, 2, 3), array(1, 5)));
     $this->assertTrue(arrays::searchArray(array(1, 2, 3), array(1)));
     $this->assertFalse(arrays::searchArray(array(1, 2, 3), array()));
     $this->assertFalse(arrays::searchArray(array(1, 2, 3), array(5)));
 }
示例#3
0
 /**
  * @return var
  * @param $arraySearch Array
  * @param $arraySearch Array
  * @desc checks array membership in arrays
  */
 function searchArray($arraySearch, $arrayCheck)
 {
     for ($index = 0; $index < sizeof($arraySearch); $index++) {
         if (arrays::member($arraySearch[$index], $arrayCheck)) {
             return $arraySearch[$index];
         }
     }
     return false;
 }
 /**
  * @return array - an array of unique timepoints
  * @desc Locate the timepoints of all the before predicates	
  */
 function findallTimepoints()
 {
     $timepoints = array();
     for ($index = 0; $index < sizeof($this->constructs); $index++) {
         //Do not add the timepoint if it is already in the list
         if (!arrays::member($this->constructs[$index]->getTimePoints(), $timepoints)) {
             array_push($timepoints, $this->constructs[$index]->getTimePoints());
         }
     }
     return $timepoints;
 }
示例#5
0
文件: files.php 项目: rigidus/ea
 function info($file, $key = false)
 {
     self::$file_info = array();
     $array = explode(".", $file);
     self::$file_info['size'] = @filesize($file);
     self::$file_info['type'] = arrays::lastValue($array);
     self::$file_info['name'] = str_replace('.' . self::$file_info['type'], '', $file);
     self::$file_info['image'] = false;
     if (self::$file_info['type'] == 'JPG' || self::$file_info['type'] == 'jpg' || self::$file_info['type'] == 'gif' || self::$file_info['type'] == 'png') {
         self::$file_info['image'] = true;
     }
     if (!$key) {
         return self::$file_info;
     } else {
         return self::$file_info[$key];
     }
 }
示例#6
0
 function getallmembers($groupid)
 {
     $field = 'members';
     $resultsarray = array();
     if (is_array($groupid)) {
         foreach ($groupid as $group) {
             $result = dbs::selrecord($field, 'groups', 'groupid=' . $group, '0', '1');
             $memberlist = arrays::array_explode($result[$field], ',');
             if ($memberslist) {
                 array_merge($resultsarray, $memberlist);
             }
         }
     } else {
         $result = dbs::selrecord($field, 'groups', 'groupid=' . $groupid, '0', '1');
         $resultsarray = arrays::array_explode($result[$field], ',');
     }
     return $resultsarray;
 }
示例#7
0
function processActions($xmlSVG, $currentNode)
{
    $xmlSVG = preg_replace("/'/", "_", $xmlSVG);
    $xmlSVG = preg_replace("/[\\d]*/", "", $xmlSVG);
    $xmlSVG = preg_replace("/[_]+/", "_", $xmlSVG);
    //Remove any duplicate edges
    $SVGArray = explode(";\n", $xmlSVG);
    $SVGArray = arrays::removeDuplicates($SVGArray);
    $xmlSVG = implode(";\n", $SVGArray);
    //Highlight the goalNode
    $xmlSVG .= "goalNode[color=\"black\",shape=circle,style=filled,fillcolor=\".7 .3 1.0\"] ;\n";
    if (is_array($currentNode)) {
        for ($index = 0; $index < sizeof($currentNode); $index++) {
            $xmlSVG .= $currentNode[$index] . "[color=\"black\",style=filled,fillcolor=\"yellow\"] ;\n";
        }
    } else {
        //Highlight the CurrentNode
        $xmlSVG .= $currentNode . "[color=\"black\",style=filled,fillcolor=\"yellow\"] ;\n";
    }
    //Highlight the CurrentNode
    return $xmlSVG;
}
示例#8
0
 function actOnJavascriptPlanActions($actionPackets)
 {
     $plansConvergence = false;
     $constraintsArray = array();
     //Setup the javascript collections
     for ($index = 0; $index < sizeof($actionPackets); $index++) {
         $constraintsArray[$index] = new javaScriptCollection();
     }
     while (!$plansConvergence) {
         //Plans have have converged to a single plan
         $actionArray = array();
         $packetCollection = array();
         for ($index = 0; $index < sizeof($actionPackets); $index++) {
             $actionNode = $actionPackets[$index]->getAction();
             $data = $actionNode->getData();
             $actionPredicate = node::getNodeData($data);
             //Find the values for this conditional action
             $predicateValues = $actionPredicate->getPredicateValues();
             //Create a new javascript constraint
             $javaScriptConstraint = new javaScriptConstraint($predicateValues[1]->toString(), $predicateValues[2]->toString(), $predicateValues);
             //Add this constraint to the associated collection
             $constraintsArray[$index]->addConstraint($javaScriptConstraint);
             //Find the next action for this action packet
             $nextActionPackets = planAction::fetchNextAction($actionPackets[$index]->getPlans());
             $nextAction = $nextActionPackets[1];
             $actionArray[$index] = $nextAction[0]->toString();
             $packetCollection = array_merge($packetCollection, $nextActionPackets[0]);
         }
         $plansConvergence = arrays::allEqual($actionArray);
         if (!$plansConvergence) {
             $actionPackets = $packetCollection;
         }
     }
     //Plans must have convereged so it does not matter which one we return!
     return array('actionPackets' => $actionPackets[0], 'constraints' => $constraintsArray);
     //return $actionPackets[0];
 }
示例#9
0
 function edit()
 {
     events::observe('save', 'pages', 'savePage');
     events::observer();
     if (events::detect('save')) {
         return true;
     }
     if (events::detect('restore')) {
         self::restoreVersion(events::get('restore'));
     }
     admin::components('tabs', 'validator', 'upload');
     if (settings::get('pages', 'redactor')) {
         admin::components('redactor');
         s::section('redactor');
     }
     $page_id = admin::get('id');
     appPages::getPagesSelect(ADMIN_SITE_ID, $page_id);
     appPages::getParentPages(ADMIN_SITE_ID, true);
     appTemplates::getTmpls(ADMIN_SITE_ID);
     db::table('pages');
     db::where('page_id', $page_id);
     $row = db::assoc();
     s::set('page_link', '<a href="' . self::getUrl($row['page_folder']) . '">Посмотреть страницу на сайте</a>');
     if ($row['page_dynamic'] == '1') {
         $row['page_folder'] = '';
     } else {
         if ($row['page_folder'] != '/') {
             $row['page_folder'] = string::clearBoth($row['page_folder']);
             $arr = explode('/', $row['page_folder']);
             $row['page_folder'] = arrays::lastValue($arr);
         }
     }
     f::set('page_content', $row['page_content'], 0);
     f::set($row);
     s::set('page_id', $page_id);
     db::table('pages_files');
     db::where('page_id', $page_id);
     $r = db::select();
     while ($a = mysql_fetch_assoc($r)) {
         $a['file_type'] = files::getFileIco($a['file_type']);
         s::roll('page_files', $a);
     }
     /*
     	Load versions
     */
     db::table('pages_versions');
     db::where('page_id', $page_id);
     db::order('version_date', 'DESC');
     $res = db::select();
     $versions = array();
     while ($row = mysql_fetch_assoc($res)) {
         $versions[$row['version_date']][$row['content_id']] = array('version_id' => $row['version_id'], 'content_id' => $row['content_id'], 'version_content' => $row['version_content']);
     }
     foreach ($versions as $k => $v) {
         s::roll('versions', array('date' => dt::date2print('%H:%i:%s %d.%m.%Y', $k), 'version_date' => $k, 'id' => md5($k)));
         foreach ($v as $d => $f) {
             $f['version_content'] = htmlspecialchars('{non}' . $f['version_content'] . '{/non}');
             s::roll('versions_' . md5($k), $f);
         }
     }
 }
示例#10
0
 /**
  * @return Array of Edges
  * @param String $name
  * @param Array $history
  * @desc Find all orderings linking into the passed node
  */
 function findBackwardsConnections($name, $history)
 {
     $nodeList = array();
     $edgesSize = sizeof($this->edges);
     for ($index = 0; $index < $edgesSize; $index++) {
         $result = $this->edges[$index]->matchReverse($name);
         if ($result && !arrays::member($result, $history)) {
             array_push($nodeList, $result);
         }
     }
     return $nodeList;
 }
示例#11
0
文件: f.php 项目: rigidus/ea
 function parsing($tpl)
 {
     /*
     	Inputs
     */
     preg_match_all(self::$regex_input, $tpl, $out);
     if ($out) {
         foreach ($out[1] as $k => $v) {
             $attr = arrays::attr2array($v);
             if (!isset($attr['name'])) {
                 continue;
             }
             $attr['type'] = self::getType($attr);
             if ($attr['type'] == 'button' || $attr['type'] == 'image' || $attr['type'] == 'file') {
                 continue;
             }
             $attr['replace'] = $out[0][$k];
             if (!self::$observe_submits && $attr['type'] == 'submit') {
                 continue;
             } else {
                 if ($attr['type'] == 'submit') {
                     $tt = explode(':', $attr['name']);
                     if ($tt) {
                         if (!isset($tt[2])) {
                             $tt[2] = false;
                         }
                         if (!isset($tt[3])) {
                             $tt[3] = false;
                         }
                         events::observe($tt[0], $tt[1], $tt[2], $tt[3]);
                         $attr['name'] = $tt[0];
                         self::$elements[$attr['name']] = $attr;
                         self::$elements[$attr['name']]['gtype'] = 'submit';
                     }
                     continue;
                 }
             }
             $attr['index'] = false;
             if ($attr['type'] == 'radio') {
                 $attr = self::getValueRadio($attr);
                 self::$elements[$attr['name']][$attr['value']] = $attr;
                 self::$elements[$attr['name']]['gtype'] = $attr['type'];
             } else {
                 if (strstr($attr['name'], '[')) {
                     $match = self::formalizeName($attr['name']);
                     $attr['name'] = $match[1];
                     $attr['index'] = $match[2];
                     if ($attr['type'] == 'checkbox') {
                         $attr = self::getValueCheckBox($attr);
                     } else {
                         $attr = self::getValueField($attr);
                     }
                     self::$elements[$attr['name']][$attr['index']] = $attr;
                     self::$elements[$attr['name']]['gtype'] = $attr['type'];
                 } else {
                     if ($attr['type'] == 'checkbox') {
                         $attr = self::getValueCheckBox($attr);
                     } else {
                         $attr = self::getValueField($attr);
                     }
                     self::$elements[$attr['name']] = $attr;
                     self::$elements[$attr['name']]['gtype'] = $attr['type'];
                 }
             }
         }
     }
     /*
     	Textareas
     */
     $out = array();
     preg_match_all(self::$regex_textarea, parent::$code, $out);
     if ($out) {
         foreach ($out[1] as $k => $v) {
             $attr = arrays::attr2array($v);
             if (!isset($attr['name'])) {
                 continue;
             }
             $attr['index'] = false;
             $attr['type'] = 'textarea';
             $attr['replace'] = $out[0][$k];
             $attr['value'] = $out[2][$k];
             if (strstr($attr['name'], '[')) {
                 $match = self::formalizeName($attr['name']);
                 $attr['name'] = $match[1];
                 $attr['index'] = $match[2];
                 $attr = self::getValueField($attr);
                 self::$elements[$attr['name']][$attr['index']] = $attr;
                 self::$elements[$attr['name']]['gtype'] = $attr['type'];
             } else {
                 $attr = self::getValueField($attr);
                 self::$elements[$attr['name']] = $attr;
                 self::$elements[$attr['name']]['gtype'] = $attr['type'];
             }
         }
     }
     /*
     	Selects
     */
     $out = array();
     preg_match_all(self::$regex_select, parent::$code, $out);
     if ($out) {
         foreach ($out[1] as $k => $v) {
             $attr = arrays::attr2array($v);
             if (!isset($attr['name'])) {
                 continue;
             }
             $attr['index'] = false;
             $attr['type'] = 'select';
             $attr['replace'] = $out[0][$k];
             $attr['options'] = self::getSelectOption($out[2][$k]);
             if (strstr($attr['name'], '[')) {
                 $match = self::formalizeName($attr['name']);
                 $attr['name'] = $match[1];
                 $attr['index'] = $match[2];
                 if (isset($attr['multiple'])) {
                     $attr['index'] = false;
                     self::$elements[$attr['name']] = $attr;
                     self::$elements[$attr['name']]['gtype'] = $attr['type'];
                     self::$elements[$attr['name']]['selected'] = self::getValueSelect($attr);
                     self::$elements[$attr['name']]['multi'] = false;
                 } else {
                     self::$elements[$attr['name']]['selected'] = self::getValueSelect($attr);
                     self::$elements[$attr['name']][$attr['index']] = $attr;
                     self::$elements[$attr['name']]['gtype'] = $attr['type'];
                     self::$elements[$attr['name']]['multi'] = true;
                 }
             } else {
                 $attr['selected'] = self::getValueSelect($attr);
                 self::$elements[$attr['name']] = $attr;
                 self::$elements[$attr['name']]['gtype'] = $attr['type'];
                 self::$elements[$attr['name']]['multi'] = false;
             }
         }
     }
 }
示例#12
0
 function checkForLoop($entryTimepoint)
 {
     return arrays::member($entryTimepoint, $this->history);
 }
示例#13
0
 function _addGroup()
 {
     $array = ini::parse(SYS_ROOT . 'conf/admin/groups.ini');
     $group_id = arrays::maxKey($array);
     $group_id++;
     self::addGroupForce($group_id);
     headers::action('system', 'users', 'groups');
 }
示例#14
0
 /**
  * @return unknown
  * @param unknown $name
  * @param unknown $current
  * @desc get date data for a Y-m-d selection
  */
 function getdata_date($name, $current)
 {
     $year = date("Y");
     if (!$current) {
         // Set to default
         $current = $mysql_today;
     }
     list($datey, $datem, $dated) = explode('-', $current);
     $result[0]['day'] = formdata::getdata_select($name . 'd', 0, $dated, arrays::genlist(1, 31), 0, 0, 0);
     $result[0]['month'] = formdata::getdata_select($name . 'm', 0, $datem, arrays::genlist(1, 12), 0, 0, 0);
     $result[0]['year'] = formdata::getdata_select($name . 'y', 0, $datey, arrays::genlist(2000, 2006), 0, 0, 0);
     return $result;
 }
示例#15
0
 function getDrafts($type, $user)
 {
     $collection = [];
     if (is_object($user)) {
         $user = $user->id;
     }
     if (!is_numeric($user)) {
         throw new Exception('People must be an instance of people or be an id');
     }
     $auth = ['in', 'out'];
     if (!arrays::in($type, $auth)) {
         throw new Exception('An offer must be "in" or "out".');
     }
     $drafts = bigDb('draft' . $type)->where(['people_id', '=', $user])->exec(true);
     foreach ($drafts as $draft) {
         $status = opt($draft)->get('status', 1);
         if (1 == $status) {
             array_push($collection, $draft->assoc());
         }
     }
     return $collection;
 }
示例#16
0
文件: conf.php 项目: rigidus/ea
 function deleteFrom($conf_name, $value_name, $value, $engine = 'web')
 {
     $ini = ini::parse(SYS_ROOT . 'conf/' . $engine . '/' . $conf_name . '.ini');
     foreach ($ini as $k => $v) {
         if (isset($v[$value_name])) {
             $arr = explode(',', $v[$value_name]);
             $ini[$k][$value_name] = implode(',', arrays::unsetValue($arr, $value));
         }
     }
     ini::write($ini);
 }
示例#17
0
echo $pageref;
?>
">
<input type="hidden" name="mode" value="preview">
<td colspan="2">

<table border="0" cellpadding="4" cellspacing="0" class="searcher" width="100%">
<tr>
<td colspan="2" class="title">GROUPPRE</td>
</tr>
<tr>
<td width="260">Group name</td>
<td>
<?php 
// get an a-Z type selection box
$selectdata = formdata::getdata_select('initial', 'initial', $initial, arrays::genlist('A', 'Z'), 0, 0, 'initial');
$selectdata = formdata::add_option($selectdata, $initial, 0, 'CHOOSE');
// and display it
formdisplay::display_select($selectdata, 'default');
?>
</td>
</tr>
<tr>
<td>KEYQUERY</td>
<td><input type="text" name="keyword" value="<?php 
echo $keyword;
?>
" style="width:100px"></td>
<tr>
<td>&nbsp;</td>
<td><input type="submit" name="submit" value="SEARCH"></td>
示例#18
0
 function getPoint()
 {
     db::table('menus_points');
     db::where('point_id', params::get('point_id'));
     $row = db::assoc();
     buffer::add('{non}' . arrays::array2burst($row) . '{/non}');
 }
示例#19
0
 function irrecordArray($table, $valsarray, $showkey)
 {
     if ($table && sizeof($valsarray)) {
         $vals = '';
         //Generate column names
         $cols = dbs::genfieldnames($table, $showkey);
         $cols = preg_replace('/`|\\s/', '', $cols);
         //Break up into an array
         $keyarray = arrays::array_explode($cols, ",");
         //$valsarray_size = sizeof($valsarray);
         $valsarray_size = sizeof($keyarray);
         $sql = "INSERT INTO `{$table}` (" . $cols . ") VALUES";
         for ($valueIndex = 0; $valueIndex < sizeof($valsarray); $valueIndex++) {
             $vals = '';
             for ($index = 0; $index < $valsarray_size; $index++) {
                 if ($index != 0) {
                     $vals .= ",";
                 }
                 $vals .= "'" . $valsarray[$valueIndex][$keyarray[$index]] . "'";
             }
             if ($valueIndex != sizeof($valsarray) - 1) {
                 $sql .= "(" . $vals . "),";
             } else {
                 $sql .= "(" . $vals . ")";
             }
         }
         debug::message($sql . '<br><br>');
         $result = mysql_query($sql) or die("Couldna execute record insert/replace - " . mysql_errno() . ": " . mysql_error());
         return mysql_insert_id();
     }
     return false;
 }
示例#20
0
文件: web.php 项目: rigidus/ea
 public function loadPageData()
 {
     $arr_t = self::$page_tree;
     unset($arr_t[0], $arr_t[1]);
     $arr = array();
     $arr[0] = self::$page_tree[0];
     $arr[1] = self::$page_tree[1];
     $i = 2;
     foreach ($arr_t as $k => $v) {
         $v = string::clearBoth($v);
         $t = explode('/', $v);
         $count = count($t);
         $tt = array();
         $g = array();
         // start matrix
         for ($z = 1; $z <= $count; $z++) {
             $g = $t;
             $g[$z] = str_replace($t[$z], '[dynamic]', $t[$z]);
             $tt = implode('/', $g);
             $arr[$i] = '/' . string::clearBoth($tt) . '/';
             $i++;
         }
         $matrix = array();
         $x = 1;
         $y = 2;
         for ($z = 0; $z < $count * 2; $z++) {
             $m = $x + $y;
             if ($m < $count) {
                 $matrix[] = array($x, $m);
                 $y++;
             } elseif ($m == $count) {
                 $x++;
                 $y = 2;
             }
         }
         foreach ($matrix as $u => $r) {
             $g = $t;
             $g[$r[0]] = str_replace($t[$r[0]], '[dynamic]', $t[$r[0]]);
             $g[$r[1]] = str_replace($t[$r[1]], '[dynamic]', $t[$r[1]]);
             $tt = implode('/', $g);
             $arr[$i] = '/' . string::clearBoth($tt) . '/';
             $i++;
         }
         // end matrix
     }
     $list_path = "";
     foreach ($arr as $v) {
         if (!empty($v)) {
             $list_path .= "'" . $v . "',";
         }
     }
     $list_path = ereg_replace(",\$", "", $list_path);
     db::table('pages');
     db::join('templates', 'pages', 'tmpl_id');
     db::where('page_folder', $list_path, 'IN');
     db::where('site_id', SITE_ID, '=', 'pages');
     db::order('page_level');
     $res = db::select();
     $t_pages = array();
     $path_pages = array();
     if (db::rows() > 0) {
         while ($row = mysql_fetch_assoc($res)) {
             $t_pages[] = $row;
         }
     }
     $max_level = arrays::maxKey($t_pages, 'page_level');
     $new_array = arrays::sliceByKey($t_pages, $max_level, 'page_level');
     $tested = array();
     $et = explode('/', string::clearBoth(URI_SELF));
     /*
     	Data of current page
     */
     if ($new_array) {
         foreach ($new_array as $k => $v) {
             $folder = explode('/', string::clearBoth($v['page_folder']));
             $tested[$k] = 0;
             foreach ($folder as $d => $f) {
                 if (isset($et[$d])) {
                     if ($f == $et[$d]) {
                         $tested[$k]++;
                     }
                 }
             }
         }
         $path_pages[] = self::$page = $t_pages[arrays::maxValueKey($tested)];
     } else {
         $path_pages[] = self::$page = arrays::lastValue($t_pages);
     }
     $t_pages = array_reverse($t_pages);
     $parent = self::$page['page_parent'];
     if ($parent != 0) {
         foreach ($t_pages as $k => $v) {
             if ($v['page_id'] != $parent && $v['page_folder'] != '/') {
                 unset($t_pages[$k]);
             } else {
                 $path_pages[] = $v;
                 $parent = $v['page_parent'];
             }
         }
     }
     self::$pages = array_reverse($path_pages);
     unset($t_pages, $path_pages);
 }
示例#21
0
文件: admin.php 项目: rigidus/ea
 function adapter()
 {
     $adapter_file = APPS . self::$map['app'] . '/adapter.ini';
     $array = ini::parse($adapter_file);
     $action = self::$map['module'] . '.' . self::$map['action'];
     if (self::$apps_excl) {
         if (self::$map['app'] != 'system' || $action != 'profile.view') {
             if (!isset(self::$apps_excl[self::$map['app']][$action])) {
                 return self::loadErrorPage();
             }
         }
     }
     if (!$array) {
         return self::loadErrorPage();
     }
     if (!isset($array[$action])) {
         return self::loadErrorPage();
     }
     $mtabs = $tabs = false;
     foreach ($array as $k => $v) {
         if (isset($v['rule'])) {
             $rule = explode(',', $v['rule']);
             $continue = true;
             foreach ($rule as $u) {
                 $u = trim($u);
                 if ($u == RULE || $u == 'all') {
                     $continue = false;
                 }
             }
             if ($continue) {
                 continue;
             }
         }
         if (arrays::testKey($v, 'ico')) {
             $ico = 'tab_ico tab_ico_' . $v['ico'];
         } else {
             $ico = '';
         }
         if (arrays::testKey($v, 'mtab')) {
             $active = false;
             if ($action == $k) {
                 $active = true;
             }
             if ($v['mtab'] == 1) {
                 $name = $v['title'];
             } else {
                 $name = $v['mtab'];
             }
             $list = explode('.', $k);
             $link = SYS_DIR . self::$map['app'] . '/' . $list[0] . '/' . $list[1] . '/';
             if (isset($v['right'])) {
                 if ($active) {
                     $addtabs[$list[0]][] = array('tab' => '<span class="' . $ico . '">' . $name . '</span>');
                 } else {
                     $addtabs[$list[0]][] = array('tab' => '<a href="' . $link . '" class="' . $ico . '">' . $name . '</a>');
                 }
             } else {
                 if ($active) {
                     $mtabs[$list[0]][] = array('tab' => '<span class="' . $ico . '">' . $name . '</span>');
                 } else {
                     $mtabs[$list[0]][] = array('tab' => '<a href="' . $link . '" class="' . $ico . '">' . $name . '</a>');
                 }
             }
         } else {
             if (arrays::testKey($v, 'tab')) {
                 $active = false;
                 if ($action == $k) {
                     $active = true;
                 }
                 if ($v['tab'] == 1) {
                     $name = $v['title'];
                 } else {
                     $name = $v['tab'];
                 }
                 $list = explode('.', $k);
                 $link = SYS_DIR . self::$map['app'] . '/' . $list[0] . '/' . $list[1] . '/';
                 if (isset($v['right'])) {
                     if ($active) {
                         $addtabs[] = array('tab' => '<span class="' . $ico . '">' . $name . '</span>');
                     } else {
                         $addtabs[] = array('tab' => '<a href="' . $link . '" class="' . $ico . '">' . $name . '</a>');
                     }
                 } else {
                     if ($active) {
                         $tabs[] = array('tab' => '<span class="' . $ico . '">' . $name . '</span>');
                     } else {
                         $tabs[] = array('tab' => '<a href="' . $link . '" class="' . $ico . '">' . $name . '</a>');
                     }
                 }
             }
         }
     }
     if (isset($mtabs[self::$map['module']]) && $mtabs[self::$map['module']]) {
         s::rollArray('admin_tabs', $mtabs[self::$map['module']]);
         s::set('admin_tabs', files::get(ROOT . STYLE_PATH . 'tmpls/tabs.html'));
         if (isset($addtabs[self::$map['module']])) {
             s::rollArray('admin_right_tabs', $addtabs[self::$map['module']]);
         }
     } else {
         if ($tabs) {
             s::rollArray('admin_tabs', $tabs);
             s::set('admin_tabs', files::get(ROOT . STYLE_PATH . 'tmpls/tabs.html'));
         }
         if ($addtabs) {
             s::rollArray('admin_right_tabs', $addtabs);
         }
     }
     $adapter = $array[$action];
     if (arrays::testKey($adapter, 'title')) {
         self::$map['title'] = $adapter['title'];
     }
     if (arrays::testKey($adapter, 'mode')) {
         self::$map['mode'] = $adapter['mode'];
     }
     if (arrays::testKey($adapter, 'rule')) {
         self::$map['rule'] = $adapter['rule'];
     }
 }
示例#22
0
文件: router.php 项目: rigidus/ea
 function stringQs()
 {
     $str = arrays::array2query(self::$query_array);
     return $str;
 }
示例#23
0
 /**
  * @return void
  * @param $currentActions array of actionPackets
  * @desc merges those actions packets that have the same action
  */
 function composeActions($currentActions)
 {
     $mergedActionPacketList = array();
     //Made a copy for breaking down
     $comparisonList = $currentActions;
     while (sizeof($comparisonList) != 0) {
         //We still have action packets to process
         //Save the comparison action packet
         $comparsionObject = $comparisonList[0];
         //Remove the action packet we are going to compare.
         $comparisonList = arrays::array_chop($comparisonList, 0);
         //Find matches of Action packet and list of action Packets
         $matches = planComparison::getAllMatchingActions($comparisonList, $comparsionObject);
         //Update the new array with those that did not match the action packet
         $comparisonList = $matches['array'];
         //Merge a list of actionPackets and a actionPacket
         $mergedActionPacket = planComparison::merge($matches['actions'], $comparsionObject);
         //Collect result
         array_push($mergedActionPacketList, $mergedActionPacket);
     }
     return $mergedActionPacketList;
 }
示例#24
0
    /**
     * @return void
     * @param CoreWorkflowDatPacket $coreWorkflowDataPacket
     * @desc Displays the HTML for the each workflow item
    */
    function html_displayXML($coreWorkflowDataPacket)
    {
        $tdClass = 'helpBod';
        $planGroups = array();
        $formName = '';
        workflowDisplayHTML::workflowState($coreWorkflowDataPacket->getWorkflowId(), $coreWorkflowDataPacket->getData(), false);
        //Fetch plans from the database
        $planGraphList = graphPlanDatabaseAccess::getPlanGraphList($coreWorkflowDataPacket->getworkflowid());
        $possibleActions = actionPacket::processLoop($planGraphList, $coreWorkflowDataPacket->getworkflowid());
        if (sizeof($possibleActions)) {
            //Actions have been fouund
            $possibleActionsSize = sizeof($possibleActions);
            for ($actionPacketIndex = 0; $actionPacketIndex < $possibleActionsSize; $actionPacketIndex++) {
                $currentAction = $possibleActions[$actionPacketIndex]->getAction();
                $data = $currentAction->getData();
                $entryTimepoint = $currentAction->getName();
                $vars = $data[0]->getPredicateValues();
                $formName = $vars[0]->toString();
                $workflowCreator = $vars[1]->toString();
                //Convert into string form
                array_push($planGroups, $vars[2]->toString());
                //Check if this is a loop re-entry point
                if ($possibleActions[$actionPacketIndex]->checkForLoopReentry($entryTimepoint)) {
                    //Check we have not already save the state
                    if (!graphPlanDatabaseAccess::stateAlreadyUpdated($coreWorkflowDataPacket->getworkflowid(), $formName)) {
                        graphPlanDatabaseAccess::savePlanState($planGraphList, $coreWorkflowDataPacket->getworkflowid(), $formName);
                    }
                }
            }
            //Fetch the groups the user is a member of
            $groups = groups::getUserGroupNames($_SESSION['valid_user']);
            $groupString = "";
            $superuser = false;
            //Compare against the groups specified in the plans
            $groupsSize = sizeof($groups);
            for ($index = 0; $index < $groupsSize; $index++) {
                if ($groups[$index] == 'superuser') {
                    $superuser = true;
                } else {
                    $groupString .= $groups[$index];
                }
            }
            if (!$superuser) {
                $match = arrays::searchArray($planGroups, $groups);
            } else {
                $match = $planGroups[0];
            }
            ?>
		
	<td class="<?php 
            echo $tdClass;
            ?>
" width="172"><?php 
            echo string::sentence($formName);
            ?>
</td>
        
	<td class="<?php 
            echo $tdClass;
            ?>
" width="100"> <?php 
            echo string::sentence($workflowCreator);
            ?>
 </td>
        
	<td class="<?php 
            echo $tdClass;
            ?>
"> <?php 
            echo time::arrangedate($coreWorkflowDataPacket->getDate());
            ?>
 </td>

	<?php 
            workflowDisplayHTML::buttons($coreWorkflowDataPacket->getWorkflowId(), $match, $planGroups, $formName);
        }
    }