示例#1
0
/**
 * Callback to add filters on top of the result set
 *
 * @param Form
 */
function filter_goals(&$Form)
{
    $Form->checkbox_basic_input('final', get_param('final'), T_('Final only') . ' •');
    $Form->text('s', get_param('s'), 30, T_('Search'), '', 255);
    $GoalCategoryCache =& get_GoalCategoryCache(NT_('All'));
    $GoalCategoryCache->load_all();
    $Form->select_input_object('cat', get_param('cat'), $GoalCategoryCache, T_('Category'), array('allow_none' => true));
}
示例#2
0
// Determine if we are creating or updating...
global $action;
$creating = is_create_action($action);
// These params need to be memorized and passed through regenerated urls: (this allows to come back to the right list order & page)
param('results_goals_page', 'integer', '', true);
param('results_goals_order', 'string', '', true);
$Form = new Form(NULL, 'goal_checkchanges', 'post', 'compact');
if (!$creating) {
    $Form->global_icon(T_('Delete this goal!'), 'delete', regenerate_url('action', 'action=delete&' . url_crumb('goal')));
}
$Form->global_icon(T_('Cancel editing!'), 'close', regenerate_url('action'));
$Form->begin_form('fform', $creating ? T_('New goal') : T_('Goal'));
$Form->add_crumb('goal');
$Form->hiddens_by_key(get_memorized('action' . ($creating ? ',goal_ID' : '')));
// (this allows to come back to the right list order & page)
$GoalCategoryCache =& get_GoalCategoryCache();
$GoalCategoryCache->load_all();
$Form->select_input_object('goal_gcat_ID', $edited_Goal->gcat_ID, $GoalCategoryCache, T_('Category'), array('required' => true));
$Form->text_input('goal_name', $edited_Goal->name, 40, T_('Name'), '', array('maxlength' => 50, 'required' => true));
$Form->text_input('goal_key', $edited_Goal->key, 32, T_('Key'), T_('Should be URL friendly'), array('required' => true));
$Form->text_input('goal_redir_url', $edited_Goal->redir_url, 60, T_('Normal Redirection URL'), '', array('maxlength' => 255, 'class' => 'large', 'required' => true));
$Form->text_input('goal_temp_redir_url', $edited_Goal->temp_redir_url, 60, T_('Temporary Redirection URL'), '', array('maxlength' => 255, 'class' => 'large'));
$Form->date_input('goal_temp_start_date', is_int($edited_Goal->temp_start_ts) ? date2mysql($edited_Goal->temp_start_ts) : $edited_Goal->temp_start_ts, T_('Temporary Start Date'));
$Form->time_input('goal_temp_start_time', is_int($edited_Goal->temp_start_ts) ? date2mysql($edited_Goal->temp_start_ts) : $edited_Goal->temp_start_ts, T_('Temporary Start Time'));
$Form->date_input('goal_temp_end_date', is_int($edited_Goal->temp_end_ts) ? date2mysql($edited_Goal->temp_end_ts) : $edited_Goal->temp_end_ts, T_('Temporary End Date'));
$Form->time_input('goal_temp_end_time', is_int($edited_Goal->temp_end_ts) ? date2mysql($edited_Goal->temp_end_ts) : $edited_Goal->temp_end_ts, T_('Temporary End Time'));
$Form->text_input('goal_default_value', $edited_Goal->default_value, 15, T_('Default value'), '');
$Form->textarea('goal_notes', $edited_Goal->get('notes'), 15, T_('Notes'), '', 50);
if ($creating) {
    $Form->end_form(array(array('submit', 'actionArray[create]', T_('Record'), 'SaveButton'), array('submit', 'actionArray[create_new]', T_('Record, then Create New'), 'SaveButton'), array('submit', 'actionArray[create_copy]', T_('Record, then Create Similar'), 'SaveButton')));
} else {
/**
 * Callback to add filters on top of the result set
 *
 * @param Form
 */
function filter_goal_hits(&$Form)
{
    global $datestart, $datestop;
    $Form->date_input('datestartinput', $datestart, T_('From'));
    $Form->date_input('datestopinput', $datestop, T_('to'));
    $Form->checkbox_basic_input('exclude', get_param('exclude'), T_('Exclude') . ' → ');
    $Form->text_input('sess_ID', get_param('sess_ID'), 15, T_('Session ID'), '', array('maxlength' => 20));
    $Form->text_input('goal_name', get_param('goal_name'), 20, T_('Goal names starting with'), '', array('maxlength' => 50));
    $GoalCategoryCache =& get_GoalCategoryCache(NT_('All'));
    $GoalCategoryCache->load_all();
    $Form->select_input_object('goal_cat', get_param('goal_cat'), $GoalCategoryCache, T_('Goal category'), array('allow_none' => true));
}
示例#4
0
// ################### GOAL TRACKING ###################
$Form->begin_fieldset(T_('Goal tracking') . get_manual_link('post-goal-tracking-panel') . action_icon(T_('Goals'), 'edit', $admin_url . '?ctrl=goals&blog=' . $Blog->ID, T_('Goals'), 3, 4, array('class' => 'action_icon pull-right')), array('id' => 'itemform_goals', 'fold' => true));
$Form->switch_layout('table');
$Form->formstart = '<table id="item_locations" cellspacing="0" class="fform">' . "\n";
$Form->labelstart = '<td class="right"><strong>';
$Form->labelend = '</strong></td>';
echo '<p class="note">' . T_('You can track a hit on a goal every time this page is displayed to a user.') . '</p>';
echo $Form->formstart;
$goal_ID = $edited_Item->get_setting('goal_ID');
$item_goal_cat_ID = 0;
$GoalCache =& get_GoalCache();
if (!empty($goal_ID) && ($item_Goal = $GoalCache->get_by_ID($goal_ID, false, false))) {
    // Get category ID of goal
    $item_goal_cat_ID = $item_Goal->gcat_ID;
}
$GoalCategoryCache =& get_GoalCategoryCache(NT_('No Category'));
$GoalCategoryCache->load_all();
$Form->select_input_object('goal_cat_ID', $item_goal_cat_ID, $GoalCategoryCache, T_('Category'), array('allow_none' => true));
// Get only the goals without a defined redirect url
$goals_where_sql = 'goal_redir_url IS NULL';
if (empty($item_goal_cat_ID)) {
    // Get the goals without category
    $goals_where_sql .= ' AND goal_gcat_ID IS NULL';
} else {
    // Get the goals by category ID
    $goals_where_sql .= ' AND goal_gcat_ID = ' . $DB->quote($item_goal_cat_ID);
}
$GoalCache->load_where($goals_where_sql);
$Form->select_input_object('goal_ID', $edited_Item->get_setting('goal_ID'), $GoalCache, get_icon('multi_action', 'imgtag', array('style' => 'margin:0 5px 0 14px;position:relative;top:-1px;')) . T_('Goal'), array('allow_none' => true, 'note' => '<img src="' . $rsc_url . 'img/ajax-loader.gif" alt="' . T_('Loading...') . '" title="' . T_('Loading...') . '" style="display:none;margin-left:5px" align="top" />'));
echo $Form->formend;
$Form->switch_layout(NULL);
 *
 * @package admin
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
global $blog, $admin_url, $rsc_url;
global $Session;
$perm_options_edit = $current_User->check_perm('options', 'edit', false);
/**
 * View funcs
 */
require_once dirname(__FILE__) . '/_stats_view.funcs.php';
// Create query:
$SQL = new SQL();
$SQL->SELECT('gcat_ID, gcat_name, gcat_color');
$SQL->FROM('T_track__goalcat');
// Create result set:
$Results = new Results($SQL->get(), 'gcats_', '-A');
$Results->Cache =& get_GoalCategoryCache();
$Results->title = T_('Goal categories') . get_manual_link('goal-category-settings');
$Results->cols[] = array('th' => T_('ID'), 'order' => 'gcat_ID', 'td_class' => 'shrinkwrap', 'td' => '$gcat_ID$');
$Results->cols[] = array('th' => T_('Name'), 'order' => 'gcat_name', 'td' => $perm_options_edit ? '<a href="' . $admin_url . '?ctrl=goals&amp;tab3=cats&amp;action=cat_edit&amp;blog=' . $blog . '&amp;gcat_ID=$gcat_ID$" style="color:$gcat_color$;font-weight:bold">$gcat_name$</a>' : '<b style="color:$gcat_color$">$gcat_name$</b>');
$Results->cols[] = array('th' => T_('Color'), 'order' => 'gcat_color', 'td_class' => 'shrinkwrap', 'td' => '$gcat_color$', 'extra' => array('style' => 'color:#gcat_color#'));
if ($perm_options_edit) {
    // We have permission to modify:
    $Results->cols[] = array('th' => T_('Actions'), 'th_class' => 'shrinkwrap', 'td_class' => 'shrinkwrap', 'td' => '%action_icon( "' . T_('Edit this goal category...') . '", "edit", "' . $admin_url . '?ctrl=goals&amp;tab3=cats&amp;action=cat_edit&amp;blog=' . $blog . '&amp;gcat_ID=#gcat_ID#" )%' . '%action_icon( "' . T_('Copy this goal category...') . '", "copy", "' . $admin_url . '?ctrl=goals&amp;tab3=cats&amp;action=cat_copy&amp;blog=' . $blog . '&amp;gcat_ID=#gcat_ID#" )%' . '~conditional( #gcat_ID# > 1, \'%action_icon( "' . T_('Delete this goal category...') . '", "delete", "' . $admin_url . '?ctrl=goals&amp;tab3=cats&amp;action=cat_delete&amp;blog=' . $blog . '&amp;gcat_ID=#gcat_ID#&amp;' . url_crumb('goalcat') . '" )%\', "" )~');
    $Results->global_icon(T_('Create a new goal category...'), 'new', regenerate_url('action', 'action=cat_new'), T_('New goal category') . ' &raquo;', 3, 4, array('class' => 'action_icon btn-primary'));
}
// Display results:
$Results->display();
/**
 * Callback to add filters on top of the result set
 *
 * @param Form
 */
function filter_goal_hitsummary(&$Form)
{
    $Form->checkbox_basic_input('final', get_param('final'), T_('Final'));
    $Form->text_input('goal_name', get_param('goal_name'), 20, T_('Goal names starting with'), '', array('maxlength' => 50));
    $GoalCategoryCache =& get_GoalCategoryCache(NT_('All'));
    $GoalCategoryCache->load_all();
    $Form->select_input_object('goal_cat', get_param('goal_cat'), $GoalCategoryCache, T_('Goal category'), array('allow_none' => true));
}