Plugin Directory

Changeset 3370713


Ignore:
Timestamp:
09/30/2025 09:16:17 PM (5 months ago)
Author:
plainware
Message:

3.9.62

Location:
locatoraid/trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • locatoraid/trunk/happ2/hsystem/database/query_builder.php

    r1925696 r3370713  
    5252
    5353class HC_Database_Query_Builder {
    54     /**
    55      * Table prefix
    56      *
    57      * @var string
    58      */
    5954    public $dbprefix        = '';
    60 
    61     /**
    62      * Character set
    63      *
    64      * @var string
    65      */
    6655    public $char_set        = 'utf8';
    67 
    68     /**
    69      * Swap Prefix
    70      *
    71      * @var string
    72      */
    7356    public $swap_pre        = '';
    74 
    75     /**
    76      * Debug flag
    77      *
    78      * Whether to display error messages.
    79      *
    80      * @var bool
    81      */
    8257    public $db_debug        = FALSE;
    8358    public $db_debug_level  = 'low';
    84 
    85     /**
    86      * Benchmark time
    87      *
    88      * @var int
    89      */
    9059    public $benchmark       = 0;
    91 
    92     /**
    93      * Bind marker
    94      *
    95      * Character used to identify values in a prepared statement.
    96      *
    97      * @var string
    98      */
    9960    public $bind_marker     = '?';
    100 
    101     /**
    102      * Save queries flag
    103      *
    104      * Whether to keep an in-memory history of queries for debugging purposes.
    105      *
    106      * @var bool
    107      */
    10861    public $save_queries        = TRUE;
    109 
    110     /**
    111      * Queries list
    112      *
    113      * @see CI_DB_driver::$save_queries
    114      * @var string[]
    115      */
    11662    public $queries         = array();
    117 
    118     /**
    119      * Query times
    120      *
    121      * A list of times that queries took to execute.
    122      *
    123      * @var array
    124      */
    12563    public $query_times     = array();
    126 
    127     /**
    128      * Transaction enabled flag
    129      *
    130      * @var bool
    131      */
    13264    public $trans_enabled       = TRUE;
    133 
    134     /**
    135      * Strict transaction mode flag
    136      *
    137      * @var bool
    138      */
    13965    public $trans_strict        = TRUE;
    140 
    141     /**
    142      * Transaction depth level
    143      *
    144      * @var int
    145      */
    14666    protected $_trans_depth     = 0;
    147 
    148     /**
    149      * Transaction status flag
    150      *
    151      * Used with transactions to determine if a rollback should occur.
    152      *
    153      * @var bool
    154      */
    15567    protected $_trans_status    = TRUE;
    156 
    157     /**
    158      * Transaction failure flag
    159      *
    160      * Used with transactions to determine if a transaction has failed.
    161      *
    162      * @var bool
    163      */
    16468    protected $_trans_failure   = FALSE;
    165 
    166     /**
    167      * Cache On flag
    168      *
    169      * @var bool
    170      */
    17169    public $cache_on        = FALSE;
    172 
    173     /**
    174      * Cache directory path
    175      *
    176      * @var bool
    177      */
    17870    public $cachedir        = '';
    179 
    180     /**
    181      * Cache auto-delete flag
    182      *
    183      * @var bool
    184      */
    18571    public $cache_autodel       = FALSE;
    186 
    187     /**
    188      * DB Cache object
    189      *
    190      * @see CI_DB_cache
    191      * @var object
    192      */
    19372    public $CACHE;
    194 
    195     /**
    196      * Protect identifiers flag
    197      *
    198      * @var bool
    199      */
    20073    protected $_protect_identifiers     = TRUE;
    201 
    202     /**
    203      * List of reserved identifiers
    204      *
    205      * Identifiers that must NOT be escaped.
    206      *
    207      * @var string[]
    208      */
    20974    protected $_reserved_identifiers    = array('*');
    210 
    211     /**
    212      * Identifier escape character
    213      *
    214      * @var string
    215      */
    216     // protected $_escape_char = '"';
    21775    protected $_escape_char = '`';
    218 
    219     /**
    220      * ESCAPE statement string
    221      *
    222      * @var string
    223      */
    22476    protected $_like_escape_str = " ESCAPE '%s' ";
    225 
    226     /**
    227      * ESCAPE character
    228      *
    229      * @var string
    230      */
    23177    protected $_like_escape_chr = '!';
    232 
    233     /**
    234      * ORDER BY random keyword
    235      *
    236      * @var array
    237      */
    23878    protected $_random_keyword = array('RAND()', 'RAND(%d)');
    239 
    240     /**
    241      * COUNT string
    242      *
    243      * @used-by CI_DB_driver::count_all()
    244      * @used-by CI_DB_query_builder::count_all_results()
    245      *
    246      * @var string
    247      */
    24879    protected $_count_string = 'SELECT COUNT(*) AS ';
    249 
    250     /**
    251      * Return DELETE SQL flag
    252      *
    253      * @var bool
    254      */
    25580    protected $return_delete_sql        = FALSE;
    256 
    257     /**
    258      * Reset DELETE data flag
    259      *
    260      * @var bool
    261      */
    26281    protected $reset_delete_data        = FALSE;
    263 
    264     /**
    265      * QB SELECT data
    266      *
    267      * @var array
    268      */
    26982    protected $qb_select            = array();
    270 
    271     /**
    272      * QB DISTINCT flag
    273      *
    274      * @var bool
    275      */
    27683    protected $qb_distinct          = FALSE;
    277 
    278     /**
    279      * QB FROM data
    280      *
    281      * @var array
    282      */
    28384    protected $qb_from          = array();
    284 
    285     /**
    286      * QB JOIN data
    287      *
    288      * @var array
    289      */
    29085    protected $qb_join          = array();
    29186    protected $qb_join_tables   = array();
    292 
    293     /**
    294      * QB WHERE data
    295      *
    296      * @var array
    297      */
    29887    protected $qb_where         = array();
    299 
    300     /**
    301      * QB GROUP BY data
    302      *
    303      * @var array
    304      */
    30588    protected $qb_groupby           = array();
    306 
    307     /**
    308      * QB HAVING data
    309      *
    310      * @var array
    311      */
    31289    protected $qb_having            = array();
    313 
    314     /**
    315      * QB keys
    316      *
    317      * @var array
    318      */
    31990    protected $qb_keys          = array();
    320 
    321     /**
    322      * QB LIMIT data
    323      *
    324      * @var int
    325      */
    32691    protected $qb_limit         = FALSE;
    327 
    328     /**
    329      * QB OFFSET data
    330      *
    331      * @var int
    332      */
    33392    protected $qb_offset            = FALSE;
    334 
    335     /**
    336      * QB ORDER BY data
    337      *
    338      * @var array
    339      */
    34093    protected $qb_orderby           = array();
    341 
    342     /**
    343      * QB data sets
    344      *
    345      * @var array
    346      */
    34794    protected $qb_set           = array();
    348 
    349     /**
    350      * QB aliased tables list
    351      *
    352      * @var array
    353      */
    35495    protected $qb_aliased_tables        = array();
    355 
    356     /**
    357      * QB WHERE group started flag
    358      *
    359      * @var bool
    360      */
    36196    protected $qb_where_group_started   = FALSE;
    362 
    363     /**
    364      * QB WHERE group count
    365      *
    366      * @var int
    367      */
    36897    protected $qb_where_group_count     = 0;
    369 
    370     // Query Builder Caching variables
    371 
    372     /**
    373      * QB Caching flag
    374      *
    375      * @var bool
    376      */
    37798    protected $qb_caching               = FALSE;
    378 
    379     /**
    380      * QB Cache exists list
    381      *
    382      * @var array
    383      */
    38499    protected $qb_cache_exists          = array();
    385 
    386     /**
    387      * QB Cache SELECT data
    388      *
    389      * @var array
    390      */
    391100    protected $qb_cache_select          = array();
    392 
    393     /**
    394      * QB Cache FROM data
    395      *
    396      * @var array
    397      */
    398101    protected $qb_cache_from            = array();
    399 
    400     /**
    401      * QB Cache JOIN data
    402      *
    403      * @var array
    404      */
    405102    protected $qb_cache_join            = array();
    406 
    407     /**
    408      * QB Cache WHERE data
    409      *
    410      * @var array
    411      */
    412103    protected $qb_cache_where           = array();
    413 
    414     /**
    415      * QB Cache GROUP BY data
    416      *
    417      * @var array
    418      */
    419104    protected $qb_cache_groupby         = array();
    420 
    421     /**
    422      * QB Cache HAVING data
    423      *
    424      * @var array
    425      */
    426105    protected $qb_cache_having          = array();
    427 
    428     /**
    429      * QB Cache ORDER BY data
    430      *
    431      * @var array
    432      */
    433106    protected $qb_cache_orderby         = array();
    434 
    435     /**
    436      * QB Cache data sets
    437      *
    438      * @var array
    439      */
    440107    protected $qb_cache_set             = array();
    441 
    442     /**
    443      * QB No Escape data
    444      *
    445      * @var array
    446      */
    447108    protected $qb_no_escape             = array();
    448 
    449     /**
    450      * QB Cache No Escape data
    451      *
    452      * @var array
    453      */
    454109    protected $qb_cache_no_escape           = array();
    455110
    456     // --------------------------------------------------------------------
    457 
    458     /**
    459      * Select
    460      *
    461      * Generates the SELECT portion of the query
    462      *
    463      * @param   string
    464      * @param   mixed
    465      * @return  CI_DB_query_builder
    466      */
    467111    public function select($select = '*', $escape = NULL)
    468112    {
     
    496140    }
    497141
    498     // --------------------------------------------------------------------
    499 
    500     /**
    501      * Select Max
    502      *
    503      * Generates a SELECT MAX(field) portion of a query
    504      *
    505      * @param   string  the field
    506      * @param   string  an alias
    507      * @return  CI_DB_query_builder
    508      */
    509142    public function select_max($select = '', $alias = '')
    510143    {
     
    512145    }
    513146
    514     // --------------------------------------------------------------------
    515 
    516     /**
    517      * Select Min
    518      *
    519      * Generates a SELECT MIN(field) portion of a query
    520      *
    521      * @param   string  the field
    522      * @param   string  an alias
    523      * @return  CI_DB_query_builder
    524      */
    525147    public function select_min($select = '', $alias = '')
    526148    {
     
    528150    }
    529151
    530     // --------------------------------------------------------------------
    531 
    532     /**
    533      * Select Average
    534      *
    535      * Generates a SELECT AVG(field) portion of a query
    536      *
    537      * @param   string  the field
    538      * @param   string  an alias
    539      * @return  CI_DB_query_builder
    540      */
    541152    public function select_avg($select = '', $alias = '')
    542153    {
     
    544155    }
    545156
    546     // --------------------------------------------------------------------
    547 
    548     /**
    549      * Select Sum
    550      *
    551      * Generates a SELECT SUM(field) portion of a query
    552      *
    553      * @param   string  the field
    554      * @param   string  an alias
    555      * @return  CI_DB_query_builder
    556      */
    557157    public function select_sum($select = '', $alias = '')
    558158    {
     
    560160    }
    561161
    562     // --------------------------------------------------------------------
    563 
    564     /**
    565      * SELECT [MAX|MIN|AVG|SUM]()
    566      *
    567      * @used-by select_max()
    568      * @used-by select_min()
    569      * @used-by select_avg()
    570      * @used-by select_sum()
    571      *
    572      * @param   string  $select Field name
    573      * @param   string  $alias
    574      * @param   string  $type
    575      * @return  CI_DB_query_builder
    576      */
    577162    protected function _max_min_avg_sum($select = '', $alias = '', $type = 'MAX')
    578163    {
     
    608193    }
    609194
    610     // --------------------------------------------------------------------
    611 
    612     /**
    613      * Determines the alias name based on the table
    614      *
    615      * @param   string  $item
    616      * @return  string
    617      */
    618195    protected function _create_alias_from_table($item)
    619196    {
     
    627204    }
    628205
    629     // --------------------------------------------------------------------
    630 
    631     /**
    632      * DISTINCT
    633      *
    634      * Sets a flag which tells the query string compiler to add DISTINCT
    635      *
    636      * @param   bool    $val
    637      * @return  CI_DB_query_builder
    638      */
    639206    public function distinct($val = TRUE)
    640207    {
     
    643210    }
    644211
    645     // --------------------------------------------------------------------
    646 
    647     /**
    648      * From
    649      *
    650      * Generates the FROM portion of the query
    651      *
    652      * @param   mixed   $from   can be a string or array
    653      * @return  CI_DB_query_builder
    654      */
    655212    public function from($from)
    656213    {
     
    694251    }
    695252
    696     // --------------------------------------------------------------------
    697 
    698     /**
    699      * JOIN
    700      *
    701      * Generates the JOIN portion of the query
    702      *
    703      * @param   string
    704      * @param   string  the join condition
    705      * @param   string  the type of join
    706      * @param   string  whether not to try to escape identifiers
    707      * @return  CI_DB_query_builder
    708      */
    709253    public function join($table, $cond, $type = '', $escape = NULL)
    710254    {
     
    790334    }
    791335
    792     // --------------------------------------------------------------------
    793 
    794     /**
    795      * WHERE
    796      *
    797      * Generates the WHERE portion of the query.
    798      * Separates multiple calls with 'AND'.
    799      *
    800      * @param   mixed
    801      * @param   mixed
    802      * @param   bool
    803      * @return  CI_DB_query_builder
    804      */
    805336    public function where($key, $value = NULL, $escape = NULL)
    806337    {
     
    808339    }
    809340
    810     // --------------------------------------------------------------------
    811 
    812     /**
    813      * OR WHERE
    814      *
    815      * Generates the WHERE portion of the query.
    816      * Separates multiple calls with 'OR'.
    817      *
    818      * @param   mixed
    819      * @param   mixed
    820      * @param   bool
    821      * @return  CI_DB_query_builder
    822      */
    823341    public function or_where($key, $value = NULL, $escape = NULL)
    824342    {
     
    826344    }
    827345
    828     // --------------------------------------------------------------------
    829 
    830     /**
    831      * WHERE, HAVING
    832      *
    833      * @used-by where()
    834      * @used-by or_where()
    835      * @used-by having()
    836      * @used-by or_having()
    837      *
    838      * @param   string  $qb_key 'qb_where' or 'qb_having'
    839      * @param   mixed   $key
    840      * @param   mixed   $value
    841      * @param   string  $type
    842      * @param   bool    $escape
    843      * @return  CI_DB_query_builder
    844      */
    845346    protected function _wh($qb_key, $key, $value = NULL, $type = 'AND ', $escape = NULL)
    846347    {
     
    895396    }
    896397
    897     // --------------------------------------------------------------------
    898 
    899     /**
    900      * WHERE IN
    901      *
    902      * Generates a WHERE field IN('item', 'item') SQL query,
    903      * joined with 'AND' if appropriate.
    904      *
    905      * @param   string  $key    The field to search
    906      * @param   array   $values The values searched on
    907      * @param   bool    $escape
    908      * @return  CI_DB_query_builder
    909      */
    910398    public function where_in($key = NULL, $values = NULL, $escape = NULL)
    911399    {
     
    913401    }
    914402
    915     // --------------------------------------------------------------------
    916 
    917     /**
    918      * OR WHERE IN
    919      *
    920      * Generates a WHERE field IN('item', 'item') SQL query,
    921      * joined with 'OR' if appropriate.
    922      *
    923      * @param   string  $key    The field to search
    924      * @param   array   $values The values searched on
    925      * @param   bool    $escape
    926      * @return  CI_DB_query_builder
    927      */
    928403    public function or_where_in($key = NULL, $values = NULL, $escape = NULL)
    929404    {
     
    931406    }
    932407
    933     // --------------------------------------------------------------------
    934 
    935     /**
    936      * WHERE NOT IN
    937      *
    938      * Generates a WHERE field NOT IN('item', 'item') SQL query,
    939      * joined with 'AND' if appropriate.
    940      *
    941      * @param   string  $key    The field to search
    942      * @param   array   $values The values searched on
    943      * @param   bool    $escape
    944      * @return  CI_DB_query_builder
    945      */
    946408    public function where_not_in($key = NULL, $values = NULL, $escape = NULL)
    947409    {
     
    949411    }
    950412
    951     // --------------------------------------------------------------------
    952 
    953     /**
    954      * OR WHERE NOT IN
    955      *
    956      * Generates a WHERE field NOT IN('item', 'item') SQL query,
    957      * joined with 'OR' if appropriate.
    958      *
    959      * @param   string  $key    The field to search
    960      * @param   array   $values The values searched on
    961      * @param   bool    $escape
    962      * @return  CI_DB_query_builder
    963      */
    964413    public function or_where_not_in($key = NULL, $values = NULL, $escape = NULL)
    965414    {
     
    967416    }
    968417
    969     // --------------------------------------------------------------------
    970 
    971     /**
    972      * Internal WHERE IN
    973      *
    974      * @used-by where_in()
    975      * @used-by or_where_in()
    976      * @used-by where_not_in()
    977      * @used-by or_where_not_in()
    978      *
    979      * @param   string  $key    The field to search
    980      * @param   array   $values The values searched on
    981      * @param   bool    $not    If the statement would be IN or NOT IN
    982      * @param   string  $type
    983      * @param   bool    $escape
    984      * @return  CI_DB_query_builder
    985      */
    986418    protected function _where_in($key = NULL, $values = NULL, $not = FALSE, $type = 'AND ', $escape = NULL)
    987419    {
     
    1032464    }
    1033465
    1034     // --------------------------------------------------------------------
    1035 
    1036     /**
    1037      * LIKE
    1038      *
    1039      * Generates a %LIKE% portion of the query.
    1040      * Separates multiple calls with 'AND'.
    1041      *
    1042      * @param   mixed   $field
    1043      * @param   string  $match
    1044      * @param   string  $side
    1045      * @param   bool    $escape
    1046      * @return  CI_DB_query_builder
    1047      */
    1048466    public function like($field, $match = '', $side = 'both', $escape = NULL)
    1049467    {
     
    1051469    }
    1052470
    1053     // --------------------------------------------------------------------
    1054 
    1055     /**
    1056      * NOT LIKE
    1057      *
    1058      * Generates a NOT LIKE portion of the query.
    1059      * Separates multiple calls with 'AND'.
    1060      *
    1061      * @param   mixed   $field
    1062      * @param   string  $match
    1063      * @param   string  $side
    1064      * @param   bool    $escape
    1065      * @return  CI_DB_query_builder
    1066      */
    1067471    public function not_like($field, $match = '', $side = 'both', $escape = NULL)
    1068472    {
     
    1070474    }
    1071475
    1072     // --------------------------------------------------------------------
    1073 
    1074     /**
    1075      * OR LIKE
    1076      *
    1077      * Generates a %LIKE% portion of the query.
    1078      * Separates multiple calls with 'OR'.
    1079      *
    1080      * @param   mixed   $field
    1081      * @param   string  $match
    1082      * @param   string  $side
    1083      * @param   bool    $escape
    1084      * @return  CI_DB_query_builder
    1085      */
    1086476    public function or_like($field, $match = '', $side = 'both', $escape = NULL)
    1087477    {
     
    1089479    }
    1090480
    1091     // --------------------------------------------------------------------
    1092 
    1093     /**
    1094      * OR NOT LIKE
    1095      *
    1096      * Generates a NOT LIKE portion of the query.
    1097      * Separates multiple calls with 'OR'.
    1098      *
    1099      * @param   mixed   $field
    1100      * @param   string  $match
    1101      * @param   string  $side
    1102      * @param   bool    $escape
    1103      * @return  CI_DB_query_builder
    1104      */
    1105481    public function or_not_like($field, $match = '', $side = 'both', $escape = NULL)
    1106482    {
     
    1108484    }
    1109485
    1110     // --------------------------------------------------------------------
    1111 
    1112     /**
    1113      * Internal LIKE
    1114      *
    1115      * @used-by like()
    1116      * @used-by or_like()
    1117      * @used-by not_like()
    1118      * @used-by or_not_like()
    1119      *
    1120      * @param   mixed   $field
    1121      * @param   string  $match
    1122      * @param   string  $type
    1123      * @param   string  $side
    1124      * @param   string  $not
    1125      * @param   bool    $escape
    1126      * @return  CI_DB_query_builder
    1127      */
    1128486    protected function _like($field, $match = '', $type = 'AND ', $side = 'both', $not = '', $escape = NULL)
    1129487    {
     
    1181539    }
    1182540
    1183     // --------------------------------------------------------------------
    1184 
    1185     /**
    1186      * Starts a query group.
    1187      *
    1188      * @param   string  $not    (Internal use only)
    1189      * @param   string  $type   (Internal use only)
    1190      * @return  CI_DB_query_builder
    1191      */
    1192541    public function group_start($not = '', $type = 'AND ')
    1193542    {
     
    1210559    }
    1211560
    1212     // --------------------------------------------------------------------
    1213 
    1214     /**
    1215      * Starts a query group, but ORs the group
    1216      *
    1217      * @return  CI_DB_query_builder
    1218      */
    1219561    public function or_group_start()
    1220562    {
     
    1222564    }
    1223565
    1224     // --------------------------------------------------------------------
    1225 
    1226     /**
    1227      * Starts a query group, but NOTs the group
    1228      *
    1229      * @return  CI_DB_query_builder
    1230      */
    1231566    public function not_group_start()
    1232567    {
     
    1234569    }
    1235570
    1236     // --------------------------------------------------------------------
    1237 
    1238     /**
    1239      * Starts a query group, but OR NOTs the group
    1240      *
    1241      * @return  CI_DB_query_builder
    1242      */
    1243571    public function or_not_group_start()
    1244572    {
     
    1246574    }
    1247575
    1248     // --------------------------------------------------------------------
    1249 
    1250     /**
    1251      * Ends a query group
    1252      *
    1253      * @return  CI_DB_query_builder
    1254      */
    1255576    public function group_end()
    1256577    {
     
    1270591    }
    1271592
    1272     // --------------------------------------------------------------------
    1273 
    1274     /**
    1275      * Group_get_type
    1276      *
    1277      * @used-by group_start()
    1278      * @used-by _like()
    1279      * @used-by _wh()
    1280      * @used-by _where_in()
    1281      *
    1282      * @param   string  $type
    1283      * @return  string
    1284      */
    1285593    protected function _group_get_type($type)
    1286594    {
     
    1294602    }
    1295603
    1296     // --------------------------------------------------------------------
    1297 
    1298     /**
    1299      * GROUP BY
    1300      *
    1301      * @param   string  $by
    1302      * @param   bool    $escape
    1303      * @return  CI_DB_query_builder
    1304      */
    1305604    public function group_by($by, $escape = NULL)
    1306605    {
     
    1334633    }
    1335634
    1336     // --------------------------------------------------------------------
    1337 
    1338     /**
    1339      * HAVING
    1340      *
    1341      * Separates multiple calls with 'AND'.
    1342      *
    1343      * @param   string  $key
    1344      * @param   string  $value
    1345      * @param   bool    $escape
    1346      * @return  CI_DB_query_builder
    1347      */
    1348635    public function having($key, $value = NULL, $escape = NULL)
    1349636    {
     
    1351638    }
    1352639
    1353     // --------------------------------------------------------------------
    1354 
    1355     /**
    1356      * OR HAVING
    1357      *
    1358      * Separates multiple calls with 'OR'.
    1359      *
    1360      * @param   string  $key
    1361      * @param   string  $value
    1362      * @param   bool    $escape
    1363      * @return  CI_DB_query_builder
    1364      */
    1365640    public function or_having($key, $value = NULL, $escape = NULL)
    1366641    {
     
    1368643    }
    1369644
    1370     // --------------------------------------------------------------------
    1371 
    1372     /**
    1373      * ORDER BY
    1374      *
    1375      * @param   string  $orderby
    1376      * @param   string  $direction  ASC, DESC or RANDOM
    1377      * @param   bool    $escape
    1378      * @return  CI_DB_query_builder
    1379      */
    1380645    public function order_by($orderby, $direction = '', $escape = NULL)
    1381646    {
     
    1427692    }
    1428693
    1429     // --------------------------------------------------------------------
    1430 
    1431     /**
    1432      * LIMIT
    1433      *
    1434      * @param   int $value  LIMIT value
    1435      * @param   int $offset OFFSET value
    1436      * @return  CI_DB_query_builder
    1437      */
    1438694    public function limit($value, $offset = 0)
    1439695    {
     
    1444700    }
    1445701
    1446     // --------------------------------------------------------------------
    1447 
    1448     /**
    1449      * Sets the OFFSET value
    1450      *
    1451      * @param   int $offset OFFSET value
    1452      * @return  CI_DB_query_builder
    1453      */
    1454702    public function offset($offset)
    1455703    {
     
    1458706    }
    1459707
    1460     // --------------------------------------------------------------------
    1461 
    1462     /**
    1463      * LIMIT string
    1464      *
    1465      * Generates a platform-specific LIMIT clause.
    1466      *
    1467      * @param   string  $sql    SQL Query
    1468      * @return  string
    1469      */
    1470708    protected function _limit($sql)
    1471709    {
     
    1473711    }
    1474712
    1475     // --------------------------------------------------------------------
    1476 
    1477     /**
    1478      * The "set" function.
    1479      *
    1480      * Allows key/value pairs to be set for inserting or updating
    1481      *
    1482      * @param   mixed
    1483      * @param   string
    1484      * @param   bool
    1485      * @return  CI_DB_query_builder
    1486      */
    1487713    public function set($key, $value = '', $escape = NULL)
    1488714    {
     
    1505731    }
    1506732
    1507     // --------------------------------------------------------------------
    1508 
    1509     /**
    1510      * Get SELECT query string
    1511      *
    1512      * Compiles a SELECT query string and returns the sql.
    1513      *
    1514      * @param   string  the table name to select from (optional)
    1515      * @param   bool    TRUE: resets QB values; FALSE: leave QB values alone
    1516      * @return  string
    1517      */
    1518733    public function get_compiled_select($table = '', $reset = TRUE)
    1519734    {
     
    1534749    }
    1535750
    1536     // --------------------------------------------------------------------
    1537 
    1538     /**
    1539      * Insert batch statement
    1540      *
    1541      * Generates a platform-specific insert string from the supplied data.
    1542      *
    1543      * @param   string  $table  Table name
    1544      * @param   array   $keys   INSERT keys
    1545      * @param   array   $values INSERT values
    1546      * @return  string
    1547      */
    1548751    protected function _insert_batch($table, $keys, $values)
    1549752    {
     
    1551754    }
    1552755
    1553     // --------------------------------------------------------------------
    1554 
    1555     /**
    1556      * The "set_insert_batch" function.  Allows key/value pairs to be set for batch inserts
    1557      *
    1558      * @param   mixed
    1559      * @param   string
    1560      * @param   bool
    1561      * @return  CI_DB_query_builder
    1562      */
    1563756    public function set_insert_batch($key, $value = '', $escape = NULL)
    1564757    {
     
    1609802    }
    1610803
    1611     // --------------------------------------------------------------------
    1612 
    1613     /**
    1614      * Get INSERT query string
    1615      *
    1616      * Compiles an insert query and returns the sql
    1617      *
    1618      * @param   string  the table to insert into
    1619      * @param   bool    TRUE: reset QB values; FALSE: leave QB values alone
    1620      * @return  string
    1621      */
    1622804    public function get_compiled_insert($table = '', $reset = TRUE)
    1623805    {
     
    1643825    }
    1644826
    1645     // --------------------------------------------------------------------
    1646 
    1647     /**
    1648      * Validate Insert
    1649      *
    1650      * This method is used by both insert() and get_compiled_insert() to
    1651      * validate that the there data is actually being set and that table
    1652      * has been chosen to be inserted into.
    1653      *
    1654      * @param   string  the table to insert data into
    1655      * @return  string
    1656      */
    1657827    protected function _validate_insert($table = '')
    1658828    {
     
    1674844    }
    1675845
    1676     // --------------------------------------------------------------------
    1677 
    1678     /**
    1679      * Replace statement
    1680      *
    1681      * Generates a platform-specific replace string from the supplied data
    1682      *
    1683      * @param   string  the table name
    1684      * @param   array   the insert keys
    1685      * @param   array   the insert values
    1686      * @return  string
    1687      */
    1688846    protected function _replace($table, $keys, $values)
    1689847    {
     
    1691849    }
    1692850
    1693     // --------------------------------------------------------------------
    1694 
    1695     /**
    1696      * FROM tables
    1697      *
    1698      * Groups tables in FROM clauses if needed, so there is no confusion
    1699      * about operator precedence.
    1700      *
    1701      * Note: This is only used (and overridden) by MySQL and CUBRID.
    1702      *
    1703      * @return  string
    1704      */
    1705851    protected function _from_tables()
    1706852    {
     
    1708854    }
    1709855
    1710     // --------------------------------------------------------------------
    1711 
    1712     /**
    1713      * Get UPDATE query string
    1714      *
    1715      * Compiles an update query and returns the sql
    1716      *
    1717      * @param   string  the table to update
    1718      * @param   bool    TRUE: reset QB values; FALSE: leave QB values alone
    1719      * @return  string
    1720      */
    1721856    public function get_compiled_update($table = '', $reset = TRUE)
    1722857    {
     
    1739874    }
    1740875
    1741     // --------------------------------------------------------------------
    1742 
    1743     /**
    1744      * Validate Update
    1745      *
    1746      * This method is used by both update() and get_compiled_update() to
    1747      * validate that data is actually being set and that a table has been
    1748      * chosen to be update.
    1749      *
    1750      * @param   string  the table to update data on
    1751      * @return  bool
    1752      */
    1753876    protected function _validate_update($table)
    1754877    {
     
    1770893    }
    1771894
    1772     // --------------------------------------------------------------------
    1773 
    1774     /**
    1775      * Update_Batch statement
    1776      *
    1777      * Generates a platform-specific batch update string from the supplied data
    1778      *
    1779      * @param   string  $table  Table name
    1780      * @param   array   $values Update data
    1781      * @param   string  $index  WHERE key
    1782      * @return  string
    1783      */
    1784895    protected function _update_batch($table, $values, $index)
    1785896    {
     
    1811922    }
    1812923
    1813     // --------------------------------------------------------------------
    1814 
    1815     /**
    1816      * The "set_update_batch" function.  Allows key/value pairs to be set for batch updating
    1817      *
    1818      * @param   array
    1819      * @param   string
    1820      * @param   bool
    1821      * @return  CI_DB_query_builder
    1822      */
    1823924    public function set_update_batch($key, $index = '', $escape = NULL)
    1824925    {
     
    1857958    }
    1858959
    1859     // --------------------------------------------------------------------
    1860 
    1861     /**
    1862      * Truncate statement
    1863      *
    1864      * Generates a platform-specific truncate string from the supplied data
    1865      *
    1866      * If the database does not support the truncate() command,
    1867      * then this method maps to 'DELETE FROM table'
    1868      *
    1869      * @param   string  the table name
    1870      * @return  string
    1871      */
    1872960    protected function _truncate($table)
    1873961    {
     
    1875963    }
    1876964
    1877     // --------------------------------------------------------------------
    1878 
    1879     /**
    1880      * Get DELETE query string
    1881      *
    1882      * Compiles a delete query string and returns the sql
    1883      *
    1884      * @param   string  the table to delete from
    1885      * @param   bool    TRUE: reset QB values; FALSE: leave QB values alone
    1886      * @return  string
    1887      */
    1888965    public function get_compiled_delete($table = '', $reset = TRUE)
    1889966    {
     
    1894971    }
    1895972
    1896     // --------------------------------------------------------------------
    1897 
    1898     /**
    1899      * Delete
    1900      *
    1901      * Compiles a delete string and runs the query
    1902      *
    1903      * @param   mixed   the table(s) to delete from. String or array
    1904      * @param   mixed   the where clause
    1905      * @param   mixed   the limit clause
    1906      * @param   bool
    1907      * @return  mixed
    1908      */
    1909973    public function delete($table = '', $where = '', $limit = NULL, $reset_data = TRUE)
    1910974    {
     
    19611025    }
    19621026
    1963     // --------------------------------------------------------------------
    1964 
    1965     /**
    1966      * Delete statement
    1967      *
    1968      * Generates a platform-specific delete string from the supplied data
    1969      *
    1970      * @param   string  the table name
    1971      * @return  string
    1972      */
    19731027    protected function _delete($table)
    19741028    {
     
    19981052    }
    19991053
    2000     // --------------------------------------------------------------------
    2001 
    2002     /**
    2003      * DB Prefix
    2004      *
    2005      * Prepends a database prefix if one exists in configuration
    2006      *
    2007      * @param   string  the table
    2008      * @return  string
    2009      */
    20101054    public function dbprefix($table = '')
    20111055    {
     
    20181062    }
    20191063
    2020     // --------------------------------------------------------------------
    2021 
    2022     /**
    2023      * Set DB Prefix
    2024      *
    2025      * Set's the DB Prefix to something new without needing to reconnect
    2026      *
    2027      * @param   string  the prefix
    2028      * @return  string
    2029      */
    20301064    public function set_prefix($prefix = '')
    20311065    {
     
    20371071    }
    20381072
    2039     // --------------------------------------------------------------------
    2040 
    2041     /**
    2042      * Track Aliases
    2043      *
    2044      * Used to track SQL statements written with aliased tables.
    2045      *
    2046      * @param   string  The table to inspect
    2047      * @return  string
    2048      */
    20491073    protected function _track_aliases($table)
    20501074    {
     
    20821106    }
    20831107
    2084     // --------------------------------------------------------------------
    2085 
    2086     /**
    2087      * Compile the SELECT statement
    2088      *
    2089      * Generates a query string based on which functions were used.
    2090      * Should not be called directly.
    2091      *
    2092      * @param   bool    $select_override
    2093      * @return  string
    2094      */
    20951108    protected function _compile_select($select_override = FALSE)
    20961109    {
     
    21521165    }
    21531166
    2154     // --------------------------------------------------------------------
    2155 
    2156     /**
    2157      * Compile WHERE, HAVING statements
    2158      *
    2159      * Escapes identifiers in WHERE and HAVING statements at execution time.
    2160      *
    2161      * Required so that aliases are tracked properly, regardless of whether
    2162      * where(), or_where(), having(), or_having are called prior to from(),
    2163      * join() and dbprefix is added only if needed.
    2164      *
    2165      * @param   string  $qb_key 'qb_where' or 'qb_having'
    2166      * @return  string  SQL statement
    2167      */
    21681167    public function get_compiled_where( $reset = TRUE )
    21691168    {
     
    22431242    }
    22441243
    2245     // --------------------------------------------------------------------
    2246 
    2247     /**
    2248      * Compile GROUP BY
    2249      *
    2250      * Escapes identifiers in GROUP BY statements at execution time.
    2251      *
    2252      * Required so that aliases are tracked properly, regardless of wether
    2253      * group_by() is called prior to from(), join() and dbprefix is added
    2254      * only if needed.
    2255      *
    2256      * @return  string  SQL statement
    2257      */
    22581244    protected function _compile_group_by()
    22591245    {
     
    22791265    }
    22801266
    2281     // --------------------------------------------------------------------
    2282 
    2283     /**
    2284      * Compile ORDER BY
    2285      *
    2286      * Escapes identifiers in ORDER BY statements at execution time.
    2287      *
    2288      * Required so that aliases are tracked properly, regardless of wether
    2289      * order_by() is called prior to from(), join() and dbprefix is added
    2290      * only if needed.
    2291      *
    2292      * @return  string  SQL statement
    2293      */
    22941267    protected function _compile_order_by()
    22951268    {
     
    23161289    }
    23171290
    2318     // --------------------------------------------------------------------
    2319 
    2320     /**
    2321      * Object to Array
    2322      *
    2323      * Takes an object as input and converts the class variables to array key/vals
    2324      *
    2325      * @param   object
    2326      * @return  array
    2327      */
    23281291    protected function _object_to_array($object)
    23291292    {
     
    23461309    }
    23471310
    2348     // --------------------------------------------------------------------
    2349 
    2350     /**
    2351      * Object to Array
    2352      *
    2353      * Takes an object as input and converts the class variables to array key/vals
    2354      *
    2355      * @param   object
    2356      * @return  array
    2357      */
    23581311    protected function _object_to_array_batch($object)
    23591312    {
     
    23831336    }
    23841337
    2385     // --------------------------------------------------------------------
    2386 
    2387     /**
    2388      * Start Cache
    2389      *
    2390      * Starts QB caching
    2391      *
    2392      * @return  CI_DB_query_builder
    2393      */
    23941338    public function start_cache()
    23951339    {
     
    23981342    }
    23991343
    2400     // --------------------------------------------------------------------
    2401 
    2402     /**
    2403      * Stop Cache
    2404      *
    2405      * Stops QB caching
    2406      *
    2407      * @return  CI_DB_query_builder
    2408      */
    24091344    public function stop_cache()
    24101345    {
     
    24131348    }
    24141349
    2415     // --------------------------------------------------------------------
    2416 
    2417     /**
    2418      * Flush Cache
    2419      *
    2420      * Empties the QB cache
    2421      *
    2422      * @return  CI_DB_query_builder
    2423      */
    24241350    public function flush_cache()
    24251351    {
     
    24401366    }
    24411367
    2442     // --------------------------------------------------------------------
    2443 
    2444     /**
    2445      * Merge Cache
    2446      *
    2447      * When called, this function merges any cached QB arrays with
    2448      * locally called ones.
    2449      *
    2450      * @return  void
    2451      */
    24521368    protected function _merge_cache()
    24531369    {
     
    24941410    }
    24951411
    2496     // --------------------------------------------------------------------
    2497 
    2498     /**
    2499      * Is literal
    2500      *
    2501      * Determines if a string represents a literal value or a field name
    2502      *
    2503      * @param   string  $str
    2504      * @return  bool
    2505      */
    25061412    protected function _is_literal($str)
    25071413    {
     
    25241430    }
    25251431
    2526     // --------------------------------------------------------------------
    2527 
    2528     /**
    2529      * Reset Query Builder values.
    2530      *
    2531      * Publicly-visible method to reset the QB values.
    2532      *
    2533      * @return  CI_DB_query_builder
    2534      */
    25351432    public function reset_query()
    25361433    {
     
    25401437    }
    25411438
    2542     // --------------------------------------------------------------------
    2543 
    2544     /**
    2545      * Resets the query builder values.  Called by the get() function
    2546      *
    2547      * @param   array   An array of fields to reset
    2548      * @return  void
    2549      */
    25501439    protected function _reset_run($qb_reset_items)
    25511440    {
     
    25561445    }
    25571446
    2558     // --------------------------------------------------------------------
    2559 
    2560     /**
    2561      * Resets the query builder values.  Called by the get() function
    2562      *
    2563      * @return  void
    2564      */
    25651447    protected function _reset_select()
    25661448    {
     
    25821464    }
    25831465
    2584     // --------------------------------------------------------------------
    2585 
    2586     /**
    2587      * Resets the query builder "write" values.
    2588      *
    2589      * Called by the insert() update() insert_batch() update_batch() and delete() functions
    2590      *
    2591      * @return  void
    2592      */
    25931466    protected function _reset_write()
    25941467    {
     
    26041477    }
    26051478
    2606    
    2607     // --------------------------------------------------------------------
    2608 
    2609     /**
    2610      * Version number query string
    2611      *
    2612      * @return  string
    2613      */
    26141479    protected function _version()
    26151480    {
     
    26171482    }
    26181483
    2619     // --------------------------------------------------------------------
    2620 
    2621     /**
    2622      * Disable Transactions
    2623      * This permits transactions to be disabled at run-time.
    2624      *
    2625      * @return  void
    2626      */
    26271484    public function trans_off()
    26281485    {
     
    26301487    }
    26311488
    2632     // --------------------------------------------------------------------
    2633 
    2634     /**
    2635      * Enable/disable Transaction Strict Mode
    2636      *
    2637      * When strict mode is enabled, if you are running multiple groups of
    2638      * transactions, if one group fails all subsequent groups will be
    2639      * rolled back.
    2640      *
    2641      * If strict mode is disabled, each group is treated autonomously,
    2642      * meaning a failure of one group will not affect any others
    2643      *
    2644      * @param   bool    $mode = TRUE
    2645      * @return  void
    2646      */
    26471489    public function trans_strict($mode = TRUE)
    26481490    {
     
    26501492    }
    26511493
    2652     // --------------------------------------------------------------------
    2653 
    2654     /**
    2655      * Start Transaction
    2656      *
    2657      * @param   bool    $test_mode = FALSE
    2658      * @return  bool
    2659      */
    26601494    public function trans_start($test_mode = FALSE)
    26611495    {
     
    26681502    }
    26691503
    2670     // --------------------------------------------------------------------
    2671 
    2672     /**
    2673      * Complete Transaction
    2674      *
    2675      * @return  bool
    2676      */
    26771504    public function trans_complete()
    26781505    {
     
    27021529    }
    27031530
    2704     // --------------------------------------------------------------------
    2705 
    2706     /**
    2707      * Lets you retrieve the transaction flag to determine if it has failed
    2708      *
    2709      * @return  bool
    2710      */
    27111531    public function trans_status()
    27121532    {
     
    27141534    }
    27151535
    2716     // --------------------------------------------------------------------
    2717 
    2718     /**
    2719      * Begin Transaction
    2720      *
    2721      * @param   bool    $test_mode
    2722      * @return  bool
    2723      */
    27241536    public function trans_begin($test_mode = FALSE)
    27251537    {
     
    27491561    }
    27501562
    2751     // --------------------------------------------------------------------
    2752 
    2753     /**
    2754      * Commit Transaction
    2755      *
    2756      * @return  bool
    2757      */
    27581563    public function trans_commit()
    27591564    {
     
    27721577    }
    27731578
    2774     // --------------------------------------------------------------------
    2775 
    2776     /**
    2777      * Rollback Transaction
    2778      *
    2779      * @return  bool
    2780      */
    27811579    public function trans_rollback()
    27821580    {
     
    27951593    }
    27961594
    2797     // --------------------------------------------------------------------
    2798 
    2799     /**
    2800      * Compile Bindings
    2801      *
    2802      * @param   string  the sql statement
    2803      * @param   array   an array of bind data
    2804      * @return  string
    2805      */
    28061595    public function compile_binds($sql, $binds)
    28071596    {
     
    28601649    }
    28611650
    2862     // --------------------------------------------------------------------
    2863 
    2864     /**
    2865      * Determines if a query is a "write" type.
    2866      *
    2867      * @param   string  An SQL query string
    2868      * @return  bool
    2869      */
    28701651    public function is_write_type($sql)
    28711652    {
     
    28731654    }
    28741655
    2875     // --------------------------------------------------------------------
    2876 
    2877     /**
    2878      * "Smart" Escape String
    2879      *
    2880      * Escapes data based on type
    2881      * Sets boolean and null types
    2882      *
    2883      * @param   string
    2884      * @return  mixed
    2885      */
    28861656    public function escape($str)
    28871657    {
     
    29071677    }
    29081678
    2909     // --------------------------------------------------------------------
    2910 
    2911     /**
    2912      * Escape String
    2913      *
    2914      * @param   string|string[] $str    Input string
    2915      * @param   bool    $like   Whether or not the string will be used in a LIKE condition
    2916      * @return  string
    2917      */
    29181679    public function escape_str($str, $like = FALSE)
    29191680    {
     
    29431704    }
    29441705
    2945     // --------------------------------------------------------------------
    2946 
    2947     /**
    2948      * Escape LIKE String
    2949      *
    2950      * Calls the individual driver for platform
    2951      * specific escaping for LIKE conditions
    2952      *
    2953      * @param   string|string[]
    2954      * @return  mixed
    2955      */
    29561706    public function escape_like_str($str)
    29571707    {
     
    29591709    }
    29601710
    2961     // --------------------------------------------------------------------
    2962 
    2963     /**
    2964      * Platform-dependant string escape
    2965      *
    2966      * @param   string
    2967      * @return  string
    2968      */
    29691711    protected function _escape_str($str)
    29701712    {
     
    29721714    }
    29731715
    2974     // --------------------------------------------------------------------
    2975 
    2976     /**
    2977      * Escape the SQL Identifiers
    2978      *
    2979      * This function escapes column and table names
    2980      *
    2981      * @param   mixed
    2982      * @return  mixed
    2983      */
    29841716    public function escape_identifiers($item)
    29851717    {
     
    30341766    }
    30351767
    3036     // --------------------------------------------------------------------
    3037 
    3038     /**
    3039      * Generate an insert string
    3040      *
    3041      * @param   string  the table upon which the query will be performed
    3042      * @param   array   an associative array data of key/values
    3043      * @return  string
    3044      */
    30451768    public function insert_string($table, $data)
    30461769    {
     
    30561779    }
    30571780
    3058     // --------------------------------------------------------------------
    3059 
    3060     /**
    3061      * Insert statement
    3062      *
    3063      * Generates a platform-specific insert string from the supplied data
    3064      *
    3065      * @param   string  the table name
    3066      * @param   array   the insert keys
    3067      * @param   array   the insert values
    3068      * @return  string
    3069      */
    30701781    protected function _insert($table, $keys, $values)
    30711782    {
     
    30731784    }
    30741785
    3075     // --------------------------------------------------------------------
    3076 
    3077     /**
    3078      * Generate an update string
    3079      *
    3080      * @param   string  the table upon which the query will be performed
    3081      * @param   array   an associative array data of key/values
    3082      * @param   mixed   the "where" statement
    3083      * @return  string
    3084      */
    30851786    public function update_string($table, $data, $where)
    30861787    {
     
    31031804    }
    31041805
    3105     // --------------------------------------------------------------------
    3106 
    3107     /**
    3108      * Update statement
    3109      *
    3110      * Generates a platform-specific update string from the supplied data
    3111      *
    3112      * @param   string  the table name
    3113      * @param   array   the update data
    3114      * @return  string
    3115      */
    31161806    protected function _update($table, $values)
    31171807    {
     
    31271817    }
    31281818
    3129     // --------------------------------------------------------------------
    3130 
    3131     /**
    3132      * Tests whether the string has an SQL operator
    3133      *
    3134      * @param   string
    3135      * @return  bool
    3136      */
    31371819    protected function _has_operator($str)
    31381820    {
     
    31401822    }
    31411823
    3142     // --------------------------------------------------------------------
    3143 
    3144     /**
    3145      * Returns the SQL string operator
    3146      *
    3147      * @param   string
    3148      * @return  string
    3149      */
    31501824    protected function _get_operator($str)
    31511825    {
     
    31781852    }
    31791853
    3180     // --------------------------------------------------------------------
    3181 
    3182     /**
    3183      * Protect Identifiers
    3184      *
    3185      * This function is used extensively by the Query Builder class, and by
    3186      * a couple functions in this class.
    3187      * It takes a column or table name (optionally with an alias) and inserts
    3188      * the table prefix onto it. Some logic is necessary in order to deal with
    3189      * column names that include the path. Consider a query like this:
    3190      *
    3191      * SELECT hostname.database.table.column AS c FROM hostname.database.table
    3192      *
    3193      * Or a query with aliasing:
    3194      *
    3195      * SELECT m.member_id, m.member_name FROM members AS m
    3196      *
    3197      * Since the column name can include up to four segments (host, DB, table, column)
    3198      * or also have an alias prefix, we need to do a bit of work to figure this out and
    3199      * insert the table prefix (if it exists) in the proper position, and escape only
    3200      * the correct identifiers.
    3201      *
    3202      * @param   string
    3203      * @param   bool
    3204      * @param   mixed
    3205      * @param   bool
    3206      * @return  string
    3207      */
    32081854    public function protect_identifiers($item, $prefix_single = FALSE, $protect_identifiers = NULL, $field_exists = TRUE)
    32091855    {
     
    33792025                $safe_file_name = str_replace(array(), '', $call['file']);
    33802026                $safe_file_name = basename( $safe_file_name );
    3381 
    33822027                // $message[] = 'Filename: ' . $safe_file_name;
    33832028                // $message[] = 'Line Number: '. $call['line'];
    3384 
    33852029                break;
    33862030            }
  • locatoraid/trunk/happ2/hsystem/factory.php

    r1726376 r3370713  
    6363            $this_return_path .= '.php';
    6464            array_unshift( $return_path, $this_return_path );
    65             // $final_return_path[] = $this_return_path;
    6665
    6766            $last_subdir = '';
     
    7372
    7473                $this_return_path .= '.php';
    75                 // $final_return_path[] = $this_return_path;
    7674                array_unshift( $return_path, $this_return_path );
    7775
     
    8381        }
    8482
    85 // echo "FINAL RETURN PATH<br>";
    86 // _print_r( $return_path );
    87 
    8883        $return = array( $return_module, $return_classname, $return_path );
    8984
    90 // echo "MAKING CLASSNAME PATH FROM '$slug'<br>";
    91 // _print_r( $return );
    9285        $slug2class[ $slug ] = $return;
    9386        return $return;
  • locatoraid/trunk/happ2/modules/acl/roles.php

    r2859421 r3370713  
    22class Acl_Roles_HC_MVC extends _HC_MVC
    33{
    4     public function has_role( $user_id, $check_role, $on = NULL )
     4    public function has_role($user_id, $check_role, $on = null)
    55    {
    6         $return = FALSE;
     6        $ret = false;
    77        $bits = 0;
    88
    9         if( $on ){
    10         }
    11         else {
    12             if( $user_id ){
     9        if ($on) {
     10        } else {
     11            if($user_id) {
    1312                $user = $this->app->make('/users/commands/read')
    14                     ->execute( array($user_id) )
     13                    ->execute(array($user_id))
    1514                    ;
    16                 if( $user && isset($user['roles']) ){
     15                if($user && isset($user['roles'])) {
    1716                    $bits = $user['roles'];
    1817                }
     
    2019        }
    2120
    22         $user_roles = $this->get_roles( $bits );
    23         if( in_array($check_role, $user_roles) ){
    24             $return = TRUE;
     21        $user_roles = $this->get_roles($bits);
     22        if(in_array($check_role, $user_roles)) {
     23            $ret = true;
    2524        }
    2625
    27         return $return;
     26        return $ret;
    2827    }
    2928
     
    3130    {
    3231        $return = array(
    33             'admin'     => __( 'Administrator', 'locatoraid' ),
     32            'admin' => __( 'Administrator', 'locatoraid' ),
    3433            );
    3534
  • locatoraid/trunk/happ2/modules/auth.wordpress/_config_route.php

    r1807089 r3370713  
    99$config['route']['auth/login'] = $auth_wordpress_login_redirect;
    1010$config['route']['login'] = $auth_wordpress_login_redirect;
     11if (is_admin()){
     12    $config['route'][''] = '/locations/index/controller';
     13} else {
     14    $config['route'][''] = $auth_wordpress_login_redirect;
     15}
  • locatoraid/trunk/locatoraid.php

    r3349796 r3370713  
    44Plugin URI: https://www.locatoraid.com/
    55Description: Store locator plugin
    6 Version: 3.9.61
     6Version: 3.9.62
    77Author: plainware.com
    88Author URI: https://www.locatoraid.com/
     
    1212
    1313if( ! defined('LC3_VERSION') ){
    14     define( 'LC3_VERSION', 3961 );
     14    define( 'LC3_VERSION', 3962 );
    1515}
    1616
  • locatoraid/trunk/modules/addon.conf/_config_after.php

    r3008011 r3370713  
    22$config['after']['/conf/view/layout->tabs'][] = function( $app, $ret )
    33{
    4     $ret['addon'] = array( 'addon.conf', __('Add-ons', 'locatoraid') );
     4    $ret['addon'] = array('addon.conf', __('Add-ons', 'locatoraid'));
    55    return $ret;
    66};
  • locatoraid/trunk/modules/app.conf/_config_after.php

    r2791689 r3370713  
    11<?php if (! defined('ABSPATH')) exit; // Exit if accessed directly
    2 $config['after']['/conf/view/layout->tabs'][] = function( $app, $return )
     2$config['after']['/conf/view/layout->tabs'][] = function( $app, $ret )
    33{
    4     $return['app'] = array( 'app.conf', __('Configuration', 'locatoraid') );
    5     return $return;
     4    $ret['app'] = array( 'app.conf', __('Configuration', 'locatoraid') );
     5    return $ret;
    66};
  • locatoraid/trunk/modules/app/_config_route.php

    r1807089 r3370713  
    11<?php if (! defined('ABSPATH')) exit; // Exit if accessed directly
    2 $config['route'][''] = '/locations/index/controller';
     2// $config['route'][''] = '/locations/index/controller';
  • locatoraid/trunk/modules/coordinates/view.php

    r2859421 r3370713  
    22class Coordinates_View_LC_HC_MVC extends _HC_MVC
    33{
    4     public function render( $address )
     4    public function render($address)
    55    {
    66        $out = $this->app->make('/html/list')
    77            ->set_gutter(2)
    88            ;
    9 
    109        $out
    1110            ->add( $address )
  • locatoraid/trunk/modules/directions.front/_config_after.php

    r1925696 r3370713  
    11<?php if (! defined('ABSPATH')) exit; // Exit if accessed directly
    2 $config['after']['/front/view'][] = function( $app, $return )
     2$config['after']['/front/view'][] = function( $app, $ret )
    33{
    44    $app_settings = $app->make('/app/settings');
     
    77    $this_pname_config = $app_settings->get($this_pname);
    88    if( ! $this_pname_config ){
    9         return $return;
     9        return $ret;
    1010    }
    1111
     
    1515        ;
    1616
    17     return $return;
     17    return $ret;
    1818};
  • locatoraid/trunk/modules/directions.locations/_config_after.php

    r2791689 r3370713  
    11<?php if (! defined('ABSPATH')) exit; // Exit if accessed directly
    2 $config['after']['/locations/presenter->fields'][] = function( $app, $return )
     2$config['after']['/locations/presenter->fields'][] = function( $app, $ret )
    33{
    4     $return['directions'] = __('Directions', 'locatoraid');
    5     return $return;
     4    $ret['directions'] = __('Directions', 'locatoraid');
     5    return $ret;
    66};
    77
    8 $config['after']['/locations/presenter->present_front'][] = function( $app, $return, $search, $search_coordinates )
     8$config['after']['/locations/presenter->present_front'][] = function( $app, $ret, $search, $search_coordinates )
    99{
    10     if( ! ($return['latitude'] && $return['longitude']) ){
    11         return $return;
     10    if( ! ($ret['latitude'] && $ret['longitude']) ){
     11        return $ret;
    1212    }
    1313
    14     if( ( ($return['latitude'] == -1) OR ($return['longitude'] == -1) ) ){
    15         return $return;
     14    if( ( ($ret['latitude'] == -1) OR ($ret['longitude'] == -1) ) ){
     15        return $ret;
    1616    }
    1717
    1818    if( ! $search_coordinates ){
    19         return $return;
     19        return $ret;
    2020    }
    2121    if( ! is_array($search_coordinates) ){
    22         return $return;
     22        return $ret;
    2323    }
    2424
     
    2626    $search_lng = array_shift( $search_coordinates );
    2727    if( ! ($search_lat && $search_lng) ){
    28         return $return;
     28        return $ret;
    2929    }
    3030
     
    3434    $this_pname_config = $app_settings->get($this_pname);
    3535    if( ! $this_pname_config ){
    36         return $return;
     36        return $ret;
    3737    }
    3838
     
    4444        'class'         => 'lpr-directions',
    4545        'href'          => '#',
    46         'data-to-lat'   => $return['latitude'],
    47         'data-to-lng'   => $return['longitude'],
     46        'data-to-lat'   => $ret['latitude'],
     47        'data-to-lng'   => $ret['longitude'],
    4848        'data-from-lat' => $search_lat,
    4949        'data-from-lng' => $search_lng,
     
    5959    $link_view .= '</a>';
    6060
    61     $return['directions'] = $link_view;
    62     return $return;
     61    $ret['directions'] = $link_view;
     62    return $ret;
    6363};
  • locatoraid/trunk/readme.txt

    r3349796 r3370713  
    44Tags: map, store locator, store finder, google maps, zip code
    55License: GPLv2 or later
    6 Stable tag: 3.9.61
     6Stable tag: 3.9.62
    77Requires at least: 3.3
    88Tested up to: 6.8
     
    8989
    9090== Changelog ==
     91
     92= 3.9.62 =
     93Code cleanup and minor fixes.
    9194
    9295= 3.9.61 =
Note: See TracChangeset for help on using the changeset viewer.