public static function get_fielddefs() { if (cge_tmpdata::exists('cgfb_fielddefs')) { return cge_tmpdata::get('cgfb_fielddefs'); } $db = cmsms()->GetDb(); $query = 'SELECT * FROM ' . CGFEEDBACK_TABLE_FIELDDEFS . ' ORDER BY iorder'; $tmp = $db->GetArray($query); if (is_array($tmp)) { for ($i = 0; $i < count($tmp); $i++) { $tmp[$i]['attribs'] = unserialize($tmp[$i]['attribs']); if (isset($tmp[$i]['attribs']['options'])) { $t2 = cge_array::explode_with_key($tmp[$i]['attribs']['options'], '=', "\n"); $tmp[$i]['attribs']['options'] = array_flip($t2); } } $tmp = cge_array::to_hash($tmp, 'id'); cge_tmpdata::set('cgfb_fielddefs', $tmp); return $tmp; } }
function smarty_function_str_to_assoc($params, &$smarty) { $input = ''; $delim1 = ','; $delim2 = '='; if (isset($params['input'])) { $input = trim($params['input']); } if (isset($params['delim1'])) { $delim1 = trim($params['delim1']); } if (isset($params['delim2'])) { $delim2 = trim($params['delim2']); } if ($input == '') { return; } $tmp = cge_array::explode_with_key($input, $delim2, $delim1); if (isset($params['assign'])) { $smarty->assign(trim($params['assign']), $tmp); return; } return $tmp; }
# This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Or read it online: http: //www.gnu.org/licenses/licenses.html#GPL # #------------------------------------------------------------------------- if (!isset($gCms)) { exit; } $tmp_params = array(); if (isset($params['hidden_params'])) { $tmp_params = cge_array::explode_with_key($params['hidden_params']); } $params = array_merge($params, $tmp_params); // check for required arguments if (!isset($params['mode'])) { $params['mode'] = 'summary'; } // setup $template = 'summaryrpt_' . $this->GetPreference('default_summaryrpt'); if (isset($params['template'])) { $template = 'summaryrpt_' . $params['template']; } $config = $gCms->GetConfig(); // handle the sendfilepage parameter $sendfilepage = $returnid; if (isset($params['sendfilepage'])) {
// convert it to a comma separated list for storage $fieldlist[$name] = implode(',', $fieldlist[$name]); } break; case 6: // image break; case 8: // date // todo, validate... against attribs. break; } } } // get the parms from the first step $parms1 = cge_array::explode_with_key($params['step1_params']); // and merge em into $params so we can actually add the user account $params = array_merge($params, $parms1); // now find out which groups he's a member of $username = ''; if (isset($params['input_username'])) { $username = $params['input_username']; } $password = ''; if (isset($params['input_password']) && $params['input_password'] != '') { $password = $params['input_password']; } $expiresdate = strtotime('+10 years', time()); if (isset($params['input_expiresdate'])) { $expiresdate = $params['input_expiresdate']; }