コード例 #1
0
 function mark_up_item(model\BasicItem $item, $show_project = false)
 {
     global $term;
     $markup = '';
     list($li, $text, $note) = $this->basic_markup($item);
     if ($item instanceof model\TaskItem) {
         $colours = \tpp\lang('state_colours');
         $done = '';
         $tags = '';
         $date_tag = '';
         $checked = '';
         $decorate = '';
         $project = '';
         // done always takes precedence; however if not-done, the old state returns
         if ($item->done()) {
             $done = 'strike';
             $checked = ' checked="checked"';
             $decorate = ' class="' . $done . '"';
         } else {
             $decorate = ' class="bk-' . $colours[$item->action()] . '"';
         }
         foreach ($item->tags() as $tag) {
             $tags .= '<span class="tag" title="">' . $tag . '</span>';
         }
         if ($item->date() != '') {
             $date_tag = '<span class="date-tag" title="">' . $item->date() . '</span>';
         }
         if ($show_project) {
             $name = $this->_h($item->project_name());
             $project = '<span class="project" id="' . $item->project_key() . '" title="' . '" data-index="' . $item->project_index() . '">' . $name . '</span>';
         }
         $src = $item->done() ? 'images/done.png' : 'images/todo.png';
         $check = '<input type="image" class="check-done" src="' . $src . '" id="' . $item->key() . '" title="">';
         //$check = '<input type="checkbox" name="'. $item->key() . '" ' . $checked . '>';
         $p = '<p' . $decorate . '>' . $text . '</p>';
         $markup = $li . $check . $p . $tags . $date_tag . $project . $note . '</li>';
     } elseif ($item instanceof model\ProjectItem) {
         $index = $item->index();
         $pfx = $index > 0 ? $index . $term['proj_sep'] : '';
         $p = '<p data-index="' . $index . '" title="">' . $pfx . $text . '</p>';
         $markup = $li . $p . $note . '</li>';
     } elseif ($item instanceof model\InfoItem) {
         $markup = $li . $text . $note . '</li>';
     }
     log && msg('building task:', $item->raw(), get_class($item), $markup);
     return $markup . "\n";
 }
コード例 #2
0
</a>
<a href="<?php 
echo tpp\config('website_url');
?>
"><?php 
echo \tpp\lang('website_lbl');
?>
</a>

<select name="lang-list">
    <?php 
echo '<option selected>' . $this->cur_lang . '</option>';
foreach ($this->langs as $lang) {
    if ($lang != $this->cur_lang) {
        echo '<option value="' . $lang . '">' . $lang . '</option>';
    }
}
?>
</select>
<span class="lang"><?php 
echo \tpp\lang('language');
?>
</span>

<span class="insert" id="insert" title="<?php 
echo \tpp\lang('insert_location_tip');
?>
">
    <img id="top" src="images/insert_top.png" alt="insert" />
    <img id="bottom" src="images/insert_bottom.png" alt="insert" />
</span>
コード例 #3
0
 protected function _create($name, $sample = null)
 {
     if (self::_exists($name)) {
         return $name;
     } else {
         $name = self::_validate_name($name);
         if (!empty($name)) {
             $path = self::_fullpath($name);
             $text = is_null($sample) ? \tpp\lang('new_tab_content') : $sample;
             file_put_contents($path, $text);
             return $name;
         } else {
             return false;
         }
     }
 }
コード例 #4
0
 private function _edit_user($username, $password = null, $email = null)
 {
     $user = $this->_get_user($username);
     if ($user !== false) {
         if (!is_null($password)) {
             if ($this->_valid_password($password)) {
                 $this->_users[$username]['password'] = $this->_encrypted($password);
             } else {
                 $this->_error[] = \tpp\lang('invalid_password_err');
             }
         }
         if (filter_var($email, FILTER_VALIDATE_EMAIL) !== false) {
             $this->_users[$username]['email'] = $email;
         } else {
             $this->_error[] = \tpp\lang('invalid_email_err');
         }
         if (empty($this->_error)) {
             $this->_save_users();
             return true;
         } else {
             return false;
         }
     }
 }
コード例 #5
0
    <a href="#" title="<?php 
echo \tpp\lang('startpage_tip');
?>
"><p class="red">Task</p><p>paper+</p></a>
</div>


<div class="search">
    <textarea id="search-box" accesskey="C" rows="1" title="<?php 
echo \tpp\lang('search_box_tip');
?>
" placeholder="<?php 
echo \tpp\lang('placeholder');
?>
"></textarea>
    <img id="reset-search" src="images/delete.png" alt="reset" title="<?php 
echo \tpp\lang('clear_box_tip');
?>
">
    <a href="help/search.html" title="<?php 
echo \tpp\lang('search_help_tip');
?>
"><img src="images/help.png"></a>
</div>


<div class="tabtools">
     <?php 
include 'tpl/tabtools.tpl.php';
?>
</div>
コード例 #6
0
 /**
  * Sets up the Content, including the correct tab names for Trash and Archive, tag index, task and item count.
  */
 private function set_up($name, $file_path)
 {
     $this->_cont->name = $name;
     $this->_cont->file_path = $file_path;
     // Confirm the Tab type
     if ($name == FILE_TRASH) {
         $this->_cont->tab_type = TAB_TRASH;
         $this->_cont->index = 1;
         $this->_cont->title = \tpp\lang('trash_lbl');
     } elseif ($name == FILE_ARCHIVE) {
         $this->_cont->tab_type = TAB_ARCHIVE;
         $this->_cont->index = 2;
         $this->_cont->title = \tpp\lang('archive_lbl');
     }
 }
コード例 #7
0
<input type="image" src="images/tp-pencil.png" class="tool-icon" id="edit-button" value="Edit" title="<?php 
echo \tpp\lang('edit_all_tip');
?>
">

<input type="image" src="images/rename.png" class="tool-icon restrict" id="rename-button" value="Rename" title="<?php 
echo \tpp\lang('rename_tip');
?>
">
<input type="image" src="images/remove.png" class="tool-icon restrict" id="remove-button" value="Remove" title="<?php 
echo \tpp\lang('remove_tip');
?>
">
<input type="image" src="images/archive.png" class="tool-icon restrict" id="archive-done-button" value="Archive" title="<?php 
echo \tpp\lang('archive_done_tip');
?>
">

<input type="image" src="images/star-off.png" class="tool-icon" id="remove_actions-button" value="Star" title="<?php 
echo \tpp\lang('remove_actions_tip');
?>
">
コード例 #8
0
<span class="task-buttons">
    <input type="image" class="archive-button restrict" src="images/archive.png" id="{id}" title="<?php 
echo \tpp\lang('archive_button_tip', true);
?>
">
    <input type="image" class="trash-button restrict"  src="images/delete.png"  id="{id}" title="<?php 
echo \tpp\lang('trash_button_tip', true);
?>
">
    <input type="image" class="action-button"  src="images/star.png"    id="{id}" title="<?php 
echo \tpp\lang('action_button_tip', true);
?>
">
</span>
コード例 #9
0
 /**
  * Copy this task to the archiving|trash taskpaper.
  */
 private function _copy_to($keys, $target_path)
 {
     global $term;
     if (!is_array($keys)) {
         $keys = array($keys);
     }
     $tasks = '';
     foreach ($keys as $key) {
         $task = self::$_content->parsed_items[$key];
         $tasks .= "\n" . $task->raw . "\n" . $term['note_prefix'] . "\n";
         if ($task->note->len > 0) {
             $tasks .= $task->note->text . "\n";
         }
         $tab_name = self::$_content->name;
         $project = self::$_content->project_by_task($key);
         $tasks .= \tpp\lang('deleted_lbl') . " " . $tab_name . " | " . $project->text . " | " . date("d-M-Y H:i");
         $tasks .= "\n" . $term['note_prefix'];
     }
     $file = fopen($target_path, 'a');
     fwrite($file, $tasks);
     fclose($file);
 }
コード例 #10
0
                        <?php 
include 'tpl/cheatsheet.tpl.php';
?>
                    </div>
                </div>

                <div class="meta column">
                    <h1><?php 
echo \tpp\lang('filter_header');
?>
</h1>
                    <?php 
echo $this->filters;
?>
                    <h1><?php 
echo \tpp\lang('tag_header');
?>
</h1>
                    <?php 
echo $this->tags;
?>
                </div>
            </div>

            <div id="footer">
                <?php 
echo $this->footer;
?>
            </div>
            
        </div>
コード例 #11
0
$markup = '';
foreach ($this->tabs as $tab) {
    $tab_class = '';
    $text_class = 'fixed';
    $name = $tab->name;
    if ($tab->type == TAB_ARCHIVE) {
        $tip = \tpp\lang('archive_tab_tip');
        $display = \tpp\lang('archive_lbl');
    } elseif ($tab->type == TAB_TRASH) {
        $tip = \tpp\lang('trash_tab_tip');
        $display = \tpp\lang('trash_lbl');
    } else {
        $text_class = '';
        $tip = $tab->note->text;
        $display = $tab->title;
    }
    $tip .= !empty($tip) ? "\n――――\n" : '';
    if ($tab->name == $this->active) {
        $tab_class = 'selected';
        $tip .= \tpp\lang('reset_tab_tip');
    } else {
        $tip .= \tpp\lang('change_tab_tip');
    }
    $markup .= '<li class="' . $tab_class . '" name="' . $name . '" title="' . $tip . '"><a href="#" class="' . $text_class . '">' . $display . '</a></li>' . PHP_EOL;
}
// the 'ADD NEW' tab at the end of the row
$markup .= '<li name="__new__" title="' . \tpp\lang('new_tab_tip') . '"><a href="#" class="fixed"><img src="images/add.png"></a></li>' . PHP_EOL;
$markup .= '<p class="today" title="">' . \tpp\long_date() . '</p>' . PHP_EOL;
echo $markup;
?>
</ul>
コード例 #12
0
?>
" autocomplete="off" required pattern="<?php 
echo \tpp\config('password_pattern');
?>
">
                    <input class="password" name="password2" type="password" placeholder="<?php 
echo \tpp\lang('repeatpassword_lbl');
?>
" autocomplete="off" required pattern="<?php 
echo \tpp\config('password_pattern');
?>
">
                </fieldset>
                <fieldset class="actions">
                    <input class="submit" type="submit" name="submit-register" value="<?php 
echo \tpp\lang('register_lbl');
?>
">
                </fieldset>

            </div>
        </div>
        
        <div id="login-err">
            <ul>
                <!-- filled via ajax -->
            </ul>
        </div>
        
    </body>
</html>
コード例 #13
0
</h2>

<ul>
    <?php 
    foreach ($this->projects as $project) {
        $markup = $this->mark_up_item($project, false);
        echo $markup;
    }
    ?>
</ul>

<br />

<h2>
    <?php 
    echo \tpp\lang('task_header');
    ?>
    <span class="freq">(<?php 
    echo $this->task_count;
    ?>
)</span>
</h2>

<?php 
}
?>

<ul>
    <?php 
foreach ($this->tasks as $task) {
    $markup = $this->mark_up_item($task, true);
コード例 #14
0
<!--
Project list template
-->
<h1>
    <?php 
echo $this->header;
?>
    <p class="sortable" title="<?php 
echo \tpp\lang('sortable_tip');
?>
"><img src="images/sortable.png" alt='sortable'/></p>
</h1>

<ul id="sortable">
    <?php 
foreach ($this->tasks as $task) {
    echo $this->mark_up_item($task, false);
}
?>
</ul>

コード例 #15
0
<ul id="tags">
    <?php 
if (!empty($this->tags)) {
    foreach ($this->tags as $tag => $freq) {
        echo '<li><span class="tag" title="' . \tpp\lang('tag_click_tip') . '">' . \tpp\no_underscores($tag) . '</span><span class="freq">' . $freq . '</span></li>';
    }
} else {
    echo '<span class="just-info">' . \tpp\lang('no_tags') . '</span>';
}
?>
</ul>
コード例 #16
0
">
</div>

<div class="find-replace-bar">
    <input type="button" value="<?php 
echo tpp\lang('go_lbl');
?>
" id="replace-button">
    <label><?php 
echo tpp\lang('replace_lbl');
?>
<input type="text" id="replace-word"></label>
    <label><?php 
echo tpp\lang('find_lbl');
?>
<input type="text" id="find-word"></label>
</div>

<textarea></textarea>

<div>
    <input type="image" src="images/save.png" class="icon save-button" value="Save" title="<?php 
echo tpp\lang('save_changes_tip');
?>
">
    <input type="image" src="images/repeat.png" class="icon cancel-button" value="Cancel" title="<?php 
echo tpp\lang('cancel_changes_tip');
?>
">
</div>
コード例 #17
0
}
$cur_lang = \tpp\ini('language');
$lang_path = 'conf/lang_' . $cur_lang . '.php';
$lang_en_path = 'conf/lang_en.php';
// default english lang strings (in case of missing items or language)
$lang = array();
require_once APP_PATH . $lang_en_path;
if (file_exists($lang_path)) {
    require_once APP_PATH . $lang_path;
}
// this ensures that dates will be localised also
// locale names must match PHP standards: see conf/locale_names.txt
$location = setlocale(LC_ALL, $cur_lang);
DEFINE('LOCATION', $location);
// used in TaskItem
define('MAX_ACTION', count(\tpp\lang('state_order')) - 2);
// set correct locale settings (timezone must be set first)
$timezone = ini('timezone');
// @ to avoid error NOTICE if timezone does not exist
if (@date_default_timezone_set($timezone) === false) {
    // this will return a suitable default if user has not set the timezone in his server
    $timezone = date_default_timezone_get();
    date_default_timezone_set($timezone);
}
DEFINE('TIMEZONE', $timezone);
// compile LESS css sheets
require_once APP_PATH . 'lib/lessc.inc.php';
log && msg('Compiling the lessCSS files');
try {
    \lessc::ccompile('css/style.less', 'css/style.css');
} catch (exception $ex) {